Open hatfield-c opened 4 years ago
Each ActorShipManager will have a list of "Brains", one for each difficulty.
Each "Brain" will have a list of "Behaviors" we want the ship to exhibit, ranging from "Patrol" to "Combat".
Each "Behavior" will be composed of the following:
All of these things should be able to be set up in the inspector. Then at runtime, the director will tell an instantiated ActorShipManager what difficulty to use, which will in turn pass the appropriate Brain to the ShipActor, which will then be responsible for managing behaviours.
Note - the InferenceDevice field may or may not be serializeable. If it is not, then we can use a boolean titled "GPU" instead. If it is on, then decisions are made on the GPU. If it is off, then the CPU is used.
Enemy ships now select their neural network based on the given difficulty they are instantiated with.
The training environments for our behaviors will need to be set up such that when the agent collides with the terrain a penalty will be applied to the agent. This necessitates the creation of a "agent_terrain" script to be applied to terrain.
We should begin by training a neural network to patrol by itself, in search of a target. Once that NN has been trained effectively, we can then reuse it, and have it trained with multiple enemy ships.
A basic training scene + architecture has been set up. It will be likely that this architecture needs to be refined, but it will serve as a good base for now.
This issue is ready for QA. To QA this issue:
There will need to be an architecture to handle the loading and management of AI neural networks for use on enemy ships.
The architecture should be reusable on multiple ships, and each ship should maintain a list of [neural network, behavior name/key] pairs, such that each desired behavior from the ship has an associated neural network. This also necessarily means that there must be a way to swap between the neural networks being used by the enemy, such that we don't waste processing power by running them all at all times.
Some basic behaviors are: