-
Notifications
You must be signed in to change notification settings - Fork 16
You can walk through pillars #9
Comments
Yeah I haven't got around to fixing that, it's partly because I implemented collision checking in a very naive way, and now when I want to make something collide-able retrospectively it's a real pain. Ideally you do collision checking in a high level way where everything derives from a solid, you throw them all in a quad tree, and only check collisions with nearby things. As-is, the game checks all collisions regardless of distance, and each game object has to go through all the other game object types that it wants to check collisions with and does a bounding box collision with each one. This means that if I want to make something solid, I have to, go to each entity type (e.g. Player, bullet, Turret, wall, and like 20 others) and add a condition check. Now that I know better I can't justify doing all that, what I really need to do is sit down one afternoon and write out a binary space partitioning algorithm because the would simplify things. |
Thats interesting, I'll keep the quad tree collision in mind. So all objects would be derived from some sort of colliadable solid class, thrown in a tree and collisions are only checked at for close objects. Will keep in mind |
Or if adding a dependency isn't an issue there are libraries for this, Box2D (for 2D), BulletPhysics (for 3D). I'm trying to wrap up this project, so I might just add in Box2D and call it a day. |
I just remembered the real reason you can walk through pillars; my algorithm for determining where to put a pillar doesn't prevent the game from placing them at choke points, thus making regions of the map inaccessible. Guess I could make them destructible. |
Not sure if you knew or not, but you can walk and shoot through pillars. maybe you didnt implement that yet
The text was updated successfully, but these errors were encountered: