nkzw-tech / athena-crisis

Athena Crisis is an Advance Wars inspired modern-retro turn-based tactical strategy game. Athena Crisis is open core technology.
https://athenacrisis.com/open-source
Other
1.37k stars 105 forks source link

[Performance] EvaluationPanel should run map evaluations async and/or in a worker #16

Closed cpojer closed 1 month ago

cpojer commented 1 month ago

The map editor has an "Evaluation" panel that can be accessed by pressing v or via the "more" dropdown of the editor link panel. When pressing "Start evaluation", it simulates 10 games of the AI playing against the AI and displays the results. This runs directly on the client, and is a sync operation, which locks up the browser until it is done.

This task is about making this operation non-blocking, either by yielding more often or by running in a web worker. Both approaches will likely be changing useClientGameAction. The first approach likely modifies and extends executeGameAction to yield after an AI concludes a turn, so that the a game can be played by calculating a turn, yielding and then going back and executing another turn until the end.

A good way to test this is by making a very large map with many players.

Links

Funding

Fund with Polar