Now, the report is no longer just in the JS console. You get a nice HTML report showing progress of a batch run, as well as a way to reproduce matches, and to see the STDERR from a given match.
Sweet !
Every pushed AI has its own unique agentId, so it is possible to test some code against an AI version that isnât in the arena anymore (Recar, Iâm looking at you).
Adding a field in the plugin to manually type an agentId would be the ultimate feature ! No more AI-hiding problem during contests, and CG staff wonât even have to add this feature themselves.
Okay, so after playing with this a bit, I have validated that it is definitely feasible, and if you wanted to, you could start doing it today. Just do this:
Load CG Spunk
Go to the IDE
Right-click on one of the playerâs avatars and select âInspectâ from the context menu. This step is important. It sets the execution context for the JS console.
Open the JS console
Type the following into the console:
api = angular.element(â.agentâ).eq(0).scope().api
user = {pseudo: , avatar: }
agent = {agentId: , codingamer: user, valid: false}
api.addAgent(agent, )
Where:
<id> = The agentId you want to test against
<name> = The name for the agent (in quotes). This can really be anything. Itâs just a label. Ideally, you use the actual username, but itâs not necessary. If you omit it, then things will still work, but the agent will be âUnnamedâ
<avatarId> = The id of the avatar image to show for the agent. Again, this can be any avatarId you want, or you can omit it to use the standard âghostâ image.
<position> = The index of the position to load the agent into. 0 for left, or 1 for right.
If you want me to include this in the UI for the extension, I could do so, but as @Aveuh said, I think it would be of very limited use, and might cause some confusion. Feel free to write up a proposal, though.
Just watch the outgoing request in your browser while pressing the PLAY button against that particular AI.
There is no way to retrieve that id when its no longer in the arena, but if you watch the arena leaderboard closely enough, sooner or later youâll catch something interesting to save for later tests
I believe this is related to Issue #21. I can reproduce the bug, and it appears to only affect games where there are more than 2 players possible (i.e. Tron in Silver) and you select âPerform each iteration a second time with positions swappedâ. It gets confused when trying to swap two players if the 3rd player position is empty.
It shifts all players to the left, and wraps the first player to the last position. This allows for 3 (of 6 possible) different configurations with 3 players. I havenât figured out a good way to handle the multiple player permutations issue.
Should I just stick with the shift-left strategy and execute 3 matches per run for 3 players, or should I execute 6 matches per run? This can balloon quickly, and becomes a reporting headache.
It currently executes a hardcoded 2 matches per run (when swapping is enabled) which obviously doesnât work very well for more than 2 players.
Well, I wouldnât mind having every possibility tested, but that multiplies the number of matches per 24 for 4 players so maybe not a good idea. Trying the left shift could be a good solution I guess ?
A new version of CG Spunk (v0.2.0) has been published to the Chrome Web Store and should be rolling out to clients soon. There are pretty substantial improvements in this release, including:
Pretty good support for multiplayer games with more than 2 players.
The ability to directly compare IDE code vs. arena code in the exact same game scenarios
The ability to âsaveâ and ârestoreâ batch runs (by copying and pasting the batch description JSON) so that you can run the exact same test with updated code
The ability to manually enter batch description JSON (advanced) to specify opponents and boards.