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
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

wallyweb wrote: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)
Nice suggestion. However, buoys are buoys, and I think they should remain as they are. What we could do is to design a new type, or new types, of docks. Currently a dock is a two-tile object that must be placed on a coast tile with a flat slope and an adjacent water tile. Instead, we could add an offshore dock that can be placed in the middle of the ocean, with new graphics (which I am not volunteering to do). And we could have another dock for canals and lakes, to avoid having to raise the land next to them (plus those elevated piers on a lake, where there are no tides, are truly unsightly). Would this work for you?
wallyweb wrote: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)
?
Yes, we could restrict docking to one ship at a time, although we would have to enlarge the dock struct (code-wise) for that, as there is no way to do it in the map array. But it is doable, and routing ships to a free dock, well, after all the work I have done with the pathfinders, should be easy. The trickiest part here would be to decide when to wait for a dock to become free and when to head for another one, if it is far away. Or we could keep a queue of ships waiting at each docking tile... Hmm, this deserves more thought, after all.
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

cirdan wrote: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?
Thanks for your efforts fixing the bugs :)
And strange but true if I use the setup outside the tunnel it works, so it maybe an old bug, but it only
showed up on me while using the path signals on tunnel exits. Nice coincident then :)

I have uploaded the crash on servicing a train as zip again. Sorry I had the impression you are using windows for development as well.
I will now try to remember to upload something more linux/unix like.

Will try your patches later. Had to return to 43b6fbab on my linux machine because the newer revision crashed my current big game
instantly (only a few days or seconds after loading the game). I will report if all works now. Maybe even the depot crash is gone
with your bugfixes.

I will provide an ubuntu 13.10 executable as well for testing later on if I have compiled it at my laptop.

Any package for windows now wally? I am to lazy to power up the virtual machine for compiling ;)
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

cirdan wrote:Nice suggestion.
:bow:
However, buoys are buoys, and I think they should remain as they are. What we could do is to design a new type, or new types, of docks.
Agreed. Code-wise, they are definitely different. The current in game buoy is navigational but for off-shore loading and unloading, the terminal is definitely also a buoy with the only visual difference being in the paint scheme. Code it as a dock but until a new graphic is available, let them share the same sprite(s).

For the canals and lakes, the height of the current dock can be halved and for where we currently have a flat portion on a sloped tile, we could have a sloped portion on a flat tile.

Can this be done as follows?
One menu selection focuses the mouse ... then if the mouse is over a sloped tile, the surrent dock is built, if the mouse is over a flat tile, a low dock (see above) is built and if the mouse is over a water tile, a docking buoy is built?

For coding simplicity, graphicaly, the docking buoy can be two tiles with one tile using a plain water tile sprite and the other tile having the docking buoy.
Would this work for you?
Yes.
Yes, we could restrict docking to one ship at a time, although we would have to enlarge the dock struct (code-wise) for that, as there is no way to do it in the map array. But it is doable, and routing ships to a free dock, well, after all the work I have done with the pathfinders, should be easy. The trickiest part here would be to decide when to wait for a dock to become free and when to head for another one, if it is far away. Or we could keep a queue of ships waiting at each docking tile... Hmm, this deserves more thought, after all.
Both work for me ... Which would be simplest to code?
TrueSatan wrote:Any package for windows now wally? I am to lazy to power up the virtual machine for compiling :wink:
I'll be compiling and posting later today or this evening. :D
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

For everyone on Ubuntu 13.10 (maybe some others are working as well, libc6) I attached the 64bit version
of ad261e81M for testing purpose.
Cirdan good news first. I can load my "night" savegame ;)
The stuck in tunnel is fixed and even unstuck the train, nice :)
Thanks for fixing the bug :bow:

But the crash while trying to go to the depot for servicing happens even in the new version.
Btw I have seen that I haven't released the second train
on my provided save game. Just send it out fast forward and after some time... crash.
I have the feeling the yapf has some trouble finding the way to the depot if the train is inside
the tunnel.

Since i never use breakdowns and without them there is no autoservicing those crashes are
not happening for me anyway. So selfish as I am I could live with the bug *hehe*

