Modern Waypoints

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1732
Joined: 30 Mar 2005 09:43

Re: Modern Waypoints

Post by peter1138 »

Your source does not look like source, but decompiled-GRF instead. No comments...

Edit: Remove bit 15 of the ground sprite for each layout as it is not valid there.
He's like, some kind of OpenTTD developer.
User avatar
kamnet
Moderator
Moderator
Posts: 8588
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Modern Waypoints

Post by kamnet »

petern wrote:Your source does not look like source, but decompiled-GRF instead. No comments...
Like many NewGRFs from years gone by, there is no more commented original source. It was never posted here and has since been lost by the original author.
petern wrote:Edit: Remove bit 15 of the ground sprite for each layout as it is not valid there.
Thank you, I'll take a look at it when I get a chance.
SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

Re: Modern Waypoints

Post by SimYouLater »

kamnet wrote:
petern wrote:Your source does not look like source, but decompiled-GRF instead. No comments...
Like many NewGRFs from years gone by, there is no more commented original source. It was never posted here and has since been lost by the original author.
petern wrote:Edit: Remove bit 15 of the ground sprite for each layout as it is not valid there.
Thank you, I'll take a look at it when I get a chance.
Did you never get the chance? If I'm going to learn any NFO at all, I suppose this would be a good start. What exactly would "bit 15 be in...

Code: Select all

// Automatically generated by GRFCODEC. Do not modify!
// (Info version 7)
// Escapes: 2+ 2- 2< 2> 2u< 2u> 2/ 2% 2u/ 2u% 2* 2& 2| 2^ 2sto = 2s 2rst = 2r 2psto 2ror = 2rot 2cmp 2ucmp 2<< 2u>> 2>>
// Escapes: 71 70 7= 7! 7< 7> 7G 7g 7gG 7GG 7gg 7c 7C
// Escapes: D= = DR D+ = DF D- = DC Du* = DM D* = DnF Du<< = DnC D<< = DO D& D| Du/ D/ Du% D%
// Format: spritenum pcxfile xpos ypos compression ysize xsize xrel yrel
    0 * 4	 0A 00 00 00
    1 * 211	 08 06 "AW" 01 02 "Modern Waypoint" 00 "Modern-style "
	 "gantry waypoint modeled after OpenTTD's "
	 "tubular bridge. Graphics by Amadeus "
	 "Wieczorek (MeusH), code by Alan "
	 "Blanchflower (Prof. Frink). Released "
	 "under GNU Public License v2. ." 00
    2 * 76	 00 04 04 01 00 08 "WAYP" 0C FE 0D FE 09 04 F4 83 00 00 80 F3 83 00 00 80 F4 83 00 00 00 00
	 00 10 05 17 2D 84 00 00 00 0B 00 10 05 17 2E 84 00 00 80 F3 83 00 00 00 00 00 05 10 17 2F 84 00
	 00 0B 00 00 05 10 17 30 84 00 00 80
    3 * 4	 01 04 01 04
    4 modern_waypoint2/modern_waypoint2.png 82 8 09 27 29 -27 -11
    5 modern_waypoint2/modern_waypoint2.png 130 8 09 34 26 -22 -22
    6 modern_waypoint2/modern_waypoint2.png 162 8 09 34 26 -25 -11
    7 modern_waypoint2/modern_waypoint2.png 194 8 09 28 28 22 -22
    8 * 7	 02 04 00 00 01 00 00
    9 * 7	 03 04 01 00 00 00 00
   10 * 22	 04 04 9F 01 00 "┼Modern Waypoint" 00
Is it...

Code: Select all

00 10 05 17 2D 84 00 00 00 0B 00 10 05 17 2E 84 00 00 80 F3 83 00 00 00 00 00 05 10 17 2F 84 00
...or is it even specifically one of these... ?

Code: Select all

2 * 76	 00 04 04 01 00 08 "WAYP" 0C FE 0D FE 09 04 F4 83 !?00?! ?!00!? 80 F3 83 00 00 80 F4 83 00 00 00 00
00 10 05 17 2D 84 00 00 00 0B 00 10 05 17 !?2E?! ?!84!? 00 00 80 F3 83 00 00 00 00 00 05 10 17 2F 84 00
!?xx?! = Is this bit "14" (first bit is 1) or bit "15" (first bit is 0)?

?!xx!? = Is this "13" (first bit is 1) or bit "14" (first bit is 0)?

Or am way off and none of the above is relevant? I'm basing this only on what I know about base 16 (hexadecimal).
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
User avatar
kamnet
Moderator
Moderator
Posts: 8588
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Modern Waypoints

Post by kamnet »

