boardgamers / gaia-engine

Javascript engine for project gaia
MIT License
13 stars 6 forks source link

Better federation algorithm #231

Closed coyotte508 closed 3 years ago

coyotte508 commented 3 years ago

Know when to give up looking for federations.

With the following data: https://gist.github.com/coyotte508/3e431a5cf077808a63cc306b44e0708e

image

Ivits, when they convert power to a qic, trigger a refresh of the federation cache. And it causes the site to hang too long and causes an error 504 and they can't complete their next move.

At least, for ivits, planets that are unreachable from the current federation should be excluded from the search space.

More generally, if with a given number of satellites any two building groups can not be connected, the suggested federation should be discarded.

coyotte508 commented 3 years ago

Addressed by https://github.com/boardgamers/gaia-engine/commit/0e8acbc4a50be5b4669b876c720a5caf32ec0329