Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Sat Feb 23, 2019 4:02 am

All times are UTC




Post new topic  Reply to topic  [ 144 posts ]  Go to page Previous 1 2 3 4 58 Next
Author Message
PostPosted: Sat Feb 06, 2010 9:57 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Thu Aug 25, 2005 9:44 am
Posts: 333
Location: Eindhoven, Netherlands
I've seen the same effect happening, the pileup at a station where a train is waiting to separate... Maybe though there were too many trains on the route (for the network, not for the amount of cargo)...


Top
   
PostPosted: Mon Feb 08, 2010 8:37 pm 
Offline
Engineer
Engineer
User avatar

Joined: Mon Feb 08, 2010 8:27 pm
Posts: 6
Location: Delft, The Netherlands
I'm very pleased with this patch. Although I had never worked with sources/compiling it worked like a charm.
Working with r18956.

Thanks, and I will follow this thread.


Wouter

PS: I uploaded a Win32 binary r18956 with automated-timetables-and-separation_trunk_svn_r18956.diff

Attachment:
File comment: OpenTTD trunk r18956 Win32 with automated-timetables-and-separation_trunk_svn_r18956.diff
openttd-trunk-r18956-win32-automated-timetables-and-separation.rar [3.05 MiB]
Downloaded 120 times


Top
   
PostPosted: Mon Feb 08, 2010 9:54 pm 
Offline
Engineer
Engineer

Joined: Sun Nov 25, 2007 1:26 pm
Posts: 44
Thank you for the feedback! And thanks, boekabart and Wouter, for the update and the new build! :)

I agree a maximum waiting time might be needed, unless something else is done to make sure the times never get as high. Traffic jams, for example, might be detected and affected vehicles timetables halted until things are running again.

I've not updated the patch for a while now, because I've been playing with a new approach to this patch and rewriting the parts that handle the actual separation. The new idea could perhaps be described as "rubber band separation", as the idea is for the vehicles to behave as if they are connected with stretchy rubber bands: they always want to be in the middle of the vehicle directly ahead and the vehicle directly behind. :)
(previously they all aimed for their own "global" slot without caring about the local situation)

I have an early version running now, but it's not yet ready for public testing since it's not complete enough. I'm afraid this means no updates until it's done, but when it is I hope it'll be better and more resilient than before. :)


Top
   
PostPosted: Fri Feb 12, 2010 10:22 pm 
Offline
Engineer
Engineer

Joined: Sun Nov 25, 2007 1:26 pm
Posts: 44
New version uploaded, with rewritten and very different separation logic! :D

I've done a lot of changes and only small scale testing, so new bugs might have sneaked in.. But hopefully it should both work and be a big improvement. Things like stopped vehicles and manually skipping orders should be handled more gracefully now, by stopping their timetables and removing them from the separation chain. (As soon as they arrive at a station they'll be started and added once again.)


