Project: Subway
Moderator: OpenTTD Developers
- technosnorunt58
- Engineer
- Posts: 79
- Joined: 09 Nov 2008 00:59
Project: Subway
Hi I am new here and I would like to start a project to create subways in OpenTTD.
If you would like to be a coder or drawer poast here.
If you do theise are REAL subway models.
EDIT: I can/will draw.
Updates:
If you would like to be a coder or drawer poast here.
If you do theise are REAL subway models.
EDIT: I can/will draw.
Updates:
Last edited by technosnorunt58 on 09 Nov 2008 14:02, edited 3 times in total.
Re: Project: Subway
there is a whole lot of metro/subway trains included in the 2cc-set, and we would love to have more if you want to draw:). However; your initial thread seem to be placed in the dev section, and not the grapics section...
Getting "underground" building into OTTD however is somewhat more difficult. There is a couple of ideas out there, but none of them has been acted on, and the devs have not made any "official" statements (that i know of), that such a project have been started.
The closest things is probably Belugas' (iirc) attempt to get signals on bridge tiles. (And i __think__ that can be adopted to tunnels at some point?
Getting "underground" building into OTTD however is somewhat more difficult. There is a couple of ideas out there, but none of them has been acted on, and the devs have not made any "official" statements (that i know of), that such a project have been started.
The closest things is probably Belugas' (iirc) attempt to get signals on bridge tiles. (And i __think__ that can be adopted to tunnels at some point?

Re: Project: Subway
The easiest way to simulate a kind of subway that I've found is to use trams on a lower level to the city and only leaving tunnels for corners and the station stops.
All that would really require is some kind of 'subway train' graphic that runs on tram tracks.
All that would really require is some kind of 'subway train' graphic that runs on tram tracks.
Re: Project: Subway
So what are you going to do yourself? If you want other to help, your best chance it to make a good start (ie code a patch) and show it off. If others like the way you implemented it, they might help with coding and or graphics.technosnorunt58 wrote:Hi I am new here and I would like to start a project to create subways in OpenTTD.
If you would like to be a coder or drawer poast here.
If you do theise are REAL subway models.
Updates:
- technosnorunt58
- Engineer
- Posts: 79
- Joined: 09 Nov 2008 00:59
Re: Project: Subway
I do not know how to code that much.
Don't some subways go above ground also?

Don't some subways go above ground also?

- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Re: Project: Subway
They in fact go only above ground in OTTD 

Re: Project: Subway
Its a nice idea and I hope it gets implemented, but it will be a lot of work...
Drawing the sprites is easy enough - creating an actual underground, that's not so easy
Drawing the sprites is easy enough - creating an actual underground, that's not so easy

