Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

You can walk through pillars #9

Open
nevzheng opened this issue Feb 28, 2017 · 4 comments
Open

You can walk through pillars #9

nevzheng opened this issue Feb 28, 2017 · 4 comments

Comments

@nevzheng
Copy link

Not sure if you knew or not, but you can walk and shoot through pillars. maybe you didnt implement that yet

@evanbowman
Copy link
Owner

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.

@nevzheng
Copy link
Author

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

@evanbowman
Copy link
Owner

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.

@evanbowman
Copy link
Owner

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants