State Space
Last updated
Last updated
In order for the agents to understand the game world, we need to convert the game state into a format that it can digest - we will call this the model's "state space".
Each model architecture will have different structure for the state space, so it is important to clearly define the features that are important to your game and the method to extract them. Developers can either use the built-in feature engineering module or create their own custom features.
The NRN agents SDK comes with an ability to automatically extract features from a game world. Developers only need to define a configuration so the SDK knows how to access certain values from the game world. Below we show an example getting the following features:
Raycasts that originate from the player and detect enemies around it
Relative position (distance and angle) to a powerup
The state config is comprised of an array of feature configs of the following format:
In the configurations below, we use the notation string -> objectType
to denote that the value for the key must be a string that points to an object of a particular type.
If developers want to create features that are currently not offered by the feature engineering module, then they are able to. Below we showcase how to convert a game world to a state matrix with custom feature engineering: