Page 1 of 2

[OTTD] SMITS v1.0

Posted: 16 Jul 2010 14:03
by Froix
Shanghai Maglev Inspired Track Set v1.0 or SMITS XD
(previously released as Shanghai Maglev Tracks versions 1.0 - 1.5)

This NewGRF contains graphic replacements for tracks, fences, depots, tunnels, bridges, station and icons/cursors for the maglev rail. All are optional except for the main tracks, fence, depot and icons/cursors via the use of parameters (see Parameters below). All climates are supported.
See Screenshot and DL links below

Requirements
OpenTTD (Windows palette compatible) DL Here

How to Use
  • 1. Copy this Newgrf (SMITS.grf or SMITS.tar) to your OpenTTD/data folder
  • 2.a. Add the Newgrf via the Newgrf settings windows inside the game or
  • 2.b. Edit Openttd configuration file
  • 3. At the start of the game, set parameters according to your preference. Parameter settings are saved in your savegame so you only need to do this once but you may still change these in-game as many times as you like.
Main Parameters
  • 1st Parameter - sets compatibilty with graphics base set
    • 0 - original base set (default value)
    • 1 - Opengfx base set
  • 2nd Parameter - bridge and tunnel settings
    • 0 - use default tunnels, bridge heads are removed (default value)
    • 1 - use default tunnels, show bridge heads
    • 2 - use custom tunnels, bridge heads are removed
    • 3 - use custom tunnels, show bridge heads
  • 3rd Parameter - station settings
    • 0 - use custom station graphics separately
      * Adv: snowed on station supported, default station graphics can still be used
      Disadv: my coding could be buggy
    • 1 - replace default maglev station graphics with custom graphics
      * Adv: uses simple graphic sprite replacement (less chance of conflict with other GRFs), built maglev stations are instantly replaced when used for saved games.
      Disadv: no snowy station, built maglev stations are instantly replaced when used for saved games.
Extra Parameters
  • 4th Parameter - share tunnel with other railtypes
    • 0 - share with none (default value)
    • 1 - share tunnel with monorail
    • 2 - share tunnel with normal rails
      * Just for fun. This feature works only with other railtypes loaded in the game via NewGRF. There may be minor glitches depending on how the tunnel sprites are drawn in the railtype. This NewGRF needs priority over the other railtype for this feature to work.
  • 5th Parameter - additional icons/cursors
    • 0 - disabled by default
    • 1 - enable custom icons/cursors in the construction window to match railtype icons
    • 2 - more icons
      * Incomplete.
Tools Used
Grfcodec and NFORenum for compilation and debugging
GIMP for drawing sprites
Notepad++ for coding NFO
WinGRF for quick TTD GRF lookups

Thanks To
The developers of Grfcodec and Nforenum.
Foobar's List of Bridge Codes.
And to the rest of the guys at the TTD Community for their support and encouragement.

Changes From Last Release
  • added custom station
  • reworked track shadows
  • added custom fences
  • added custom icons/cursors
  • changed depot
  • bridge revamped

Copyright 2010 Froix

Re: [OTTD] Shanghai Maglev Tracks

Posted: 16 Jul 2010 14:13
by planetmaker
Nice stuff! :-)

But you use a simple sprite replacement for rail tracks. That's not anymore state of the art ;-) - OpenTTD can do better, if you provide the tracks a a railtype; in that case you don't have to worry about any ground sprites. That'd make it also easy to drop the limitation to temperate climate.

I can refer you to the swedish rails which I programmed the last months: http://dev.openttdcoop.org/projects/swedishrails (or just get the grf and the source tar ball from http://bundles.openttdcoop.org/swedishr ... es/LATEST/
The source code is freely available under the GPL v2 and it should be moderately easy to just replace all sprites I use there by your own sprites and thus modify this into a maglev replacement.

Re: [OTTD] Shanghai Maglev Tracks

Posted: 16 Jul 2010 14:38
by DJ Nekkid
a screenshot would be nice :D

Re: [OTTD] Shanghai Maglev Tracks

