Currently, a single step (state, agent_id, action) of the Puoribor environment requires at least 331B to serialize.1 For a 100 turn game, this results in a 331 * 2 * 100 = 66.2KB history.
This is pretty inefficient, and can be solved by simply only using the actions of each step.
All fights environments are pure functions of the form:
$$\mathrm{env}(\mathrm{state}_n, \mathrm{action}_n) = \mathrm{state}_{n+1}$$
With $\mathrm{state}_0$ known, all we need are $\mathrm{action}_0 \cdots \mathrm{action}_{n-1}$ to reconstruct $\mathrm{state}_{n}$.
Using this method, all we need are 4B to serialize each step. Action-based serialization should be explored.
Currently, a single step
(state, agent_id, action)of the Puoribor environment requires at least 331B to serialize.1 For a 100 turn game, this results in a 331 * 2 * 100 = 66.2KB history.This is pretty inefficient, and can be solved by simply only using the actions of each step.
All
fightsenvironments are pure functions of the form:With$\mathrm{state}_0$ known, all we need are $\mathrm{action}_0 \cdots \mathrm{action}_{n-1}$ to reconstruct $\mathrm{state}_{n}$ .
Using this method, all we need are 4B to serialize each step. Action-based serialization should be explored.
Footnotes
$(9 \times 9 \times 4 + 2 + 1) + 3 + 1$ uint8 are needed. In reality, 425B is needed using MessagePack. The initial state is encoded as
g6VzdGF0ZYOlYm9hcmSUmZkAAAAAAAAAAACZAAAAAAAAAAAAmQAAAAAAAAAAAJkAAAAAAAAAAACZAQAAAAAAAAAAmQAAAAAAAAAAAJkAAAAAAAAAAACZAAAAAAAAAAAAmQAAAAAAAAAAAJmZAAAAAAAAAAAAmQAAAAAAAAAAAJkAAAAAAAAAAACZAAAAAAAAAAAAmQAAAAAAAAAAAZkAAAAAAAAAAACZAAAAAAAAAAAAmQAAAAAAAAAAAJkAAAAAAAAAAACZmQAAAAAAAAAAAJkAAAAAAAAAAACZAAAAAAAAAAAAmQAAAAAAAAAAAJkAAAAAAAAAAACZAAAAAAAAAAAAmQAAAAAAAAAAAJkAAAAAAAAAAACZAAAAAAAAAAAAmZkAAAAAAAAAAACZAAAAAAAAAAAAmQAAAAAAAAAAAJkAAAAAAAAAAACZAAAAAAAAAAAAmQAAAAAAAAAAAJkAAAAAAAAAAACZAAAAAAAAAAAAmQAAAAAAAAAAAK93YWxsc19yZW1haW5pbmeSCgqkZG9uZcKmYWN0aW9ukwAAAKhhZ2VudF9pZAA=this way. ↩