K, off to change signaling on my "night" game.
Attachments
openttd-custom-gad261e81M.tar.bz2
64bit Ubuntu 13.10 Libc6
(5.51 MiB) Downloaded 76 times
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

He slides silently into his lab, closes and bars the door, turns down the lights, cranks up YouTube for some New Orleans jazz from LAMUSICFACTORY, and sets to work by the glow of the screen ...
Time to git some GIT going ...
./configures
make bundle
watches SRCs do the Lindy Hop as .cpp's compile down Royal Street ...
and then it's done ...
The MC presents tonight's star attraction ...
OpenTTD-gad261e81-Win32.7z
(5.12 MiB) Downloaded 85 times
Note that .zip Fats was too fat to squeeze through the door to tt-forums and he sent his twin sister ... .7z Skinny.
Enjoy the show.
Sorry ... No refunds ...
:mrgreen:
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

wallyweb wrote:He slides silently into his lab, closes and bars the door, turns down the lights, cranks up YouTube for some New Orleans jazz from LAMUSICFACTORY, and sets to work by the glow of the screen ...
Time to git some GIT going ...
./configures
make bundle
watches SRCs do the Lindy Hop as .cpp's compile down Royal Street ...
and then it's done ...
The MC presents tonight's star attraction ...

Note that .zip Fats was too fat to squeeze through the door to tt-forums and he sent his twin sister ... .7z Skinny.
Enjoy the show.
Sorry ... No refunds ...
:mrgreen:
Thanks wally :)
And yeah the attachment size should be a little higher now, since openttd grows bigger and bigger with every feature ;)
I think I have to write to owen to allow .xz for file extensions as well.
Would saves a lot of space if you are using xz for compressing the linux files. Dunno if there is some compression tool with xz for windows as well
(oh 7zip can extract xz, nice :) ).

Funny "Sorry....No refunds..." reminds me on the merchants in Fable 3. Hearing the voice in my head now reading the words lol
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

cirdan wrote: 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.
Nice, then it could be a nice addition.
Cirdan wrote: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.
Hmm yes I really would like it combined. More complex doesn't mean everyone wants it and understands it ;) Even if you replace it with your new settings it could be something like ttd behavior, openttd behavior and advanced settings. All controlled by your patch.
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 :)
Cirdan wrote: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.
Nice new UI always sounds good, but a lot of work. Dunno how the GUI code is now, but it was a pain in the you know where when I tried a few patches.
What about
Accepts Rating
Passenger 1000/Good (67%)
Coal No service
on one page and the button below for switch to the accept, it is now switching between accepts and rating.
Or a button bar on your right like you have for vehicles. Then "location" could be the same icon as there.
Maybe easier to click on tablets (touch support) as well.
Just made a cheap screenshot with a vehicle window in the background ;)

Dunno if it would break the ttd spirit to much, but I guess openttd is now far from original ttd anyway.
So its time to rethink the UI anyway :)

Happy coding Cirdan.
Attachments
station view overlay.PNG
station view overlay.PNG (13.01 KiB) Viewed 3460 times
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

TrueSatan wrote:And yeah the attachment size should be a little higher now, since openttd grows bigger and bigger with every feature ;)
Apparently the file size limit comes with the phpBB code and I do not think there is much that orudge can do there.
Adding another compression file type (.xz) wold probably be the best solution.
I'm not too worried about the Windows releases because 7zip is readily available and easily installed.
The best of course would be for 7zip to offer a Linux repo.
oberhümer
Tycoon
Tycoon
Posts: 1283
Joined: 23 Oct 2009 19:35
Location: Here and there, sometime or another

Re: New map features

Post by oberhümer »

The best of course would be for 7zip to offer a Linux repo
I have 7-Zip support out of the box with (K)Ubuntu, surprised to hear that it's far from universal.
--- Licenses: GNU LGPL, version 2 or newer, code and graphics. CC-By-SA, graphics, alternatively. If you're using any, I'd like to hear about it --- Call them "track types" ---
--- Mostly inactive developer for: NuTracks - Central European Train Set --- Running/compiling for: Linux (x86) - Android - Windows (32/64 bit) ---

