User:Mog/TerrainReorg
From The Battle for Wesnoth Wiki
< User:Mog
Terrain macro overhaul
The terrain macros are currently a mess. There are lots of inconsitencies and often several different ways to do the same thing.
I found the following issues. Feel free to add/comment to the list.
Issues
- Inconsistent ordering of parameters
- Inconsistent naming of macros
- Two ways of naming rotations. Most terrains have (n,ne,se,s,sw,nw), i.e. rotations are named according to the edges of the hex. Castles/chasm/etc. have the rotations (ne,e,se,sw,w,nw) i.e. named for the corners of the hex.
Proposed changes
- Have a consistent naming scheme. E.g. all macros that have a flag parameter end with _F, macros with a probability parameter with _P, layer with _L. Ideally, these suffixes are ordered the same way as the coresponding parameters.
- Most macros have a similar structure, so i suggest the following parameter ordering:
MACRO_NAME IDS1 [,IDS2, [IDS3, ...]] [LAYER] [PROB] [FLAG] IMAGE
There may be macros where this scheme will not work, but for the majority it should.
- I suggest renaming the castle tiles to use the more common naming method. This means renaming a corner direction to two edge directions (e.g. ne-> n-ne, e->ne-se, etc.). This also makes clear if the hexes around the corner are ordered clockwise or counterclockwise (another current inconsitency btw.)