1
\$\begingroup\$

I'm looking for high level implementation details, not specifics.

I've worked with bounding boxes before in some 2D games, but I'm currently tackling a "2D + depth" (2.5D?) style game along the lines of Double Dragon, Battletoads, TMNT: The Arcade Game, etc and I'm curious what a sensible collision system would be.

I think collisions between actual game objects is, for the most part, okay. I'm basically using a bounding box test that only executes if the objects' positions are within some depth threshold of each other. My real question is about collisions between floors and walls.

I want more freedom with the floors and walls than those older games listed as examples, so I've also put "mesh objects" into the game that are essentially just planes defined as combinations of triangles (simple floors also exist). The mesh objects can be static or dynamic (ie, floating platforms), and are built out of arbitrary points (ie, they are not always flat and parallel with the floor).

I can mathematically calculate collisions between objects and meshes, but I'm not sure how to go about calculating collisions between meshes themselves.

For example, how can I calculate whether two arbitrary triangles made of three arbitrary 3D points collide on a turn given position, speed, and acceleration vectors for each?

If this system sounds clumsy, I'm open to suggestions :)

\$\endgroup\$
  • \$\begingroup\$ See the FAQ about what type of questions to not ask. "Which technology to use" is one of them. There isn't a really large number of engines to choose from, go through them and match them up to your requirements. \$\endgroup\$ – MichaelHouse Apr 23 '13 at 14:11
  • \$\begingroup\$ I don't think this violates "What technology do I use", since I'm building a system from scratch to learn the ropes and I was curious about an underlying concept. Simply saying "use a pre-existing engine" doesn't really help, but thanks anyway. \$\endgroup\$ – Awesomania Apr 23 '13 at 15:59
  • \$\begingroup\$ "Can anyone recommend a collision engine"... You aren't asking for an pre-existing engine? \$\endgroup\$ – MichaelHouse Apr 23 '13 at 16:08
  • \$\begingroup\$ You are correct, this was a poorly phrased question title. I was really hoping for a solution to my problems in implementing the system as I had already imagined it, or alternatively an different "approach" to an engine design that I could implement myself for fun. Thanks. \$\endgroup\$ – Awesomania Apr 23 '13 at 19:16
  • \$\begingroup\$ I've edited the question slightly, perhaps that will be enough. Though I expect the answer is something along the lines of assume it's 3D and detect collisions that way, or assume it's 2D and detect collisions that way. \$\endgroup\$ – MichaelHouse Apr 23 '13 at 21:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.