bergerhealer / TrainCarts

Minecarts redefined
MIT License
205 stars 63 forks source link

Failed to perform physics #491

Closed amalon closed 10 months ago

amalon commented 10 months ago

Info

Please provide the following information:


Bug

Description

I'm regularly getting trains misbehaving, getting split up at a particular junction. Something I've noticed is that on server startup I often see this sort of message:

[20:10:33 ERROR]: [Train_Carts] Failed to perform physics on train 'train_circle3' at club_170_62_-98:                
[20:10:33 ERROR]: [Train_Carts] Index 0 out of bounds for length 0            
java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0                
        at com.bergerkiller.bukkit.tc.controller.components.RailPath.getStartPosition(RailPath.java:90) ~[TrainCarts-1.20.4-v1-1518.jar:?]                                                                                                  
        at com.bergerkiller.bukkit.tc.controller.components.ObstacleTracker.hardEnterNewMutexZoneIfInside(ObstacleTracker.java:259) ~[TrainCarts-1.20.4-v1-1518.jar:?]                                                                      
        at com.bergerkiller.bukkit.tc.controller.components.ObstacleTracker.update(ObstacleTracker.java:95) ~[TrainCarts-1.20.4-v1-1518.jar:?]                                                                                              
        at com.bergerkiller.bukkit.tc.controller.MinecartGroup.doPhysics_step(MinecartGroup.java:2026) ~[TrainCarts-1.20.4-v1-1518.jar:?]                                                                                                   
        at com.bergerkiller.bukkit.tc.controller.MinecartGroup.doPhysics(MinecartGroup.java:1853) ~[TrainCarts-1.20.4-v1-1518.jar:?]                                                                                                        
        at com.bergerkiller.bukkit.tc.controller.MinecartGroupStore.doFixedTick(MinecartGroupStore.java:40) ~[TrainCarts-1.20.4-v1-1518.jar:?]                                                                                              
        at com.bergerkiller.bukkit.tc.controller.global.TrainUpdateController$TrainUpdateTask.run(TrainUpdateController.java:225) ~[TrainCarts-1.20.4-v1-1518.jar:?]                                                                        
        at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.20.1.jar:git-Paper-65]                                                                                                                             at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:480) ~[paper-1.20.1.jar:git-Paper-65]                                                                                                   at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1480) ~[paper-1.20.1.jar:git-Paper-65]                                                                                                                    
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:447) ~[paper-1.20.1.jar:git-Paper-65]                                                                                                           
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1394) ~[paper-1.20.1.jar:git-Paper-65]                                                                                                                      
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1171) ~[paper-1.20.1.jar:git-Paper-65]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[paper-1.20.1.jar:git-Paper-65]                                                                                                                    
        at java.lang.Thread.run(Thread.java:1623) ~[?:?]                                                                                                                                             

Around here I often find trains queued up, and when I investigate it looks like trains have gone through an spmutex without seeing it, i.e. /train status doesn't say entering or entered the mutex, and then got stuck facing another train coming from the other way (for which /train status says entered mutex).

It often seems to work for quite a while when the server is up, and then go wrong when it shuts down and comes back up again. Anyway, I don't know if the above back trace is any help. Happy to try and figure out more details if not.

Thanks

bergerkiller commented 10 months ago

For some reason one of the path elements is empty, or zero-length. Might be a strange tc-coasters node that isnt properly connected perhaps? This at least fixes that error but it may not fix all problems

https://ci.mg-dev.eu/job/TrainCarts/1520/

amalon commented 10 months ago

Those coordinates are very near a junction that appears to span multiple TCCoasters CSV files. One of them has the junction and 3 links, another has one of the links as a root and links to the junction. Is it possibly a race between tcc loading and train physics?

I'll give that snapshot a go tomorrow and see if it helps. Thanks again!

bergerkiller commented 10 months ago

Unlikely as tcc tracks are basically globally always available. Unlike vanilla track it doesnt lazy load any of it. But there might be some weird glitch that causes a zero-length path segment to sneak in somehow.

amalon commented 10 months ago

