New map features

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

Eddi wrote:
cirdan wrote:I am puzzled. Why a rectangular (square?) area to store a row of tiles? I was thinking of a simple array.
common requests include wider bridges, switches on bridges, diagonal bridges, ...
This is sounding like a bridge tile is evolving into a simple ground tile with the only difference being that it has abutments and is elevated between the abutments.
Conceptually, this sounds like the ability to stack ground tiles verticaly.
How does the simple ground tile handle track and road building and their (track/road) associated parts (stations, signals, etc.)?
Here's a thought .. A road station tile that is under a bridge and is part of a rail station tile on the bridge tile above it.

Another way of looking at it ... The player builds a bridge with an empty deck, then the player uses the road/track building tool to add (drag and drop?) the appropriate deck.
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

Btw. new maps features... what about statin tiles on diagonal tracks? i know it lacks of sprites currently, but
if you are about to extend the array anyway...
same goes for digonal tunnels but i guess that will be hard to implement.
and by diagonal i only mean 45° . I really want this sometimes, because it looks better then
build it straight make a turn and build it straight again to cross some other tracks for example.

better not talking about brigdes over stations with station tiles on the bridge. right wally ;)
or stations on top of stations. so you could do something like underground stations or interchange station.

and I know it will only happen if the map array will be completely changed.

I was just thinking loud :)
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

TrueSatan wrote:underground stations
Subways?
and I know it will only happen if the map array will be completely changed.
Maybe not ... I don't know the internals, but how different could it be from the diagonal tracks that we already have?
I was just thinking loud :)
Isn't that what Einstein said about relativity?
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

Not necessarily subways, you can have stations for "normal" trains as well deep underground and a few floors higher
so to say crossing tracks.
Like https://en.wikipedia.org/wiki/Berlin_Hauptbahnhof. Underground from north to south
overground east to west.
Beside that you have the underground/subway (U-Bahn) and some tracks for the urban railway (S-Bahn) on the upper floor
and now some extra tracks being build on the lower floor as well, all separated from the main line.

Hmm... but tracks are tracks and I think its a long way to have tunnels, bridges and stations behave like tracks.
As far as I remember from the discussions here they are something completely different (A. The Larch; if someone gets it ;) )
Dunno much about the code anymore (long time ago I tried to made some patches... as the code was human readable ;) )
so I can only guess that making diagonal tunnels should/could be easier then the rest, because tunnels are magical
wormholes ;) Maybe Cirdan can do some magic.
edit: a look into the source and I was mistaken... Its tunnelbridge... So tunnel and bridge share some functions.
doesn't make it easier...

Make me thinking about some fancy rail track that only has a visible start and end and an invisible connection between those.
The wormhole train. It starts to move towards the beginning black hole and magically shows up instantly at the other side.
Would be funny for years maybe past 2500...

Anyway anything Cirdan comes up with it appreciated :) Right wally? btw. any plans for a patchpack with Cirdans patch?

Happy dispatching in openttd world :)
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

TrueSatan wrote:anything Cirdan comes up with it appreciated :) Right wally?
Right! :D :D
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

TrueSatan wrote:I have compiled the nmf version with your patch and now have some strange problem.
all savegames with version g43b6fbab are shown with Startdate: 5000000.
And as you maybe can guess they are crashing to desktop immediately.
Older versions of my savegames are working fine in g43b6fbabM.
I will try to look at your crash log.
TrueSatan wrote:I have one thing for the gui you maybe should change.
If you don't have any of those good ate the station it should be grayed out
and not pressable. At least if you set it to automatic.
"Automatic" only means that cargo collection will start if a vehicle tries to load it; otherwise, it is like manual. But I will try to disable the buttons if there are no cargo sources nearby.
TrueSatan wrote:And maybe it would be better to click something like "Collected Goods at this station" and get a new window with the full
name of the goods. Those abbreviations are to small on small resolutions.
I am reusing the button row from the station list window, but perhaps I lack the perspective of playing with non-default cargoes.
TrueSatan wrote:Currently I wouln't use the feature, because I play mainly alone only for building complexe networks
and accumulate money ;)
I have never played multiplayer, yet I find this feature very useful. I still remember playing TTD and trying very hard to keep my stations out of range of anything but the industries I intended to serve, and get annoyed when a town crept close and suddenly there were passengers waiting in my coal-only station...

