Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 /
avatar image
0
Question by Supershandy · Feb 03, 2014 at 01:18 PM · aiscaletranslatefloating point

The floating point origin and AI

Hello everyone.

I felt I should ask this question before i get too bogged down in it and find that the path leads to a dead end.

I'm working on a space simulator and have managed to procedurally create the milkyway, this is pretty useless though atm as I can physically use it for the mpment.

But for creating solar systems, a scale issue came up and i thought a clever workaround would be using multiple cameras and a ratio speed script to recreate the solar system at a 1AU scale and then have the objwcts scale up in the main view as the subscene camera moved near to a planet.

However, this subcamera is slaved to the main camera and the main camera moves at a 1:1 scale which means when moving forward it can cover large distances.

However this still wasn't a viable solution because of the floating point problems at distance. Searching the net i found a solution called "floating point origin".

Now i understand that basically this moves everything to you and the camera used stays at 0,0,0. However i have a feeling that this solution would cause problems with AI characters, yet there are no mentions on the net if this is a problem or not.

So my question is, does the floating point origin affect how AI behave?

Thanks

Comment
Add comment · Show 5
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 Pangamini · Feb 03, 2014 at 02:20 PM 0
Share

I am currently thinking about same problem, and my idea is to create some custom wrapper around transform, that uses double precision (opt. any other number format). All logic is calculated in doubles using these transforms, and only then the float values are generated and fed to the engine itself. The only place where i think i won't be able to make this work is builtin subsystems like physics, lightmap baking etc...

avatar image Supershandy · Feb 03, 2014 at 02:24 PM 0
Share

I'm ok with the physics side of things as i won't be using phisics or lightmap baking etc, and i'm trying to avoid doubles for performance purposes.

The AI just uses traditional transform.translate and transform.rotate, it's just if they get moved back whether it's going to screw them up if they're doing an intercept, evade, patrol etc

avatar image Pangamini · Feb 03, 2014 at 02:27 PM 0
Share

well i know nothing about your ai, but if they are 100000 km away from the origin and try to move at 1m/s at 50fps, they might as well not move at all OR move by epsilon every frame OR move in different direction (caused by rounding each axis movement up or down)

avatar image Supershandy · Feb 03, 2014 at 02:35 PM 0
Share

That's why i'm looking at the floating origin solution, but obviously if it can be shown or proved that it doesn't work, then i guess i'm going to have to scale back the production and leave it for a future update

avatar image unimechanic ♦♦ · Feb 22, 2014 at 02:28 AM 0
Share

This question could have different solutions that derive into long discussions, and it might stay unanswered for an undeter$$anonymous$$ed amount of time. Please help us improve Unity Answers with concrete questions and answers, and consider using Unity Forums which is a great place to discuss ideas. Thanks for your comprehension, Unity Support.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by unimechanic · Feb 22, 2014 at 02:32 AM

The answer to this question depends on how you design the scales of your world, and the system that you choose for your AI. This video could help you to solve the first requirement:

http://unity3d.com/learn/resources/talks/how-hard-can-rocket-science-be-anyway-building-new-universe-kerbal-space

Comment
Add comment · Show 2 · 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 whydoidoit · Feb 22, 2014 at 02:36 AM 0
Share

That's a cool video - hadn't seen that.

avatar image The-W.A.T.Z.R · Jul 31, 2014 at 08:57 PM 0
Share

it is a awesome solution with floating point/origin but how do you create it? i dont find the information :/

info my Q

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

21 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

Related Questions

Mapping from External to Unity World Coordinates 1 Answer

simple 2d car Ai 0 Answers

Transform.translate change 1 Answer

Center position after scale 1 Answer

Scripting for AI 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