Feature #1395

sprite layouts

Added by Hirundo about 9 years ago. Updated about 3 years ago.

Status:ClosedStart date:2010-09-02
Priority:NormalDue date:
Assignee:Hirundo% Done:

100%

Category:-
Target version:-

Description

I propose that the current Tilelayout spritegroups are moved to another place, namely the spritelayout-block. This would allow a uniform manner of defining and using layouts for both stations and houses/industrytiles/airporttiles/objecttiles.

The current 'spriteblock' construct becomes basically bogus for these items. Instead I propose something like this:

/* all inside the global scope */
spriteset foo {
    [....] //real sprites, numbered sequentially (this is sprite 0)
    [....] // sprite 1
    { //sprite 2 
        [....] //for stuff that supports construction stages, this supports defining multiple sprites for these stages
        [....]
    }
}

spritelayout bar {
    groundsprite {
        sprite: 1; //use sprite 1 from the sprite set
        /* all other stuff from current spritegroup */
    }
}

/* Then, in places where you'd refer to a sprite group (graphics or switch block), you refer to '<sprites>, <layout>' instead. (e.g. 'foo, bar') */

The idea is that it allows arbitrary combinations of layouts and sprites.
For anything but stations, these combinations are 'resolved' at compile time, possibly resulting in a duplication of sprites. This does allow re-use of standard building layouts. I think a simple groundsprite with a 16x16x16 building on top suffices for most situations.

The implementation for stations would be more powerful yet more complex, and dependant on some other features, so I'll leave that out of here for now.

Associated revisions

Revision 999:114a257a538d
Added by Hirundo about 9 years ago

Feature #1395: Preliminary support for offsets within sprite sets.

Revision 999:114a257a538d
Added by Hirundo about 9 years ago

Feature #1395: Preliminary support for offsets within sprite sets.

Revision 1004:f2a4ed84357c
Added by Hirundo about 9 years ago

Fix #1395: An Action1 used for a sprite layout should have num_ent = 1.

Revision 1004:f2a4ed84357c
Added by Hirundo about 9 years ago

Fix #1395: An Action1 used for a sprite layout should have num_ent = 1.

Revision 1008:ae48d5d12f60
Added by Hirundo about 9 years ago

Feature #1395: Allow referring to labels inside sprite sets.

Revision 1008:ae48d5d12f60
Added by Hirundo about 9 years ago

Feature #1395: Allow referring to labels inside sprite sets.

History

#1 Updated by Hirundo about 9 years ago

Suggested changes to the spec:

- spritelayout definition as before.
- using a spritelayout is like this:
layout(spriteset[, spriteset2])
Multiple spritesets can be used for construction stages, if the sprite layout stays the same. This is expected (and documented) to only be used for simple cases. Else it's better to use varaction2.

- Sprites inside sprite sets can be labeled:

spriteset (foo, "img") {
    [...]
    spr1: [...]
}

Then when referring to a sprite, you can use either of these:
sprite: 1;
sprite: spr1;
If multiple sprite sets (construction stages) are used, a name should both exist and refer to the same number in all of them.

#2 Updated by Hirundo about 9 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Applied in changeset f2a4ed84357c.

#3 Updated by Hirundo about 9 years ago

  • Status changed from Closed to New
  • % Done changed from 100 to 30

Didn't mean to close it (yet)

'Fix #xxx' closes, but 'Feature #xxx' does not?

#4 Updated by Hirundo almost 9 years ago

The basic functionality works now.
I'd say we skip the passing of parameters for now (<0.1)
It's quite hard to do and I have little time, and in the current form it would most likely end up as a hack. Better do it properly in 0.2.0

Parameters would be nice, but nothing should break without it. You can always use a cpp macro for most stuff.

#5 Updated by yexo almost 9 years ago

As long as you're sure we won't need to break the current syntax to support that it's fine.

#6 Updated by Hirundo over 8 years ago

  • % Done changed from 30 to 60

As of r1611, parameters work as long as they are numbers. Still todo:
- parameters that are spritesets
- documentation
- regression coverage

#7 Updated by Hirundo about 8 years ago

  • Assignee set to Hirundo
  • Target version set to 0.2.0

#8 Updated by yexo almost 8 years ago

  • Target version deleted (0.2.0)

#9 Updated by Hirundo about 7 years ago

  • Status changed from New to Closed
  • % Done changed from 60 to 100

#10 Updated by Ammler about 7 years ago

  • Status changed from Closed to Reopened
  • % Done changed from 100 to 60

sorry, migation issue

#11 Updated by Hirundo over 6 years ago

  • Status changed from Reopened to Closed
  • % Done changed from 60 to 100

Applied in changeset eddi-nml:f2a4ed84357c.

#12 Updated by planetmaker over 6 years ago

  • Status changed from Closed to Reopened
  • % Done changed from 100 to 60

#13 Updated by Hirundo about 3 years ago

  • % Done changed from 60 to 100
  • Status changed from Reopened to Closed

Applied in changeset f2a4ed84357c.

Also available in: Atom PDF