tobymao / 18xx

A platform for playing 18xx games online!
https://18xx.games
Other
285 stars 186 forks source link

[1862] Auto-routing fails when running freight trains #9627

Open Yuki-yao opened 1 year ago

Yuki-yao commented 1 year ago

If the corporation has any freight train, uncaught error occurs in javascript when I click the auto routing button. I checked the console and got message like this: image

Hotseat game json link: https://gist.github.com/Yuki-yao/42b9614470fe5cd1bc791b23db30b0ed To reproduce the bug, just buy L&H (with freight permission) and lay a track towards the C2 port, then try to run a 1F train. image

Updated: I'm not sure if this would help, but there is another example in which auto-routing generated bad result, when clicking auto button after resetting to last route: https://gist.github.com/Yuki-yao/35d9e35560ad25b6bdb96c2517f8bffb. No error reported in console.

Browser version: Chrome 116.0.5845.187, on desktop

philcampeau commented 1 year ago

Duplicate of #5925

philcampeau commented 1 year ago

Duplicate of #5925

Yuki-yao commented 1 year ago

@philcampeau Sorry if I misunderstood something, but it seems that #5925 is about revenue calculating on permanent trains. Is that problem also related to auto routing (with error output in console)?

philcampeau commented 1 year ago

This is what I get for looking at GitHub at 3am.

Sorry about that, you're right. This is a different issue.

Yuki-yao commented 1 year ago

Well I find out that sometimes auto routing can finish even if the corporation has freight trains, with wrong result like this: (https://gist.github.com/Yuki-yao/af2390f7190a9c5a6ceac7011dbf339b)

image

Just a guess: considering that the correct route is linking the port, maybe there is something wrong with the auto-routing calculation involving ports?

roseundy commented 1 year ago

I'm not sure auto-routing has ever worked for 1862 due to the unusual rules for freight trains.