News for hackers. Stuff that matters.
Re:WebRTC: the future of web games by bemmu on Wednesday December 28, 2016 @01:25AM (#13268829)
What kind of collision detection do you use?

I was inspired by your games to try something similar for the latest Ludum Dare: http://www.bemmu.com/compo/ludum/37/index.html

At first I tried checking every creature for collisions against everything else, but unsurprisingly that was too slow (N^2). To reduce the checks I put each creature in a grid cell based on their position, then check for collisions only against creatures in the same or adjacent cells.

I think overlapping grids would be even more efficient, or perhaps to do these checks on GPU.

Re:WebRTC: the future of web games by efnx on Wednesday December 28, 2016 @02:14AM (#13268977)
Use a quadtree or similar structure for your broadphase detection, it will help right off the bat.