I haven't seen the failed to perform physics error any more, though trains are still splitting. I've found the debug option to log splits and get a fair few on server start, for reasons Next cart is derailed and End of rails reached before finding next cart. Looking at coordinates though (after trains moved on) doesn't show anything unusual, just at random bits of track)

bergerkiller commented 10 months ago

These messages also show detailed pathing information / coordinates which can help in figuring out the path suddenly ends. The last position (exact position) is important. Can you stand at such a position, look all the way down, and make a screenshot? Then also include the full details logged

amalon commented 10 months ago

I checked trains weren't split (/train list not showing any with ~ in the name), restarted server, and got the following logs. Despite all the trains mentioned, only train_circle1 then appeared to actually be split up (with a train_circle1~a on the train list in addition to train_circle):

[09:27:39 WARN]: [Train_Carts] Train 'train_circle3' split apart because: Next cart is derailed                                                                                                                                             
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 241/62/-498}, pos={241.5/62.9379/-504.9979}, mot={0.0/-0.0048/1.0}, f=SOUTH}                                                  
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE 241/62/-499}, pos={241.5/62.9374/-498.623}, mot={0.0/0.0031/1.0}, f=SOUTH}                                                                                                           
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #4 of 6 [990d2070-f08b-473e-9d74-1df7289feb2d] at x=241.5 y=62.93739587878509 z=-498.6229594053605                                                                      
[09:27:39 WARN]: [Train_Carts] Train 'train_circle3' split apart because: Next cart is derailed                                                                                                                                             
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 241/63/-485}, pos={241.5/62.9806/-489.9978}, mot={0.0/0.0035/1.0}, f=SOUTH}                                                   
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE 241/62/-484}, pos={241.5/62.996/-483.6229}, mot={0.0/0.0024/1.0}, f=SOUTH}                                                                                                           
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #1 of 6 [bd18af65-0590-4e34-af13-f4d01756850a] at x=241.5 y=62.99598761169761 z=-483.62291296302664                                                                     
[09:27:39 WARN]: [Train_Carts] Train 'train_beacon1' split apart because: Next cart is derailed                                                                                                                                             
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 195/76/-2205}, pos={195.5/76.9375/-2199.84}, mot={0.0/0.0/1.0}, f=SOUTH}                                                      
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE 195/76/-2191}, pos={195.5/76.9375/-2190.79}, mot={0.0/0.0/1.0}, f=SOUTH}                                                                                                             
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #4 of 6 [5d1fc281-60e4-42e9-83a3-85cb07d78841] at x=195.5 y=76.9375 z=-2190.7900085214583                                                                               
[09:27:39 WARN]: [Train_Carts] Train 'train_beacon1' split apart because: Next cart is derailed                                                                                                                                             
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 195/76/-2205}, pos={195.5/76.9375/-2199.632}, mot={0.0/0.0/1.0}, f=SOUTH}                                                     
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE 195/76/-2191}, pos={195.5/76.9375/-2190.582}, mot={0.0/0.0/1.0}, f=SOUTH}                                                                                                            
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #4 of 6 [5d1fc281-60e4-42e9-83a3-85cb07d78841] at x=195.5 y=76.9375 z=-2190.5820167091315                                                                               
[09:27:39 WARN]: [Train_Carts] Train 'train_beacon1' split apart because: Next cart is derailed                                                                                                                                             
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 195/76/-2205}, pos={195.5/76.9375/-2199.424}, mot={0.0/0.0/1.0}, f=SOUTH}                                                     
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE 195/76/-2191}, pos={195.5/76.9375/-2190.374}, mot={0.0/0.0/1.0}, f=SOUTH}                                                                                                            
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #4 of 6 [5d1fc281-60e4-42e9-83a3-85cb07d78841] at x=195.5 y=76.9375 z=-2190.3740248968047                                                                               
[09:27:39 WARN]: [Train_Carts] Train 'train_beacon3' split apart because: Next cart is derailed                                                                                                                                             
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 -775/63/717}, pos={-774.0332/63.9375/717.2415}, mot={-0.9958/0.0/-0.0913}, f=WEST}                                            
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE -783/63/715}, pos={-782.9302/63.9237/715.781}, mot={-0.9879/-0.0015/-0.1553}, f=WEST}                                                                                                
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #1 of 6 [901f7f5f-6af8-411a-8880-48539b6a6931] at x=-782.9302075372998 y=63.923695675439305 z=715.7810457632611                                                         
[09:27:39 WARN]: [Train_Carts] Train 'train_beacon3' split apart because: Next cart is derailed                                                                                                                                             
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 -775/63/717}, pos={-774.0332/63.9375/717.2415}, mot={-0.9958/0.0/-0.0913}, f=WEST}                                            
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE -783/63/715}, pos={-782.9302/63.9237/715.781}, mot={-0.9868/-0.0015/-0.162}, f=WEST}                                                                                                 
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #1 of 6 [901f7f5f-6af8-411a-8880-48539b6a6931] at x=-782.9302075372998 y=63.923695675439305 z=715.7810457632611                                                         