wallyweb wrote:This is sounding like a bridge tile is evolving into a simple ground tile with the only difference being that it has abutments and is elevated between the abutments.
Conceptually, this sounds like the ability to stack ground tiles verticaly.
How does the simple ground tile handle track and road building and their (track/road) associated parts (stations, signals, etc.)?
Here's a thought .. A road station tile that is under a bridge and is part of a rail station tile on the bridge tile above it.

Another way of looking at it ... The player builds a bridge with an empty deck, then the player uses the road/track building tool to add (drag and drop?) the appropriate deck.
That is a possibility, but we need a clean way to do it.

TrueSatan wrote:Btw. new maps features... what about statin tiles on diagonal tracks? i know it lacks of sprites currently, but
if you are about to extend the array anyway...
It is not that easy. Station tiles have a lot of newgrf state, and I do not see a clear way of extending that to diagonal stations...
TrueSatan wrote:same goes for digonal tunnels but i guess that will be hard to implement.
...plus, in a sense, I think that diagonal stations, bridges or tunnels are not in the spirit of TTD. That may just be my opinion though.
TrueSatan wrote:and I know it will only happen if the map array will be completely changed.
It is more a matter of having a clear spec than devising the implementation.


Thanks for your enthusiasm, anyway. I will see what I try to do next.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

cirdan wrote:
wallyweb wrote:Another way of looking at it ... The player builds a bridge with an empty deck, then the player uses the road/track building tool to add (drag and drop?) the appropriate deck.
That is a possibility, but we need a clean way to do it.
This could be challenging.
The GRFSpecs Action0 for bridges is implemented via an ActionA replacement of the bridges originally defined under TTD where there are only four railtypes:
Rail, Road, Monorail, MagLev.
If I understand OTTD's railtype implementaion, additional railtypes when applied to bridges is a simple graphical overlay. (Am I correct?)
Station graphics could be applied to a bridge via ActionA or as a separate railtype overlay, but they would not have the properties of a station tile.

Is there a way to create a new bridge spec that is not an ActionA? Could this spec be implemented while retaining the old ActionA specification for backwards compatibility?
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

TrueSatan wrote:If you don't have any of those good...
Cirdan wrote:"Automatic" only means that cargo collection will start if a vehicle tries to load it; otherwise, it is like manual. But I will try to disable the buttons if there are no cargo sources nearby.
Okay that's what i meant :)
TrueSatan wrote:Currently I wouln't use the feature, because I play mainly alone only for building complexe networks
and accumulate money ;)
Cirdan wrote:I have never played multiplayer, yet I find this feature very useful. I still remember playing TTD and trying very hard to keep my stations out of range of anything but the industries I intended to serve, and get annoyed when a town crept close and suddenly there were passengers waiting in my coal-only station...
Wasn't there a setting for it? Start using goods only if a vehicle accepts them? Its under Cargo handling in advanced setting. And it works.
If your train has only for example coal wagons it only will pick up the coal and nothing else will show up. I though your patch more as a way to prevent the goods at all.

Cirdan wrote:It is not that easy. Station tiles have a lot of newgrf state, and I do not see a clear way of extending that to diagonal stations....
Sure i am aware of the newgrf states. It was only i thought I had since long. It would be so nice sometimes to have them...
TrueSatan wrote:same goes for diagonal tunnels but i guess that will be hard to implement.
Cirdan wrote:...plus, in a sense, I think that diagonal stations, bridges or tunnels are not in the spirit of TTD. That may just be my opinion though.
Fully agree with bridges they should be straight. But tunnels only have an entrance and an exit and would perfectly fit without much new graphics
into the openttd world. But maybe its only my humble opinion and wishful thinking ;)

Cirdan wrote:Thanks for your enthusiasm, anyway. I will see what I try to do next.
Pleasure is all mine/ours :)
Thanks so much for your efforts Cirdan :bow:
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: New map features

