Tilesets: too easy for extrastyle and defined extra graphics not to match
Bug #758964 highlighted this. It's too easy to add extra graphics but forget to add an extra style in the .tilespec, and you often mostly get away with it because of fallbacks in common rulesets. It would be nice if the game could warn you about this mistake.
I don't think it's possible to do it purely at tileset load time; at this stage, a tileset is a collection of random graphics waiting for a ruleset to come along and make sense of some of them.
A simple approach to this is to use the tag for which we found an extra style defined for loading all graphics for that extra. As well as not allowing the style and graphics to differ, this disallows fallbacks within extras; currently, for instance, each individual road direction can independently be a primary or fallback sprite.
I suspect such flexible fallbacks were possible just because coding up proper whole-extra rollback and fallback when we found one of a set missing would have been too painful, rather than because anyone thought they would be useful. I can't think of plausible ways to use this flexibility that can't be done another way.
It is probably too late to make such a tileset semantic change for 2.6, though.
#2 Updated by Jacob Nevins almost 2 years ago
- File m-30-26-tileset-extrastyle-fallback.patch m-30-26-tileset-extrastyle-fallback.patch added
- Status changed from In Progress to Resolved
- Target version set to 3.0.0
A simple approach to this is to use the tag for which we found an extra style defined for loading all graphics for that extra.
Attached patch does this.
I plan to commit to S3_0 and master soon if no objections. (Not S2_6, although it does apply to that branch.)