Announcement

Collapse
No announcement yet.

Great but...please a double precison solution

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by Syed View Post
    Converting everything to double (if it is even possible) will not work, as physx is using float (32 bit) internally.
    Good then, than PhysX is on the way out and be replaced by Chaos.

    Originally posted by BrUnO XaVIeR View Post
    Blueprints have enforced smaller floating point range on input fields.
    You don't need doubles, you just have to use C++.
    3D coordinate system in double precision is generally a bad idea, GPUs would take 4x more time to run the math instead of increasing performance.
    You can render only using camera space transliting all world coordinates to reltively to camera.

    Doubles for World Cordinates aka spatial seraching (traces, sweeps), won't make any noticeable performance difference on PC or consoles (next gen at least).
    Last edited by iniside; 12-30-2019, 06:40 PM.
    https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

    Comment


      #17
      Yeah people on the webs also say things like that...
      And websites are running slower and slower even though today's hardware is over 100x faster than when they adopted that mentality
      | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

      Comment


        #18
        Originally posted by oniregoc View Post
        So let's upgrade physix to double...CPU now can handle this isn't it ?! For me the only actual solution is to go C++ which is not "artist oriented" ...but as indie...no choice
        Handle it? Yes. Handle it efficiently? No.

        Most SIMD lanes on CPUs are still 128 bits wide. So, you either get 2x64 values (e.g., doubles), or 4x32 values (e.g., floats) per operation. That means you require twice as many mathematical OPs to do the same thing in float. As well as missing out on various 4 lane tricks.
        Able Ability System - A high performance, robust ability system for UE4. Now Available!

        Comment


          #19
          Originally posted by Syed View Post
          Converting everything to double (if it is even possible) will not work, as physx is using float (32 bit) internally.
          PhysX can be compiled to use 64 bit precision.

          Comment


            #20
            Originally posted by ambershee View Post

            PhysX can be compiled to use 64 bit precision.
            PhysX 2 it was matter of changing single typedef (FReal).

            in PhysX 3 it is much more complicated. PhysX 4 assumes floats in many places.
            https://github.com/iniside/ActionRPGGame - Action RPG Starter kit. Work in Progress. You can use it in whatever way you wish.

            Comment


              #21
              Relying on wheter something is 4.669256687 or 4.669257164 isn't the best idea.
              Generally, the assumption that floating-point type represents exactly the number we want is dangerous.

              Comment


                #22
                I'm not sure why this thread went down into graphics land... he didn't really explain what he is trying to do.
                Maybe he is trying to do decimal operations in which case he could try to use this:

                https://github.com/BrUnOXaVIeRLeiTE/MoneytalksUE4
                | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                Comment


                  #23
                  I'll save the trouble of this thread now - Epic are never going to invest time into this. It was also confirmed by a core engine member many years ago (I'm not digging up the thread).

                  Take if from me, it's not as easy as just doing Find & Replace 'float' with 'double' - you also have to check *every* function accross the engine for .f and replace with .0, otherwise there are calculations still happening in float-precision all over the place and the doubles give you no benefit (I experienced exactly this when making my own space game). This is also why PhysX isn't as easy as changing a single define either - many of it's operations still natively work in floating point format.

                  I was working with solar-system scale numbers in Satellite Command and even I didn't need doubles accross the whole engine to make that game. The loss of precision comes from performing many operations between large and small numbers (e.g, multiplying the mass of a planet in KG against delta time) - You keep 95% of the precision by performing all movement and physics operations in your own code, then at the last minute send those values back to UE4. That was plenty good enough for me.

                  This is *really* simple - You create a double-precision math library and 'vector' type (DMath and DVector in my case) - then do all your movement code with those. You can pretty much 1-for-1 copy the existing engine classes for this and just ensure everything is using doubles. You then convert to an FVector and send that to the engine at the last moment. It's really simple.

                  I should also say - Even double-precision isn't enough to reliably use a 3D coordinate system of Solar-System scale anyway. It'll never be enough, Games like Kerbal etc. have layers of coordinate systems which work together, and you seamlessly move between them and change coordinate spaces. Once setup this is quite easy to maintain, but requires strict setup from the beginning.

                  If you're making a game like this, you have zero choice other than to learn and use C++.

                  C++ not being "indie" enough is a moot point, you will have to be prepared to get your hands dirty from time-to-time if your making something more ambitious. It's also really not that difficult to learn, and UE4 makes it easy for you. Blueprint is enough for "traditional" games and mechanics, it doesn't cut the mustard for something more advanced.
                  Last edited by TheJamsh; 01-04-2020, 09:27 AM.

                  Comment


                    #24
                    Originally posted by TheJamsh View Post
                    I'll save the trouble of this thread now - Epic are never going to invest time into this. It was also confirmed by a core engine member many years ago (I'm not digging up the thread).
                    Ah c'mon James, you know you want to help make the engine use doubles....... Of course I mean this James of course....

                    That card did not refer to 'origin rebasing' (which is already supporting) but actually changing the engine to use double precision for world positions. After doing some investigation, this just doesn't seem like the right thing for us to work on at the moment. It would be a HUGE amount of work (basically every FVector and FTransform could potentially change), and would probably make upgrading rather painful for users.
                    BTW:
                    Just to add, here's a recent thread with experiments on double precision. These two others have sadly faded off into extinction... Example1... Example2...
                    Last edited by UnrealEnterprise; 01-04-2020, 11:07 AM.
                    ----------------------------------------------------------------------------------------------------------
                    What are the BEST Unreal Tutorials / Docs? There are none tbh... Here's why
                    Instead its better to just take projects apart (see the free 'creators' listed here)

                    Comment


                      #25
                      Keep the player at 0,0,0
                      Move the world around it.

                      Problem solved.
                      * drops mic *
                      * makes gangsta pose *
                      | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                      Comment


                        #26
                        Originally posted by BrUnO XaVIeR View Post
                        Keep the player at 0,0,0
                        Move the world around it.

                        Problem solved.
                        * drops mic *
                        * makes gangsta pose *
                        And the COST of doing that in a scene with 10-30k actors / 3.4 million polygons?
                        ----------------------------------------------------------------------------------------------------------
                        What are the BEST Unreal Tutorials / Docs? There are none tbh... Here's why
                        Instead its better to just take projects apart (see the free 'creators' listed here)

                        Comment


                          #27
                          Everything dynamic, level streaming
                          | Savior | USQLite | FSM | Object Pool | Sound Occlusion | Property Transfer | Magic Nodes | MORE |

                          Comment


                            #28
                            Originally posted by ClavosTech View Post

                            And the COST of doing that in a scene with 10-30k actors / 3.4 million polygons?
                            30k? OOP must die! :P

                            Comment

                            Working...
                            X