(I don't usually post whenever I update, but this time the changes compared to the last version are just too big)


Top
   
PostPosted: Sat Feb 13, 2010 12:57 pm 
Offline
Engineer
Engineer
User avatar

Joined: Mon Feb 08, 2010 8:27 pm
Posts: 6
Location: Delft, The Netherlands
Updated binary
automated-timetables-and-separation-v0.6 against r19027

First test shows no bugs.

Attachment:


Top
   
PostPosted: Sat Feb 13, 2010 10:17 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Oct 04, 2008 11:05 pm
Posts: 2655
Location: Lost in spaces
Hello Gathers,

Quote:
Things like stopped vehicles and manually skipping orders should be handled more gracefully now, by stopping their timetables and removing them from the separation chain. (As soon as they arrive at a station they'll be started and added once again.)

This works very well and me likes very, very much.

However loading savegames seems to be broken.
I have solved it on my side by bumping all savegame values beyond trunk.

ps:
Maybe you could introduce #define TIMESEP_SV "value".
That way you do not have to go find all values to change them but only have to do value + 1 when trunk bumps.

_________________
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.


Top
   
PostPosted: Sun Feb 14, 2010 10:06 am 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 4691
Location: home
ChillCore wrote:
Maybe you could introduce #define TIMESEP_SV "value".
Introducing more named constants is always a good idea, except not with a #define, but with a 'const int', or an 'enum' (this is C++, man :D ).


Top
   
PostPosted: Sun Feb 14, 2010 12:08 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Oct 04, 2008 11:05 pm
Posts: 2655
Location: Lost in spaces
Alberth wrote:
ChillCore wrote:
Maybe you could introduce #define TIMESEP_SV "value".
Introducing more named constants is always a good idea, except not with a #define, but with a 'const int', or an 'enum' (this is C++, man :D ).

Thank you for correcting me Alberth. It is very much appreciated. :)

[Off-topic]
"#define" is C? I saw/learned it from other patches.
I tried an online tutorial but I prefer flipping real pages so I did not get very far. Time to hit the book store for a few kilos of paper. The new Operation Flashpoint will have to wait a bit.
[/Off-topic]

EDIT:
saveload/saveload.h line82: #define SL_MAX_VERSION 255.

_________________
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.


Top
   
PostPosted: Sun Feb 14, 2010 1:35 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 4691
Location: home
ChillCore wrote:
"#define" is C? I saw/learned it from other patches.
In principle, yes in the sense that C++ has better mechanisms to express something is a constant number.
On the other hand, C++ is a super set of C, so a #define is (Edit: technically) correct C++.

ChillCore wrote:
I tried an online tutorial but I prefer flipping real pages so I did not get very far. Time to hit the book store for a few kilos of paper.
Me too.
With programming, you can also learn a lot from doing, and from reading other code.

ChillCore wrote:
saveload/saveload.h line82: #define SL_MAX_VERSION 255.
Unfortunately, when a dev decides OpenTTD is going to use C++ instead of C, the source code does not magically improve itself to shiny new and perfect C++ code overnight :(

That #define is one of the more harmless ones. There are also a few that create more complicated data structures.


Top
   
PostPosted: Mon Feb 15, 2010 10:30 pm 
Offline
Route Supervisor
Route Supervisor

Joined: Fri Sep 24, 2004 3:47 pm
Posts: 454
Wait... So can I use the most recent version of the patch? Or does the save/load thing need to be fixed first?


Top
   
PostPosted: Mon Feb 15, 2010 10:36 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Oct 04, 2008 11:05 pm
Posts: 2655
Location: Lost in spaces
You can play. Just hit new game and go.
For loading savegames, scenarios are also savegames, you fix it yourself or wait a little bit.

_________________
-- .- -.-- / - .... . / ..-. --- .-. -.-. . / -... . / .-- .. - .... / -.-- --- ..- .-.-.-
--- .... / -.-- . .- .... --..-- / .- -. -.. / .--. .-. .- .. ... . / - .... . / .-.. --- .-. -.. / ..-. --- .-. / .... . / --. .- ...- . / ..- ... / -.-. .... --- --- -.-. .... --- --- ... .-.-.- / ---... .--.

Playing with my patchpack? Ask questions on usage and report bugs in the correct thread first, please.
All included patches have been modified and are no longer 100% original.


Top
   
PostPosted: Mon Feb 15, 2010 10:44 pm 
Offline
Route Supervisor
Route Supervisor

Joined: Fri Sep 24, 2004 3:47 pm
Posts: 454
ChillCore wrote:
You can play. Just hit new game and go.
For loading savegames, scenarios are also savegames, you fix it yourself or wait a little bit.


Well, I'd have to devote some time to learning C++ to fix it. I'll just wait. :)


Top
   
PostPosted: Wed Feb 17, 2010 3:32 am 
Offline
Traffic Manager
Traffic Manager

Joined: Sat Sep 24, 2005 1:52 pm
Posts: 160
Location: Denmark
Wow, this is very very awesome, i never before quite did understand how to use timetables, but with this, even us lesser mortals can have fun thanks :lol:

_________________
Feel free to join my server on 90.185.50.242. its coop, meaning 1 company to dominate the whole map :) its more random and not as pro as the Openttd Coop guys.


Top
   
PostPosted: Sat Feb 20, 2010 1:24 am 
Offline
Engineer
Engineer

Joined: Sun Nov 25, 2007 1:26 pm
Posts: 44
I've fixed the savegame version numbers now, sorry it took some time. Thanks for the bug report! Please let me know if there is anything else that I should change. :)
(besides adding more comments)


Top
   
PostPosted: Sat Feb 20, 2010 2:28 pm 
Offline
Moderator
Moderator
User avatar

Joined: Sat Apr 02, 2005 7:01 am
Posts: 3679
Location: Sydney NSW Antipodea
Would this patch be a client side only patch on MP games? Ie would it be optional for the clients?

_________________
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/


Top
   