Post by Eddi »

wallyweb wrote:If I understand OTTD's railtype implementaion, additional railtypes when applied to bridges is a simple graphical overlay. (Am I correct?)
for new railtypes, yes. for old railtypes, no.
Station graphics could be applied to a bridge via ActionA or as a separate railtype overlay, but they would not have the properties of a station tile.
that may be possible, but is complete nonsense. also, it does not provide the possibilities that stations have for altering the looks
Is there a way to create a new bridge spec that is not an ActionA? Could this spec be implemented while retaining the old ActionA specification for backwards compatibility?
certainly, but it would be a whole different task, and really complex.
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

wallyweb wrote:This could be challenging.
The GRFSpecs Action0 for bridges is implemented via an ActionA replacement of the bridges originally defined under TTD where there are only four railtypes:
Rail, Road, Monorail, MagLev.
If I understand OTTD's railtype implementaion, additional railtypes when applied to bridges is a simple graphical overlay. (Am I correct?)
Station graphics could be applied to a bridge via ActionA or as a separate railtype overlay, but they would not have the properties of a station tile.

Is there a way to create a new bridge spec that is not an ActionA? Could this spec be implemented while retaining the old ActionA specification for backwards compatibility?
You obviously know far more about newgrf specs than I do. In any case, I think newgrf interaction is something to be addressed later. By the way, I am beginning to like the idea of having bridge contents stored in an off-map array.
TrueSatan wrote:
Cirdan wrote:"Automatic" only means that cargo collection will start if a vehicle tries to load it; otherwise, it is like manual. But I will try to disable the buttons if there are no cargo sources nearby.
Okay that's what i meant :)
I will think about it and see if it is easy to implement.
TrueSatan wrote:Wasn't there a setting for it? Start using goods only if a vehicle accepts them? Its under Cargo handling in advanced setting. And it works.
If your train has only for example coal wagons it only will pick up the coal and nothing else will show up. I though your patch more as a way to prevent the goods at all.
The new (still unmerged) goods selection patch serves two purposes: it allows you to start collecting cargo before a vehicle arrives (so, say, passengers will start gathering at the other end of a newly-built route before the first vehicle gets there) and to stop collecting cargo at all (for instance, if a vehicle accidentally tries to load it; this is currently unfixable).
TrueSatan wrote:Fully agree with bridges they should be straight. But tunnels only have an entrance and an exit and would perfectly fit without much new graphics into the openttd world. But maybe its only my humble opinion and wishful thinking ;)
Hmm, so straight bridges but more flexible tunnels... I like that better. As I said before, I may get around to trying something for bridges.
Eddi
Tycoon
Tycoon
Posts: 8272
Joined: 17 Jan 2007 00:14

Re: New map features

Post by Eddi »

conceptually, bridges and tunnels are the same thing, just with slightly different interface, so anything you do for bridges can be applied to tunnels and vice versa.

for bridges, i was imagining something like: you can do small segments of bridges, each segment can be different directions, width, graphical shapes, etc. then you can have short segments that cannot be high above the ground, but have lots of flexibility (e.g. for elevated railways), or you can have long segments that can be high but don't have as much flexibility (e.g. for spanning rivers/valleys) (but if the segment is 2xN, you can still put in switches between the rails etc., you just can't put in curves)

maybe there is a point for similar restrictions for tunnels.
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

Cirdan wrote:The new (still unmerged) goods selection patch serves two purposes: it allows you to start collecting cargo before a vehicle arrives (so, say, passengers will start gathering at the other end of a newly-built route before the first vehicle gets there) and to stop collecting cargo at all (for instance, if a vehicle accidentally tries to load it; this is currently unfixable).
So its a mixture between the old ttd behavior of starting to provide/collect "good" (I count passengers in as well ;) )
even there hasn't been any vehicle to fetch them and the don't accept goods or provide them for waypoints (it differs a bit more with the setting and does not deny everything in general). Imho its more like a cheat. If you have set up the vehicles wrong the only one to blame is yourself ;)
I do that often enough *sigh* forgetting to refit to the proper goods... usually its only bad for the station rating ;)
And you can "fix it" by destroying the station wait until the station sign vanishes and then build it again :D
Its a nice to have feature for stopping some cargo. But I have the feeling if you use the feeder service a lot and
click something and the feeder went wrong there will be a lot of questions in the forum.
Another point is you have now two options in advanced setting, yours and the "Deliver cargo only..." Any way to get those combined?
Maybe it could be an "Advanced cargo delivery setting" TTD Style, OpenTTD(TTDPatch Style), Complex Style
and then your settings will be shown at the station window and the advanced setting for Complex Style will be enabled as well.

