Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[RELEASED] uPhysics & uPhysicsPro

Discussion in 'Assets and Asset Store' started by Sharp-Development, Nov 14, 2013.

  1. Sharp-Development

    Sharp-Development

    Joined:
    Nov 14, 2013
    Posts:
    353
    I've so felt the same way! :p

    Using Unity terrain with uPhysics aint a problem. Technically, terrain mesh and terrain collider are two different things. uPhysics just uses the terrain to generate the collider so there wont be a problem to use it for you. ;)

    Ah yea! Now I understood. However, this can already be solved by using multiple rays OR a simple shape cast. Infact a shapecast will do the same thing as a simple cylinder collider but being cheaper in most cases. However, I will make sure and implement all three types so everyone should be satisfied.

    Thats another topic I should really focus on. With the standard WheelCollider implementation you normally dont get this behaviour. However, Im sure I'll be able to integrate a constraint setup for WheelColliders, either thightly integrated into it or as a general component based setup procedure. However, this might need a bit more time since it'll need me to integrate Featherstone with the current solver. Featherstone is definitely on my roadmap especially since its aswell required for proper rope physics (incoming aswell) but im not yet sure if it'll make it into v2.2.

    Cheers!
     
  2. mcmorry

    mcmorry

    Joined:
    Dec 2, 2012
    Posts:
    581
    Yes is exactly what I mean. Thanks for clarifying :)
    As @Sharp Development says, probably the Cylinder colliders could what is needed in this case. The grip and the traction should come from any contact points on the collider.
     
  3. fenglin

    fenglin

    Joined:
    Feb 25, 2014
    Posts:
    3
    It is possible to provide a preview version? We really need TriMesh and Multi simulation :)
     
  4. DeepMotionPhysics

    DeepMotionPhysics

    Joined:
    Jul 31, 2014
    Posts:
    243
    Well said. I just feel it's hard to make raycast / shape-cast solution generic because it's essentially encode the physical modeling of wheels and suspensions into a pre-made equation instead of exposing the construction to the modeler/designer. When it works it works perfect though. It's the custom scenario like the following that can be challenging for ray-cast.



    P.S. Really like your movement optimization using spatial hash and transform load balancing. It makes great sense for massive script controlled motion like thousands of mobs in MMORPG

    A.P.

     
  5. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Okay, mid June has come and gone, and after some longer break from my game project I am back to tackle the whole physics mess again...

    Any news on the availability of uPhysics 2.2? What is in the release, what will be postponed?

    Didn't checked the Store yet so sorry if it has been released and I am asking stupid questions here, but no update in this thread since may make it unlikely that something was sent to the asset store yet.
     
  6. Al-

    Al-

    Joined:
    Jun 5, 2015
    Posts:
    25
    No update since August 2014. Is this Asset abandoned?. Publisher's website is unavailable too
     
    Last edited: Jul 8, 2015
    emergki likes this.
  7. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    As of May 2015, Publisher was commiting to making the next update available end of June 2015. No post in this thread though since then... I will have to check if the version 2.2 is available yet in the asset store.
     
    Al- likes this.
  8. Sharp-Development

    Sharp-Development

    Joined:
    Nov 14, 2013
    Posts:
    353
    Hello there,

    Its been getting quiet silent around uPhysics the last couple of weeks. The release is still on its way and actively developed. We've lately faced some troubles with certain implementations and had to put a bit more man hours into it then expected. This is aswell based on the sheer content included in the in the next release.

    Besides that we aswell have to maintain some other projects, so im sorry if we couldnt stick to the announced ETA. We arent good at doing proper ETA's either way. :p
     
    jason-fisher and Al- like this.
  9. Al-

    Al-

    Joined:
    Jun 5, 2015
    Posts:
    25
    Thanks for your reply, Sharp Dev. Expectantly waiting for the new release
     
  10. scone

    scone

    Joined:
    May 21, 2008
    Posts:
    244
    Hi there, I got uPhysics when it was on Level11, and I have the perfect use case for it! I'm making a game for Google Glass that involves shooting lots of robots as they fly around you. I found that I can almost double the amount of robots if I use uPhysics, and even better--I was stuck using constant velocity/angular velocity and some clever parenting in PhysX. In uPhysics I can write code to do the locomotion and it still runs fast!

    However, I ran into a problem when I tried to implement my shooter. I was just using Physics.Raycast, but I notice that you're still working on your own raycast function. My first attempt was just to put a long skinny trigger sticking out of my camera, but that doesn't seem to work. I currently have a situation where it sort of works if I put colliders on my laser "bullets" but this doesn't actually work on Glass, I'm assuming due to performance reasons. Even on desktop, it's super messed up because the colliders bump each other around.

    I would prefer to use trigger logic, but I get the impression that the collision detection isn't as precise? If I just try switching my robots and bullets to triggers, I just don't see any collision events.

    I've reached out to the developer via e-mail but haven't heard back. There's no huge rush on this, but I'd like to be able to switch over to uPhysics because I've always been a little bit disappointed by the number of bots I can get away with and the fact that using FixedUpdate (as opposed to a fixed velocity) really killed performance.
     
  11. Sharp-Development

    Sharp-Development

    Joined:
    Nov 14, 2013
    Posts:
    353
    Hello there,

    I infact catched your mail but didnt came around to answer you yet. Sorry for that! :/

    Raycasting is currently under development. Its already working in the upcoming release.
    My best advice for now would be to set the bullet as a trigger, so as soon as it enters the robots collider, it will fire events. Depending on how fast your bullets are, you may need to attach a rigidbody to it and set it to continuous so it doesnt just fly throught. Using actual colliders for this might get a bit critical due to the physical reaction the bullet might have on the robots collider.

    The collision detection itself is precise enough to handle such cases. However, there are two different modes uPhysics operates. (And not just uPhysics as a matter of fact)
    1) Discrete collision detection which does just a simple overlap test per frame. This will obviously cause fast traveling objects to just tunnel throught others. This is the default mode for none rigidbody colliders.
    2) CCD ( Continuous collison detection ), this does actual TOI ( time of impact ) calculations and adjusts the velocity depending on it. In other words, when using this mode tunneling cannot happen. This mode has to be manually set by turning it on in the rigidbody settings.

    Now, tho, im not quiet sure anymore if the current available version did use CCD for rigidbody triggers aswell or if it was exclusively used for colliders. Gotta check that. Another thing you aswell would want to check is the trigger mode used. Set it to Bounds -> Bounds so its catched as soon as the bounds overlap.

    Annnddd another thing, you can have multiple colliders of any kind on the same object. So having a collider AND a trigger on your robots would be perfectly fine. ;)
     
  12. scone

    scone

    Joined:
    May 21, 2008
    Posts:
    244
    Hi there,

    Thanks for the response, and no worries about missing the e-mail. My solution at this point is just to loop through the list of robots and call the RayIntersectsSphere function on each collider. My guess is that this can be optimized, since we only care about one quandrant. I'd love to hear your thoughts on how to optimize this.

    It was kind of chaos up until this point, so it's difficult to say what I tried along the way, but nothing with triggers ever worked. I'd rather not use triggers on the bullets because I don't care about if the bullet hits the target--I just want it to destroy the robot if it's in the reticule when you pull the trigger.

    Is it possible that the simulation was "lagging behind" and thus missing the trigger events? For some reason everything went to hell when I tried adding rigidbodies. The robots would just kind of get stuck and shake somewhere near the origin. I can't say I've tried everything--but certainly close to it. I've also started tracing around the source code and trying to figure out why the events weren't firing. I kind of gave up there because this is a side project and I'm trying to be careful about spending too much time.

    I know that this is an imposition, but do you think it would be possible for us to work together someday to try and debug all of this? Maybe it's easier if I just give you access to my project sources? It's not a very large project, and I can give you credentials to pull the git repo in a private message. Please feel free to say no, since I know this is a big ask. Glass is an extremely resource-limited environment, so any advice you have about optimizing the game further would be hugely appreciated. It's been a very interesting project--turns out that it runs a lot faster without graphics batching, for example. That was a surprise!

    Thanks again for your response, and for putting this together!
     
  13. Sharp-Development

    Sharp-Development

    Joined:
    Nov 14, 2013
    Posts:
    353
    Hello there,

    Optimizing it is quiet simple. Apply a trigger which catches all surrounding robots in y range. To now check, you simply have to iterate over the robots in range. ;)

    As of debugging this, im all in! Tho, this really has to wait after the next version update. Im kinda sure thought, the problems you experience will pretty much solve up with it. If not, its something we can surely look into. :)
     
  14. scone

    scone

    Joined:
    May 21, 2008
    Posts:
    244
    Hey man. Actually they're all in range all the time by nature of the game design. PM me with your details and I'll get you access to the code repo so you can see what's going on, and we can start our own thread.
     
  15. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,296
    I'm thinking to test it. Do you think it will work in a 1000km envirement? One terrain 2 object movement
    Or i need to limited , reset , move terrain etc. I'm new and i'm trying to make a airplane simulator.
     
  16. gian-reto-alig

    gian-reto-alig

    Joined:
    Apr 30, 2013
    Posts:
    756
    Any chance to get an update about uPhysics 2.2?
    Can you already give an ETA, or is development still ongoing?

    Sorry to bother you times and times again, and thanks in advance....
     
  17. mlbspike

    mlbspike

    Joined:
    Sep 3, 2014
    Posts:
    1
    Will a purchase of the current version include free upgrade to the 2.2 version? Wish I could see the docs, the manual seems to be more of a technical design discussion ... Interesting, but offering minimal insight into ease of use.
     
  18. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    319
    Very interested to buy this gem. Any news on the update, since the last update is Aug 06, 2014? Btw, sorry if this was asked before, how is the performance of uPhysics 2.2 vs. Unity current Physics? Many thanks.
     
  19. Riddhesh

    Riddhesh

    Joined:
    Jan 5, 2015
    Posts:
    4
    Looks cool, an extended version of Physics in Unity,
    Will this asset work on Multiplayer too?I am having the problem of different physics calculations on different OS with current unity physics?? Will this asset help me to solve the problem??
     
  20. jrhtcg

    jrhtcg

    Joined:
    Jul 13, 2013
    Posts:
    34
    I am working on a game that will have dynamic content and will allow the player to build Rube Goldberg machines. Here is a link to a video (video) that shows a bug I am having with PhysX. The video is of an UNREAL project but the bug is the same in Unity. I would prefer to work in Unity and I am looking for a solution.

    The video shows a sphere that is launched along a surface made up of many different objects that have been lined up to look like a single flat surface. When PhysX sees the seem between the two objects it gets confused and sometimes causes the object to bounce even though the surface is flat. I also have a player character that uses joints to link a body to a single sphere where the sphere acts like a wheel and the body stays in sync using a compound joint. It works pretty well until it hits the seem and then all hell breaks lose.

    My question is do you think your new version will be able to provide that functionality or should I look else where?
     
  21. fbbgo

    fbbgo

    Joined:
    Oct 14, 2014
    Posts:
    20
    where is new version, you said will upgrade last year.
    pls work hard.
     
  22. Techgeek1

    Techgeek1

    Joined:
    Dec 3, 2014
    Posts:
    3
    Hey Sharp,

    Any idea when you will release the new version? Also how well does the current version work in Unity 5 and how difficult would it be to extend the system? Like adding swept AABB collision against a procedural mesh (if it's not already implemented). I would love to integrate this asset into a project my team is working on. Especially the load balancing (^^).
     
    cl9 likes this.
  23. sygaki786

    sygaki786

    Joined:
    Jan 26, 2014
    Posts:
    142
    Will this physics package help developing a ball/bowling game where the materials will change allowing for a variety of interactions? So I would need more than the basic physics materials that come with Unity 5.
     
  24. koenigstiger

    koenigstiger

    Joined:
    Nov 13, 2015
    Posts:
    1
    Any update? Even if the update is that no new version will ever come out, it would be great to know.

    Thanks!
     
  25. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    319
  26. IO-Fox

    IO-Fox

    Joined:
    Jul 14, 2014
    Posts:
    86
    @ikemen_blueD I'm trying to get in touch with him. He doesn't respond to PMs. I don't think this asset is supported. People have been requesting videos and/or a demo since 2014 - including the request for benchmarks to back up claims. There's only been a single review of the asset, so this developer makes it rather difficult to make a purchase when there's no documentation, video(s), demo, or simple timely responses to important questions. I'm staying away.
     
    CarterG81 likes this.
  27. fbbgo

    fbbgo

    Joined:
    Oct 14, 2014
    Posts:
    20
    I wrote a review but deleted by others:mad:
     
  28. david55527

    david55527

    Joined:
    Mar 24, 2013
    Posts:
    58
    I purchased this yesterday, so I thought I'd leave a review since there's a noticeable lack of them in this thread.

    I asked for a webplayer demo comparing uPhysics and PhysX waaay back on the first page, about 3.5 years ago. @Sharp Development never provided one, or even a benchmark video, which is a shame because uPhysics is amazing.

    I was a little iffy on purchasing it. Not many reviews, no benchmarks, very little useful documentation, and no active support from what I could see. I wasn't even sure if I'd be able to get it working. But Unity's PhysX implementation is pretty terrible when dealing with thousands of objects, and I don't have the time nor the physics knowledge to write my own physics system.

    To my surprise, it wasn't hard at all to use. There's an example scene that shows you the basics, including how to set up the scene to use uPhysics and some basic syntax. Changing position and rotation of objects is the same, except using the uPTransform component instead of the standard transform component. Trigger and collider events use OnTrigger and OnCollision, so that's pretty similar as well. I had to do a little digging to figure out how to handle movement with Rigidbodies. You can't directly set their position apparently, but you can do things like _rigidbody._force or _rigidbody._linearVelocity.

    I played around with rigidbody physics and they seemed a little wonky. Perhaps I was doing something wrong, but if you need accurate rigidbody physics I'd stick with PhysX.

    As far as performance, with PhysX I was able to get around 4,000 sphere triggers moving at once. Any higher and Unity came grinding to a halt. With uPhysics, I was able to get 35,000 sphere triggers moving at once while maintaining a steady 500 FPS. That's an incredible performance difference.

    With all that said, I'd absolutely recommend uPhysics if you need to move thousands of objects around with basic collision detection - an example use case, and exactly what uPhysics was made for, is an MMO server. You need to update thousands of players and monster's locations at once and you just can't do this with PhysX.

    If on the other hand, you need accurate rigidbody physics and to have everything bounce off and react as it should, maybe for something like Rocket League, stick with PhysX.

    If anyone has any further questions about uPhysics I'll try to answer them. I'm hoping that @Sharp Development continues developing it and writes up some proper documentation because this is one of the most impressive assets I've purchased.
     
    jason-fisher and CarterG81 like this.
  29. electric_jesus

    electric_jesus

    Joined:
    Mar 8, 2015
    Posts:
    32
    @david55527 Hi!
    Is there a solution for ropes in uPhysics?
     
  30. CarterG81

    CarterG81

    Joined:
    Jul 25, 2013
    Posts:
    1,772
    6 months later, does this review still hold?

    How has uPhysics treated you since?

    I was contemplating rolling my own physics to replace Unity's implementation if I run into performance issues (server loading thousands of objects in a huge multiplayer world), but the performance reports on this seem absolutely amazing.

    But the last update was Aug 2014... and I have a strong aversion to "dead assets".
     
    jason-fisher likes this.
  31. david55527

    david55527

    Joined:
    Mar 24, 2013
    Posts:
    58
    No, there isn't.

    Well - sort of. The numbers in that review are a little skewed. uPhysics has a load balancer that lets you specify how often to update transforms. The review was done with that set to 0.1 seconds, which for a lot of cases is too high unless your game is rather slow paced.

    I ran performance tests again after Unity 5.5 was released. 5.5 came with an update to PhysX 3.3 which, I think, helped a bit. If you compare the physics themselves, PhysX is still slower but not by a large margin.

    I also found that uPhysics had some pretty bad issues - for example destroying an object with a uPCollider on it while it's colliding with something else (for example, a player disconnecting while being hit by a projectile, or destroying projectiles on hit instead of object pooling them) would completely break uPhysics. All of this can be worked around but it makes me question how stable the physics module would be in a production environment.

    Where uPhysics still shines, though, is updating transforms. Unity absolutely struggles here but uPhysics has no problems moving thousands of transforms at once.

    What I've ended up doing is just using uPhysics to update transforms and let PhysX do the physics. The performance is almost as good as using uPhysics for everything, and you won't suffer from some of the nasty issues.

    As far as performance using this method, I was seeing around 200+ FPS updating the transforms of 10,000 objects every 0.02 seconds on my old AMD Phenom II - so in my opinion still quite good.

    With that said, if you decide to roll your own solution let me know ;) I do think there's still room for improvement here, but for now it's good enough for me.
     
    Last edited: Dec 17, 2016
  32. jason-fisher

    jason-fisher

    Joined:
    Mar 19, 2014
    Posts:
    133
    Thanks for the updated review. I purchased this a while back but haven't gotten to the point of needing to implement yet .. and have already moved on to 5.5. My use case is the orbit and rotation of planets and asteroids that have NPCs roaming around on them and it sounds like this is still applicable.. but is it the best solution?
     
    CarterG81 likes this.
  33. CarterG81

    CarterG81

    Joined:
    Jul 25, 2013
    Posts:
    1,772
    Thanks for this. I was especially curious since the PhysX update.

    Now, when you say "update transforms", what do you mean exactly? Every method that deals with Transforms, or does PhysX actually move the gameobjects independent of Unity's transform implementation? I thought Unity's transform component was required & thus couldn't be replaced? (If uPhysics does all the math and THEN sets the Unity transform, then I understand.)

    Otherwise, do you know any of how this is done in uPhysics? Is this explained in detail in the documentation?

    I doubt I will roll my own Physics system beyond anything other than simply updating transforms or basic collision. My game doesn't require very much physics at all. However, I do have an enormous number of objects with very simple collision detection.

    Most never move though, so even so- I may not see any real benefit from uPhysics or time spent rolling my own.

    Thanks again! :)
     
  34. CarterG81

    CarterG81

    Joined:
    Jul 25, 2013
    Posts:
    1,772
    I had a lot of trouble finding any other solution. The Asset Store doesn't seem to be hopping with replacement Physics frameworks... Although maybe others exist and I simply couldn't find them because they're advertised poorly? uPhysics is the only one I even found.
     
  35. david55527

    david55527

    Joined:
    Mar 24, 2013
    Posts:
    58
    I wouldn't bother with it, unless you have thousands of asteroids and NPCs that need to be moving at once.

    From the documentation:

     
  36. Sharp-Development

    Sharp-Development

    Joined:
    Nov 14, 2013
    Posts:
    353
    Sorry if im not really able to maintain this asset but maybe I can clarify how the transforms work. Its basically a seperated component, the uPTransform, which is, like described above, a copy of the original unity transform. However, it doesnt imply some of the nasty things the unity transform comes with.

    Unity transforms always recreate the world matrix on each call to position/rotation/scale. In detail this means that the hierarchy is traversed untill the root is reached and all local positions/rotations/scales are "summed" together. For deep hierarchies this is super cost inefficient. This applies to reading the property but aswell to writing it. If you want to SET the global position, this means you first need to calculate the current global position in order to calculate the new local position.
    uPhysics gets around all this by:
    a) Caching the actual world properties. A world property only gets recalculated if the local property of this or any object of its hierachy changed.
    b) Recalculation of world properties can be threaded.
    c) uPhysics only sets local properties of a unity transform, means it doesnt require the unity transform to do any math.

    All this gets used by the LoadBalancer, which effectively defers all calls to unitys transform component onto multiple frames.

    So yea, uPhysics doesnt replace unity transforms, those are indeed required. However, it does all the math and only feeds results to the unity transforms later on in a performant fashion.
     
    electric_jesus likes this.
  37. jason-fisher

    jason-fisher

    Joined:
    Mar 19, 2014
    Posts:
    133
    Yes -- basically, client/server multiplayer and spatial octrees holding many voxel planet/asteroid octrees, with enclaves on planets/asteroids being built/managed by 'architect' AIs.. so really trying to not rely on PhysX except for local player interaction.
     
  38. nbg_yalta

    nbg_yalta

    Joined:
    Oct 3, 2012
    Posts:
    369
    Hi, are are you still working on this? Will I be able to make bullets ricochets locally synced on clients over network with this package? And what about raycasting?
     
  39. IO-Fox

    IO-Fox

    Joined:
    Jul 14, 2014
    Posts:
    86
    This project is abandoned.

    Purchase at your own risk.
     
    MNNoxMortem likes this.
unityunity