SimYouLater wrote:
kamnet wrote:
petern wrote:Your source does not look like source, but decompiled-GRF instead. No comments...
Like many NewGRFs from years gone by, there is no more commented original source. It was never posted here and has since been lost by the original author.
petern wrote:Edit: Remove bit 15 of the ground sprite for each layout as it is not valid there.
Thank you, I'll take a look at it when I get a chance.
Did you never get the chance? If I'm going to learn any NFO at all, I suppose this would be a good start. What exactly would "bit 15 be in...
No, I never did get back to fixing it. Unfortunately I never really learned station code and I'd have to dig back in. I suspect Quast65 or Michael Blunck could be of help here.
SimYouLater
Chief Executive
Chief Executive
Posts: 675
Joined: 03 Apr 2016 20:19

Re: Modern Waypoints

Post by SimYouLater »

kamnet wrote:
SimYouLater wrote:
kamnet wrote: Like many NewGRFs from years gone by, there is no more commented original source. It was never posted here and has since been lost by the original author.

Thank you, I'll take a look at it when I get a chance.
Did you never get the chance? If I'm going to learn any NFO at all, I suppose this would be a good start. What exactly would "bit 15 be in...
No, I never did get back to fixing it. Unfortunately I never really learned station code and I'd have to dig back in. I suspect Quast65 or Michael Blunck could be of help here.
So I suspect that if a bit needs to be "removed" that means changing it to "00" since actually removing it isn't how that kind of code works? Screw it, I'll try every possible fix and test compile them all.
Licenses for my work...
You automatically have my permission to re-license graphics or code by me if needed for use in any project that is not GPL v2, on the condition that if you release any derivatives of my graphics they're automatically considered as ALSO GPL v2 (code may remain unreleased, but please do provide it) and carry this provision in GPL v2 uses.
Please ask someone in-the-know to be sure that the graphics are done by me. Especially TTD-Scale, long story.
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: Modern Waypoints

Post by michael blunck »

SimYouLater wrote:
petern wrote: Edit: Remove bit 15 of the ground sprite for each layout as it is not valid there.
So I suspect that if a bit needs to be "removed" that means changing it to "00" since actually removing it isn't how that kind of code works?

Code: Select all

2 * 76    00 04 04 01 00 08 "WAYP" 0C FE 0D FE 09 04 F4 83 00 00 80 F3 83 00 00 80 F4 83 00 00 00 00
    00 10 05 17 2D 84 00 00 00 0B 00 10 05 17 2E 84 00 00 80 F3 83 00 00 00 00 00 05 10 17 2F 84 00
    00 0B 00 00 05 10 17 30 84 00 00 80
->

Code: Select all

2 * 76    00 04 04 01 00 
	08 "WAYP" 
	0C FE 
	0D FE 
	09 04 
		<F4 83 00 00>  80 // ground sprite
		<F3 83 00 00>  80 // ground sprite 
		<F4 83 00 00>  // ground sprite
		<00 00 00>  <10 05 17>  <2D 84 00 00> // building sprite
		<00 0B 00>  <10 05 17>  <2E 84 00 00>  80 // building sprite
		<F3 83 00 00> // ground sprite
		<00 00 00>  <05 10 17>  <2F 84 00 00> // building sprite
		<0B 00 00>  <05 10 17>  <30 84 00 00>  80 // building sprite
Property "09" sets the station´s layout. It is defined by a number of tiles, each composed by a number of sprites. A literal "80" ends the list of sprites for each tile. Each tile must consist at least of one ground sprite.

Bit 15 in a sprite number sets "company colour" translation.

As can be seen, ground sprites above have bits 15 set: <F4 83 00 00>/<F3 83 00 00>. This should be changed to <F4 03 00 00>/<F3 03 00 00>, i.e. with bits 15 not being set.

HTH
Michael
Image
User avatar
kamnet
Moderator
Moderator
Posts: 8588
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Modern Waypoints

Post by kamnet »

michael blunck wrote: Property "09" sets the station´s layout. It is defined by a number of tiles, each composed by a number of sprites. A literal "80" ends the list of sprites for each tile. Each tile must consist at least of one ground sprite.

Bit 15 in a sprite number sets "company colour" translation.

As can be seen, ground sprites above have bits 15 set: <F4 83 00 00>/<F3 83 00 00>. This should be changed to <F4 03 00 00>/<F3 03 00 00>, i.e. with bits 15 not being set.

HTH
Michael
Yes, this fixed the issue exactly. Can you point me to where these bits are documented? I can't seem to locate them on the wiki.
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: Modern Waypoints

Post by michael blunck »

@kamnet

https://newgrf-specs.tt-wiki.net/wiki/A ... t_.2809.29
Please note that only bit31 (TTD/custom) for ground sprites has a special meaning, and thus is mentioned.

regards
Michael
Image
User avatar
kamnet
Moderator
Moderator
Posts: 8588
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Modern Waypoints

Post by kamnet »

michael blunck wrote:@kamnet

https://newgrf-specs.tt-wiki.net/wiki/A ... t_.2809.29
Please note that only bit31 (TTD/custom) for ground sprites has a special meaning, and thus is mentioned.

regards
Michael
I'm assuming then I'd need to pull up the base graphics spritesheet and track down the sprite number intended for use?
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Re: Modern Waypoints

Post by michael blunck »

