#GameDevConfessional
Early on I found that if multiple objects move in a line at the same time there might be a tick where two objects try to occupy the same grid tile in the grid management logic. This was causing bugs. I made it so that only 1 grid actor can occupy a tile...
Early on I found that if multiple objects move in a line at the same time there might be a tick where two objects try to occupy the same grid tile in the grid management logic. This was causing bugs. I made it so that only 1 grid actor can occupy a tile...
at a time. But then sometimes an object would override the location of another object while they were both moving. Sometimes a grid actor might disappear from the grid manager and never get added back again. To fix this I wrote a function on the base class for all grid objects...
The function "TempHackEnsureGridMangerKnowsYou" runs on every tick on every grid actor. It just checks to see if it exists on the grid manager, and if it doesn't and there is nothing occupying the tile it is on it adds itself to the grid manager. This is the backbone for my game.