Artificial Testing Player - GeneRainier/salmon-run-working GitHub Wiki

Overview

Part of the issue Salmon Run has had in the past is ease of playtesting as it pertains to data generation. We do not have a constant pool of players to play the game and generate evolution data and, as a result, we often do not have enough data to ensure the current balance of the game generates meaningful results for the classroom. In order to alleviate this, we have created an artificial player (AP) who can run simple games automatically rather than requiring a human to sit and play through 10-20 rounds of the game, which can take a substantial amount of time.

Initialization Values

In order to facilitate quick adaptations for different lesson plans, we have a list of potential initialization settings within Unity that can be adjusted via the Inspector. This also allows for testing multiple settings while outputting the same kind of output file and using the same AP. All that needs to be changed to test a different set of initialization settings is to add it to the list in the Inspector, set all the values, and set the "setToUse" value to the appropriate list index.

Artificial Tower Placement

The goal of the AP is to have it automatically place towers in line with a predicted lesson plan from round to round. This means we have the AP select from a list of potential locations for a tower that can either be occupied or not occupied. Each round, the AP randomly selects locations and checks if they are occupied. If it is, it selects another location. If it is not occupied, the AP places a tower. The type of tower placed is determined by the lesson plan being tested. For instance, one lesson plan may require placing 3 anglers after the first round, then 3 rangers after round two, and then two more anglers and a ranger after round three. The third round would result in the two anglers being placed first followed by the lone ranger. After tower placement, the AP starts the round, sets it to the fastest setting, and waits for the round to complete. The process then repeats until the desired round is reached (for instance, round 20 or the end of the lesson plan).

Data Output

Data from these rounds is output to a .txt file within the Salmon Run Project folder. The format of this output file is the set of initialization values on their own line, one after the other, followed by definitions for the shorthand variants of the data being tracked (Short Offspring = offSh), and then rows for each round and all the data in the round. Each column of the last section is a unique piece of data (offSh, offMd, etc.) and the row is all of those corresponding values for that round. The file is appended each round and its name is the timestamp of the time the game was started. This allows for one unique file for each run game. This file will only output if the "Make Output File" boolean is set to true in the Inspector of the ManagerIndex of the scene.