I've been thinking about methods of maintaining objects in a game. Currently I'm thinking of using a Manager for each system, Physics, AI and Graphics. Each are independent of each other and cutting out the Physic's part won't break the game, just cause things not to fall by gravity. How would someone recommend going about doing things like this? I've been thinking about it for a while, but can't come up with a feasible method.
Below are the reasons why how I'm thinking of having it work will not work.
This is my problem though, because I'm trying to have the data stored in RAM sequentially, so instead of storing a structure containing the position and velocity next to each other in ram. have all positions so be placed next to each other in ram and all velocities to be stored next to each other. Nice large chunks. This brings up my problem of What if you remove a entity? There's now a unused space inside the chunk of memory. I don't want to use any if statements to check if the ram is used or unused and skip over that block, because this would cause a stall in the CPU, one stall on every entity adds up.
Another issue would be what if an entity isn't affected by Physics or doesn't have any Positions, would I just leave the memory blank? but this would cause the same issue as before. The only real solution I can fabricate is having a another chunk of Bitfeilds to tell each system about the entity and what it actually contains. I can see it working, but that will still use a if statement to check if each entity will run it's stuff.