But I rather would like something like the old ttd sign cheat: 4.1.9 Station reset.
But thats only my two cents :)
TrueSatan wrote:Fully agree with bridges they should be straight. But tunnels only have an entrance and an exit and would perfectly fit without much new graphics into the openttd world. But maybe its only my humble opinion and wishful thinking ;)
Cirdan wrote:Hmm, so straight bridges but more flexible tunnels... I like that better. As I said before, I may get around to trying something for bridges.
Can't wait to see either or both together... if ever :)
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

cirdan wrote:You obviously know far more about newgrf specs than I do.
You give me far too much credit. :bow:
In any case, I think newgrf interaction is something to be addressed later.
Agreed. I was just musing on some of the possibilities.
By the way, I am beginning to like the idea of having bridge contents stored in an off-map array.
You obviously know far more about OTTD coding than I do. :wink:
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

Hey Cirdan, I accidentally found a bug that results into a crash.
If you have servicing enabled and the train is in the tunnel, the game asserts with some yapf error.
I have included a initial setup where everything is working, then a advanced setup (only a second train)
and the crash save itself. If you need the config I can provide it as well. But its so basic
it should be reproducible anytime.

I wanted to reproduce the "stuck in tunnel" if the signal at the end of the tunnel is a path signal, since I had that problem again
in my current game. Strange but I can't reproduce it with a basic setup. Two tunnels, a bit of tracks
in a "circle" and switching lines inside the two ovals. All set up with waypoints.
Looks like a basic train set ;)
Strange if I remove the path signal setup afterwards and move it one track further outside the tunnel it works all the time.

I will let the test setup run for a while and if there I get the bug I will post it as well ;)

Happy bug hunting ;)
edit: replaced file with a "vanilla" setup no newgrf anymore
Attachments
servicing-crash-while in tunnel.zip
(1.3 MiB) Downloaded 83 times
Last edited by TrueSatan on 30 Mar 2014 16:49, edited 2 times in total.
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

So finally I got it working... err bugging... err you know what I mean ;)
Some save game before it gets stuck inside the tunnel.
and the train stuck in tunnel itself. Looks like a track reserving problem.
Maybe it has something to do with the other yapf problem I found as well.

Hope you can find something :)
If not just remove the path signal feature, it would be nice but is not necessary.

Regards
Attachments
stuck in tunnel.zip
(167.92 KiB) Downloaded 82 times
Last edited by TrueSatan on 29 Mar 2014 18:54, edited 1 time in total.
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

Compiled and tested g2699f279.
Every save game i used to play is giving vehicle is lost now and game crashed a few seconds later to desktop without any warning.

Tested with a new small setup and path signal before tunnel(s) with signals on it is broken now. You will get stucked
before the path signal, doesn#t matter if single way or both ways.
Some "normal" signals before the tunnel entrance signals fix the problem.
But i guess you are working on something :)

Just wanted to let you know ;)

Regards
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