--- Need a file packer? 7-Zip --- BOINC - use your computing power to benefit science --- Block trackers, not ads --- Unix in dispersible pellets, the formula for the future. ---
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

oberhümer wrote:
The best of course would be for 7zip to offer a Linux repo
I have 7-Zip support out of the box with (K)Ubuntu, surprised to hear that it's far from universal.
Looks like it is a (X/K/etc.)Ubuntu thing. Maybe they support it to get windows user easier to a linux
os. Who knows. I'll guess .xz is the best option to ask. I will pm owen about the support.

Regards
3298
Traffic Manager
Traffic Manager
Posts: 143
Joined: 02 Apr 2011 12:55

Re: New map features

Post by 3298 »

7-zip is also in the Manjaro repos, independent of desktop environment. I've also seen other programs handling 7z files just fine, for example Ark (the KDE archive program), and others. Nevertheless, more allowed archive types wouldn't be a bad idea.
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

Owen just posted that we have now xz as extension and more :)

Thanks Owen :)

Happy flooding the forum :P

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

Re: New map features

Post by cirdan »

TrueSatan wrote:But the crash while trying to go to the depot for servicing happens even in the new version.
Btw I have seen that I haven't released the second train
on my provided save game. Just send it out fast forward and after some time... crash.
I have the feeling the yapf has some trouble finding the way to the depot if the train is inside
the tunnel.
I have just updated my branch, and (hopefully) this bug should be fixed. The assertion you were triggering was wrong when the pathfinder was invoked with a maximum penalty, but your bug report prompted me to do some more cleanup there. The pathfinders are getting in a much better shape over time; in fact, they are mostly readable now.
TrueSatan wrote:Since i never use breakdowns and without them there is no autoservicing those crashes are
not happening for me anyway. So selfish as I am I could live with the bug *hehe*
Heh, I do the same; that is why I never came across this bug.
TrueSatan wrote:What about
Accepts Rating
Passenger 1000/Good (67%)
Coal No service
on one page and the button below for switch to the accept, it is now switching between accepts and rating.
Thanks for your ideas--I will try to use them for a new UI.
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

Thanks Cirdan,

already compiled for ubuntu :) I will test it and post it later if everything is working.
I have the feeling (was reading your commits on the git tree) that it solves
my trains that are stucked in the depot from time to time as well.
Those yapf fixes making sense (even) to me :)

Hmm what about a new way for those breakdowns. Currently they are no fun
even with the new setting. That's why I disable the breakdowns and with it
the auto servicing.
I had something like
Breakdowns/Year.....Age of Train.........Condition/State
.......0- 1.........................0-5 .............100%-75%
.......2 - 4........................5-10............100%-75%
.......3-6.........................>10..............100%-50%
.......0-2.......................... 0-5...............75%-50%
.......3-6 .........................5-10........ ....75%-50%
.......5-10.........................>10..............75%-50%
.......0-3........................... 0-5..............50%-25%
.......4-8...........................5-10.............50%-25%
......10-20........................>10..............50%-25%
Everything under 25% is like >20 to a high random number of breakdowns
Edit: I know now what I really miss. Its condition/state of the vehicle.
Reliability could serve as a factor as well. If the state is worse but the reliability is good it
breaks down less often. (formula)*(100-reliability)

To save money there should be a edit: condition/state parameter for servicing to set it to 100%, 75% or 50%
Like in real life ;) Some companies do not care about their passengers or good lol
Missing the table feature now lol
But maybe its to cpmplex for a game that should be some fun :)

Thanks again for fixing the bug. Tested with my test scenario. Works flawless.
So everyone have fun with the newest version.

Attached is Version 9d44e037 of Cirdans NMF for Untuntu 13.10 64bit as.xz
Attachments
openttd-custom-g9d44e037-UNIX.tar.xz
(4.48 MiB) Downloaded 80 times
Last edited by TrueSatan on 05 Apr 2014 13:28, edited 1 time in total.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

For the Windows user le me add ...
OpenTTD-g9d44e037-Win32.7z
(5.12 MiB) Downloaded 122 times
Guarantee wrote: Guarantee == NULL
TrueSatan
Transport Coordinator
Transport Coordinator
Posts: 291
Joined: 16 Jul 2003 18:33