kamnet wrote: I'm assuming then I'd need to pull up the base graphics spritesheet and track down the sprite number intended for use?
Sorry? You´re talking about those ground sprites?

For rails, they´re always 1012/1011 (x/y), resp 0x3F4/0x3F3. In case a track set is used, they´re automagically replaced by those of said track set.

regards
Michael
Image
User avatar
kamnet
Moderator
Moderator
Posts: 8588
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Modern Waypoints

Post by kamnet »

michael blunck wrote:
kamnet wrote: I'm assuming then I'd need to pull up the base graphics spritesheet and track down the sprite number intended for use?
Sorry? You´re talking about those ground sprites?

For rails, they´re always 1012/1011 (x/y), resp 0x3F4/0x3F3. In case a track set is used, they´re automagically replaced by those of said track set.

regards
Michael
Thank you! I'll have to scribble some notes away someplace. (where I'll likely forget them :D)

OK I'm gonna clean up the source code a little and push an update. Thank you for your help!
User avatar
kamnet
Moderator
Moderator
Posts: 8588
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Modern Waypoints

Post by kamnet »

Compiled .grf, all source code and documentation attached.
Attachments
modern_waypoint3.tar
(48 KiB) Downloaded 85 times
User avatar
Quast65
Tycoon
Tycoon
Posts: 2663
Joined: 09 Oct 2011 13:51
Location: The Netherlands

Re: Modern Waypoints

Post by Quast65 »

kamnet wrote:I'm assuming then I'd need to pull up the base graphics spritesheet and track down the sprite number intended for use?
Michael already helped you regarding the tracks, but in case you ever want to make non-track stationtiles and want to use base-graphics for those as groundtiles you need to do this:

- Indeed, track down the spritenumber of that base-graphic (not sure if they are shown in the source files, otherwise just decompile the Opengfx-base GRF), for example basic grass tile is number: 3981
- Convert that number into Hexadecimals, this is a handy webpage: http://www.statman.info/conversions/hexadecimal.html, 3981 becomes F8D (so, 0F 8D)
- Finally you have to reverse the two bits for the code, so 0F 8D becomes 8D 0F

This way you can for example give non-track tiles roadsprites, those will automagically be replaced by those of a roadset. (handy if you for example want to make parkingspots for a station, but you want the road to look like that of the roadset)
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: Modern Waypoints

Post by michael blunck »

Quast65 wrote: Michael already helped you regarding the tracks, but in case you ever want to make non-track stationtiles and want to use base-graphics for those as groundtiles you need to do this:

- Indeed, track down the spritenumber of that base-graphic (not sure if they are shown in the source files, otherwise just decompile the Opengfx-base GRF), for example basic grass tile is number: 3981
- Convert that number into Hexadecimals, this is a handy webpage: http://www.statman.info/conversions/hexadecimal.html, 3981 becomes F8D (so, 0F 8D)
- Finally you have to reverse the two bits for the code, so 0F 8D becomes 8D 0F
This is exactly the same thing I already explained above. There´s no difference between station tiles with track and station tiles without (trains will happily drive over gras). In fact, you can use any TTD (or custom) sprite for ground tiles (or building tiles). Whether for stations or for houses, industry tiles, or objects.

You may even use decimal numbers, no need for hex conversion.

regards
Michael
Image
User avatar
kamnet
Moderator
Moderator
Posts: 8588
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Modern Waypoints

Post by kamnet »

Quast65 wrote:This way you can for example give non-track tiles roadsprites, those will automagically be replaced by those of a roadset. (handy if you for example want to make parkingspots for a station, but you want the road to look like that of the roadset)
Get out of my head! :D :bow:
Nickel_Plate
Traffic Manager
Traffic Manager
Posts: 146
Joined: 27 Dec 2004 19:37
Location: Home of the Big Cat

Re: Modern Waypoints

Post by Nickel_Plate »

Found a Graphics Glitch with modern waypoints. ?(
Attachments
CGJ0001.PNG
CGJ0001.PNG (29.25 KiB) Viewed 2580 times
User avatar
kamnet
Moderator
Moderator
Posts: 8588
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Modern Waypoints

Post by kamnet »

Thank you for noticing! I will have to look into how to fix that little glitch. No sure when I'll get that done. If somebody wants to take a crack at it, be my guest :)
User avatar
Quast65
Tycoon
Tycoon
Posts: 2663
Joined: 09 Oct 2011 13:51
Location: The Netherlands

Re: Modern Waypoints

Post by Quast65 »

For direction-2 the sprites are built up the wrong way around.

The first one should be the back-of-track graphic, the second the front-of-track graphic.

Either, switch the graphics around in the graphicsfile (and adjust the graphicsproperties accordingly in the Action-1 in the NFO-file).

Or, switch these around:

\dx3F3 // Ground sprite set to F3 03 00 00
00 00 00 05 10 17 \dx842F // Building sprite
0B 00 00 05 10 17 \dx8430 // Building sprite
80
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.
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 72 guests