Vampire Survivors

Vampire Survivors

View Stats:
Collision detection: What type of space partitioning?
Can any of you guys make an educated guess on what type of space partitioning is used in Vampire Survivors? I've been wondering because there is a decent amount of stuff on the screen when you get to a certain point.
< >
Showing 1-5 of 5 comments
Marfig Jun 15, 2022 @ 8:25am 
I'm no expert by all means, but I doubt any sort of advanced space partitioning is being used, since anything more advanced than plain-ol' bounding boxes would put a burden on the game loop -- and VS already suffers from being a single-core process.
Originally posted by Marfig:
I'm no expert by all means, but I doubt any sort of advanced space partitioning is being used, since anything more advanced than plain-ol' bounding boxes would put a burden on the game loop -- and VS already suffers from being a single-core process.
I must surely underestimate the power of modern CPUs then.
Marfig Jun 15, 2022 @ 12:53pm 
For the life of me, I couldn't find where I read that Vampire Survivors doesn't do multithreading, or that it was limited. Must be my memory playing tricks. So, I fired up process explorer and took a look myself. It sure is multithreaded. Obviously! So scratch my dummass answer above.

But you asked for opinions, so here it goes...

There really isn't that much going on screen as it may appear. And the collision detection is further simplified by being 2D, with rectangular hitboxes (play with Concetta to see this), with axis-aligned hitboxes (entities never rotate), and what seems no monster-to-monster collision detection (except boss monsters).

So at the available game resolution, with the limited number of entities on-screen (including borders, objects, enemies, beams, and projectiles), and the simplified geometry of these entities, I'd think collision detection in VS can be easily handled without any space partitioning algorithm.

That said, if I were to hazard a guess as to what space partitioning method could benefit a game like this, I would say Sweep and Prune would be the most efficient, given what the current game requires. However, a dynamic uniform grid algorithm like the one in the link below would allow the developers to introduce collision detection between monsters with little to no impact on performance.

https://www.youtube.com/watch?v=ELUZ60zZJzM
Last edited by Marfig; Jun 15, 2022 @ 12:55pm
Astral Projection Jun 15, 2022 @ 8:05pm 
Its pretty easy to spatial partition 2D collisions. Any grid or hash based solution will have thousands of objects colliding super fast.
Thanks for the replies lads.
< >
Showing 1-5 of 5 comments
Per page: 1530 50

Date Posted: Jun 15, 2022 @ 8:11am
Posts: 5