Re: New map features

Post by TrueSatan »

Since some was asking about platforms here
Image
and I was building up some waypoint just before the entrance
I though about waypoints with signals.
Those waypoints could be useful before stations sometimes.
But if there is not enough space it would be cool to have the possibility
to build them with signals as well. Like path signals.

But I guess those are handled as stations tiles and so it will be difficulty to
change their behavior.

Btw. features. Since trains can get stuck in a tunnel for a while - e.g. some train
in front has some delay - it would be nice to have them clickable.
I remember some patch where the train became a silhouette if it entered
the tunnel to make it clickable. Maybe it would be possible to have an
advanced option for that.

Happy weekend and/or coding Cirdan :)
User avatar
romazoon
Tycoon
Tycoon
Posts: 1291
Joined: 20 Jun 2010 23:16

Re: New map features

Post by romazoon »

Hello Cirdan

Here is a report for a crash. I used the binary from wallyweb posted a couple message before mine.

i remember i have reloaded the Civil IA the moment before it crashed. But it might be a different problem because i had the same crash(same message at least) while doing other things, on some other game (but same version of your fork) where i messed a bit with newgrf and so i didn t bothered to report...

Here the crash happen on a clean game, a scenario with a clean gamelog, that i've setted intentionnaly to test your nice OTTD fork, and see if i manage to get the same crash...wich it seems i succeeded

happy debugging, and thanks for all your effort.
Attachments
crash.sav
(1.65 MiB) Downloaded 76 times
crash.png
(89.23 KiB) Downloaded 5 times
autosave6.sav
edit : last save before the crash happens. you can reproduce crash by reloading the civil IA in the "script debugging".
(1.65 MiB) Downloaded 78 times
User avatar
cirdan
Director
Director
Posts: 539
Joined: 07 Apr 2007 18:08

Re: New map features

Post by cirdan »

TrueSatan wrote:already compiled for ubuntu :) I will test it and post it later if everything is working.
I have the feeling (was reading your commits on the git tree) that it solves
my trains that are stucked in the depot from time to time as well.
Those yapf fixes making sense (even) to me :)
Ah, yes. The pathfinder is in a fairly good shape now, unlike the horrible mess of spaghetti code that it was. The rail pathfinder is still hard to follow at times, because it is a complex piece of code, after all, but the road and ship pathfinders are nicely readable. In fact, I think that the reworking of the pathfinders is the most prominent change in my branch with respect to openttd trunk, even more than the added features.
TrueSatan wrote:Hmm what about a new way for those breakdowns. [...]
Well, I am not really interested in breakdowns (I always disable them), but anybody can send in patches if there is an agreement on a better behaviour for them.
TrueSatan wrote:Since some was asking about platforms here
Platform numbers, or groups, have been in my to-do list for a long time, because I do not like to be forced to use waypoints to route my trains to specific platforms: this is a workaround, not a solution. But I have not sorted out all the technical details yet.
romazoon wrote:Here is a report for a crash. I used the binary from wallyweb posted a couple message before mine.
Thanks for your bug report. The crash happens when a company that owns a rail tunnel goes bankrupt, because the code tries to update the company's road infrastructure counts for that tunnel. This bug exists already in openttd, but they get away with it because their checks are not as strict as mine (openttd does not complain if you ask for the roadtypes of a rail tunnel). I have a patch for this bug, but I will not be able to update my branch until next week.
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: New map features

Post by wallyweb »

cirdan wrote:
TrueSatan wrote:Since some was asking about platforms here
Platform numbers, or groups, have been in my to-do list for a long time, because I do not like to be forced to use waypoints to route my trains to specific platforms: this is a workaround, not a solution. But I have not sorted out all the technical details yet.
TTDPatch controls platform access with programmable signals, however, platform numbering would be easier to manage. I like it. Could it also be applied to the dock discussion above?
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: New map features

Post by Pyoro »

Has anyone managed to combine more height levels with this? Seems like something rather difficult to do; or at least it's clearly beyond me ^^;
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 22 guests