NFO proposal: Road vehicle property 21, visual effects
Moderator: Graphics Moderators
NFO proposal: Road vehicle property 21, visual effects
This is similar to visual effects for trains.
The value is a bitstuffed word, containing:
Bits 0-3: effect offset: a 4 bit signed value with 0 being the center of the vehicle.
Bits 4-5: effect type: same as for trains, 0 = default, 1 = steam, 2 = diesel, 3 = spark. As there is no default for road vehicles, 0 actually means no effect.
Bit 6: unused, as effect type of 0 is disable.
Bit 7: unused, there is no powered wagons concept for road vehicles.
Bits 8-11: 4 bit unsigned height offset for effect, 0 is at road level, 10 is where the effect is placed for trains.
The value can be set using callback 36, however it is only set once on build. This could be changed if desired.
Unlike effects for trains, effect offset applies to all effect types. None of the changes here affect effects for trains.
The value is a bitstuffed word, containing:
Bits 0-3: effect offset: a 4 bit signed value with 0 being the center of the vehicle.
Bits 4-5: effect type: same as for trains, 0 = default, 1 = steam, 2 = diesel, 3 = spark. As there is no default for road vehicles, 0 actually means no effect.
Bit 6: unused, as effect type of 0 is disable.
Bit 7: unused, there is no powered wagons concept for road vehicles.
Bits 8-11: 4 bit unsigned height offset for effect, 0 is at road level, 10 is where the effect is placed for trains.
The value can be set using callback 36, however it is only set once on build. This could be changed if desired.
Unlike effects for trains, effect offset applies to all effect types. None of the changes here affect effects for trains.
He's like, some kind of OpenTTD developer.
Re: NFO proprosal: Road vehicle property 21, visual effects
Ships! Ships! Ships!
(Though they are longer, the position offset should be enough, as effects far from center would look weird anyway when turning)
Wrt. the callback: It might be more useful when it is called on leaving the depot. So it can change after refitting.
(Though they are longer, the position offset should be enough, as effects far from center would look weird anyway when turning)
Wrt. the callback: It might be more useful when it is called on leaving the depot. So it can change after refitting.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Re: NFO proprosal: Road vehicle property 21, visual effects
Could be done for ships too, yes. The 4 bit height offset might need to be increased in that case...
He's like, some kind of OpenTTD developer.
Re: NFO proprosal: Road vehicle property 21, visual effects
Well you could use the bit for powered wagons, as there aren't even wagons for ships, let alone powered wagons. That would extend it to 5 bits.peter1138 wrote:Could be done for ships too, yes. The 4 bit height offset might need to be increased in that case...
EDIT: or you could extend off the other end. I think you have 4 spare bits that way. I missed that first time.
Melt with the Shadows,
Embrace your destiny...
Embrace your destiny...
-
- Tycoon
- Posts: 5948
- Joined: 27 Apr 2005 07:09
- Contact:
Re: NFO proprosal: Road vehicle property 21, visual effects
Unfortunately, a lot of modern vessels have their smoke stacks at the very end ...frosch wrote:Ships! Ships! Ships!
(Though they are longer, the position offset should be enough, as effects far from center would look weird anyway when turning) [...]
regards
Michael
- andythenorth
- Tycoon
- Posts: 5658
- Joined: 31 Mar 2007 14:23
- Location: Lost in Music
Re: NFO proprosal: Road vehicle property 21, visual effects
If this is implemented, I'll definitely stick support into HEQS for it! Zmoke belching bulldozers...peter1138 wrote:2 = diesel
cheers,
Andy
FIRS Industry Replacement Set (released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (finished)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Re: NFO proprosal: Road vehicle property 21, visual effects
Hmm, ships, would 5 bit signed be enough or 6 bit to be safe? That's -16 to 15 or -32 to 31 respectively.
To do this we should probably drop the train effect layout, like so:
Bits 0-1: effect type, same as above
Bits 2-7: unsigned 6 bit offset (0 to 63 game units, 32 is central)
Bits 8-12: unsigned 5 bit height offset (0 to 31 pixels)
EDIT: Effect offset for trains is not signed, it is 0 to 15 with 8 being the centre. I have modified the list to match.
To do this we should probably drop the train effect layout, like so:
Bits 0-1: effect type, same as above
Bits 2-7: unsigned 6 bit offset (0 to 63 game units, 32 is central)
Bits 8-12: unsigned 5 bit height offset (0 to 31 pixels)
EDIT: Effect offset for trains is not signed, it is 0 to 15 with 8 being the centre. I have modified the list to match.
He's like, some kind of OpenTTD developer.
Re: NFO proprosal: Road vehicle property 21, visual effects
"Unused" is generally a bad plan. "Must be zero"/"must be clear" is much better. That way no one can complain when setting the bit starts doing something.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Re: NFO proprosal: Road vehicle property 21, visual effects
I think that's avoided with the new proposed layout, although we could say bits 13-14 must be clear...
He's like, some kind of OpenTTD developer.
Who is online
Users browsing this forum: No registered users and 20 guests