- Home /
Maximum scene size?
I searched around and couldn't find details on this. What is the limit for creating a scene in Unity? Warning, I am completely new to Unity, so these may be super simple or super confusing.
This basically breaks down into three parts:
1) In assembling a platform, if I just keep adding to it, will it ever tell me it is too big?
2) If I create a sphere and accelerate it any direction, what happens to it? - What happens when it hits the sky-box? Will it ever hit the sky box?
3) If I create about 500 spheres and accelerate each along a separate vector, what happens to them?
Now, those may seem like odd questions, considering one of the tutorials actually says that when creating bullets, give them a life-span so they get destroyed, else the gun creating them will eventually create far too many.
Here is the kind of information I am looking for:
Existence - does the object still exist, or does it become a concept after a certain distance? This may be confusing, but I mean if you were able to watch the object in the scene and follow it out, would it eventually stop being rendered but still tracked in location?
Travel Limit - Is there a point where the object can't actually travel any further. You know those invisible walls in games that keep you from reaching the edge of the map? I'm talking that sort of thing, where the object literally can not increase distance from 0,0,0 position.
Player Limits - Is the scene centered on the player or does the player follow the same rules? If I launch the player into the void and there is something behind them at the travel limit, is that something dragged along with the player?
I am already formulating a concept to test these... but I'm hoping I don't need to experiment. I don't know what risks there are... possible uncaught exceptions that could cause havoc in my computer.
heh great question. "Unity philosophy corner" :)
"Existence - does the object still exist, or does it become a concept after a certain distance?"
Forget Unity, I often ask that about life generally !
Answer by Fattie · May 02, 2013 at 08:37 PM
"Is the scene centered on the player or does the player follow the same rules" that's a very astute question. no, a "player" is completely morally ambiguous to the engine, and indeed so is the camera (/cameras). They are nothing special - do anything with them.
"Travel Limit" you would simply run in to the numbers being too big for a computer. I think the answer is simply "yes" it is limited. (But it is so big it is irrelevant - computer games don't work like that.) There is also a tedious technical point that accuracy decreases as numbers get really big - but it's just irrelevant. Recall that you won't be able to see anything that far away. It's just that simple.
"Existence - does the object still exist, or does it become a concept after a certain distance" No, the object just exists. All it is is: a struct with a couple (well .. three!) numbers. (those numbers, us humans interprets them as "locatiion" or whatever - but they're just numbers
Note though that very typically you will CHOOSE TO abandon, just erase ("DestroyImmediate()" ... !) objects as they move away. An extremely simple example is when you launch bombs and the like, inevitably you just have "a big box" around your game and when the bullet reaches that box, you know you can just get rid of it. Also read about "culling" and the like for how the cameras work. And there's "fog" which you can use if you want .. because it's too boring to draw everything far away.
In answer to 1-2-3, it's no more mysterious than any other computer program. What if you tied to add 100 billion lines in excell? WHat about a google lines? It's no big deal really.
The only factor you'll find s, can the physics engine handled that many things bouncing around - try and see.
So I hope it gives you a feel for game engines. I encourage you to just open the editor (recall, it's free) and play around. Add a floor, and a hundred balls (just literally click "add sphere" - check it has a rigidbody, gravity and a collider) .. bounce them around.
the physics engines in game engines are very special, they're not meant to be like "multiphysics" engines nor are they meant to be like finite element analysis systems .. hey have their own specialness. (You need only play any video game to see how amazing they are.)
Okay, just to see if I am following: Unity doesn't use some sort of 'work around' to allow infinite distance availability. It is just expected that no situation will arise where an object is actually sent outside the viable range.
$$anonymous$$y only experience making games was in Visual Basic 6.0... heh, yeah, I did that sort of thing. Well, objects that went 'off screen' reach a certain distance and can't travel any further off the screen. I devised a way to track all the object locations in an array system and only create the object when it was just off the screen. Thus, all objects were just concepts that only existed when they were at risk of being on camera. Never did actually implement it though.
So, that tells you my level of knowledge when it comes to working with engines... none. hehehe.
"Unity doesn't use some sort of 'work around' to allow infinite distance availability"
that sentence is absolutely correct.
"in visual basic .. objects that went 'off screen' reach a certain distance and can't travel any further off the screen"
that is absolutely NOT the case in Unity. It's like Excel. (O$$anonymous$$ .. there is probably some ultimate limit like "88 quadrillion".) But no they can go anywhere at all.
lol go have fun.
Answer by Cross22 · Jul 30, 2016 at 10:06 PM
Ancient question, but just in case people come to this page via google:
Unity typically uses 32-bit floating point numbers. They have a maximum value of 3.402823 × 10^38 which is a couple trillion meters (1 Unity unit = 1 meter). Because float precision decreases the larger they become, you cannot actually use these large numbers. The computer would be unable to distinguish between a position that is 2 million meters away and one that is 2 million meters plus 1 cm away- they end up being the same number.
In the Unity Editor, if you try to assign a position to an object which is more than 100,000 meters from the origin, you will see a warning pop up, telling you to make your level smaller than that.
2) If I create a sphere and accelerate it any direction, what happens to it? - What happens when it hits the sky-box? Will it ever hit the sky box?
The sky box is infinitely far away. So conceptually it won't hit it. From a technical point of view, every camera in your scene has a far clipping plane (default is 1000m). If an object is farther than that from the camera it will no longer be shown on the screen (unless it is the skybox).
Footnote: it's actually more than a few trillion, here are the names- https://en.wikipedia.org/wiki/Names_of_large_numbers
1 Unity unit != 1 metre. It's just one unit, and you can choose an arbitrary scale to make that represent any real-world unit of distance you want.
While it is true that a unit does not automatically have any context of size, the default implication is that 1 unit equals 1 meter, if not only because the default Physics.gravity vector reflects the real-world gravitational estimate of ~9.81 meters per second downward.
Your answer
Follow this Question
Related Questions
What is the largest Terrain Size allowed in a Scene and maximum number of Scenes in a Game? 5 Answers
Limit the available stage space? 1 Answer
Is there any problem with working with big units? 1 Answer
50mb limit with Unity 3.5 + Android license (not! pro) 0 Answers
[HELP} Asynchronous loading assets after loading scene 1 Answer