-
Notifications
You must be signed in to change notification settings - Fork 0
AI Overview
Our AI has two working modalities:
- Adaptive Mode, that keeps track of the events that occur in the galaxy, and manages EnergyCells in the most convenient way
- Random Mode, that (as the name suggests) is randomic
Both use three coefficients, rocket_gen_coeff, basic_gen_coeff and complex_gen_coeff, to adjust the AI behavior to the user's needs.
The user can choose among the modalities and determine the coefficients values when creating the planet AI, respectively passing the desired value to the parameter random_mode and to the three coefficients.
AI Constructor
Every time an Explorer asks for the creation of a basic resource or the crafting of a complex one, the planet chooses whether to perform this task or not considering the previous requests. If the planet is continuously threaten by Asteroids, it will lean towards the crafting of a Rocket to survive, while if there hasn't been many Asteroids in a while, it will prioritize generating resources for the Explorer.
This is achieved by keeping track of the previous messages, counting the occurrences of Sunrays and Asteroids that have been sent.
Every time an Explorer asks for the creation of a basic resource or the crafting of a complex one, the planet chooses whether to perform this task or not on a random basis.
Indeed, each time the planet receives a generator or combine request, it computes a random value and makes a choice by comparing it to the appropriate coefficient.
A coefficient's value is a threshold with respect to the computed probability value. For example,
- setting a coefficient to 0 will make the algorithm always prioritize the Explorers' requests in spite of its defense
- make the coefficient rising will balance the Explorers' need with the defense construction: if a coefficient is 0.5, the probability will be balanced
- setting a coefficient to 1 will make the algorithm always prioritize the planet's defense, achieved by the construction of a Rocket. As a downside, the planet can't satisfy any request coming from the Explorers.