Add: Slope-aware and roadtype-specific one-way sprites - #10282
Conversation
|
Basesets use action5, so handling more sprites here should be doable, if only first 6 are provided use openttd included ones for the missing. |
|
I know it's possible, I just haven't yet figured out the details of how it's done. Will look again when it's not 3am on Christmas Day... |
|
https://github.com/OpenTTD/OpenTTD/blob/master/src/newgrf.cpp#L6160 It's already handled like OpenTTD GUI block (and we increased it many times). |
2bc18ba to
fd6b72d
Compare
For OpenTTD/OpenTTD#10282. To-do: draw less ugly ones. Maybe poke a decent pixel artist.
|
Action5 is supported now; this is ready for review. |
|
I think the failed commit check is an actions failure and not a problem with your PR. Hope it'll run properly next time you push it. |
Ideally, the one-way road graphics from openttd.grf would be updated, too. One could argue if the graphics should be in openttd.grf or in orig_extra.grf. |
|
Something is not right with it. I reran the CI but it didn't resolve it. |
ca2669e to
493ce94
Compare
|
Added sloped graphics to These will only be visible if no one-way sprites at all are provided by a baseset or GRF; i.e. when using the TTD baseset. The CI issue was caused by my branch being based on a rather old checkout of OTTD, rebasing cleared it up. |
Per OpenTTD#10238, the baseset only provided one-way sprites for flat tiles, matching the default road type. These look bad on slopes or on some custom roadtypes. Action5 type 0x09 is extended to accept a set of 18 sprites. The first 6 are unchanged from before this patch, followed by similar groups for north-facing and then south-facing slopes. For compatibility with older basesets and NewGRFs, if an Action5 provides only sprites for flat tiles these will be used on slopes as in previous versions. Action3 type 0x0B, for roadtypes only, may optionally provide a set of 18 sprites as above for use with that roadtype. Sprites for sloped tiles are added to openttd.grf, used when no one-way sprites are provided by the baseset (i.e. when using the original TTD graphics).
493ce94 to
5f77d3c
Compare
Motivation / Problem
As in #10238:
Description
Action5 type 0x09 is extended to accept a set of 18 sprites.
The first 6 are unchanged from before this patch, followed by similar groups for north-facing and then south-facing slopes.
For compatibility with older basesets and NewGRFs, if an Action5 provides only sprites for flat tiles these will be used on slopes as in previous versions.
Action3 type 0x0B, for roadtypes only, may optionally provide a set of 18 sprites as above for use with that roadtype.
OpenTTD/OpenGFX#82
OpenTTD/nml#274
Limitations
This doesn't yet allow the baseset itself to provide indicators for sloped tiles, because I haven't yet understood how to add sprites to the baseset without breaking compatibility. I intend to do that before merging.This is done now.
Using flat tiles for slopes, if no sloped tiles are provided, for compatibility might be confusing if for some reason a GRF wanted to override only the flat tiles. I can't think of a reason to do that.
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.