google-research / falken

Falken provides developers with a service that allows them to train AI that can play their games
Apache License 2.0
253 stars 35 forks source link

Dynamic entity support #13

Closed haowang1013 closed 3 years ago

haowang1013 commented 3 years ago

Hi,

Does Falken currently support adding entity to the brain spec observation after the session has started? My experimental code is like this

auto& Spec = Brain->brain_spec_base();
auto Entity = new falken::EntityBase(Spec.observations_base(), TCHAR_TO_UTF8(*Actor->GetName()));

And it causes error for me:

[Falken] ERROR: SubmitEpisodeChunks failed with status: Episode data failed did not match the brain spec for the session. Brainspec check failed in chunk 0, step 120: ObservationSpec observations contains 2 global_entities vs. expected 1 global_entities..[Falken] ERROR: Failed to upload observations/actions during episode 7dcad5b3-7bd1-41eb-867f-589af5bbd7f3: Error message: Episode data failed did not match the brain spec for the session. Brainspec check failed in chunk 0, step 120: ObservationSpec observations contains 2 global_entities vs. expected 1 global_entities.. Error code: 2The thread 0x58e8 has exited with code 0 (0x0).

Note that I'm not able to pre-allocate those entities as they're created dynamically during the simulation.

hmoraldo commented 3 years ago

The current implementation requires all entities to be known in advance. You can provide a fixed number of entities and set them to special values whenever they aren't in use.