Transport Tycoon Forums
https://www.tt-forums.net/

Replacing river graphics
https://www.tt-forums.net/viewtopic.php?f=68&t=83478
Page 2 of 2

Author:  wallyweb [ Wed Jul 11, 2018 7:43 pm ]
Post subject:  Re: Replacing river graphics

Quast65 wrote:
Code:
When using OpenGFX-extra version XX.XX and newer, Action-1-2-3 is needed to change Canal-graphics and not Action-5.
Except for the Lock-Icon, for that you still need to use Action-5 (type 88, offset 40).
Are you sure? Using types 08/88 Action5 should be good for the top group of 65 canal graphics (sprite numbers 276 through 241).

Type 8 addresses all 65 sprites at once. Type 88 allows the coder to address sprites beginning at a specific sprite by referencing the offset for that sprite. In hexadecimal the offsets for canals start with 0x00 for sprite 276 and end with 0x40 for sprite 241.

Perhaps your note suggestion should be:
Code:
The Action 0-1-2-3 scheme can be used instead of Action5 and might be the preferable method considering that the river sprites and supplemental canal sprites are not included in the Action5 range of 65 sprites.


Your closing question might be better stated:
Has the Action 5 range of 65 canal sprites been extended since it was originally set?

Author:  Quast65 [ Wed Jul 11, 2018 10:23 pm ]
Post subject:  Re: Replacing river graphics

wallyweb wrote:
Are you sure?

The following may sound rude or harsh, but please know that I dont mean it that way, I mean it in the kindest and friendliest way, but I just dont know how else to write it down...

Try it out yourself.

Check that you use the most recent version of OGFX for the base-sprites of your game.
Then code a simple Action-5 GRF and try to change one of the 65 graphics (except the lock-icon) of the canals with type 88 and an offset.
See if anything changes, it probably wont.
Then set the offset to 40 and you will see that the lock-icon is the only one of the 65 graphics that you can change using Action-5.

I really really hope that you prove me wrong...

I think that from the moment that a version of OGFX basegraphics came out with the new canal and rivergraphics added, that from that moment on Action-5 cannot be used anymore to change those graphics (except for the lock-icon).
Maybe, just maybe, it still can. If so, I would really like to know how.

Author:  wallyweb [ Thu Jul 12, 2018 1:52 am ]
Post subject:  Re: Replacing river graphics

You were not at all harsh. :D

Quast65 wrote:
Try it out yourself.

Which version of OpenGFX are you using?

Author:  Quast65 [ Thu Jul 12, 2018 2:39 am ]
Post subject:  Re: Replacing river graphics

Quote:
You were not at all harsh.

Pfew! 8)
Quote:
Which version of OpenGFX are you using?

0.5.2, but basically you can use any version of OGFX that provides river-sprites. Since those sprites are added I think the issue has risen...

Author:  wallyweb [ Thu Jul 12, 2018 12:39 pm ]
Post subject:  Re: Replacing river graphics

Quast65 wrote:
And also with this one, only the icon of the locks was changed.


Ok ... I think I've got this figured out:

- Action5 addresses the first 65 canal/river sprites of ogfxe_extra.grf
- The canal/river sprites are repeated in ogfxe_extra.grf. There are two sets of canal/river sprites.
- The second set of canal/river sprites are beyond the 65 sprite limit.
- The canal icon sprite is not repeated. It remains with the first set.
- ogfxe_extra.grf uses the second set.

Result:
You were able to change the canal icon because it is still used by ogfxe_extra.grf.
You did successfully modify the other sprites, but they are not used by ogfxe_extra.grf
This is why nforenum did not throw any errors.

Conclusion:
For ogfxe_extra.grf canal /river sprites, use the Canals Action0-1-2-3 scheme to modify them in the repeated set of sprites and pray that nobody alters ogfxe_extra.grf in future revisions.

Fix:
Increase the 65 sprite limit
or
add a note to the GRF Action5 specifications that the canal/river sprites modified by Action5 are not the ones used by ogfxe_extra.grf

Several days of headbanging were wasted causing many keyboards to be mangled all because this was not noted in the specifications.

