Run yarn
Run tsc
Run node dist\index.js
Can Also press F5 inside Visual Studio Code while inside src/index.js and it will automatically watch for changes and rebuild, and run.
Should start to see server running, and processing empty actions
Can test out connecting a player and rendering by running code in the sample renderer repo : https://github.com/NikitaVr/the-seed-render
- Agents Connect (this can really be done at any point)
- Server sends State
- Agent
- Calculate Reward
- Calculate new Action
- Send new Action to Server
- Server
- Receives Actions
- Identify Conflicts (ex. 2 agents trying to eat the same food)
- Resolve Conflicts
- Take Actions -> New State
- Apply Environment Built In Changes (ex. berries growing)
- Send new State
- Repeat
There are two options
Step Timer, where, for example, the server calculates a step every 2 seconds.
If an agent sends an action late, the server will calculate the action on the next step. If on the next step the server receives a more recent action from the agent, it will discard the old action.
This step is waits until all connected agents send an action. This means fast agents can train very quickly, and slow agents can take the time they need.