Posted: 16 Jul 2010 17:28
by FooBar
Screenshot. Not a very nice setup, but it gives an idea of this set.

@Froix: You did a good job on your first newgrf! I'd never use it, but then I'm also biased by my own transrapid tracks (see link in signature).
Anyways, keep expanding it to other climates (Railtypes is a great help here!) and figure out what you want to do with the level crossings. :D

Re: [OTTD] Shanghai Maglev Tracks

Posted: 16 Jul 2010 17:31
by planetmaker
FooBar wrote:what you want to do with the level crossings. :D
I'd simply disallow level crossings. Something only possible with railtypes :-) (and in recent nightlies only). Which, btw, would also help to solve the bridge hassle: just define proper overlay sprites which hide the default tracks and you're set for all bridges, whatever base set or newgrf provides them.

Re: [OTTD] Shanghai Maglev Tracks

Posted: 16 Jul 2010 19:06
by cmoiromain
These are nice!
Congrats on learning newgrf, not everyone is capable of this. And the graphics look pretty good too. As Foobar said, a transrapid set has already been made by him, but I like yours just as much (though they are more a king of monorail track in my eyes).
BTW, that maglev isn't Shangai-exclusive, there is one test track in Germany (where the thing was invented in the first place). Shangai is the only commercial line.

Good luck!

Re: [OTTD] Shanghai Maglev Tracks

Posted: 16 Jul 2010 20:21
by FooBar
cmoiromain wrote:BTW, that maglev isn't Shangai-exclusive, there is one test track in Germany
The style of track is though. The track at the test facility looks quite different from the track built in Shanghai.

Re: [OTTD] Shanghai Maglev Tracks

Posted: 16 Jul 2010 20:55
by michael blunck
FooBar wrote:
cmoiromain wrote:BTW, that maglev isn't Shangai-exclusive, there is one test track in Germany
The style of track is though. The track at the test facility looks quite different from the track built in Shanghai.
Bad soil conditions in Shanghai (silt) required development of a novel hybrid (steel/concrete) track system.

regards
Michael

Re: [OTTD] Shanghai Maglev Tracks

Posted: 16 Jul 2010 22:11
by cmoiromain
I don't see that many differences...
Look at those two pictures: Germany - China

Re: [OTTD] Shanghai Maglev Tracks

Posted: 17 Jul 2010 02:14
by Froix
@planetmaker

Is there a railtypes guide for the layman out? :wink: I'll look into it when I get more time. I'm leaving 32bpp graphics for the real artists though.

@foobar

Thanks for the screeny. Just uploaded another one on my first post. I've seen your transrapid tracks, I've used them a couple of times. The original maglevs just get muddy when working with multiple congested intersections.


I was just looking at cmoiromain's Germany pic and thought, "Ooo they're about to intersect, they better slap those signals fast" ahahaha I've got TTD on the brains. They're most likely rerouting though ahaha

Image

I'm sticking with the Shanghai title. :wink: Hey! Thanks for the comments guys!

Re: [OTTD] Shanghai Maglev Tracks

Posted: 17 Jul 2010 10:57
by XeryusTC
Very nice job there :) I quite like these tracks and I'll probably use them when I start another game which has some kind of maglev involved :) I prefer them over the transrapid track set by far as they fit more to the tracks lying on the ground as all other track types in TTD do.

On another note, I don't know if you want to support TTDP with this, but if you don't it would probably be best to use the tracktype stuff that OTTD supports nowadays as suggested before. If you do want to support TTDP I'd suggest that you support OTTD with the methods suggested before and but also have a normal sprite replacement and disable one piece or the other depending on the host program. I don't know if this lies within your current NFO abilities though.

Re: [OTTD] Shanghai Maglev Tracks

Posted: 17 Jul 2010 16:10
by FooBar
Froix wrote:Is there a railtypes guide for the layman out?
Guide? Probably not. You basically have to work with the information on the Action 3 page. The principle is not that hard to follow though. Have a look at it, and just ask if you have questions.

