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 /
avatar image
0
Question by Mikozouzou · Jan 22, 2016 at 01:14 PM · valueendless runnerwarningnumbersmaximum

What is the maximum value Unity can handles before warning ?

Hello,

I'm developping an infinite exploration runner game (with several lanes and the possibility of move right / left while running) and I had a performance issue with the first version of the prototype : I was moving the environment and not the character and its camera, so it was laggy because of all the objects which were moving.

As I gonna make the character and its camera moving, until which value can I consider letting my character running forward before having to set it back to its initial position ?

My character is currently running at 15 units per second (54km/h), so 10 000 will be reached in a few minutes.

Thanks in advance !

Comment
Add comment · Show 4
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 Fattie · Jan 24, 2016 at 04:03 PM 0
Share

it's "around 1000" units, but google for 100s of questions on this

avatar image Fattie · Jan 24, 2016 at 04:03 PM 0
Share

note that normally you very simply "keep moving everything back to the center of your stage", that is how all runners are done. Do that.

avatar image Fattie · Jan 24, 2016 at 09:28 PM -1
Share

"so it was laggy because of all the objects which were moving."

you were just doing something wrong then. it's that simple

the way you first did it is the only way to do it.

there is absolutely no reason, whatsoever, that moving the scenery would "cause lag". there is zero, no, mathematical difference from moving the camera.

it's possible you are including far, far too much scenery, not culling, not "getting rid of it behind" -- or you could be making one of a dozen basic mistakes.

Just FYI --there are many (superb) "infinite runner kits" available on the asset store for a few dollars. that's how development is done now.

for something as trivial and common as a runner, you just do that and drop in your graphics. you'd no more program one from scratch that you would say "program a database from scratch" Hope it helps

avatar image Mikozouzou Fattie · Jan 26, 2016 at 10:40 PM 0
Share

I get your point Fattie, as we're a young $$anonymous$$m of self learners on Unity we probably did something wrong. I also totally agree with you when you say that many unity plugins on the assets store that will do that job well, but we would learn to do the main part of this by ourselves first.

We have many objects moving at the same time by a single line of code :

 transform.position = new Vector3(transform.position.x, transform.position.y, transform.position.z - Game$$anonymous$$anager.instance.speedBlocs * Time.deltaTime);

Our hierarchy is $$anonymous$$ovingLevelDesignBloc > ParentsOfObstacles > Obstacles, and the code is put on $$anonymous$$ovingLevelDesignBloc.

As you can see on the screenshot, it is - for us - the most costly resource. alt text

screen-profiler-breathe.png (41.4 kB)

3 Replies

· Add your reply
  • Sort: 
avatar image
3

Answer by Eno-Khaon · Jan 24, 2016 at 04:32 AM

To be precise, there's no specific "safe" range using floating point numbers, per se. Floating point numbers themselves can be seen as an integer with a decimal point you can put wherever you want.

Although this isn't directly indicative of floating point numbers and their precision, you can imagine it this way:

Let's say you have a large number, such as 1 billion and 1, so... 1,000,000,001 or 1000000001.0. That same number is almost identical to barely over 1 or 1.000000001 in floating point notation.

What this means for you, however, is that you're still limited by the bit-count of the floating point value. If you consider the maximum 32-bit signed value of 2147483647 (2.1 billion), that means that once you exceed 100,000, you would have only 5 decimal points remaining for calculation precision. The greater the number, the lower the accuracy inherently becomes, which is especially problematic for performing physics calculations. The less granularity available for the calculations, the more destructive things will become.

That said, that is also why Unity offers a warning once a position vector reaches high values; it's only there for your own sake, to avoid running into calculation issues which can't be remedied without sizable increases in calculation cost.

Comment
Add comment · Show 3 · 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 Fattie · Jan 24, 2016 at 09:27 PM 1
Share

With runners

YOU SI$$anonymous$$PLY $$anonymous$$EEP THE CA$$anonymous$$ERA AND PLAYER AT ZERO, AND $$anonymous$$OVE THE BAC$$anonymous$$GROUND

it's just that simple.

avatar image Mikozouzou · Jan 24, 2016 at 09:52 PM 0
Share

Actually I think that you cannot do this way in many cases, mainly because of performances. The most expensive action is the movement of all the background elements, which in my case made impossible the game playable on mobile devices even with optimized assets.

Anyway, following your answers I will move my character and find a sneaky way to put everything back at the origin of the scene without being spotted by the player.

avatar image Fattie Mikozouzou · Jan 24, 2016 at 10:09 PM 1
Share

difficult to believe, i'd guess you've made some other basic woe you know?

moving something takes almost no processing power and not et hat moving the camera is just the same!

NOTE precisely as you say, another approach is you run along a track of say 1km, and then JU$$anonymous$$P BAC$$anonymous$$ TO THE START AGAIN; so you loop over say 1km. Each method has it's own incnonveniences

avatar image
1

Answer by hexagonius · Jan 23, 2016 at 11:22 PM

According to this post going up to 100000, it's save:

http://answers.unity3d.com/questions/377376/limit-of-unity-world-space-out-of-range.html

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 Fattie · Jan 24, 2016 at 04:05 PM 1
Share

most people keep it down to about 10,000

BUT THAT IS TOTALLY IRRELEVANT HER$$anonymous$$

when you do a runner, you very simply keep the action "near the middle of your stage", and you move the ground "under" the player character

Couldn't be simpler - one of the most basic and well-known techniques in video game engineering

avatar image
0

Answer by Highwalker · Jan 24, 2016 at 04:03 PM

I too am making an endless type game, and from my experimentation, there's no limit. The transform position numbers just start to look odd at some point (like when you go past the max number on a calculator). But unity handles it just fine without issue. And I do use distance calculations and the likes. So as far as I know, there's really no issue.

Comment
Add comment · 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

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

6 People are following this question.

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

Related Questions

Great unity X Y value (Space game) 0 Answers

Variables and ranges in javascript 2 Answers

How do Generate Random Unique int ? 1 Answer

how do you get an input value from 0 to 1 and display a dollar value? 1 Answer

How do I interpolate a value up and then back down? Gradual interpolation 2 Answers


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