Opened 6 years ago

Last modified 8 months ago

#3392 new defect

Add the ability to output AI commands to commands.txt

Reported by: Itms Owned by: Sandarac
Priority: Nice to Have Milestone: Work In Progress
Component: Core engine Keywords: patch
Cc: Patch: Phab:D153

Description (last modified by Angen)

Currently the commands.txt don't include AI commands, as those should be deterministic. It would also be wrong to replay a file with commands for AI players, as they would interfere.

However, it would be nice to have a way to output these commands, for instance with a command-line option, in order to:

  • see what the AI did by reading the file
  • be able to modify things for testing and bug-hunting
  • test serialization in games with AIs, just by disabling AIs and replaying their commands (this will be invalid when the AI supports serialization tests)

If such a system is implemented, it would be necessary to test that a commands file with AIs doesn't contain commands for AI players.

Change History (4)

comment:1 by mimo, 6 years ago

Priority: If Time PermitsNice to Have

I support the idea, and we can in fact extend it. It would then be nice if the replays (either visual or not) had an option to switch ON/OFF the AI computation (could be OFF by default, with ON being needed mainly for AI development): if OFF the AI commands would be read from the file, while if ON they would be recomputed. That would boost a bit the replay speed.

And we can even go further and also send these AI commands to all players in case of MP. In a first step, the Engine would only check that commands from all players are identical, but in a second step we can have an option to share the AIs between the players such that each AI would only be computed by one player. This sharing can be either random or according to the relative CPUs of the different players or with an additional gui in the AI configuration panel. That would probably improve FPS of people playing with trusted friends on old computers. But as that could give some cheat possibilities, it should only be an option.

comment:2 by elexis, 5 years ago

Keywords: patch rfc added
Milestone: BacklogWork In Progress

Patch by Sandarac implementing that

comment:3 by Sandarac, 5 years ago

Keywords: rfc removed

comment:4 by Angen, 8 months ago

Description: modified (diff)
Owner: set to Sandarac
Patch: Phab:D153
Note: See TracTickets for help on using tickets.