PostPosted: Sat Feb 20, 2010 2:47 pm 
Offline
Transport Coordinator
Transport Coordinator

Joined: Sun Jan 27, 2008 1:02 pm
Posts: 298
robotboy wrote:
Would this patch be a client side only patch on MP games? Ie would it be optional for the clients?

No. This patch influences the game state, so you will desync.

_________________
Create your own NewGRF? Check out this tutorial!


Top
   
PostPosted: Sun Feb 21, 2010 5:14 am 
Offline
Moderator
Moderator
User avatar

Joined: Sat Apr 02, 2005 7:01 am
Posts: 3679
Location: Sydney NSW Antipodea
This patch fails to apply with IS2 applied. It fails at saveload.cpp. If you want, I can upload PeterT's updated IS2 patch. Woyld it be possible to get a patch that works with IS2 please :?:
Edit
I actually tried compiling it and it seems to work, even saving and loading. I did not try and set up any timetables though.

_________________
Formerly known as r0b0t_b0y2003, robotboy, roboboy and beclawat. The best place to get the most recent nightly builds of TTDPatch is: http://roboboy.users.tt-forums.net/TTDPatch/nightlies/


Top
   
PostPosted: Sun Feb 21, 2010 12:28 pm 
Offline
Tycoon
Tycoon

Joined: Thu Apr 02, 2009 10:43 pm
Posts: 3008
Location: Massachusetts, USA
robotboy wrote:
This patch fails to apply with IS2 applied. It fails at saveload.cpp.

Usually it's fine to ignore anything that fails at src/saveload/saveload.cpp, it's just because they wanted to bump the save game version, it should compile anyway.


Top
   
PostPosted: Sun Feb 21, 2010 5:09 pm 
Offline
Engineer
Engineer

Joined: Sun Nov 25, 2007 1:26 pm
Posts: 44
New version :)
I'm now trying to detect and handle jams by checking if the travelling time takes more than 10 times as long as expected. If that is the case, all shared vehicles timetables are stopped until they reach the next station (to avoid updating the timetable with huge travel times because of a jam) and the order time that was detected as 10 times higher than expected is cleared (set to 0) to avoid having vehicles become erroneously early and blocking the station. The order time that was cleared will be filled again as soon as another vehicle with a running timetable arrives again.

This might not be the most elegant way of solving it, but it should make recovery from large jams much smoother, even when 1-lane stations are used. :)

I've not had time to test everything in a larger game for a while, so please let me know if you happen upon any bugs or situations where vehicles block stations annoyingly long. :)


Top
   
PostPosted: Sat Mar 06, 2010 1:03 pm 
Offline
Engineer
Engineer

Joined: Mon Oct 01, 2007 2:21 am
Posts: 13
Skype: yuris125
Location: London
Hi Gathers,

Looks like the pattern of my behaviour at this forum is to lurk for some time, report a few bugs, and then disappear for several years :)
Anyway, I think I found a bug in your patch. The scenario is: you have several vehicles sharing the same order, with automated timetable. You decide to move one of these vehicles to another route. You delete shared orders from this vehicle. After that, when the first of the vehicles of this group arrives at a station, the game crashes
The easiest way to repro is
1. Start a new game
2. Create a bus route serving one of the towns
3. Create 3 busses to serve this route. Make sure they all share the same orders
4. Wait for a few days to let the timetable to settle
5. Open Orders window of any of the vehicles, and remove its shared orders
I'm attaching two save games. In autosave1.sav, steps 1-4 are done, so you'll need to delete orders of one of the busses to reproduce the crash. In game will crash.sav, all steps are done, and it will crash as soon as one of the busses arrives to a station. The saves were made by trunk version r19283 with version 0.7 of your patch applied; the game was compiled in Visual C++ 2008 Express Edition. I deactivated all NewGRFs for these saves
The crash.* files are also attached
If you need more information, let me know

Thanks for the excellent patch, and best regards
Yuri


Attachments:
File comment: crash.* files
crash.zip [281.64 KiB]
Downloaded 96 times
File comment: game will crash as soon as one of the vehicles arrives to a station
game will crash.sav [28.07 KiB]
Downloaded 83 times
File comment: all set up to repro the crash, but the last step (which causes the crash) not done
autosave1.sav [27.87 KiB]
Downloaded 91 times
Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 144 posts ]  Go to page Previous 1 2 3 4 58 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2019 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2019.
Hosted by Zernebok Hosting.