Search Unity

Should I be using the Physics engine?

Discussion in 'Physics' started by phoekiel, Dec 26, 2014.

  1. phoekiel

    phoekiel

    Joined:
    Oct 20, 2012
    Posts:
    51
    Hi! I have been reading a lot of material recently about good game making practices and the following question came to my mind: when should I use the built-in physics engine?

    Some people argue for platformers, using the physics engine is not necessary and it even makes the game unreliable (since physics calculations depend on the machine's power and can sometimes behaved in unexpected ways). Others argue that it is the best way to deal with collision detection and stuff like that since the algorithms are optimized and should work on a variety of different systems.

    This questions arises from a project I am currently working on. I wanna make a platformer like Megaman X, Strider or Dustforce. Should I use the physics engine to handle player-walls, player-objects and player-projectiles collisions? I am also thinking about adding some networking multiplayer. Is that going to be a problem?

    Thank you so much for your time.
     
  2. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    For a megaman x style game you could really completely fake it with just basic "gravity" added to y velocity when not "grounded" and a slightly lower gravity effect when wall sliding, plus push back when hit by weapon/attack and such. Plus not using physics could provide a performance boost, allowing more detailed stuff going on in the game itself - which is an important hand off! Networking would benefit from not using physics for the same reason, less overhead from built in stuff means more power for YOUR stuff, your scripting and graphics get more elbow room.

    I would say it is best to use the built in physics when you really absolutely require a physically active object. Maybe like a bunch of balls rolling down a hill, or car collisions and stuff like that. But if the situation could be easily faked (by faked I mean not physics driven by the built in physics) and look good, then go for that to save on resources to apply towards other parts of the project being more detailed (like perhaps instead of physics you could code a complex bit that handles a whole pile of upgrade-able suit options and weapons and remind players of the good old MMX days :D )
     
  3. greenLantern101

    greenLantern101

    Joined:
    Jan 1, 2015
    Posts:
    31
    I think something like https://www.assetstore.unity3d.com/en/#!/content/11228 will suffice. If you have interactions that are too complex to handle any other way (for example, 20 boxes in a container, or a a wierd polygon shape) then you should use the physics engine to be accurate.