Here's the bit mentioning train_circle1:

[09:27:39 WARN]: [Train_Carts] Train 'train_circle1' split apart because: Next cart is derailed                                                                                                                                             
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 -807/63/604}, pos={-806.5/63.9375/614.6739}, mot={0.0/0.0/-1.0}, f=NORTH}                                                     
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE -807/63/608}, pos={-806.5/63.9375/608.2989}, mot={0.0/0.0/-1.0}, f=NORTH}                                                                                                            
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #5 of 6 [a3b8d073-17df-4fdf-83db-4861cdb5b528] at x=-806.5 y=63.9375 z=608.2988611585242                                                                                
[09:27:39 WARN]: [Train_Carts] Train 'train_circle1' split apart because: End of the rails reached before finding next cart                                                                                                                 
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 -807/63/602}, pos={-806.5/63.9375/601.9238}, mot={0.0/0.0/-1.0}, f=NORTH}                                                     
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE -807/63/600}, pos={-806.5/63.9375/600.449}, mot={0.0/0.0/-1.0}, f=NORTH}                                                                                                             
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #3 of 6 [0eda740c-bbca-44b0-944b-f9398b41f790] at x=-806.5 y=63.9375 z=599.6736646435112                                                                                
[09:27:39 WARN]: [Train_Carts] Train 'train_circle1' split apart because: Next cart is derailed                                                                                                                                             
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 -807/63/598}, pos={-806.5/63.9375/599.6737}, mot={0.0/0.0/-1.0}, f=NORTH}                                                     
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE -807/63/593}, pos={-806.5/63.9375/593.2986}, mot={0.0/0.0/-1.0}, f=NORTH}
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #2 of 6 [ea3d04c1-8f7a-44ab-8b5f-2513d0d06c7c] at x=-806.5 y=63.9375 z=593.2985825202361
[09:27:39 WARN]: [Train_Carts] Train 'train_circle1~a' split apart because: Next cart is derailed
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 -807/63/602}, pos={-806.5/63.9375/601.9238}, mot={0.0/0.0/-1.0}, f=NORTH}
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE -807/63/608}, pos={-806.5/63.9375/608.2989}, mot={0.0/0.0/1.0}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #2 of 3 [a3b8d073-17df-4fdf-83db-4861cdb5b528] at x=-806.5 y=63.9375 z=608.2988611585242
[09:27:39 WARN]: [Train_Carts] Train 'train_circle1' split apart because: Next cart is derailed
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 -807/63/598}, pos={-806.5/63.9375/599.6737}, mot={0.0/0.0/-1.0}, f=NORTH}
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE -807/63/593}, pos={-806.5/63.9375/593.2986}, mot={0.0/0.0/-1.0}, f=NORTH}

and the rest:

