Japanese Stations Add-ons
Moderator: Graphics Moderators
Japanese Stations Add-ons
Hello, all! I'd like to share with you the project I've been working on for the last month:
The
Japanese Stations Add-ons Set
=====================================================================================================================
Latest release: viewtopic.php?p=1252536#p1252536
=====================================================================================================================
The goal is to add a few more options to the original Japanese Stations Set. The add-ons include fenced platforms, with fences both on the platform or next to the tracks, longer platform ends, two types of ramps, the old style tiled roof and pedestrian overpasses with modern yellow lines, benches, plants, vending machines and elongated platforms to go under bridges.
Future plans
This is my first attempt at making a GRF, and it is very much a work in progress, but I think it has enough to be playable. There are some more things I'd like to include in the future, like a few more platform tiles, as well as some non-track tiles. Any feedback, comments or suggestions are welcome.
A full release (v1.0) would need to be fully compatible with the original Japanese Stations Set, that would mean: Year dependent, snow and passenger aware platforms. It would also be nice to have auto-orienting platform ends and buffers, and custom foundations. Unfortunately, I'm learning to code as I go and I don't currently know how to implement all those features, so it'll probably take some time before they are available.
License
As the original Japanese Stations Set, this Add-ons are GPLv2. The source can be found here https://github.com/DemianWSE/JapaneseStationsAddons and on the attachments of this post. Any problems, let me know, I'm very new at all this coding and github stuff so it's not unlikely I made a mistake somewhere.
Soon I'll upload the set to BaNaNaS.
That's all for now!
The
Japanese Stations Add-ons Set
=====================================================================================================================
Latest release: viewtopic.php?p=1252536#p1252536
=====================================================================================================================
The goal is to add a few more options to the original Japanese Stations Set. The add-ons include fenced platforms, with fences both on the platform or next to the tracks, longer platform ends, two types of ramps, the old style tiled roof and pedestrian overpasses with modern yellow lines, benches, plants, vending machines and elongated platforms to go under bridges.
Future plans
This is my first attempt at making a GRF, and it is very much a work in progress, but I think it has enough to be playable. There are some more things I'd like to include in the future, like a few more platform tiles, as well as some non-track tiles. Any feedback, comments or suggestions are welcome.
A full release (v1.0) would need to be fully compatible with the original Japanese Stations Set, that would mean: Year dependent, snow and passenger aware platforms. It would also be nice to have auto-orienting platform ends and buffers, and custom foundations. Unfortunately, I'm learning to code as I go and I don't currently know how to implement all those features, so it'll probably take some time before they are available.
License
As the original Japanese Stations Set, this Add-ons are GPLv2. The source can be found here https://github.com/DemianWSE/JapaneseStationsAddons and on the attachments of this post. Any problems, let me know, I'm very new at all this coding and github stuff so it's not unlikely I made a mistake somewhere.
Soon I'll upload the set to BaNaNaS.
That's all for now!
- Attachments
-
- jpstationsAddonsv0.1.grf
- (424.43 KiB) Downloaded 287 times
-
- jpstationsAddonsv0.1_source.rar
- (150.43 KiB) Downloaded 172 times
Last edited by DemianWSE on 07 Apr 2022 02:58, edited 2 times in total.
DemianWSE
-
- Tycoon
- Posts: 5948
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Japanese Stations Add-ons
You could get all those features easily by coding your set in m4nfo.DemianWSE wrote: It would also be nice to have auto-orienting platform ends and buffers, and custom foundations. Unfortunately, I'm learning to code as I go and I don't currently know how to implement all those features, so it'll probably take some time before they are available.
Here's a tutorial:
http://www.ttdpatch.de/grfspecs/m4nfoMa ... nsTut.html
And here's a full station project:
https://github.com/kiwitreekor/korean_station
BTW, JGRPP has a feature "bridges over stations", so no need for "elongated platforms".
regards
Michael
Re: Japanese Stations Add-ons
Thanks! I'll check it out.michael blunck wrote: ↑06 Dec 2020 21:42 You could get all those features easily by coding your set in m4nfo.
I didn't know that, I've never really played with JGRPP, I tried it like a year ago but the amount of stuff it adds was so much I knew it would take me ages to get every setting the way I like. Maybe I'll give it another chance.BTW, JGRPP has a feature "bridges over stations", so no need for "elongated platforms".
Cheers!
DemianWSE
Re: Japanese Stations Add-ons
Looks good, I'll have to have a look at this, most of my games lately have been using the JP Station set primarily so this will make a good addition.
(Also darnit Michael, you've tried to sell me on m4nfo a few times now but that tutorial is exactly what I needed too... )
(Also darnit Michael, you've tried to sell me on m4nfo a few times now but that tutorial is exactly what I needed too... )
Currently working under the name 'reldred' on Github, and Discord.
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.
14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.
14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
-
- Tycoon
- Posts: 5948
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Japanese Stations Add-ons
Yeah, Richard. But that was exactly 4 years ago!
regards
Michael
Re: Japanese Stations Add-ons
Four years? But the blink of an eye...michael blunck wrote: ↑07 Dec 2020 11:20Yeah, Richard. But that was exactly 4 years ago!
regards
Michael
Currently working under the name 'reldred' on Github, and Discord.
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.
14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.
14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
Re: Japanese Stations Add-ons
Just when I started a Japan set game.. Funny timing, this But so far looks very good..
If I may lobby for a tile inclusion.. do the following sound like a good idea to you?
If I may lobby for a tile inclusion.. do the following sound like a good idea to you?
- Original Japanese set has overpass for through tracks (i.e. without platform) as a waypoint - would it be possible to have it included as a station tile?
- In a similar vein, we have modular station overpass (both high and low) with platform edge.. would it be possible to make one without platform for through tracks, both in waypoint and station tile form?
- And perhaps a bit more difficult - buffer station tiles without platform behind the buffer - i.e. platforms on one or both sides continue straight instead of an "L" shape
My visits on the forums are sporadic only, so PMs may go unanswered for a long time. If you wish to report a bug etc., the best option is via DM or ping on r/Openttd Discord
Re: Japanese Stations Add-ons
Yeah, the Japanese stations have been my main station set for a while now, that is why I started this project . Let me know if you have any suggestions.
This shouldn't be a problem.
This depends on how easy or hard it is to make company colors work in stations and waypoints, I haven't tried to use company colors yet, so I don't know, but I would hope it's not too bad. I'll have to try.
I haven't tried to code buffers yet, but it should be possible. Though I don't know how good it would look, the buffers on the tracks are small and don't have much contrast, I think without the platform on the back it would be hard to tell they are buffers at all.
Anyway, I'll give them a try soon and let you know. Although, I have to say, I don't see the benefit of having the overpasses without platforms as station tiles, could you tell me or, even better, show me a situation in which those would be useful?
Cheers!
DemianWSE
Re: Japanese Stations Add-ons
About the only thing I can think of for the moment is for consistencies sake see if you can mirror the time based graphics and the introduction years for things like the Shinkansen stations. Otherwise I've been pretty impressed by it. The little ramps for the island stations when butted right up against a road crossing look very nice.
Currently working under the name 'reldred' on Github, and Discord.
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.
14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
NFO/NML coder, part-time patch writer for JGRPP, and all round belligerent.
14:40 <orudge> I can't say I discriminate against any particular user
14:41 <Aegir> orudge: I can!
-
- Tycoon
- Posts: 5948
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Japanese Stations Add-ons
In m4nfo, this is quite easy, by using function compcol() instead of regular() for station sprites, see:DemianWSE wrote: This depends on how easy or hard it is to make company colors work in stations and waypoints, I haven't tried to use company colors yet, so I don't know, but I would hope it's not too bad. I'll have to try.
http://www.ttdpatch.de/grfspecs/m4nfoMa ... tions.html
I have such buffers in NewStations, and I think they look OK.DemianWSE wrote: [...] buffers on the tracks are small and don't have much contrast, I think without the platform on the back it would be hard to tell they are buffers at all.
regards
Michael
Re: Japanese Stations Add-ons
This is lovely. I had thought about making a Japanese Stations Addon for a while now, but I likely wouldn't have added the things you did. I'd love to see what you come up with.
I agree with Michael that these features are probably easier to implement in m4nfo.
The buffers in most NewGRFs, including NewStations are a bunch larger than the Japanese ones, so you might want to tweak the sprites a bit, but I reckon it could work just fine. You don't know until you try.
I agree with Michael that these features are probably easier to implement in m4nfo.
The buffers in most NewGRFs, including NewStations are a bunch larger than the Japanese ones, so you might want to tweak the sprites a bit, but I reckon it could work just fine. You don't know until you try.
Re: Japanese Stations Add-ons
Very excited to see this - always wanted more variety added to the JapanSet Stations. Well done.
Once wish of mine - I'd love to see one-way overpass sections, at the moment the only option is bi-directional...but I'd love to have the option to place them at the end of the platform or at the end of the station roofs with just stairs in one direction.
Once wish of mine - I'd love to see one-way overpass sections, at the moment the only option is bi-directional...but I'd love to have the option to place them at the end of the platform or at the end of the station roofs with just stairs in one direction.
Regards,
Tinny/Tintinfan.
Tinny/Tintinfan.
Re: Japanese Stations Add-ons
Thanks to everyone for the feedback and the kind words!
I hope to work on the suggestions you gave me in the next few days, I'll let you know how it goes.
Cheers!
Yeah, I have some learning to do before being able to do that, but it is in my plans for sure.
michael blunck wrote: ↑08 Dec 2020 09:29 In m4nfo, this is quite easy, by using function compcol() instead of regular() for station sprites, see:
Having almost no coding experience (just a little Fortran in college) both nfo and m4nfo, and nml for that matter, look equally hard to me. But on the plus side, seeing the glass half full, that means they are both equally easy . I've been reading a little the m4nfo manual and looks very interesting, I'll try to learn it a bit, especially after reading this:
I'll have to try to make it work .michael blunck wrote: ↑08 Dec 2020 09:30 You can even include nfo code directly into m4nfo sources, e.g when up to a migration project. Since m4nfo is just a bunch of macros generating plain nfo, this works without any problems.
Out of curiosity, what would you have added? Maybe we could include some of your ideas in this set
This is coming! I was planning to work on those next, I even saw a very nice example on google street view which I'll try to copy, it was mostly white with red details.
I hope to work on the suggestions you gave me in the next few days, I'll let you know how it goes.
Cheers!
DemianWSE
Re: Japanese Stations Add-ons
If you have experience with the only programming language that really matters (Fortran), then m4nfo and nml should be somewhat easier than nfo.DemianWSE wrote: ↑09 Dec 2020 03:54Having almost no coding experience (just a little Fortran in college) both nfo and m4nfo, and nml for that matter, look equally hard to me. But on the plus side, seeing the glass half full, that means they are both equally easy . I've been reading a little the m4nfo manual and looks very interesting,
Mostly utility tiles: longer platforms to have switches in the middle of platforms, as well as platform ends as waypoints. Probably also the modular stations as waypoints. For new stuff, mainly new overpass, platform roof and generic station building varieties, as well as some major station buildings such as the Nagoya towers.
-
- Tycoon
- Posts: 5948
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Japanese Stations Add-ons
Neither are real/proper programming languages. So even a profound knowledge in e.g. C/C++ wouldn't help you much.DemianWSE wrote: Having almost no coding experience (just a little Fortran in college) both nfo and m4nfo, and nml for that matter, look equally hard to me.
For example, when writing a patch for OTTD, it would need thorough knowledge about the underlying game mechanics and OTTD's structure. Just being an expert in C/C++ wouldn't suffice.
Same is true for adding to /modifying an already existing grf set, especially when originally written in low-level nfo byte code.
Today, I have taken a look into the Japan Set nfo code for the first time.DemianWSE wrote: I've been reading a little the m4nfo manual and looks very interesting, I'll try to learn it a bit, especially after reading this: [including plain nfo code in m4nfo]
I my opinion, including additions and/or modifications directly into it would be a really big undertaking. Since this wouldn't only need good knowledge of nfo, and thorough knowledge of the set as such, but also of its inner structure.
Although, a lot of its constituent objects (e g. platforms) are nicely encapsulated, there are also a lot of global vars, parameter dependencies, action6s and actionDs which are hard to track.
Ten years ago, I had the NewStation set migrated from nfo to m4nfo, and although I had a couple of (self-written) transformation tools available, and I had even been the original author of its nfo code, this was a lenghty and tedious task.
With part of the problem being a fundamental difference between nfo and "higher-level" m4nfo/NML: where nfo "pseudo sprites" (code) might be scattered over the whole grf, this is not true for languages built upon nfo. These often collect single nfo sprites into higher abstraction levels. And, e.g., m4nfo actually has no access to nfo's actions 6 and D, but hides it away from the coder by supplying higher order functions instead. And o/c, this results in a need to modify the set's structure, probably far away from a 1:1 transformation.
So, in my opinion, writing an add-on for the Japan Set (in m4nfo rather agan in plain nfo) would be the faster and better way.
regards
Michael
-
- Tycoon
- Posts: 5948
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Japanese Stations Add-ons
I've taken a look into your github japstationsadd platforms file.
In m4nfo, the first platform ID would look like this (the station definition missing in your file):
Some remarks:
- you should use CB_LAYOUT (callback 14) for addressing station tiles. This will show up far easier at a later point.
- you should set up include files for station IDs and strings.
- since the layout of all your ~80 platform types is nearly the same, you should use some form of templating to reduce size (and opportunity for introducing bugs),
- in makestation(), you might include extra sprites for menues, and/or different sprites for showing different cargoes.
- maybe it would be an idea to collect more (or all?) platform sprites in larger sprite blocks? The original grf does this for some of its station types. I don't know what would be best, at the moment.
- since the original grf shows passengers on platforms, you might include this feature as well with your additional platforms. This at least, would make good use of using CB_LAYOUT and/or use of the advanced station layout feature.
- you should think about parameters needed, and include them in grfinit().
regards
Michael
In m4nfo, the first platform ID would look like this (the station definition missing in your file):
Code: Select all
// include(ja_stations.m4)
define(JSADD_0, 0)
// include(sprites/strings.nfx)
setfeature(_STATION)
setgrfversion(7)
textmode_on()
grfinit(GRF_XXXX,
grfname(ALL, "Japanese Stations Add-ons v0.1")
grfdescription(ALL,CRLF T_LGRAY A9 "Original Japanese Stations drawn by Sanchimaru and Tony Babelony" CRLF
"and coded by Death (E. Silberstein), stevenh and Dandan" CRLF CRLF
"Add-ons by DemianWSE")
grfurl(ALL, "http://www.XXXX.XX")
grfpalette(DOS)
grfversion(1)
grfminversion(1)
grfparameter(
grfsetting(
settype(BOOL, 0, 0, 1)
setname(STR_PARAMETER)
setdescription(STR_DESCRIPTION)
)
)
)
textmode_off()
// station class name
classnames(PLATFORMS,
{UK, "Japanese Platforms (Add-ons)"},
{D, "Japanische Bahnsteige (Erweiterung)"},
{F, UTF8 "Quais japonais (supplémentaires)"},
{E, UTF8 "Andénes japoneses (expansión)"},
{I, "Banchine giapponesi (ampliamento)"}
)
//Normal platforms
// JSADD_0: Long platform end (bottom)
define(JSADD_0, "Long Platform end",
class(PLATFORMS)
callbacks(CB_LAYOUT)
exclude_widths(8)
exclude_lengths(8)
flags({GROUNDSPRITES, FOUNDATIONS})
)
layout(JSADD_0,
tile(
ground(1012)
compcol(0, xyz(0, 0, 0), dxdydz(16, 6, 5))
compcol(1,xyz(0, 10, 0), dxdydz(16, 6, 5))
)
tile(
ground(1011)
compcol(2, xyz(0, 0, 0), dxdydz(6, 16, 5))
compcol(3, xyz(10, 0, 0), dxdydz(6, 16, 5))
)
)
spriteblock(
set(
sprites/endbottom.png 8 7 01 122 64 -31 -91)
sprites/endbottom.png 88 7 01 122 64 -51 -101)
sprites/endbottom.png 168 7 01 122 64 -31 -91)
sprites/endbottom.png 248 7 01 122 64 -11 -101)
)
)
def(1) spriteset(lots(0))
def(2) callback(
cbr(0)
ref(1) else
)
makestation(JSADD_0,
link(ref(2), MENU)
link(ref(2), PASS, SPECIAL)
default(ref(2))
)
- you should use CB_LAYOUT (callback 14) for addressing station tiles. This will show up far easier at a later point.
- you should set up include files for station IDs and strings.
- since the layout of all your ~80 platform types is nearly the same, you should use some form of templating to reduce size (and opportunity for introducing bugs),
- in makestation(), you might include extra sprites for menues, and/or different sprites for showing different cargoes.
- maybe it would be an idea to collect more (or all?) platform sprites in larger sprite blocks? The original grf does this for some of its station types. I don't know what would be best, at the moment.
- since the original grf shows passengers on platforms, you might include this feature as well with your additional platforms. This at least, would make good use of using CB_LAYOUT and/or use of the advanced station layout feature.
- you should think about parameters needed, and include them in grfinit().
regards
Michael
- wicket-303
- Engineer
- Posts: 21
- Joined: 19 Sep 2017 05:52
- Location: Japan
- Contact:
Re: Japanese Stations Add-ons
Great! I am grateful for your actions.
I want a station like this.
・Stairs leading to the Over-track station building ・Overpass in the countryside ・Stations that can be used since the 1800s
I want a station like this.
・Stairs leading to the Over-track station building ・Overpass in the countryside ・Stations that can be used since the 1800s
-
- Tycoon
- Posts: 5948
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Japanese Stations Add-ons
Apropos templates.
Since not only the layouts of your station platforms are the same, but also its graphics (dimensions and offsets), you could easily get away with one template for all of your platform stations:
And then make all the platform station types in one go:
And so on, up to JSADD_n. Finally copying the layout of JSADD_0 to all the other stations:
And that's all you need.
regards
Michael
Since not only the layouts of your station platforms are the same, but also its graphics (dimensions and offsets), you could easily get away with one template for all of your platform stations:
Code: Select all
layout(JSADD_0,
tile(
ground(1012)
compcol(0, xyz(0, 0, 0), dxdydz(16, 6, 5))
compcol(1,xyz(0, 10, 0), dxdydz(16, 6, 5))
)
tile(
ground(1011)
compcol(2, xyz(0, 0, 0), dxdydz(6, 16, 5))
compcol(3, xyz(10, 0, 0), dxdydz(6, 16, 5))
)
)
define(TEMP_platform,{
sprite(sprites/$1.png 8 7 01 122 64 -31 -91)
sprite(sprites/$1.png 88 7 01 122 64 -51 -101)
sprite(sprites/$1.png 168 7 01 122 64 -31 -91)
sprite(sprites/$1.png 248 7 01 122 64 11 -101)}
)
define(TEMP_stat_platform,{
define($1, $2,
class(PLATFORMS)
callbacks(CB_LAYOUT)
exclude_widths(8)
exclude_lengths(8)
flags({GROUNDSPRITES, FOUNDATIONS})
)
spriteblock(
set(
TEMP_platform($3)
)
)
def(1) spriteset(lots(0))
def(2) callback(
cbr(0)
ref(1) else
)
makestation($1,
link(ref(2), MENU)
link(ref(2), PASS, SPECIAL)
default(ref(2))
)
})
Code: Select all
TEMP_stat_platform(JSADD_0, "Long platform end (bottom)", endbottom)
TEMP_stat_platform(JSADD_1, "Long platform end (top)", endtop)
TEMP_stat_platform(JSADD_2, "Simple ramps (bottom)", simplerampsbottom)
TEMP_stat_platform(JSADD_3, "Simple ramps (top)", simplerampstop)
TEMP_stat_platform(JSADD_4, "Half ramps (bottom)", halframpsbottom)
TEMP_stat_platform(JSADD_5, "Half ramps (top)", halframpstop)
...
Code: Select all
copylayout(JSADD_0, JSADD_1 .. JSADD_n)
regards
Michael
Re: Japanese Stations Add-ons
It was over 10 years ago and I can't remember much. All I do remember are the 3 lines of code I wrote that managed to (accidentally) freeze every pc in my faculty I got banned for that, until they realized I had no idea what I'd done
We could make some of those happen, I reckon. The platform ends as waypoints sound like a great idea, I had never thought of that!Erato wrote: ↑09 Dec 2020 08:23 Mostly utility tiles: longer platforms to have switches in the middle of platforms, as well as platform ends as waypoints. Probably also the modular stations as waypoints. For new stuff, mainly new overpass, platform roof and generic station building varieties, as well as some major station buildings such as the Nagoya towers.
I'd love to add something like that to the set, I'll try my best to do it. Could you tell me the name of a station or stations that have those type of buildings so I can look them up on google?
We could add those.
I tested going back in time using cheats and the stations were available in 1800, however if you start the game in the 1800s and there are no available trains, the game won't let you build any stations. I could be wrong here, but I think you need a NewGRF with trains available in the 1800s to make the stations also available.
Michael: thanks so much for taking the time to write, check the code and explain this stuff to me, I really appreciate it. But I'm having more basic problems with m4nfo: The last few days I've been reading your comments and the m4nfo manual, and trying to make the code you gave me work, but I've been unsuccessful. I tried installing GNU M4 for windows as the manual said, but when trying to test it with this command
Code: Select all
M4 -R m4nfo_stations.m4 < test.nfx > test.nfo
I must be doing something wrong, but I just have no idea what. I've tried reading and re-reading the manual, but I'm often left with more questions than answers.stdin:23 Invalid language symbol in function __language
I forgot to mention I created the file test.nfx and put the code you gave me for the first platform in it. I also downloaded m4nfo_stations and I put all the files in the same folder as the m4.exe file.
I think I'll spend the next few days drawing the graphics for the requested tiles, and probably add them the same way I did the others, at least for now.
Cheers!
DemianWSE
-
- Tycoon
- Posts: 5948
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Japanese Stations Add-ons
Looks like an m4nfo error message in (internal) function _language().
That's good news, since it tells you everything is working, i.e. installed correctly!
Could you check the language symbols in your function grfname()? Should be "ALL", not "all".
regards
Michael
That's good news, since it tells you everything is working, i.e. installed correctly!
Could you check the language symbols in your function grfname()? Should be "ALL", not "all".
regards
Michael
Who is online
Users browsing this forum: No registered users and 42 guests