20FPS is ok, right?

I’ve made it so hazards can be attached to objects, e.g. a moving platform, or even an enemy.
I’ve added spawners” that can spawn different objects. Watching enemies popping out every few seconds is just funny.

However, I did start to see a drop from 60fps at around 80-100 collidable objects colliding. I’ll have to optimise my engine, as that’s not great at all. Although it’s not really affecting the CPU or memory much from what I can tell…
Right now every object uses the same collision checking as the player character, which is overkill. I’ll start with something more lightweight and iterate from there.
They’re also bouncing around a lot, which is funny to watch but not intended. This is when the foot position is too close to the edge of the thing it’s standing on (most objects just have collision points in a diamond shape at the moment). Got to fix that too.

Do enemies need collision with each other? It’s not really something you see in classic platformers. Although even if I turn that off, there’s the ground collision to check for, and when I upped it to over 300 enemies it wasn’t good. I thought about just using box collision for the enemies, but because of the uneven ground I can’t really do that. I’m going to have to experiment a bit.
I’ll only update/draw objects within a certain range of the player anyway, but I’d still really like to have good performance with this relatively small number of objects on the screen.


Date
February 13, 2022