Skip to content

Instantly share code, notes, and snippets.


andythenorth/Livery Spec

Last active Feb 6, 2021
What would you like to do?
**Livery Spec**
*Feature 14 / Liveries*
Action 0 props
* ID
* Text ID
* Introduction date
* End of life date
*Feat 14 things I don't know about*
Do we need an abstraction from Action 0 ID for the livery?
* in vehicle props / varact 2, just using livery action 0 ID could be fine, but
* it's not very author-friendly
* creates savegame compatibility issues if livery ID is changed
* nml authors can use an nml identifier
* but nml identifiers won't be stable across savegames if the author adds/removes/changes order of liveries
* nml authors could provide a numeric ID explicitly
* ideas
* label - similar to cargo and railtype labels?
* some other abstraction (table)?
* no abstraction, just use ID?
* I don't see any benefit to sharing abstractions across grfs ('common livery label scheme' etc), I can only forsee complications from that
*Feature 00 / 01 / 02 / 03 Vehicles*
Action 0
* prop 0x?? - list of liveries this vehicle supports
* prop 0x?? - default livery (or rely on first available in list?)
Vehicle Varact 2
* var 0x?? - 'current livery', available in relevant action 2 chains
* do any callbacks need it restricted?
* does this have any desync risk?
Vehicle callbacks
* extend CB 36 to support
* list of liveries
* default livery
* CB 23 purchase menu text
* method to resolve the string(s) for the list of supported liveries, so author can optionally present them in buy menu details?
Purchase sprite
* var 'current livery' uses the default livery in purchase list?
* the actual choice of sprite to show will be determined in the action 2 chain by author
* if they want to do more fancy things there, they can
*Livery refit UI*
UI window
* similar to cargo subtypes UI
* for trains only
* how to build the list of liveries when more than one vehicle is selected?
* some AND or OR of the supported liveries for the selected vehicles?
* how to open the UI? If only we had fewer button in vehicle the eye icon? :P
Preview sprite
* livery menu will be more useful if displays a sprite showing how the livery will look
* use the purchase sprite?
* when cycling the livery options to draw the UI, provide the cycled livery ID as extra callback info
* what about when multiple vehicles are selected (trains only)?
* Replace type A-> B
* Either
* choose explicit livery for B from the list of supported liveries
* or choose 'keep livery if supported'
* persists the livery value of each A vehicle if vehicle B supports it
* fall back to B's default livery if A's livery not supported by B
* No magic to support rules on 'only type A with livery Foo'
* make groups for this case
* preserve the livery if available
* otherwise fall back
* it's possible that some authors will want to be able to control this to provide specific repaints when vehicles are auto-renewed
* could have a CB, 'replacing vehicle with livery X, return livery'
* TMWFTLB imho
* nothing to stop this being provided later, let's not try to boil the ocean?
*Vehicle list windows*
* sort by livery?
* group by livery?
*Sorting / filtering of purchase menu*
* sorting by livery?
* filtering by livery?
* I am -1 to purchase menu sort or filter by livery
* would add to window clutter, purchase menu has a lot of stuff already
* adds complications - would 'current livery' var change to match filter? What if author doesn't handle that in a way that matches the filter?
*Use of liveries to modify vehicle stats*
* 'red trains are faster'
* this would be possible, but is an author choice
* do nothing to specifically prevent or enable it
* probably unwise, would be better using vehicles on different IDs
* but authors gonna author :)
* does the AI need
* the list of liveries supported for a vehicle?
* a method to set the livery on a vehicle?
* does GS need
* a list of liveries per grf?
* a method to modify the availability of a livery?
* use case would be 'complete goals to unlock this special livery'
* as per every every 'level-up' grinding-based casual game ever ever
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment