Commit Graph

28 Commits (master)

Author SHA1 Message Date
orwell96 1f3a4c3bfc Rework train same-track collision system and deterministic coupling
- Adds a separate collision system for trains sharing a path
- Moved some coupling-related code to couple.lua and refactor it
- Handle coupling in a way that the initiating train always keeps its ID
- As a side effect, engine has its direction reversed after coupling
2021-07-07 22:42:14 +02:00
orwell96 b65d99aa2c Don't try to invalidate_ahead when path has been regularily invalidated before 2021-02-10 21:41:05 +01:00
orwell96 61329c11a2 Start using path_invalidate_ahead() 2021-02-10 16:36:24 +01:00
orwell96 b59b0d587d Implement a LZB speed lookup table for the path and rewrite velocity controls 2021-02-10 16:35:45 +01:00
techniX 74bf177cc8 optimize path_get_index_by_offset
Instead of calling path_get_adjacent twice (which calls path_get
twice, i.e. 4 times overall), we call path_get directly only 2 times
with min and max indices to generate all the path we need for
calculations.
2020-07-10 12:02:23 +02:00
Gabriel Pérez-Cerezo f458f39fde comment out annoying debug info 2020-06-14 12:24:30 +02:00
orwell96 b13c725976 Workaround to handle split points (dt. aufgefahrene Weichen), fixing H#77 2020-06-10 20:56:35 +02:00
orwell96 a8ae0a5332 Simplify and optimize path_get_index_by_offset (cherrypicked) 2019-12-09 11:00:21 +01:00
orwell96 1c3ea96041 Possible fix for braking problems + debug outputs 2019-01-23 15:37:18 +01:00
orwell96 240e7dd091 Warn when something clears the path winthin train step 2019-01-22 12:26:31 +01:00
orwell96 e2ae763dba Revert "Correct last commit"
This reverts commit 5f290819cd.
2019-01-22 12:11:35 +01:00
orwell96 dac65af983 Revert "Debugging code to trace down path_invalidate within callbacks error"
This reverts commit 1965e846b6.
2019-01-22 12:11:14 +01:00
orwell96 5f290819cd Correct last commit 2019-01-22 00:13:11 +01:00
orwell96 1965e846b6 Debugging code to trace down path_invalidate within callbacks error 2019-01-22 00:06:59 +01:00
orwell96 97145e0f06 Additional info print for path_print() 2019-01-21 22:16:00 +01:00
orwell96 c6bef1c358 Fix H#69
Cause was a cascaded crash, original cause was something different
2018-10-17 17:45:51 +02:00
orwell96 33c839b40d Add signal safety control override, restructure control system 2018-10-10 21:49:52 +02:00
orwell96 9586a4d709 Add off-track train flag, fixes wagon object property reset on reversing 2018-07-04 14:04:41 +02:00
orwell96 3d7924c751 Fix bugs found while testing 2018-06-14 17:39:42 +02:00
orwell96 2a76d4a960 Fix final bugs and to-do's (u.a.save/load system) 2018-06-14 17:39:42 +02:00
orwell96 24b0639c5f Mainly make collisions and coupling work
Missing: ATC stuff, yaw problems
2018-06-14 17:39:42 +02:00
orwell96 b420a71939 Implement a reverse path lookup for trains instead of an occupations window system 2018-06-14 17:39:42 +02:00
orwell96 caf2bda7bc Fix path_dir to actually be an angle, path item deletion and orientation of wagons
The occupation system as it is now will change. For each position, I will save the index in the train's path,
and implement a callback system. I need this because the occupation window system will not be enough to cover all use cases
(e.g. to make a train stop with it's center or back at a certain position, I need 3 different brake distances, which doesn't fit into the scheme)
2018-06-14 17:39:42 +02:00
orwell96 139a26fccc Bugfixes part 1
There's something wrong with the new paths, next time build a path validity checker to trace the issue
2018-06-14 17:39:42 +02:00
orwell96 30e98520e7 Occupation System, new train steps, still incomplete 2018-06-14 17:39:42 +02:00
orwell96 064a454117 Adapt wagons to new path system
Still outstanding: trains
2018-06-14 17:39:42 +02:00
orwell96 3420a1a912 Restructure path system
The changes to the path system have not yet been integrated...
2018-06-14 17:39:42 +02:00
orwell96 46c4447da0 Rewrite rail connection system...
...to support an arbitrary number of connections for rails, which leads to these new features:
- switches now get recognized by the trackworker correctly
- ability to add real rail crosses
During this, I also rewrote the rail registering system and the conway function (important part of path prediction)
Note, developers: the track preset format changed, you might need to rewrite them according to the presets in tracks.lua if you wrote your own
(possibly breaks advcarts)
2017-12-18 23:09:23 +01:00