wallstop / DxGame

1 stars 0 forks source link

New physics engine? #2

Open Vatyx opened 8 years ago

Vatyx commented 8 years ago

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

┆Issue is synchronized with this Asana task

wallstop commented 8 years ago

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:

Cons:

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.

wallstop commented 8 years ago

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:

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

wallstop commented 8 years ago

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:

Cons:

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]