Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Fri Oct 19, 2018 2:27 pm

All times are UTC




Post new topic  Reply to topic  [ 32 posts ]  Go to page 1 2 Next
Author Message
 Post subject: Replacing river graphics
PostPosted: Mon Jul 09, 2018 7:08 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1614
Location: The Netherlands
Hi all,

Is it possible to use Action-5 to replace the river graphics from OpenGFX-extra?
If so, what is the type number?

_________________
Projects: viewtopic.php?f=26&t=57266
Screenshots: viewtopic.php?f=47&t=56959

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.


Top
   
PostPosted: Mon Jul 09, 2018 8:06 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Nov 03, 2017 6:57 pm
Posts: 1582
Location: Courbevoie, near Paris, France
As far as i know, since you can replace tram tracks from opengfx-extra, you may use the same action than for tram track replacement.

_________________
NewGRFs by Tony Pixel :
North American Passenger Railroads
Not Enough Subways


My screenshots


Top
   
PostPosted: Mon Jul 09, 2018 8:14 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1614
Location: The Netherlands
acs121 wrote:
As far as i know, since you can replace tram tracks from opengfx-extra, you may use the same action than for tram track replacement.

Do you even know how Action-5 works?
You need to specify a type to replace, the tramtracks indeed have their own type-number (0B,8B), so can be replaced using Action-5, but the rivers have no type-number of their own (at least none I could find in the Wiki).
Are they part of the Canal type number (08,88)?

_________________
Projects: viewtopic.php?f=26&t=57266
Screenshots: viewtopic.php?f=47&t=56959

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.


Top
   
PostPosted: Tue Jul 10, 2018 3:39 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5336
Location: Canada
Quast65 wrote:
... the rivers have no type-number of their own (at least none I could find in the Wiki).
Are they part of the Canal type number (08,88)?
Rivers should indeed be a part of canals type 08/88. I believe they might not be. The specifications say that Type 08 has 65 real sprites and looking at the OpenGFX_extras sprite sheet we can count the 65 sprites from sprite number 276 to number 341. That range does not include the river sprites. Those are further down on the sheet starting at number 3011 to 3981 (4007 with buoys?). Note that there are more canal sprites from number 2785 to 3001.

Perhaps the question should be whether those extra canal sprites (2785 to 3001) and the river sprites (3011 to 3981) are supported in nforenum and GrfCodec and if so, beginning with which versions?

Note that OpenGFX+Landscape (which is not a base set) has even more canal/river sprites.

Note that Canals (and rivers) are supported by the Action1-2-3 triplet.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018


Top
   
PostPosted: Tue Jul 10, 2018 5:49 am 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 5237
Quast65 wrote:
Is it possible to use Action-5 to replace the river graphics from OpenGFX-extra?

I don´t know about OpenGFX-extra, but o/c it is possible to replace the canal/river graphics from any base set. My River graphics does that since 2007.

Quast65 wrote:
Do you even know how Action-5 works?
You need to specify a type to replace, the tramtracks indeed have their own type-number (0B,8B), so can be replaced using Action-5, but the rivers have no type-number of their own (at least none I could find in the Wiki).
Are they part of the Canal type number (08,88)?

Rivers and canals are the same. They only differ by their c-IDs in action3 (like railtypes do).

As Wally said, rivers/canals are using the standard 0-1-2-3 scheme, but they have only a very small number of properties, flags, callbacks and varAction2s.

BTW, there´s even a module for coding rivers/canals in m4nfo. :cool:

regards
Michael

_________________
Image


Top
   
PostPosted: Tue Jul 10, 2018 7:31 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5336
Location: Canada
michael blunck wrote:
I don´t know about OpenGFX-extra, but o/c it is possible to replace the canal/river graphics from any base set. My River graphics does that since 2007.
I am assuming you are using the 0-1-2-3 scheme to completely replace all the river sprites which are defined in ttdbase or OpenGFX_extra but what if one only wishes to replace one or two sprites? For the regular base sets one can use ActionA, but for the extended base sets one must use Action5 which only accesses a limited number of sprites as set out in the type chart. Action5 only allows the 65 canal sprites. The river sprites are beyond that 65 limit. Can the 0-1-2-3 scheme be used to modify only one or two real sprites?

Regards,

Wally

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018


Top
   
PostPosted: Tue Jul 10, 2018 7:44 am 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 5237
wallyweb wrote:
I am assuming you are using the 0-1-2-3 scheme to completely replace all the river sprites which are defined in ttdbase or OpenGFX_extra but what if one only wishes to replace one or two sprites? For the regular base sets one can use ActionA, but for the extended base sets one must use Action5 which only accesses a limited number of sprites as set out in the type chart. Action5 only allows the 65 canal sprites. The river sprites are beyond that 65 limit. Can the 0-1-2-3 scheme be used to modify only one or two real sprites?

Yes, the above mentioned rivers&canals grf uses the 0-1-2-3 scheme, but not action5.

