Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by cstockton · Oct 31, 2015 at 11:28 PM · vector3mathfloatvectorfloating point

Non physics determinism of floating point math across platforms

Are operations on Vector2/3 / floats in unity deterministic? I am very familiar with IEEE-754 and how floating point integers work under the hood.. but am curious how Unity conforms to the specification or if it does any magic under the hood for determinism. Would I be forced to use fixed point arithmetic to achieve this?

Context: I am making a game where a simulation will be run based on some initial state and input added across the simulation. I will only use physics in the rendering pipeline for effects and other visuals. Users will play offline / async and the game servers will validate users past simulations by sending initial state + input + end state. It is paramount that on IOS, Android or Linux that the game code all produces identical results across runs so I can differentiate possible cheaters/hackers from innocent users and bugs. As well as minimize the amount of simulations the user does that get invalidated.. this would cause a cascade effect to ruin most of there efforts since the last verification.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Statement · Oct 31, 2015 at 11:42 PM 0
Share

The only thing I ever heard wasn't deter$$anonymous$$istic was physics system. That doesn't rule out other subsystems, but I haven't heard of any issues. You may want to sink some time into figuring out ti$$anonymous$$g as Unitys usual update functions run on variable time steps. For fixed time calculations, FixedUpdate may be a better choice, and then you can interpolate graphics based on the fixed simulation steps.

As for telling you if they use IEEE-754 or not on all systems, I can't tell :)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by zty · Nov 25, 2015 at 02:49 AM

I'm also wondering the same. By using FixedUpdate, you can guarantee that on the same machine, same input and initial state will produce the same simulation. But what if on different architectures? Validating game play on the server is pretty common nowadays for mobile game for anti-cheat.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ExamplesAreExamples · Nov 25, 2015 at 04:27 PM 0
Share

If you wonder, then don't answer the question with "I wonder this too!"

Please.

If no one can give a concrete and verifiable answer to your question, contact sales or support and tell them that not knowing the fp standard is a deal breaker and find another engine.

Or if that is unfruitful, consider rolling out your own tests across all systems you use to catch unexpected behavior to verify behavior yourself. Obviously ideally you shouldn't have to test the system you'll be using.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

37 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

how to calculate the angle between two vectors? 6 Answers

How do I convert speed and heading to a vector? 3 Answers

Predicting the hit point on X axis, based on vector direction 1 Answer

Issue with Vector3.forward 1 Answer

Find a point in space using Vector3 angles and Raycast 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges