Replacing river graphics

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Replacing river graphics

Post by wallyweb »

Quast65 wrote:

Code: Select all

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: Select all

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?
User avatar
Quast65
Tycoon
Tycoon
Posts: 2642
Joined: 09 Oct 2011 13:51
Location: The Netherlands

Re: Replacing river graphics

Post by Quast65 »

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.
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Replacing river graphics

Post by wallyweb »

You were not at all harsh. :D
Quast65 wrote:Try it out yourself.
Which version of OpenGFX are you using?
User avatar
Quast65
Tycoon
Tycoon
Posts: 2642
Joined: 09 Oct 2011 13:51
Location: The Netherlands

Re: Replacing river graphics

Post by Quast65 »

You were not at all harsh.
Pfew! 8)
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...
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Replacing river graphics

Post by wallyweb »

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.
User avatar
Quast65
Tycoon
Tycoon
Posts: 2642
Joined: 09 Oct 2011 13:51
Location: The Netherlands

Re: Replacing river graphics

Post by Quast65 »

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: Select all

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

Code: Select all

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:
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Replacing river graphics

Post by wallyweb »

Quast65 wrote:When I look in the mirror, I can read QWERTY on my forehead :mrgreen:
That's better than 666 :twisted:
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Replacing river graphics

Post by planetmaker »

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.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Replacing river graphics

Post by wallyweb »

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:
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.
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: Replacing river graphics

Post by michael blunck »

Bis repetita non placent.

regards
Michael
Image
User avatar
Quast65
Tycoon
Tycoon
Posts: 2642
Joined: 09 Oct 2011 13:51
Location: The Netherlands

Re: Replacing river graphics

Post by Quast65 »

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:
Projects: http://www.tt-forums.net/viewtopic.php?f=26&t=57266
Screenshots: http://www.tt-forums.net/viewtopic.php?f=47&t=56959
Scenario of The Netherlands: viewtopic.php?f=60&t=87604

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016, oct 2020
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: Replacing river graphics

Post by michael blunck »

Quast65 wrote: multis viae Romam ducunt
Not in this case. :p

regards
Michael
Image
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 3 guests