3 ms·
>If you want to make a simple game like this, just sit down and program it in the obvious way. It will work. I have heard that the restrictions imposed by the
by whatshisface 8y ago
>If you want to make a simple game like this, just sit down and program it in the obvious way. It will work.
I have heard that the restrictions imposed by the Rust compiler make it surprisingly hard to get it working the normal way. The first time I heard of ECS was in a Rust talk about how it helped them stop fighting the borrow checker.
- Impossible 8y agoFor a simple game it seems like you could get away with vectors of mutable structs. This looks like ECS where one entity has a single component and there are only a few systems that update them (update, draw). For simple games you can do the old-school arcade style model with memory allocated upfront for everything (giant mutable gamestate struct) which was called out as not scalable in the talk but it worked for countless classic console and arcade games and scales all the way to Call of Duty. Another option is to avoid mutation and go for a functional style where you return a new game state struct after update (drawing probably shouldn't need to mutate), which might not scale for large games but is completely reasonable for small games without much state.
- nine_k 8y agoI suppose you can have a giant game state and return a new immutable copy on every frame if the amount of change is small, and you reuse most of the unchanged state.
- deleted 8y ago[deleted]
- Manishearth 8y ago> hard to get it working the normal way This is mostly for complex games, otherwise for simple stuff there are ways to get it working.