I´ve never tested replacement of only a smaller number of sprites by that scheme, but it could well be that only sprites defined in the action1 would be replaced, keeping the base set sprites from action5. Just try it!

regards
Michael

_________________
Image


Top
   
PostPosted: Tue Jul 10, 2018 7:55 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5336
Location: Canada
michael blunck wrote:
I´ve never tested replacement of only a smaller number of sprites by that scheme, but it could well be that only sprites defined in the action1 would be replaced, keeping the base set sprites from action5. Just try it!
Ok, but hopefully I won't see river water pouring out of the fan on my computer. Maybe I can get Quast65 to try it on his computer. Heh.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018


Top
   
PostPosted: Tue Jul 10, 2018 8:33 am 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 5237
wallyweb wrote:
Ok, but hopefully I won't see river water pouring out of the fan on my computer. Maybe I can get Quast65 to try it on his computer. Heh.

Just tested it (removing one of the straight river borders, to be overwritten by action5/base set). Looks silly. Not recommended.

Attachment:
ugly-rivers.png
ugly-rivers.png [ 506.97 KiB | Viewed 525 times ]

regards
Michael

_________________
Image


Top
   
PostPosted: Tue Jul 10, 2018 12:47 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5336
Location: Canada
michael blunck wrote:
wallyweb wrote:
Ok, but hopefully I won't see river water pouring out of the fan on my computer. Maybe I can get Quast65 to try it on his computer. Heh.

Just tested it (removing one of the straight river borders, to be overwritten by action5/base set). Looks silly. Not recommended.

ugly-rivers.png
regards
Michael
Seems that breaks the algorithm.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018


Top
   
PostPosted: Tue Jul 10, 2018 2:26 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1614
Location: The Netherlands
Thanks Wally and Michael for your input! :bow:
Action-1-2-3 is likely going to do the trick for me at the moment, so I can start testing out an idea I have.

Still, is it definitely not possible to use Action-5 (by defining the type and offset to the rivergraphics I want to change)?
Because Action-1-2-3 does mean you need to replace all of the rivergraphics (even those you want to keep the same), to avoid that strange thing that Michael had shown.
Not that big of a problem, as I can just refer to the Opengfx-extra graphics for the ones that I want to stay the same (or to Opengfx+landscape), but its a lot more code/graphics and having it done via Action-5 keeps the GRF a lot smaller ;-)

By the way, if Action-5 is not possible, then a change to the Wiki would be handy, as the way its written now, I have the assumption that Action-5 can be used for Openttd…
Attachment:
Example474.png
Example474.png [ 69.79 KiB | Viewed 485 times ]

_________________
Projects: viewtopic.php?f=26&t=57266
Screenshots: viewtopic.php?f=47&t=56959

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.


Top
   
PostPosted: Tue Jul 10, 2018 3:48 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5336
Location: Canada
Quast65 wrote:
By the way, if Action-5 is not possible, then a change to the Wiki would be handy, as the way its written now, I have the assumption that Action-5 can be used for Openttd…
Refer to the Version icons. OTTD 0.6 is not crossed out. :wink:
According to the wiki Action5 can be used for OTTD canals. Just not beyond to the first 65 sprites, and there are more than 65 OTTD canal sprites.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018


Last edited by wallyweb on Tue Jul 10, 2018 4:09 pm, edited 1 time in total.

Top
   
PostPosted: Tue Jul 10, 2018 3:54 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1614
Location: The Netherlands
Yes, meaning that it should be possible to use Action-5 with offsets, right?
But how? And what type and especially offsets to get to the rivers?

_________________
Projects: viewtopic.php?f=26&t=57266
Screenshots: viewtopic.php?f=47&t=56959

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.


Top
   
PostPosted: Tue Jul 10, 2018 4:16 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5336
Location: Canada
Quast65 wrote:
Yes, meaning that it should be possible to use Action-5 with offsets, right?
But how? And what type and especially offsets to get to the rivers?
Use type 88.
The first canal sprite (an icon) is offset 00, therefor the 65th sprite is offset \d 64.
Then go down the sprite sheet to the next canal/river sprite which will be offset \d 65 and continue counting until you arrive at the sprite you want to change.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018


Top
   
PostPosted: Tue Jul 10, 2018 4:44 pm 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 5237
This is weird. I really forgot about action5 had been abandoned by TTDPatch, years ago!

I think the reason for the change to a 0-1-2-3 scheme is that you can´t use varAction2s for canals/rivers (terrain type, height) with only an action5 layout. I.e., you can´t mix both schemes. And o/c, you can´t skip some of the needed sprites when being in 0-1-2-3 since then the fixed rank of sprites gets corrupted. See screenshot above.

regards
Michael

_________________
Image


Top
   
