Search Unity

DPhysics: Deterministic 2D Physics Engine

Discussion in 'Works In Progress - Archive' started by jpthek9, Apr 1, 2015.

  1. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Hello UCommuntiy,
    I've been working on a cross-platform deterministic physics engine for an RTS game that requires synchronous simulation. It works with a simple call to DPhysicsManager.Simulate(). I've also designed it to be flexible, easy to use, and performance friendly (even moreso than Unity's 2D physics engine) so it's also a viable for use as a general purpose physics engine.

    As of now, the engine can simulate convex polygon and circle colliders. There is also a height factor for any 3D collision detection you need (i.e. 3D bullet hit detection or layer culling). When I find the time, I'll post a video showing all the features of the physics engine but here's an early look to spark your interest:





    And here's a webplayer demo: https://335865bf1d5bae177cbf905063566852267511b4.googledrive.com/host/0B0eYzcEYIV24bE0waGZZbXp2V3c.

    If you there are any features you really need for your game, feel free to ask and I'll do my best putting it into this package.

    Estimated Asset Store Arrival Date: Late May to early Summer Break
     
    Last edited: May 15, 2015
    xdd7777 likes this.
  2. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Currently, rotation is decided by the movement script or the object's velocity if no movement script is active; this was fine for RTS games but to target the physics engine at a broader range of genres, there needs to be torque. For more realistic simulations and greater control, torque'll and rotational velocity will be added.
     
  3. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
  4. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    The first Beta has been released. I'm looking forward to the new perspectives I can use to improve the physics engine.
     
  5. fryyyyy

    fryyyyy

    Joined:
    Jul 29, 2015
    Posts:
    1
    Hey, this looks very interesting for our current project. Have you thought about supporting realtime action games as well ?
     
  6. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
  7. KHRZ

    KHRZ

    Joined:
    Mar 2, 2013
    Posts:
    56
    It's for free?? I could totally pay some for the finished version...

    Also what is the final plan for path finding? I've found a pretty neat code example that includes many-to-one paths which allows for local avoidance of units, Boids-style.

    Demo at bottom of page: https://howtorts.github.io/2014/01/30/Flow-Fields-LOS.html

    I've studied quite a bit up on StarCraft II and it seems they do pretty much the same thing. So I am thinking of implementing it in C# eventually, unless someone else does it first;)
     
  8. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Lockstep Framework's 100% free :D. Monetizing it would've been too much effort so I figured I'd just release it to the public and try to profit by getting something on my resume.

    I'm not sure about flow field navigation but all the agents in LSF navigate individually which works fine. I don't plan on adding any new features for the time being to LSF, but I think boids are a very interesting topic and the link you posted has some great example code.
     
    theANMATOR2b likes this.
  9. xujiezhige

    xujiezhige

    Joined:
    Apr 7, 2015
    Posts:
    7
    I am searching a deterministic physics engine for a RST game I'm programming. But now you give wonderful one. Thanks for your hard working. You are the best.
     
    jpthek9 and theANMATOR2b like this.
  10. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Thanks! That means a lot to me :)
     
  11. ErebusWolf

    ErebusWolf

    Joined:
    Mar 18, 2015
    Posts:
    3
    This looks fantastic! I was making a Platformer fighter game in unity but I needed a way to do rollback/rollforward for network lag and the default physics in Unity doesn't provide it. With this and a bit of work I could get that working!