Jon
- technosnorunt58
- Engineer
- Posts: 79
- Joined: 09 Nov 2008 00:59
Re: Project: Subway
Sure it is!!! All we need to do is make everything semi-transparent like buildings, roads, grass, trees, and water. And code the underground so things on top can go on it.
Re: Project: Subway
Uhm, methinks that you should leave the judging if something is easy or not to the people who can code.
You can draw all sorts of things for OpenTTD, that's never difficult (note - I do not mean to belittle the work of artists!). You could also draw space shuttles, tornados and whatnot - no problem. The difficult thing is always how to code it.
You can draw all sorts of things for OpenTTD, that's never difficult (note - I do not mean to belittle the work of artists!). You could also draw space shuttles, tornados and whatnot - no problem. The difficult thing is always how to code it.
Re: Project: Subway
That's my point.
One possible way could be to have a second "map" of tiles for the underground, not viewable on the standard view, and "linking" stations that go between the underground and above ground.
Eg a 1 tile entrance above ground that creates a below ground 4x4 2-"level" station for subway trains; kinda like an ICE system.
The two levels (one for NS and one for EW traffic could just share tiles but with no collision detection unless trains are heading on the same plane.
That would be doable, but it will most likely involve editing large swathes of pathfinder etc and the drawing of the map... a lot of work. That's not to say it can't be done - but you would have to find someone prepared to do a lot of work for it on the coding front.
One possible way could be to have a second "map" of tiles for the underground, not viewable on the standard view, and "linking" stations that go between the underground and above ground.
Eg a 1 tile entrance above ground that creates a below ground 4x4 2-"level" station for subway trains; kinda like an ICE system.
The two levels (one for NS and one for EW traffic could just share tiles but with no collision detection unless trains are heading on the same plane.
That would be doable, but it will most likely involve editing large swathes of pathfinder etc and the drawing of the map... a lot of work. That's not to say it can't be done - but you would have to find someone prepared to do a lot of work for it on the coding front.
Jon
Re: Project: Subway
Best way is not to go for a workaround, as that might create issues in the future.
To get underground levels you need a completely different map array (to curb memory consumption). This translates to changeing about half of openttd (quite a lot of work, especially since most/all devs are either students or have day jobs).
Lets see what changes need to be done:
This allows for non-uniform maps (well... within certain limits). For this lots of additional work is required, but at the moment that isn't of interest... technosnorunt58 wanted subways, and for that we need quite a bit of additional work:
NOTE: I'm not a dev, but have take a few looks at the code.
To get underground levels you need a completely different map array (to curb memory consumption). This translates to changeing about half of openttd (quite a lot of work, especially since most/all devs are either students or have day jobs).
Lets see what changes need to be done:
- Make a wrapper class for the TileIndex (the tileindex is a unique value representing the offset in the map array), to support both new and old tileindexes (this is step 1 of your project, also the easiest step).
- Make a wrapper class for the map array and populate it with the functions which calculate all kinds of things which are needed by the various parts of openttd (quite easy, but lots of work). Make sure the class functions are used instead of the global ones.
- Write the replacement map array (basically a Memory pool storing 16x16 or 8x8 blocks of tiles). Make sure it's accessed properly (otherwise havoc will ensue once you're using it).
- Get rid of the runtime TileIndex conversion, by providing converted versions of the map class functions (relatively easy, but quite a lot). NOTE: you cannot get rid of the old ones, since you might need them to load scenarios/savegames from previous versions.

This allows for non-uniform maps (well... within certain limits). For this lots of additional work is required, but at the moment that isn't of interest... technosnorunt58 wanted subways, and for that we need quite a bit of additional work:
- At this point layers need to be stacked in the map array, implementing this shouldn't be much of a problem. There are a few approaches to handling this, each having its own advantages and disadvantages.
- Get the new TileIndex an additional nybble (for the height).
- Split out tunnel and bridge code, for easy conversion later. Is this really needed?
- Adapt various checks throughout the code to see what's above/below the current tile (lots of work).
- Adapt the viewport to take the 3D map array into account.
- Put all tiles on different heights (according to their tile height). However, still treat the map as 2D (makes life easier).
- Adapt the map generator for the 3D map.
- Correct the tunnel and bridge functions to actually put rails/roads on the map in the appropriate 3D tile (converters for savegames).
- Adapt the map functions to make use of the 3D functionality (underground/overground rails).
- First the UI needs some love. Have you dreamt up an easy to use way to edit with multiple layers, without behaving like locomotion? That needs to be implemented at this point.
- Make openttd aware of what's underground and above ground and stop rendering when the border is reached (underground renders from below to the surface, and above ground renders from the surface to the top of the map array.
NOTE: I'm not a dev, but have take a few looks at the code.
Re: Project: Subway
Mostly I agree with what Expresso said but some of what he said isn't necessarily true for every reasonable approach.
The main problems in my opinion:
The main problems in my opinion:
- It isn't too hard to get something working. It is hard to make it work well, be reasonable fast and not use a huge amount of memory.
- You need a good way to be able to edit in 3 dimensions.
- You need a good way to render the world in 3 dimensions fast.
- Huge amount of existing code might need to be modified. This will likely introduce a swarm of huge bugs.
- Could use a rolling amount of layers (keeps memory requirement down, allows flexible terrain, makes rendering difficult)
- The views could be split into 2: above ground (forests, towns, bridges, etc) and below the ground (tunnels, subway, under the sea, underground stations).
- You don't necessarily need to be compatible with the old map other than allow converting the old into the new when loading.
- technosnorunt58
- Engineer
- Posts: 79
- Joined: 09 Nov 2008 00:59
Re: Project: Subway
It would need to intersect with tunnles already there.
Witch in my mind would be a possable glitch.
Witch in my mind would be a possable glitch.
Re: Project: Subway
That's why I suggested foax levels
You can't actually choose what levels the track is on (this reduces some of the workload dramatically)
Instead trains travelling NS are on "level 1" which is always above "level 2" (EW trains); these two tracks can then cross each other with no issues
Diagonal tracks are visualised as "slopes" or similar, to allow trains to change direction - these cannot intersect with either NS, SW or other diagonal tracks and are strictly 1-track-per-tile.
It's workable in either format; and would IMO be a great addition to the game in the realism it can offer (buses always struggle to cope with large cities full of passengers)... I just don't think anyone has that much spare time on their hands.
You can't actually choose what levels the track is on (this reduces some of the workload dramatically)
Instead trains travelling NS are on "level 1" which is always above "level 2" (EW trains); these two tracks can then cross each other with no issues
Diagonal tracks are visualised as "slopes" or similar, to allow trains to change direction - these cannot intersect with either NS, SW or other diagonal tracks and are strictly 1-track-per-tile.
It's workable in either format; and would IMO be a great addition to the game in the realism it can offer (buses always struggle to cope with large cities full of passengers)... I just don't think anyone has that much spare time on their hands.
Jon
- technosnorunt58
- Engineer
- Posts: 79
- Joined: 09 Nov 2008 00:59
Re: Project: Subway
So should we start?
Re: Project: Subway
Only if you're using the royal we there.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
- technosnorunt58
- Engineer
- Posts: 79
- Joined: 09 Nov 2008 00:59
Re: Project: Subway
What does that mean???DaleStan wrote:Only if you're using the royal we there.
Re: Project: Subway
The royal we, where we is used instead of I.
To put it bluntly, DaleStan's not interested, and tbh, I don't think any else is either.
To put it bluntly, DaleStan's not interested, and tbh, I don't think any else is either.
- planetmaker
- OpenTTD Developer
- Posts: 9432
- Joined: 07 Nov 2007 22:44
- Location: Sol d
Re: Project: Subway
It's up to you on how to spend your time. If properly done, it may be an awesome patch.technosnorunt58 wrote:So should we start?
For inspiration have a look at http://devs.openttd.org/~smatz/3d/
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
- CommanderZ
- Tycoon
- Posts: 1872
- Joined: 07 Apr 2008 18:29
- Location: Czech Republic
- Contact:
Re: Project: Subway
This is amazing, I never know someone actually tried to code this. Thanks for a link.planetmaker wrote:It's up to you on how to spend your time. If properly done, it may be an awesome patch.technosnorunt58 wrote:So should we start?
For inspiration have a look at http://devs.openttd.org/~smatz/3d/
Who is online
Users browsing this forum: No registered users and 16 guests