Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Mon Jan 16, 2017 12:51 pm

All times are UTC




Post new topic  Reply to topic  [ 37 posts ]  Go to page 1 2 Next
Author Message
PostPosted: Thu Dec 30, 2010 5:45 pm 
Offline
Engineer
Engineer

Joined: Tue Jun 16, 2009 2:33 pm
Posts: 9
Ever been annoyed by fast trains stopping and starting when trapped behind a slow freight train? With this patch, you can emulate a certain behaviour of the ATC system heavily utilized in Scandinavia: Trains trapped behind a slower train (up to one signal block or 20 tiles away) will automatically slow down to match the speed of the slower train. This eliminates the stopping-and-starting, making the train move a lot smoother. AFAIK it has no real impact on game mechanics.

Patch applies to r21666, there are no major bugs that I know of.


Attachments:
ATC-speed-control-r21666.diff [5.57 KiB]
Downloaded 409 times
Top
   
PostPosted: Thu Dec 30, 2010 6:13 pm 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Wed Sep 01, 2010 11:29 am
Posts: 209
Wow it sounded great and my first test pointed out that it seems to be so...

I compiled a Windows version for other possible testers:

Attachment:
File comment: Windows Binary
OpenTTD_ATC_r21666.rar [3.68 MiB]
Downloaded 291 times

_________________
DACH Train Set
My Screenshots


Top
   
PostPosted: Thu Dec 30, 2010 6:16 pm 
Offline
Director
Director

Joined: Tue Jan 20, 2009 4:07 pm
Posts: 593
Only thing I can say is: if it's as good as I hope it is, PLEASE INCLUDE IT IN 1.1 :D. Gonna test it now.


Top
   
PostPosted: Thu Dec 30, 2010 6:36 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Fri Mar 07, 2008 10:21 pm
Posts: 1012
Location: In a galaxy far far away.
Using Dwight's Binary, there is a clash with one setting

Go under Trains in advanced settings. Go to sparks/steam/smoke effect. Set it to the left all the way.

Picture is here for your benefit.


Attachments:
Unnamed, 1st Jan 5000000.png [58.51 KiB]
Downloaded 5 times

_________________
Comm Cody, Leader of 312th division and 7th Sky Corps

"If you're going through hell, keep going." Sir Winston Churchill
Top
   
PostPosted: Thu Dec 30, 2010 6:56 pm 
Offline
Engineer
Engineer

Joined: Tue Jun 16, 2009 2:33 pm
Posts: 9
Seems like an issue with english.txt, should be fixed.

As for the patch being included in 1.1.0, I'll get a task up in flyspray tomorrow if there aren't any horrible bugs. After that, it's up to the devs :)


Attachments:
File comment: String in english.txt fixed. Do NOT apply over the previous patch, apply over clean trunk.
ATC-speed-control-r21666.diff [5.44 KiB]
Downloaded 135 times
Top
   
PostPosted: Thu Dec 30, 2010 7:23 pm 
Offline
Director
Director

Joined: Tue Jan 20, 2009 4:07 pm
Posts: 593
I managed to trigger strange behaviour, see attached screen shot. A split track, one is empty, one is occupied with a slow train. The follow up train, a fast one, slows down, speeds up, slows down, speeds up, etc.


Attachments:
Drieburg Transport, 2005-04-07.png [50.2 KiB]
Downloaded 5 times
Top
   
PostPosted: Thu Dec 30, 2010 7:26 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Thu Jun 25, 2009 4:42 pm
Posts: 2362
Location: Location, Location
One thing i can say is that you will probably have to get rid of all references to 'ATC' as many people (including me) will not know what that means...

_________________
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra


Top
   
PostPosted: Thu Dec 30, 2010 7:59 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 8991
Location: Sol d
It's a nice idea.

