Object on Object
Moderator: OpenTTD Developers
Object on Object
I am continuing the discussion started under graphic development viewtopic.php?p=1176269#p1176269.
How feasible would it be to include a possibility for objects to accept other objects, including standard game objects like roads, on top of them with defined height (must be a multiple of actual height differences between levels) while allowing other objects, but especially roads, below them?
Main use case I have in mind is possibility to create an elevated transit system on top of existing roads, but this idea could work for other concepts like viaducts, metro etc.
Other similar concept I have in mind is stacking objects to combine them. For example I start with the back of the fence sprite, then add tree and then front of the fence.
How feasible would it be to include a possibility for objects to accept other objects, including standard game objects like roads, on top of them with defined height (must be a multiple of actual height differences between levels) while allowing other objects, but especially roads, below them?
Main use case I have in mind is possibility to create an elevated transit system on top of existing roads, but this idea could work for other concepts like viaducts, metro etc.
Other similar concept I have in mind is stacking objects to combine them. For example I start with the back of the fence sprite, then add tree and then front of the fence.
Re: Object on Object
Depending on how much effort you're willing to spend, from not very to trivial feasible.
In the general case, you'll end up with layers of traffic above each other, eg a road layer and on top of that a track layer, etc.
In the current map array, there is room for 1 layer only. Sure you may have hills, but only one layer of traffic. Tunnels and bridges don't count, as they are fake.
If you introduce elevated tracks by means of a height offset 'hack', it won't be long until a non-suspecting player wants to cross under those tracks. I don't think you can explain why you can't do that, since the graphics fully suggest it's possible.
The only useful way out, in my view, is to introduce multi-level traffic in general. Change the map array such that you can have as many layers as you like. At that point, your idea is obsolete, as the current newgrf would be able to handle it. In addition, you can do a whole lot of other things as well, such as subway systems, or signals on tunnels and bridges, although I believe that should not be added, the game is more challenging if tunnels and bridges don't have signal capacity. It may be impossible to prevent that though
In the general case, you'll end up with layers of traffic above each other, eg a road layer and on top of that a track layer, etc.
In the current map array, there is room for 1 layer only. Sure you may have hills, but only one layer of traffic. Tunnels and bridges don't count, as they are fake.
If you introduce elevated tracks by means of a height offset 'hack', it won't be long until a non-suspecting player wants to cross under those tracks. I don't think you can explain why you can't do that, since the graphics fully suggest it's possible.
The only useful way out, in my view, is to introduce multi-level traffic in general. Change the map array such that you can have as many layers as you like. At that point, your idea is obsolete, as the current newgrf would be able to handle it. In addition, you can do a whole lot of other things as well, such as subway systems, or signals on tunnels and bridges, although I believe that should not be added, the game is more challenging if tunnels and bridges don't have signal capacity. It may be impossible to prevent that though
Being a retired OpenTTD developer does not mean I know what I am doing.
Re: Object on Object
What about freeform bridges which can be placed the same way as one places, say, tram tracks on top of either clear ground or existing road/track? Is that even remotely a realistic possibility? That would at least give us curves, though it still wouldn't do anything about slopes.Alberth wrote:Tunnels and bridges don't count, as they are fake.
Re: Object on Object
Bridges don't exist, only the entry and exit tile exist. You find the exit from the entry by continuing to move in the same direction as the entry indicates, until you hit the exit tile. Add some magic to add graphics along that stretch of tiles, and everybody believes there is a bridge, while in reality there is only empty sky above ground tiles, and a flying train without wings. The transparent bridges setting shows pretty well what really existsKalen wrote:What about freeform bridges which can be placed the same way as one places, say, tram tracks on top of either clear ground or existing road/track? Is that even remotely a realistic possibility? That would at least give us curves, though it still wouldn't do anything about slopes.
Making a turn or going up or down cannot be done, as you break the "continue moving in same direction until you hit the exit tile" code. Unless you know a simple recipe to find the other end from one side of course, but so far nobody came up with anything else, afaik.
Being a retired OpenTTD developer does not mean I know what I am doing.
Re: Object on Object
Which files are related to the bridge travel and travel on regular roads?Alberth wrote:Making a turn or going up or down cannot be done, as you break the "continue moving in same direction until you hit the exit tile" code. Unless you know a simple recipe to find the other end from one side of course, but so far nobody came up with anything else, afaik.
Re: Object on Object
I have no idea, I cannot remember what's where in 300K lines of code especially if I never looked it up before. My usual strategy is to checkout a copy, and search for the point I am interested in.luxtram wrote:Which files are related to the bridge travel and travel on regular roads?
I think the main entry point for you is from road vehicle, as that's the thing that is moving. That would suggest some roadveh_* file.
Being a retired OpenTTD developer does not mean I know what I am doing.
Re: Object on Object
Thanks! Found it. Most of the related code is in the roadveh_cmd.cpp and tunnelbridge_cmd.cpp. I'll have a look.Alberth wrote:I have no idea, I cannot remember what's where in 300K lines of code especially if I never looked it up before. My usual strategy is to checkout a copy, and search for the point I am interested in.luxtram wrote:Which files are related to the bridge travel and travel on regular roads?
I think the main entry point for you is from road vehicle, as that's the thing that is moving. That would suggest some roadveh_* file.
-
- Tycoon
- Posts: 1828
- Joined: 10 Jul 2006 00:43
- Location: Spain
Re: Object on Object
Maybe you are suggesting a Locomotion style game:luxtram wrote:I am continuing the discussion started under graphic development viewtopic.php?p=1176269#p1176269.
How feasible would it be to include a possibility for objects to accept other objects, including standard game objects like roads, on top of them with defined height (must be a multiple of actual height differences between levels) while allowing other objects, but especially roads, below them?
Main use case I have in mind is possibility to create an elevated transit system on top of existing roads, but this idea could work for other concepts like viaducts, metro etc.
ElevatedTransit.png
Other similar concept I have in mind is stacking objects to combine them. For example I start with the back of the fence sprite, then add tree and then front of the fence.
viewtopic.php?f=30&t=75019
Sorry if my english is too poor, I want learn it, but it isn't too easy.
- [list][*]Why use PNG screenshots in 8 bpp games.
[*]Caravan site New Industry. · Spain set. · Some spanish trains for locomotion[*]Favourites:GRVTS · ECS · FIRS
Re: Object on Object
Well, it would not say that. But it is matter of branding.maquinista wrote:Maybe you are suggesting a Locomotion style game:
viewtopic.php?f=30&t=75019
What I would in fact like to have are
a) more elevation options,
b.1) bridges that turn as viaducts
b.2) bridges that turn as overhead traffic,
c) bridges over houses,
d) subways.
Who is online
Users browsing this forum: No registered users and 22 guests