Something completely different would be using NML: http://dev.openttdcoop.org/projects/nml
For NML somewhat of a guide to railtypes exists here: http://www.tt-forums.net/viewtopic.php?f=68&t=48891

Re: [OTTD] Shanghai Maglev Tracks

Posted: 21 Jul 2010 13:24
by Froix
planetmaker wrote:OpenTTD can do better, if you provide the tracks a a railtype; in that case you don't have to worry about any ground sprites. That'd make it also easy to drop the limitation to temperate climate.
Done. :D

NML would've surely made my task a lot easier but I can't compile the code. It's not recognizing the #include and #define commands. I get the "Illegal character" error. I'm guessing it has something to do with C and Python and me using Windows but I'm sure you guys know more about this one.
cmoiromain wrote:though they are more a king of monorail track in my eyes
I just widened the main tracks two pixels. I was trying to stay in proportion with the trains but I guess there was a little more space to expand to.

Re: [OTTD] Shanghai Maglev Tracks

Posted: 21 Jul 2010 18:57
by Ammler
Yes, it is easiest with unix system like linux or osx, if you want, you can use our DevZone, we could setup it so it does build on every push...

just ping us, if you like...

Re: [OTTD] Shanghai Maglev Tracks

Posted: 25 Jul 2010 06:54
by Froix
Another update.

* Tunnel now supports all climates except for Toyland.
* Depot redesigned.
* Bridge redesigned.

* Added separate Shanghai Transrapid Train GRF. (Might as well build the train)

Question: Is there a way to stop the game from greying out my pillars when using the Tubular Silicon Bridge?

Thanks Ammler! I'll keep your offer in mind. I have a feeling it'll be slow going for my slow internet though. :?

Re: [OTTD] Shanghai Maglev Tracks

Posted: 25 Jul 2010 07:00
by Kogut
Maybe you can add also newgrf bridge replacing silicon bridge?

Re: [OTTD] Shanghai Maglev Tracks

Posted: 25 Jul 2010 07:17
by planetmaker
Froix wrote: Question: Is there a way to stop the game from greying out my pillars when using the Tubular Silicon Bridge?
The three different tubular bridges share sprites, the pillars additionally among track types. The sprites are just re-coloured. As such it is not easily possible to change that unless you change the other two bridges, too.
My best guess is to keep them and adjust your maglev bridge such that it matches those... though they differ slightly between base sets. So you easily end up with glitches here and there unless you rework all those sprites, but it may work with pillars without glitch. Chosing one or another version for the two different base sets via parameter is for MP games no option as it'd be wrong for at least 1/3 of the players (same unfortunately with tunnel sprites, even with rail types, but that can be worked around).

See http://mz.openttdcoop.org/opengfx/autho ... ogfx1_base (large page, several MB!), sprites 2565 and following.
Thanks Ammler! I'll keep your offer in mind. I have a feeling it'll be slow going for my slow internet though. :?
Single updates to a repository are usually not large and as such very quick; it'd give you also the possibility to produce nightly versions, catching some errors and glitches possibly faster.

Concerning trains I indeed consider it the way better approach to keep tracks and vehicles separate entities / newgrfs and not mix them, if not necessary.

Re: [OTTD] Shanghai Maglev Tracks

Posted: 25 Jul 2010 07:29
by Kogut
It is waaaaay batter than original maglev.
Is it possible to fix it?

Re: [OTTD] Shanghai Maglev Tracks

Posted: 25 Jul 2010 10:19
by Kogut
I discovered that you changed sprites for all tubular bridges. I see nothing wrong in it but maybe sb prefer to have road bridges intact. Whatmore in RV there is junk left after that terrible tubulars

Re: [OTTD] Shanghai Maglev Tracks

Posted: 25 Jul 2010 10:29
by planetmaker
That is actually what I mean with "better leave bridges un-touched" or exercise great care. They share sprites. And it will glitch if you start replacing these sprites, too, as you cannot know which base set a user uses :-)

Thus I'd like to recommend to look at rail types again and "just" replace the tracks. And possibly make other changes optional, selectable via newgrf parameters.