A few remarks and thoughts, though:
- you totally break savegame compatibiliy. In settings.h you remove existing lines without comment, necessity and on the penalty of breaking the loading of old savegames. Nor do you bump the savegame version when introducing your new setting which alone also needs this savegame bump. Thus it needs taking care also in the saveload code.
- it doesn't fulfill its purpose flawlessly. Trains also slow down if they pass a slow train on a two-track arrangement or "see" a train in a depot (see screenshot and let two trains run on a similar thing). As this flaws became obvious after looking at a new game in 5 minutes I expect many other cases to fail or suffer from similar bugs.
- As a result of the above point, my guess is that you'll have to integrate this into the path finder - and worse - have a train know about the paths of other trains. The performance impact of this will need assessment.
- Especially in settings.h but also elsewhere you should watch the coding style. Indentation is done by tabs, avoid trailing and leading white space.


Attachments:
Senwood Transport, 10-07-2000.png
Senwood Transport, 10-07-2000.png [ 153.2 KiB | Viewed 11914 times ]

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML
Top
   
PostPosted: Thu Dec 30, 2010 8:17 pm 
Offline
Engineer
Engineer

Joined: Tue Jun 16, 2009 2:33 pm
Posts: 9
Arie- wrote:
I managed to trigger strange behaviour, see attached screen shot. A split track, one is empty, one is occupied with a slow train. The follow up train, a fast one, slows down, speeds up, slows down, speeds up, etc.

Hm, I can't seem to reproduce this. Under certain conditions, however, acceleration may cause the train to break too much, increasing the number of signal blocks between the trains, causing it to accelerate and so forth, making it oscillate between two different values. It could also be that the train leaves the 20-tile "search radius".

It may also behave strangely when two trains are heading for a head-on collision. I may include a check for this.

At stations, it may appear to be behaving strangely, since it'll slow down oncoming trains to arrival speed (24km/h). I'm not sure how to fix it though, I could add a check for station tiles, or I could increase the lower speed limit for which the rule is applied. I'm not a big fan of magic numbers, so the first option is probably the way to go.

planetmaker wrote:
A few remarks and thoughts, though:
- you totally break savegame compatibiliy. In settings.h you remove existing lines without comment, necessity and on the penalty of breaking the loading of old savegames. Nor do you bump the savegame version when introducing your new setting which alone also needs this savegame bump. Thus it needs taking care also in the saveload code.
- it doesn't fulfill its purpose flawlessly. Trains also slow down if they pass a slow train on a two-track arrangement or "see" a train in a depot (see screenshot and let two trains run on a similar thing). As this flaws became obvious after looking at a new game in 5 minutes I expect many other cases to fail or suffer from similar bugs.
- As a result of the above point, my guess is that you'll have to integrate this into the path finder - and worse - have a train know about the paths of other trains. The performance impact of this will need assessment.
- Especially in settings.h but also elsewhere you should watch the coding style. Indentation is done by tabs, avoid trailing and leading white space.


Thanks, I'll have a look at these things.

Edit: I've looked over the code, bumped the savegame version and fixed most (all?) style issues. The problem concerning stations should also be fixed (a train is no longer considered if it is braking), as should the dual-track issue (search stops when a switch is encountered, this is an ugly solution but it's the best I can do without meddling with the pathfinder... I think). Obviously this needs more testing, and I appreciate any input I receive.


Attachments:
File comment: Fixed patch against r21669
ATC-speed-control-r21669.diff [5.88 KiB]
Downloaded 106 times
Top
   
PostPosted: Fri Dec 31, 2010 2:00 pm 
Offline
Engineer
Engineer

Joined: Tue Jun 16, 2009 2:33 pm
Posts: 9
I've fixed it up further, so that the algorithm now makes a more conscious choice when it encounters switches. It tries to follow its reserved path, which should improve things in certain conditions. If there isn't a reserved path, searching stops at the switch. Trains are also ignored if they travel in the opposite direction.

Still not perfect, but this should take care of most issues. I'd like it to check all possible paths so that instead of simply not limiting speed when switches are encountered, it tries to actually follow all tracks and limit the speed anyway if they're occupied. I fear that may be too computationally expensive though, even if it could be done without meddling with the pathfinder (through a recursive search with a limited depth).


