Commit Graph

1921 Commits

Author SHA1 Message Date
Jonathan G Rennison
b2ef6c0de8 Add implementation of multi-aspect signalling and GRF support
Requires realistic braking

See: #247
2021-08-28 12:54:18 +01:00
Jonathan G Rennison
6546f6deba Fix tunnel exit signal not being set to red when train exited 2021-08-27 23:42:36 +01:00
Jonathan G Rennison
dc4b7e0558 Add helper function to set tunnel/bridge entrance signal green 2021-08-27 23:40:53 +01:00
Jonathan G Rennison
55c4fe7d45 Add helper functions to get tunnel/bridge entrance/exit trackdirs 2021-08-27 23:39:20 +01:00
Jonathan G Rennison
2283ce3a2b ATC: Reduce lower limit of nominal look-ahead distance for speed timers
See: #310
2021-08-19 01:39:29 +01:00
Jonathan G Rennison
b8d5113c5a Tracerestrict: Add slot action mode, try to acquire (only on reserve) 2021-08-15 22:39:52 +01:00
Michael Lutz
ee333a9549 Fix 2183fd4d: [NewGRF] Use divide instead of right shift for signed numbers. (#9480)
"For negative a, the value of a >> b is implementation-defined (in most implementations, this performs arithmetic right shift, so that the result remains negative)."
2021-08-15 12:14:53 +02:00
Vít Šefl
2183fd4dab Feature: [NewGRF] Maximum curve speed modifier for rail vehicles (#9346) 2021-08-15 11:17:05 +02:00
Jonathan G Rennison
9003ef7d11 When reversing train, ensure that loading is aborted if necessary 2021-07-27 18:06:44 +01:00
Jonathan G Rennison
2135aa2ae8 Fix false positive desync log message for powered free wagon chains 2021-07-26 18:08:56 +01:00
Jonathan G Rennison
6a009686c9 Fix #299: Add estimated max speed (full) to template windows 2021-07-17 23:21:12 +01:00
Jonathan G Rennison
502af119e5 Rename and move train max speed estimation functions 2021-07-17 23:06:34 +01:00
glx22
49b66ea504 Codechange: Remove FOR_EACH_SET_TRACK 2021-07-09 21:36:09 +02:00
Jonathan G Rennison
fb4e10626e Make look ahead distance vaiable with speed, within a reasonable range 2021-07-03 22:50:43 +01:00
Jonathan G Rennison
11e49ef99e Only apply signal speed restrictions from the front direction 2021-06-28 00:04:12 +01:00
Jonathan G Rennison
5fb3eb0bb9 Adjust signal speed restriction timeouts when date or day length changed 2021-06-27 23:07:32 +01:00
Jonathan G Rennison
e16c29ef7d Use already found iterator for erasing from hash map 2021-06-27 23:06:41 +01:00
Jonathan G Rennison
62075c88de Apply ATC speed restriction as advisory to prevent instant braking
Remove redundant function
2021-06-27 22:26:57 +01:00
Jonathan G Rennison
93be763301 Update ticks per tile constant 2021-06-27 22:12:29 +01:00
Jonathan G Rennison
ee2d77ecab Move train speed adaptation structs to separate header file 2021-06-27 04:41:46 +01:00
Jonathan G Rennison
3bba9ef37a Fix setting name 2021-06-27 04:41:46 +01:00
Jonathan G Rennison
e15acd3af8 Avoid train speed adaption overhead when setting not enabled 2021-06-27 04:41:46 +01:00
Jonathan G Rennison
28e39c9045 Fix trailing whitespace 2021-06-27 03:09:24 +01:00
Andreas Schmitt
669770f209 Fix a few issues and reset everything on start of new game 2021-06-20 20:40:33 +02:00
Andreas Schmitt
86cfefba08 Fix signed unsigned overflow 2021-06-20 20:40:33 +02:00
Andreas Schmitt
c1bf236a26 Rewrite the ATC logic
Now signals store speed information with a timeout for this data's validity
2021-06-20 20:40:33 +02:00
Andreas Schmitt
61669868bf Removed change and updated signal count 2021-06-20 20:40:33 +02:00
Andreas Schmitt
5d20b9397c Revert "Try something"
This reverts commit 475a097f36a70383d50ee68dac38b5ce087a1eb1.
2021-06-20 20:40:33 +02:00
Andreas Schmitt
02278f7a6f Try something
This doesn't work but hey... it's broken already in combination with realistic breaking
2021-06-20 20:40:33 +02:00
Andreas Schmitt
debc504e59 Add a setting for train speed adaptation
Prior to this change, without realistic breaking, trains would continuously run into the train in front of them. This makes them adjust their speed based on trains in front of them
2021-06-20 20:40:33 +02:00
Jonathan G Rennison
1002c6d9d2 Fix various compiler warnings
See: #267
2021-06-11 22:54:27 +01:00
glx22
5799402f7a Codechange: Rename window related DeleteXXX to match new behaviour 2021-05-29 21:08:25 +02:00
rubidium42
2e136285e1 Codechange: move from C-string to std::string for DoCommand 2021-05-29 19:02:18 +02:00
Jonathan G Rennison
f703e23322 Fix assert fail when ChooseTrainTrack called on disallowed 90 degree turn 2021-05-29 02:22:27 +01:00
rubidium42
b791ffc6de Fix: do not hide parameter by local variable with the same name 2021-05-27 18:30:56 +02:00
Jonathan G Rennison
a896753ecc Fix #9264: Do not attach temporary wagons to free wagon chains when autoreplacing 2021-05-23 21:05:55 +02:00
Jonathan G Rennison
8eb34b2f10 Do not attach temporary wagons to free wagon chains when autoreplacing
See: https://github.com/OpenTTD/OpenTTD/issues/9264
2021-05-15 22:32:50 +01:00
rubidium42
44ca7d9377 Change: Use gender-neutral pronouns 2021-05-15 10:16:48 +02:00
Jonathan G Rennison
6b2a05d02e Drive through depots: Allow moving between ends when current exit blocked 2021-04-25 18:45:11 +01:00
Jonathan G Rennison
6a62b94263 Add NewGRF railtype flag to disable realistic braking for vehs of that type
See: #242
2021-04-15 20:56:45 +01:00
Jonathan G Rennison
ba2e6087b2 Add train cache flag for whether train using realistic braking physics 2021-04-15 20:56:45 +01:00
Jonathan G Rennison
b514d29db1 Replace TrainCache::cached_tilt with a flags field 2021-04-15 20:56:45 +01:00
Jonathan G Rennison
686bcb8009 Fix no vehicle tile hash update when moving train in drive-through depot 2021-04-14 19:50:16 +01:00
Jonathan G Rennison
8e92a6844f Add a "misc_debug" console command
Add a flag to open veh window when TrainBrakesOverheatedBreakdown called
2021-04-12 00:18:13 +01:00
Jonathan G Rennison
5d5100449e Adjust realistic braking physics
Realistic acceleration uses 4 x the mass for acceleration as braking
Use 4 x mass for realistic braking as well to match
Increase per train length braking force
Add a power-based per train length braking force
2021-04-11 23:45:00 +01:00
Jonathan G Rennison
d484c32d44 Reduce sensitivity of train overheated breakdown 2021-04-11 22:53:02 +01:00
Jonathan G Rennison
26a123b708 Realistic braking: Cache offset of centre of mass of train 2021-04-03 21:25:04 +01:00
Jonathan G Rennison
dc8680eec5 Ensure that cached decel values of free wagon chain heads are zeroed 2021-04-01 01:23:08 +01:00
Jonathan G Rennison
8fd4f65a85 Validate lookahead reservation end OK before calling FollowTrainReservation 2021-04-01 00:36:13 +01:00
Jonathan G Rennison
5b5e068e52 Don't check safe waiting point in FollowTrainReservation if result unused 2021-03-31 22:39:44 +01:00