DISCLAIMER: The above is pure speculation until confirmed by someone who is familiar with ogfxe_extra.grf development.

Author:  Quast65 [ Thu Jul 12, 2018 1:25 pm ]
Post subject:  Re: Replacing river graphics

Thank you for taking the time to also test this out! :bow:

wallyweb wrote:
Ok ... I think I've got this figured out:
*text*

I agree

wallyweb wrote:
Result:
*text*

Yes!

wallyweb wrote:
Conclusion:
For ogfxe_extra.grf canal /river sprites, use the Canals Action0-1-2-3 scheme to modify them in the repeated set of sprites and pray that nobody alters ogfxe_extra.grf in future revisions.

Yep! And indeed a confirmation by an ogfxe_extra.grf developer is needed to make sure that this is absolutely the case.

wallyweb wrote:
Fix:
Increase the 65 sprite limit

Not only that…
Action-5 needs to be modified also.
At the moment the max number of realsprites and the offset is FF (255)
But there are more than 255 sprites in the repeated set of sprites, so extra Bytes are needed, so a general Action-5 should be changed from this:
Code:
6 * 4    05 TT NN OO 

(TT = Type, NN = Number of realsprites, OO = Offset)
to:
Code:
6 * 4    05 TT NN NN OO OO 


wallyweb wrote:
or
add a note to the GRF Action5 specifications that the canal/river sprites modified by Action5 are not the ones used by ogfxe_extra.grf

Probably easier than fixing the 65 sprite limit of that Type and the Action-5 properties ;-)

wallyweb wrote:
Several days of headbanging were wasted causing many keyboards to be mangled all because this was not noted in the specifications.

When I look in the mirror, I can read QWERTY on my forehead :mrgreen:

wallyweb wrote:
DISCLAIMER: The above is pure speculation until confirmed by someone who is familiar with ogfxe_extra.grf development.

Yes, please! :bow:

Author:  wallyweb [ Thu Jul 12, 2018 1:52 pm ]
Post subject:  Re: Replacing river graphics

Quast65 wrote:
When I look in the mirror, I can read QWERTY on my forehead :mrgreen:
That's better than 666 :twisted:

Author:  planetmaker [ Thu Jul 12, 2018 2:47 pm ]
Post subject:  Re: Replacing river graphics

It's quite a bit ago that I coded anything on the river part, so take the following with a grain of salt. IIRC: You necessarily need an action3 in order to distinguish between canal and river. In the absence of such distinction anywhere (base set, newgrfs), canals and rivers simply look the same. But honestly I don't recall why there's 65 sprites for that action5.

btw: If you write a NewGRF - and not a base set - better refer to what and how it is done in OpenGFX+ Landscape than looking at a base set.

Author:  wallyweb [ Thu Jul 12, 2018 4:41 pm ]
Post subject:  Re: Replacing river graphics

planetmaker wrote:
It's quite a bit ago that I coded anything on the river part, so take the following with a grain of salt. IIRC: You necessarily need an action3 in order to distinguish between canal and river. In the absence of such distinction anywhere (base set, newgrfs), canals and rivers simply look the same.
:bow:
Quote:
But honestly I don't recall why there's 65 sprites for that action5.
It's a remnant of TTDPatch from before they dropped Action5 support for canals.

Author:  michael blunck [ Thu Jul 12, 2018 4:49 pm ]
Post subject:  Re: Replacing river graphics

mb wrote:

Bis repetita non placent.

regards
Michael

Author:  Quast65 [ Thu Jul 12, 2018 6:09 pm ]
Post subject:  Re: Replacing river graphics

michael blunck wrote:
Bis repetita non placent.

True, but sometimes you need a second opinion to be sure, because multis viae Romam ducunt and you want to take the shortest one possible ;-)

Thnx guys for all your help and comments!! :bow:

Author:  michael blunck [ Thu Jul 12, 2018 6:40 pm ]
Post subject:  Re: Replacing river graphics

Quast65 wrote:
multis viae Romam ducunt

Not in this case. :p

regards
Michael

Page 2 of 2 All times are UTC
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.