#Cost of thousands of primitive 2d box colliders

1 messages · Page 1 of 1 (latest)

split pivot
#

Hello!

I was recently working on a game jam game and I am thinking about taking it further but I have some concerns with cost of performance.

For some context it's a mining game and features hundreds to thousands of 2d box colliders (not featuring rigid bodies) that are generated at runtime to create the level.

I have some concerns about that being really expensive for more complicated levels and game design later down the road.

Some ideas I would have to combat this would be a form of greedy meshing or combining the colliders into one dynamically.

My real question here is this something I should be really worrying myself about as doing a bit of research I see people mentioning it being fine but it just feels wrong to have 45k+ verts on a level for something pretty simple.

Not asking for attention or reviews of my game for the game jam, just here for context incase anyone needed to visualize what I was talking about: https://byteoracle.itch.io/repete-miner

itch.io

Upgrade Pete and His tools to beat the timer and escape the mine.

digital badger
#

If your tiles are being stored in a matrix where you are aware of which tile the player is in you could potentially have a collider for each direction that shifts based on where the player is

#

and you can use code based logic to determine which tile the collider represents

split pivot
#

Hmm that’s a really smart idea I didn’t think of

digital badger
#

This does have potential downsides eg. things outside of the context of the player such as the bomb or some kind of enemies would need considerations

#

But in general I think that amount of colliders is mostly fine though

#

colliders are built to not do too much when nothing is going on with them

#

but that's a route you could take if you want to do so

#

nice juice on the tile breaking btw 😄

split pivot
split pivot
#

I’m gonna have to rebuild the game for what I’m wanting to do because game jam codebase 😆

digital badger
#

It really won't matter I don't think. This would purely be something you'd wanna do if you are interested in learning/playing with this kind of problem to solve

split pivot
#

I think a big part of it is the desire of wanting to do something “right”. I have that perfectionist itch in me when I see an issue like this

#

100% one of my biggest roadblocks though 😆

#

Anyways thank you for the feedback on it all! It gives me a couple of avenues to check and work on when I’m rebuilding the code in a new project

digital badger
#

Totally relatable and normal feeling!

Just a random strangers two cents but with this one in particular the perfect way would probably end up be some form of calculating it yourself which is a whole mess :P. You'll probably get more gains trying to improve other aspects of the project.