- Home /
Increase the size of a Scene (space map)
Hello, is it possible to increase the size of a scene? When i fly a while with my ship, it starting deforming and then (1-2 minutes later) the game crash.
I know i could use multiple scenes but, when it's a big multiplayer map, i cannot have multiple scenes loaded at the same time, or? The next problem would be(by multiple scenes) to display the planet positions right which are rotating around the sun. The planets would be not rotating around the sun, when the scene ist not active, when i'm right.
At the moment i use Unity Free. Are there some good features in the pro-version, that i could need for a big map, or other tips for ?
A Scene does not have a "size". It's size is technically infinite, however do note that at extreme distances the accuracy of floating point numbers becomes less and less. Without using doubles (in which case the issue is only prolonged), there is no way of avoiding this issue directly, however there are some workarounds:
Don't let the player go beyond a certain point. Just don't let them pass or have some sort of gameplay element stopping them.
Don't move the player, move the environment. From a users point of view these are one and the same, but this means that you can dynamically load and change the environment without ever really moving the player at all, meaning no inaccuracies due to floating points.
Look further into floating point imprecisions for more information
when the player dont move, how can he chase other ships, when they dont move, too?
@Deel, the "local" player itself does not move in world space, however, that does not mean that any other players don't move.
You basically have to change your way of thinking... Normally, you would in comparaison with the environment that usually doesn't.
Now if you have the problem you are having, and have to consider not moving your user, just apply the inverse mouvement you would normally apply to your user, to your world.
In numbers, if I should be flying along the Z-axis at 10 m/s, just have the world move along the Z-axis at -10 m/s. And your user wont notice the difference.
Now, your enemies could be flying according to the environment's reference, which they would usually be doing. And thus nothing changes for you. Or you could try and compare their movements to yours, but it can get a little bit more tricky.
in multiplayer that means, when i fly to a player with 10% more speed than him, i only change the distance of both(one would stand and the other would co$$anonymous$$g closer and closer)?
I notice in a singleplayer game it would be much easier^^
Would it work at all in multiplayer or is there a other way ?
Answer by The_Magical_Kiwi · Aug 11, 2013 at 10:48 AM
Unity doesn't like extreme distances, I know it is a pain, but suggestion would be to scale everything down, have a unit representing a metre or 10 metres.
But when i scall a ship down 10 times, the pixel density would
rise 10 times. Is that not a performance killer?
Scaling it will change nothing. Think of a ruler that can only measure in meters, If you scale the entire world, including the ruler down by 10, will the ruler be more accurate? Relative to real space, yes, but not relative to the rest of the world.
@Deel What are you smoking? What does the scale of object have to do with performance??? :P
@Deel hehe, indeed what are you smoking? :)
Your pixel density can not just change because you make everything smaller in the world. In your camera's view it would still all be taking up the same space, so no difference there.
Plus, your screen has a fixed pixel density. And if something takes up less space on screen, and thus takes up less pixels, Unity will use a downgraded version of your textures ($$anonymous$$ipmaps) that fit the used screenspace best.
Sorry, i'm a beginner and thought it would need more ressources to render a object with a bigger pixel density^^
Actually, it's faster the smaller it is. @Deel, you should take a look into how rendering engines work. It explains a lot about performance XD
Your answer
Follow this Question
Related Questions
Advice on my Ship AI... 4 Answers
Making Top-Down spaceship movement, getting current speed, acceleration, without rigidbody! 1 Answer
Mirror movement scaled down 0 Answers
unity3d quaternion slerp is off target 0 Answers
Space Ship arcade control system 0 Answers