Instead of putting things into entities and components, I had accidentally created a big shared resource (see the specs crate docs) which was housing a ton of my game's state. /2
-
-
Show this thread
-
It got to the point where I only ever had like one entity in the entire ECS for the player itself. I thought I would have more later for enemies and stuff, but when it came time to add them, various factors led me to put them into the monolithic resource I mentioned earlier. /3
Show this thread -
This is when I had my realization. Instead of putting enough things inside the ECS, I've basically been using the specs resources feature as global mutable state. You certainly don't have to put everything in your ECS, but if you're putting nothing into it, that's a problem. /4
Show this thread -
Other symptoms of this I probably should have noticed sooner: - special cases everywhere to pull from both the ECS and the monolithic resource - the resource being needed in every single system (almost always mutably) - more and more state being added to this resource /5
Show this thread -
Hopefully someone can learn from my mistakes and use their ECS more effectively.
I'm thankful to be writing Rust and using such amazing libraries (shout out to the specs crate) so refactoring my code will be pretty easy.
Glad I came to my senses before it was too late! /6Show this thread
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.