Attachments:
File comment: Patch against r21674.
ATC-speed-control-r21674.diff [6.88 KiB]
Downloaded 161 times
Top
   
PostPosted: Fri Jul 01, 2011 11:52 pm 
Offline
Engineer
Engineer

Joined: Fri Jul 01, 2011 11:45 pm
Posts: 3
This project dead? I NEED this patch :P


Top
   
PostPosted: Sat Jul 02, 2011 1:12 pm 
Offline
OpenTTD Developer
OpenTTD Developer
User avatar

Joined: Wed Nov 07, 2007 10:44 pm
Posts: 8991
Location: Sol d
Fesken wrote:
This project dead? I NEED this patch :P

I suggest you get better working on it then ;-)

_________________
Image
OpenTTD: manual | online content | translations | Wanted contributions and patches
#openttdcoop: blog | wiki | public server | DevZone | NewGRF web translator
DevZone - home of the free NewGRFs: OpenSFX | OpenMSX | OpenGFX | Swedish Rails | OpenGFX+ Trains|RV|Industries|Airports|Landscape | NML


Top
   
PostPosted: Sun Jul 10, 2011 11:52 am 
Offline
Traffic Manager
Traffic Manager
User avatar

Joined: Tue Dec 21, 2004 5:35 am
Posts: 185
Skype: andrey-zaharov
Location: St. Petersburg, Russia
Updated to trunk


Attachments:
atc.r22604M.patch [7 KiB]
Downloaded 197 times

_________________
OpenTTD Hard Game Pack
Top
   
PostPosted: Sun Jul 10, 2011 10:38 pm 
Offline
Engineer
Engineer

Joined: Fri Jul 01, 2011 11:45 pm
Posts: 3
Vaulter wrote:
Updated to trunk


WOW nice! Thank you! :D


Top
   
PostPosted: Thu Jun 07, 2012 9:47 am 
Offline
Engineer
Engineer

Joined: Fri Aug 21, 2009 2:27 pm
Posts: 23
What is the current status of this patch?
Is it working properly (in most cases)? Are there still bugs?


Top
   
PostPosted: Thu Jun 07, 2012 12:59 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon May 21, 2007 11:47 am
Posts: 6559
Location: The Netherlands
The status is the same as that of 31 Dec 2010, 16:00.

_________________
FooBar's Tram Tracks | TransRapid Track Set | Metro Track Set | OpenGFX base graphics set | FIRS Industry Replacement Set
Dutch Tram Set | Dutch Trainset 2 | Dutch Road Furniture


Top
   
PostPosted: Thu Jun 07, 2012 1:07 pm 
Offline
Engineer
Engineer

Joined: Fri Aug 21, 2009 2:27 pm
Posts: 23
Are there any plans on putting this in openttd? or will this remain a patch here on the forum forever?
This could be *very* useful.


Top
   
PostPosted: Thu Jun 07, 2012 1:53 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Mon May 21, 2007 11:47 am
Posts: 6559
Location: The Netherlands
With a status of "still not perfect", chances that this will be put into OpenTTD are close to zero.
That doesn't mean it's a bad idea. It just means that the implementation doesn't meet the standards yet.

_________________
FooBar's Tram Tracks | TransRapid Track Set | Metro Track Set | OpenGFX base graphics set | FIRS Industry Replacement Set
Dutch Tram Set | Dutch Trainset 2 | Dutch Road Furniture


Top
   
PostPosted: Thu Jun 07, 2012 6:15 pm 
Offline
Engineer
Engineer

Joined: Fri Aug 21, 2009 2:27 pm
Posts: 23
What are the current problems that still need to be fixed?
The thread isn't entirely clear on that.


Top
   
PostPosted: Thu Jun 07, 2012 6:21 pm 
Offline
OpenTTD Developer
OpenTTD Developer

Joined: Sun Sep 09, 2007 5:03 am
Posts: 4222
Location: home
With the author having left 1.5 years ago, probably nobody knows, so why not try it yourself and find out?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 37 posts ]  Go to page 1 2 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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-2017 phpBB Limited

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