wallstop/DxGame

New physics engine?

Opened this issue · 3 comments

Vatyx commented

Do we need a new one?
What would be needed?

┆Issue is synchronized with this Asana task

Physics Engines!

Currently we are using Farseer which is a full C# port and upgrade of Box2D

Off the shelf physics engines work great for real-world physics-based simulations. Our game, however, is not one of them. In order to get precise, non-realistic movement patterns out of a physics engine, such as only moving while left is pressed, a bunch of hackery has to be done with sensors and negation forces, which need a ton of tweaking and are susceptible to bugs.

Pros:

  • Great collision detection
  • Realistic force application amongst objects

Cons:

  • Lots of hacks to get movement "tight"
  • Bugs / engine limitations

What we really want is some kind of engine that performs excellent collision detection, collision resolution, and handles forces in such a way that enables really responsive controls and movement patterns. I should be able to move back and forth extremely fast while jumping, for example.

We had a system that satisfied the above critieria, but was buggy and hard to reason about due to implementation reasons.

Recap: Using a third party engine solves the problems of buggy collision and easily applicable physics forces, but introduces a bunch of pains in the realm of movement controls and super precise collision resolution.

It would be sweet to have a tile-based "physics" engine that took into account the tile-based nature of the game for map/static objects, and presented an extremely easy to reason about force system, while maintaining strong collision detection & resolution.

Farseer can be drawn off of for inspiration. Currently, we're using three different implementations of spatial trees for a variety of things inside the engine. Specifically, a KDTree, RTree with STR loading, and a QuadTree. All implementations currently do not support re-balancing - they need to be rebuilt from scratch every frame. Augmenting these and outlining a framework similar to Farseer's Body & Fixture system would be a good place to start.

Necessary:

  • Collision detection (can be done with spatial querying)
  • Collision resolution
  • Forces (tied into collision resolution, ideally)
  • Simple shape support - we only really need Rectangles, it would be able to include circles. We don't need arbitrary polys/triangles/etc

Resources:
DxCore Spatial trees
http://gamedev.stackexchange.com/questions/5906/collision-resolution
http://www.defold.com/tutorials/platformer/

Physics Engines!

Currently we are using Farseer which is a full C# port and upgrade of Box2D

Off the shelf physics engines work great for real-world physics-based simulations. Our game, however, is not one of them. In order to get precise, non-realistic movement patterns out of a physics engine, such as only moving while left is pressed, a bunch of hackery has to be done with sensors and negation forces, which need a ton of tweaking and are susceptible to bugs.

Pros:

  • Great collision detection
  • Realistic force application amongst objects

Cons:

  • Lots of hacks to get movement "tight"
  • Bugs / engine limitations

What we really want is some kind of engine that performs excellent collision detection, collision resolution, and handles forces in such a way that enables really responsive controls and movement patterns. I should be able to move back and forth extremely fast while jumping, for example.

We had a system that satisfied the above critieria, but was buggy and hard to reason about due to implementation reasons.

[--- Commented from Asana.com
#commenter Eli Pinkerton
---[aa]