I have figured out a way to simulate metro/underground trains without having to rewrite the whole game, but of course it's not very simple at all (or someone else would have done it by now).
Ok, so metro systems. The problem that we have is as follows; we cannot have a new Z-level on which to lay track and such. There is however an unused Z-level; the sky.
After playing a game where I used helicopters to supplement buses in the inner city, I realised that with some creative coding it should be possible to create a system where when a train enters a 'Metro tunnel' it gets 'deleted', and simultaneously we procedurally generate a 'helicopter' procedurally which contains all of the information of the 'deleted' train at the metro tunnel ( a quick hack of a train depot and a heliport should provide this) which can the fly 'underground' (animate the sprite several pixels below its real location) to a metro station (modified heliport) or out of a 'Metro tunnel' where we delete the 'helicopter' and re-generate the train from earlier.
I'm not sure if things such as points or signals could be simulated 'underground' easily (perhaps each metro tunnel stores an array of what there is in that particular tunnel) but I think this might be a good starting point for approaching metro systems.
I have experience coding, but I have never done anything with openttd, so I have no idea where to start such a project.
Thoughts?
Underground/Metro
Moderator: OpenTTD Developers
Re: Underground/Metro
It could be worth a shot.
If you're not aware, there has been a fairly close attempt at an underground levels patch that gave you four separate "underground" levels to work with, and a means to unify stations on all four levels. What it lacked was a means to connect and transfer vehicles from one layer to the next, and the patch author stopped working on it due to lack of interest from OpenTTD devs to finish the project for him. At least one experimental OpenTTD build was created from it if you want to try it out immediately.
If you're not aware, there has been a fairly close attempt at an underground levels patch that gave you four separate "underground" levels to work with, and a means to unify stations on all four levels. What it lacked was a means to connect and transfer vehicles from one layer to the next, and the patch author stopped working on it due to lack of interest from OpenTTD devs to finish the project for him. At least one experimental OpenTTD build was created from it if you want to try it out immediately.
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | GarryG's Auz Sets

Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | GarryG's Auz Sets
Re: Underground/Metro
Sounds overly hacky in my opinion - someone's idea of just allocating extra strips of map-array to represent the inside of tunnels seems far less likely to become a horrible mess. 
Trains have a lot of state that aircraft don't (and one 'train' is made up of many C++ 'Train' objects, one for each loco/wagon). Adding all this to the aircraft class would be ridiculous, so slightly saner would be to give the aircraft a pointer to the actual train and 'teleport' (well, instantaneously change its position and probably other stuff) the latter when your aircraft got to the exit point. Drawing a sprite for it doesn't make sense - if it's underground, you can't see it (to "animate the sprite several pixels below its real location" wouldn't make it look 'underground' in any way, just a few tiles further south), and if you can see it then its on the surface and doesn't need to be a bizarre fake-train aircraft at all.
But then you're not really doing anything with the aircraft - it doesn't need sprites, altitude, cargo, or just about anything else, so just waiting for a bit (depending on the invisible-tunnel length) before moving the train would have the same effect.
I lost you at "I'm not sure if things such as points or signals could be simulated 'underground' easily (perhaps each metro tunnel stores an array of what there is in that particular tunnel) but I think this might be a good starting point for approaching metro systems." - aircraft don't use those things, and that exact characteristic (not needing to have extra map-array values for underground vehicles) seems to be your argument for using them in the first place. If you add extra information for underground tunnels, then you can just use ordinary sensible trains; that last paragraph seems to contradict (and makes rather more sense than IMO) the other thing you suggested.

Trains have a lot of state that aircraft don't (and one 'train' is made up of many C++ 'Train' objects, one for each loco/wagon). Adding all this to the aircraft class would be ridiculous, so slightly saner would be to give the aircraft a pointer to the actual train and 'teleport' (well, instantaneously change its position and probably other stuff) the latter when your aircraft got to the exit point. Drawing a sprite for it doesn't make sense - if it's underground, you can't see it (to "animate the sprite several pixels below its real location" wouldn't make it look 'underground' in any way, just a few tiles further south), and if you can see it then its on the surface and doesn't need to be a bizarre fake-train aircraft at all.
But then you're not really doing anything with the aircraft - it doesn't need sprites, altitude, cargo, or just about anything else, so just waiting for a bit (depending on the invisible-tunnel length) before moving the train would have the same effect.
I lost you at "I'm not sure if things such as points or signals could be simulated 'underground' easily (perhaps each metro tunnel stores an array of what there is in that particular tunnel) but I think this might be a good starting point for approaching metro systems." - aircraft don't use those things, and that exact characteristic (not needing to have extra map-array values for underground vehicles) seems to be your argument for using them in the first place. If you add extra information for underground tunnels, then you can just use ordinary sensible trains; that last paragraph seems to contradict (and makes rather more sense than IMO) the other thing you suggested.
Temporary Permanent signature filling text. Content coming soon delayed indefinitely! Oh, and I have had a screenshot thread.
Linux user (XMonad DWM/KDE, Arch), IRC obsessive and rail enthusiast. No longer building robots; now I ring church bells.
Author of an incredibly boring stickied post about NewGRFs.
Linux user (XMonad DWM/KDE, Arch), IRC obsessive and rail enthusiast. No longer building robots; now I ring church bells.
Author of an incredibly boring stickied post about NewGRFs.
Re: Underground/Metro
it's not only overly hacky, it's also completely missing the point. the issue was never putting the train somewhere which isn't on the surface. that can already be done and is how bridges and tunnels currently work. the issue is putting the rails somewhere, and a useful user interface for construction and display of underground tracks.
Who is online
Users browsing this forum: No registered users and 5 guests