[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #2 of 3 [ea3d04c1-8f7a-44ab-8b5f-2513d0d06c7c] at x=-806.5 y=63.9375 z=593.2985825202361
[09:27:39 WARN]: [Train_Carts] Train 'train_central3' split apart because: Next cart is derailed
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 119/62/53}, pos={120.9857/62.9375/49.4898}, mot={-0.3168/0.0/0.9485}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE 118/62/55}, pos={118.7223/62.9375/55.4276}, mot={-0.4618/0.0/0.887}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #5 of 6 [386114ae-f60e-4ba4-add7-462886edb550] at x=118.7223251317605 y=62.9375 z=55.42758550555997
[09:27:39 WARN]: [Train_Carts] Train 'train_central3' split apart because: Next cart is derailed
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 114/62/64}, pos={114.7387/62.9375/63.0814}, mot={-0.4618/0.0/0.887}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE 111/62/68}, pos={111.794/62.9375/68.7366}, mot={-0.4618/0.0/0.887}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #2 of 6 [e5ae91db-3ac4-4468-8f75-1164b66aa7ca] at x=111.79397095484698 y=62.9375 z=68.73657850717402
[09:27:39 WARN]: [Train_Carts] Train 'train_central3' split apart because: Next cart is derailed
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 119/62/53}, pos={120.9857/62.9375/49.4898}, mot={-0.3168/0.0/0.9485}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE 118/62/55}, pos={118.7223/62.9375/55.4276}, mot={-0.4618/0.0/0.887}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #5 of 6 [386114ae-f60e-4ba4-add7-462886edb550] at x=118.7223251317605 y=62.9375 z=55.42758550555997
[09:27:39 WARN]: [Train_Carts] Train 'train_central3' split apart because: Next cart is derailed
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 114/62/64}, pos={114.7387/62.9375/63.0814}, mot={-0.4618/0.0/0.887}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE 111/62/68}, pos={111.794/62.9375/68.7366}, mot={-0.4618/0.0/0.887}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #2 of 6 [e5ae91db-3ac4-4468-8f75-1164b66aa7ca] at x=111.79397095484698 y=62.9375 z=68.73657850717402
[09:27:39 WARN]: [Train_Carts] Train 'train_central3' split apart because: Next cart is derailed
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 119/62/53}, pos={120.9857/62.9375/49.4898}, mot={-0.3168/0.0/0.9485}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE 118/62/55}, pos={118.7223/62.9375/55.4276}, mot={-0.4616/0.0/0.8871}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #5 of 6 [386114ae-f60e-4ba4-add7-462886edb550] at x=118.7223251317605 y=62.9375 z=55.42758550555997
[09:27:39 WARN]: [Train_Carts] Train 'train_central3' split apart because: Next cart is derailed
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 114/62/64}, pos={114.7387/62.9375/63.0814}, mot={-0.4618/0.0/0.887}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE 111/62/68}, pos={111.794/62.9375/68.7366}, mot={-0.4618/0.0/0.887}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #2 of 6 [e5ae91db-3ac4-4468-8f75-1164b66aa7ca] at x=111.79397095484698 y=62.9375 z=68.73657850717402
[09:27:39 WARN]: [Train_Carts] Train 'train_central3' split apart because: Next cart is derailed
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 119/62/53}, pos={120.9061/62.9375/49.728}, mot={-0.3168/0.0/0.9485}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE 118/62/55}, pos={118.6057/62.9375/55.6495}, mot={-0.4616/0.0/0.8871}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #5 of 6 [386114ae-f60e-4ba4-add7-462886edb550] at x=118.60571330369028 y=62.9375 z=55.64946769191639
[09:27:39 WARN]: [Train_Carts] Train 'train_central3' split apart because: Next cart is derailed
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 114/62/64}, pos={114.6228/62.9375/63.3039}, mot={-0.4618/0.0/0.887}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE 111/62/68}, pos={111.6781/62.9375/68.959}, mot={-0.4618/0.0/0.887}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #2 of 6 [e5ae91db-3ac4-4468-8f75-1164b66aa7ca] at x=111.67813784466169 y=62.9375 z=68.95903073014337
[09:27:39 WARN]: [Train_Carts] Train 'train_central3' split apart because: Next cart is derailed
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 119/62/53}, pos={120.8263/62.9375/49.9669}, mot={-0.3168/0.0/0.9485}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE 118/62/55}, pos={118.486/62.9375/55.8638}, mot={-0.4615/0.0/0.8871}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #5 of 6 [386114ae-f60e-4ba4-add7-462886edb550] at x=118.48600381563969 y=62.9375 z=55.86376630730504
[09:27:39 WARN]: [Train_Carts] Train 'train_central3' split apart because: Next cart is derailed
[09:27:39 WARN]: [Train_Carts] Search start: {rail={com.bergerkiller.bukkit.coasters.CoasterRailType@68ce9d10 114/62/64}, pos={111.5623/62.9375/69.1815}, mot={-0.4618/0.0/0.887}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Search end: {rail={NONE 108/62/74}, pos={108.6179/62.9375/74.836}, mot={-0.4618/0.0/0.887}, f=SOUTH}
[09:27:39 WARN]: [Train_Carts] Cart that could not be reached: cart #1 of 6 [2eef7362-40d9-47b6-bb3a-515ab591cb51] at x=108.61792295326303 y=62.9375 z=74.83603432838729

Here are some screenshots. Here's the junction nearby: 2024-01-03_10 08 20 -807, 593: -807_593 -807, 599: -807_599 -807, 600: -807_600 -807, 601: -807_601 -807, 608: -807_608 -807, 614: -807_614

Version unchanged except traincarts -> 1520:

> train version
[10:15:08 INFO]: Train_Carts: v1.20.4-v2-SNAPSHOT (build: 1520)
[10:15:08 INFO]: BKCommonLib: v1.20.4-v1 (build: 1663)
[10:15:08 INFO]: Server: git-Paper-65 (MC: 1.20.1)

Hopefully that helps, let me know if you'd like any more info.

bergerkiller commented 10 months ago

This seems to be a bug in tc-coasters, because it doesnt find the coaster rail at { -806.5/63.9375/608.2989 } despite a rail clearly being there. Its also possibly a caching problem if it cached rail info at that position and tcc didnt invalidate that cache when loading up.

Ill make a build later today that makes traincarts completely invalidate the rail cache on startup to see if that already helps things along

bergerkiller commented 10 months ago

Let's first see if this resolves the problem. If not, Ill probably have to look at TCC's code

https://ci.mg-dev.eu/job/TrainCarts/1524/

amalon commented 10 months ago

Thanks, I updated traincarts to 1524. Unfortunately there doesn't seem to be any difference in behaviour. First time there were a few messages but no splits (not many trains), but I spawned a bunch of trains and on 2nd server restart several of them did get split up, including one which I think was right over a set of points.

bergerkiller commented 10 months ago

TCCoasters-1.20.4-v2-SNAPSHOT-NO-CI.zip Can you try with this build of TCC? Added a track rebuild after initializing for a world to see if it helps any.

amalon commented 10 months ago

Thanks. The updated TCC definitely seems to have prevented the splitting. Trains left over the switcher reload where they were without any splitting messages in the log.

The way I was reproducing was by queuing trains up to the spmutex region you helped me fix before. The trains queue just past and over a switcher. I can reproduce a presumably separate issue where even though a train is in the spmutex region, the train(s) waiting immediately start moving into the spmutex on server start. Curiously in this case 2/3 trains say entered same region via different signs, and the other 1 says approaching even though all 3 are well inside it (I can open a separate issue for that if you like).

bergerkiller commented 10 months ago

Ah thats great! Of course I still havent found the real issue but now I know where to look. I might need you to test another build later with more specific fixes, but if I cant narrow it down, I can leave the current fix in place.

Reason I want a more specific fix is because the problem has to do with loading new coasters, and currently it might still be broken when csv files are loaded in for the first time.

amalon commented 10 months ago

Retesting is no problem, it was fairly easy to reproduce.

bergerkiller commented 10 months ago

Had another look on the github and I think what I fixed was actually the only problem there was. It just wasn't "building" the track data when loading a world, so by the time traincarts enables none of the rails were linked.

I need to adjust the fix a little bit but other than that, I think that was the main problem.

I thought I already did this somewhere but apparently not 😅

bergerkiller commented 10 months ago

https://ci.mg-dev.eu/job/TC%20Coasters/334/ this is a complete, proper fix

amalon commented 10 months ago

thanks, after a quick try, 334 seems as effective as the NOCI build at preventing the splitting