tobymao / 18xx

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

[autoroute] clear routes if any connectivity changed or if player clicks "Auto" #10136

Open benjaminxscott opened 8 months ago

benjaminxscott commented 8 months ago

Existing train routes are maintained across ORs until manually cleared, to make it easier for manual routing

However for auto-routing, this behavior requires the user to clear existing routes then clicking Auto to re-calculate routes- since existing routes are "locked in" and the auto-router won't change them, which could result in lower payouts

Perhaps we can call the route cache to see if anything new was connected, and if so then clear all routes. (Perhaps only in the case where Auto-routing is enabled)

Alternatively, perhaps clicking Auto clears all routes, since the user in that case has explicitly stated they want to discard existing routes

philcampeau commented 3 weeks ago

I think the second method would actually be less resource intensive overall, and is the easiest way of applying this as well.

I came up with a fix. I'll submit it and see what people think.

roseundy commented 3 weeks ago

You're aware that not clearing routes is a feature, not a bug, right?

The idea is that you can route one or more trains and let the auto-router do the rest. This can avoid time-outs when the auto-router runs with larger trains.

The user can always click "Clear all trains".

philcampeau commented 3 weeks ago

That's a fair argument against it, I hadn't considered that.

benjaminxscott commented 3 weeks ago

I acknowledge and didn't realize that usecase, I don't tend to play games where that becomes an issue

Perhaps Auto could be grayed out if it's a no-op (e.g. if all trains are already routed).

I would claim that the behavior in (3) is "surprising" to the average user

  1. suppose existing routes are set (manually or via previous Auto)
  2. the board state has changed since last round and the player surmises routes are suboptimal or invalid
  3. clicking Auto is a no-op which IMO is not what the user expects (I propose that they would expect a full reroute, finding optimal payouts). Clear is not intuitively the answer to this, and the player has a Bad Time :tm: (and we get spurious bug reports)

This would denote that Auto is a no-op in the current routing state, while keeping it visible as an option that can be naturally discovered by playing around with Clear. It's a lot more fun to play around with buttons when there's feedback, so it's closer to a Good Time ™️ .