-
-
Couldn't load subscription status.
- Fork 4.2k
Description
In networking, It's fairly common to synchronize some pieces of game state. Currently, almost all networking solutions use their own HashMap or other indirection to map entity IDs between a client and server. While this solution generally works, it adds an unnecessary layer of complexity and makes it harder to reason about networked logic.
I am proposing extending the bevy API to include a reserve_entities() method, or something to this effect. This would allow you to reserve a contiguous interval of entity IDs, and they would not be used by bevy. This would reduce indirection and complexity in writing networked games, and will likely have other non-networked benefits in other circumstances. The ability to have deterministic IDs is generally a useful pattern, and I think it has a lot of value in Bevy.
In the coming days I will begin working on a naive approach just to get some feedback, but I would love to hear other thoughts in the meantime.