Eddi wrote:for bridges, i was imagining something like: you can do small segments of bridges, each segment can be different directions, width, graphical shapes, etc. then you can have short segments that cannot be high above the ground, but have lots of flexibility (e.g. for elevated railways), or you can have long segments that can be high but don't have as much flexibility (e.g. for spanning rivers/valleys) (but if the segment is 2xN, you can still put in switches between the rails etc., you just can't put in curves)
That is way too complex for a start. It would fit the openttd development model though, where simple features are not added because they are not deemed generic enough and bigger features are not added either because they are too complex. (The ability to close airports took 4 years to be merged because it did not allow to close other station types, which nobody wanted.)
TrueSatan wrote:Its a nice to have feature for stopping some cargo. But I have the feeling if you use the feeder service a lot and click something and the feeder went wrong there will be a lot of questions in the forum.
It should not alter feeder systems. Vehicles can still unload cargo for transfer whatever the setting is at the station. Disabling cargo collection only affects appearance of new cargo from local sources.
TrueSatan wrote:Another point is you have now two options in advanced setting, yours and the "Deliver cargo only..." Any way to get those combined?
Err, are you sure? The new setting replaces the old one. In fact, one of the advantages of the new setting is that it is now per-company instead of global.
TrueSatan wrote:But I rather would like something like the old ttd sign cheat: 4.1.9 Station reset. But thats only my two cents :)
I would rather not have a cheat, but a clean way of managing cargo. :-) By the way, I have been working on only allowing to select cargo for which there are nearby sources, and the code pieces are all in place, but I am beginning to think that we need a new UI for this, perhaps combined with the ratings tab, and I cannot come up with something I like.

With respect to your bug reports, I have been busy with some pathfinder issues. But I could not open your previous crash savegame because of some missing newgrfs that I have been unable to find, and now I cannot open your new attachments... Could you please upload them in tar.gz or zip format?
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

I will see what I can do when I return to my computer. I try to set up a vanilla nmf without any newgrf.

Hmm you cannot open 7zip files? I used 7z because its a way better compression then zip.
If you can't open my last files I will reupp them as tar.gz

edit: updated the depot crash save games in my post. please download it there again (20:29 forum time ;) )
edit2: updated the stuck in tunnel savegame (20:54 forum time ;) )
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

Thanks for your efforts. 7zip is not widely used in the linux world, as far as I can tell, where xz is much more common if you want better compression.

I have studied your savegame with the train stuck inside a tunnel, and the situation is rather subtle. A train will only get stuck in that position if it has to come to a full halt at the signal (it cannot reserve a path through it in advance) and another train has already entered the tunnel with a lower vehicle id (!), because that fools TryPathReserve into thinking that it cannot extend the reservation. And I have been able to reproduce this in openttd trunk on a normal tile, using very short locomotives (see below), so it is not a new bug.

I have updated my branch here with a fix for this, a bunch of cherry-picks from openttd trunk (up to r26404) and also fixes for the following issues:
  • Ships will now not get lost if they cannot reach the nearest depot (bug already present in openttd; see below).
  • Trains will treat red two-way end-of-line signals correctly in presence of railtype changes (see here).
  • Road vehicles will now honour the maximum distance to travel when looking for a nearby depot.
  • Road vehicles will now not consider foreign depots for servicing.
  • Road vehicles on a bridge will now consider turning at the bridge head, if possible, when looking for a depot.
Is there any pending bug that I have overlooked?
Attachments
stuck.png
stuck.png (27.03 KiB) Viewed 2477 times
landlocked-depot.png
landlocked-depot.png (313.8 KiB) Viewed 2477 times
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

cirdan wrote:I have updated my branch here ...
I will compile this into Windows later today.

Going back to your request for suggestions ...
By default, the buoy functions as a waypoint.
In TTDP, a ctrl+click placement will cause the buoy to function as a station.
In my city (Saint John, New Brunswick, Canada) the local refinery receives crude by ship (Canaport). Rather than having to dredge a deep harbour and in consideration of the Bay of Fundy's 20 foot tides, VLCCs unload at a deep water off-shore buoy.
Can the OTTD buoy adopt the TTDP functionality?
(This would also be convenient for those industry sets that offer fishing grounds ... somehow, raising a bit of land just to place a dock in the middle of the Atlantic is somewhat unrealistic)

Related to the above and your excellent multiple docks per station ...
Can a dock be set to accommodate only one ship and ...
- If an alternate dock at the same station is available, a subsequent ship will default to the next nearest available dock and ...
- If no docks are available, the subsequent ship will hold up at a buoy (similar function to pre-signals)
?
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 17 guests