OpenTTD

Tasklist

FS#3660 - minimise gaps between signals when dragging

Attached to Project: OpenTTD
Opened by Grzegorz Duczyński (adf88) - Friday, 05 March 2010, 18:24 GMT
Last edited by Michael Lutz (michi_cc) - Tuesday, 17 April 2012, 19:56 GMT
Type Patch
Category Core
Status Closed
Assigned To No-one
Operating System All
Severity High
Priority Normal
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

"When you use the function to automatically build signals on a track with a choosen density, you end up having really large blocks around tunnels or bridges, because signals are simply left out." (Buhmann)
This patch modifies signal placing algorithm to left these gaps as small as possible. Something similar was written some time ago by Buhmann: http://www.tt-forums.net/viewtopic.php?f=33&t=35443
Patch I wrote is simpler and works better :) .

Introduced rules (when iterating track piece by track piece):
- place new signal if lastly placed signal is further then given density
- if signal can't be placed (if cmd fails), place it at the last possible position
- (optional) place signal if we are N*density tiles after the first tile (fixed distance)

Screenshot attached.
This task depends upon

Closed by  Michael Lutz (michi_cc)
Tuesday, 17 April 2012, 19:56 GMT
Reason for closing:  Implemented
Additional comments about closing:  In r24129.
Comment by Grzegorz Duczyński (adf88) - Friday, 05 March 2010, 18:30 GMT
"is further then given density" - it should be "is distanced by given density or more"
I'm also attaching preview showing which rules were applied at which signals:
   preview.PNG (331.4 KiB)
Comment by Thijs Marinussen (Yexo) - Friday, 05 March 2010, 18:41 GMT
As it is now the patch will cause desycns, _settings_client.gui.drag_signals_fixed_distance should be a parameter of the command. I'm not so sure about the behavior of the "at fixed interval" setting. I think I'd rather have a switch between "minimize signal distance" and "only at fixed interval (=current behavior)".
Comment by Grzegorz Duczyński (adf88) - Friday, 05 March 2010, 18:43 GMT
I forgot to notice - it won't work with non-patched server
Comment by Grzegorz Duczyński (adf88) - Friday, 05 March 2010, 18:59 GMT
"I think I'd rather have a switch between "minimize signal distance" and "only at fixed interval (=current behavior)"." - Yexo
Are you sure? ;) People who want to have signals distanced by fixed interval (because of "nice" look) wouldn't be able to use "minimise gaps" feature. We could create two separated options, but why somebody would like to resign with "minimise gaps" feature? Second option would be useless.
Comment by Thijs Marinussen (Yexo) - Friday, 05 March 2010, 19:10 GMT
The desync has nothing to do with the server being patched or not. _settings_client.gui.drag_signals_fixed_distance can be different on all clients but you use it in a command function.
Comment by Grzegorz Duczyński (adf88) - Friday, 05 March 2010, 19:13 GMT
Yes, yes, I'll fix that.
Comment by Grzegorz Duczyński (adf88) - Saturday, 06 March 2010, 14:02 GMT
Fixed version:
Comment by Grzegorz Duczyński (adf88) - Tuesday, 23 August 2011, 08:06 GMT
An update.
Comment by Grzegorz Duczyński (adf88) - Friday, 23 December 2011, 21:12 GMT Comment by Grzegorz Duczyński (adf88) - Friday, 23 December 2011, 21:13 GMT

Loading...