PostPosted: Wed Jul 11, 2018 11:26 am 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 9040
Location: Sol d
Quast65 wrote:
acs121 wrote:
As far as i know, since you can replace tram tracks from opengfx-extra, you may use the same action than for tram track replacement.

Do you even know how Action-5 works?
You need to specify a type to replace, the tramtracks indeed have their own type-number (0B,8B), so can be replaced using Action-5, but the rivers have no type-number of their own (at least none I could find in the Wiki).
Are they part of the Canal type number (08,88)?


Yes, rivers are canals in a NewGRF sense.

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
PostPosted: Wed Jul 11, 2018 3:29 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1614
Location: The Netherlands
planetmaker wrote:
Yes, rivers are canals in a NewGRF sense.

Ok, I did a test.
I used this Action-5 with 65 realsprites:
Code:
    6 * 4    05 88 41 00 

The result was that only the icon of the locks was changed, nothing else.
I did another test, with this code and just 1 realsprite:
Code:
    6 * 4    05 88 01 40 

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

Meaning that the icon of the lock is at offset 64 (40 in Hexadecimal).
So this quote is incorrect:
wallyweb wrote:
The first canal sprite (an icon) is offset 00

The Icon is the LAST of the 65 canal-sprites!!




Now, please take a look at this graphicsfile (decoded from OpenGFX-Extra):
Attachment:
ogfxe_extra.png [561.95 KiB]
Not downloaded yet

So, the canal-sprites are Spritenr 287 (a sloped watertile) to 351 (the lock icon) = 65 realsprites.
But much further down the graphicsfile you can see many more canal and rivergraphics, starting from Spritenr 2948 (a canal-side with snow on the grass at the outer end) to Spritenr 4052 (a corner with snow)

My assumption is that these override 64 of the 65 "original" canal-sprites (as there are no icons for the locks being changed) and also add the graphics for rivers/various-snow-stages/various-climates).
The action-5s I used are therefor useless (except if I wanted to change the lock-icon).

My question then again is, can Action-5 be used to change those "new" canal/river-graphics? If so, how? :?: :? ?(

_________________
Projects: viewtopic.php?f=26&t=57266
Screenshots: viewtopic.php?f=47&t=56959

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.


Top
   
PostPosted: Wed Jul 11, 2018 4:41 pm 
Offline
Tycoon
Tycoon

Joined: Wed Apr 27, 2005 7:09 am
Posts: 5237
Quast65 wrote:
My question then again is, can Action-5 be used to change those "new" canal/river-graphics? If so, how?

Why don´t you take a look into that OGFX code? And check if it is using action5? And how? And if it is not using action5, but actions 0-1-2-3, there might be a reason for it?

regards
Michael

_________________
Image


Top
   
PostPosted: Wed Jul 11, 2018 4:42 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Nov 27, 2004 3:05 pm
Posts: 5336
Location: Canada
Quast65 wrote:
wallyweb wrote:
The first canal sprite (an icon) is offset 00

The Icon is the LAST of the 65 canal-sprites!!
:oops: I don't know what the heck I was looking at. Lesson: Don't work on this stuff at 3:00 AM.

_________________
wallyweb on tt-forums: Screenshots - Projects - Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018


Top
   
PostPosted: Wed Jul 11, 2018 6:56 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sun Oct 09, 2011 1:51 pm
Posts: 1614
Location: The Netherlands
michael blunck wrote:
Why don´t you take a look into that OGFX code? And check if it is using action5? And how? And if it is not using action5, but actions 0-1-2-3, there might be a reason for it?

I already did that and it does indeed use Action-1-2-3. This I also already tested to change those graphics, that works.
But I want to be absolutely sure that action-5 cant be used for those sprites.
Because if that is the case then this thread can also be usefull for future GRF-developers who want to change canal- and/or river- and/or lock-graphics and run into the same issue I have.
Also a small change/update of the Wiki might be handy (via an extra footnote), something like:
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).

But again, if that is definitely the case! Because, to me, Planetmakers remark means that it should/might be possible to alter rivers by using Action-5 and he is, if I am correct, one of the devs of OpenGFX.
I hope you understand that at the moment this all is a bit confusing to me. There is still no clear Yes or No to my question (or even: Partly, some things Yes, some things No).
I just dont want to waste my time using the Action-1-2-3 option, if Action-5 is also possible, as that means a much smaller code and graphicsfile (so less work/time and also means less chance for mistakes, or mistakes being spotted easier).



wallyweb wrote:
I don't know what the heck I was looking at.

No worries, just wanted to avoid any extra/future confusion ;-)

_________________
Projects: viewtopic.php?f=26&t=57266
Screenshots: viewtopic.php?f=47&t=56959

Winner of the following screenshot competitions:
sep 2012, jan 2013, apr 2013, aug 2013, mar 2014, mar 2016
All my work is released under GPL-license (either V2 or V3), if not clearly stated otherwise.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 32 posts ]  Go to page 1 2 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2018 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2018.
Hosted by Zernebok Hosting.