movement of objects with huge scenes

hi,

i’m trying to create something like a eve-online for singleplayer game.
but i’m stuck with some problem.

i’m trying to create it on real scale… the earth is REALY BIG… :stuck_out_tongue:
the problem is with movement of my ship…
what i did is… :
i created a ship and a scene-object
my ship is moving but will be set to the Vector3(0,0,0)
and my scene is moving itself. (realy weird… i know)

so… the earth is like 149597870691 (1AU = astronomical unit) units away from the 0-point
after that i set the scene object like 1AU - 80000 units so that my ship will be near earth.
but… now the problem…
when i set my ship to move on the X-axis, the scene will not move because 1AU is to large and it will be seen as 1.495979e+11

i did try to scale the scene down… but it’s still to large (or to small… depends on how you look at it)
if i scale it down to 0.00001 , my near clipping plane is to far to see my ship.

i looked if i could find some scripting about eve-online but of course i couldn’t find anything.
i like to get it in “real scale”, not those funny small planets you see in some games…
does someone know how to fix this… or have a better idea to do this…?

I really doubt anyone will notice that the game is using real scale objects (to AU, or whatever “real” scale you’re trying to use). But rather mimic the scale of the real world in your own way. If something feels proportioned well enough when played in, that’s all that matters, it doesn’t have to be the same scale of real life (or whatever life/planets you’re trying to portray).

With this scale I assume you’ll be spending a very long time with detail as well, unless you’re going to make this a forum project in the future where everyone contributes pieces at a time, or if you hire a team. G’luck.

You could think of your world as a “conveyor belt of tiles” rather than a sphere. Make large areas (using terrains perhaps) that match up on their edges. When the player is on one, he can see the eight that surround him, but others are hidden. When he moves on to a neighboring tile, the eight that surround that become visible. As far as the development goes, the world is flat, but if, for example, your ship was a space ship, you could swap the terrain with a round planet model once you lift high enough in the air.

There are different variations on designing schemes like that, but as Karmarama suggests, you probably are going to want to develop some amount of detail for the world that will be overwhelming for an entire planet all at once - so making it in tiles would allow you to develop the game concept or even release an early version that has “one continent area and the rest are on their way”, etc.

We’re playing with computers here floating point “precision” going as high as 32bits. There is no way you are going to get a 1 unit = 1 meter space game.

A unit in Unity is exactly what you want it to be - it’s all relative. The only constant in the engine to the contrary is Physics.gravity which you can just change, plus you’re not going to be using built in gravity here anyway.

And yea, like Karmarama and priceap point out here, you’d want to be using some sort of stitched grid / conveyor belt system for moving in a large simulation. You would most likely need to set this up to simply keep your game within sane active content limits.

it’s a 3d game… not a 2d game like seeing it from above…
and i do not use terrain.
check this video for what i want to create:

scale is a problem… because of floating point…
even when i scale it down, my scene is to large and i get the “1.495979e+11” problem
when i do that my scene will not move.

example: (it’s all in “real size” scale)
-earth size = 10.0 (10meter)
-ship size = 0.0001
-distance from sun to earth = 117276.474
-pluto distance to sun = 584358205 (this will be converted in unity to “5.843582e+08”)

the planets and sun and other stuff are all children of my “Scene-object”
my ship is NOT a child of my “Scene-object”
when i move the Scene-object, so that pluto next to my spaceship… my scene doesn’t move anymore on the axis where “5.843582e+08” stands.

(if you don’t understand i will post my project, so you can see for yourself)

Another trick would be to compose your rendering from two cameras. One rendering the skybox and the planetary size elements and another rendering close quarters ships and objects.

When moving around, the close quarters camera would then render the close quarters with 1:1 movement on the camera vs. ship movement and the planetary size elements camera would only move a fraction of that - giving the illusion of massive scale.

I see - sorry, I thought when you said the “earth is BIG”, I interpreted it as you wanted to move across the surface at scale, but you are wanting to move by the planets on that scale.

This comes up a lot in both animation and in game simulations - the initial thought to use actual scale relationships for solar system bodies. In the end, basically no one does that. Even astronomy programs will rely on exaggerated scales so you can see things relative to one another.

In cinema and art, there are design solutions such as “forced perspective” and the parallax scrolling you can do in order to make background objects appear large by the way they move relative to one another. It is a process of creating the illusion, not reproducing the physical dimensions of the real event.

Study more on how those illusions may have been acheived in Eve online and other space or similar games, I think you will see they have solutions that do not involve a ship being 0.00001 the size of the planet it is heading to.

Unity uses floats(32bit) for transform, and as this page tells us:

http://www.stata.com/support/faqs/data/prec.html

That only allows us to go up to ~16Mn.

So a float, if (1 meter accuracy is required) can only do 1% of 1% of the distance required.

You need to build a mufti-tiered co-ordinate system -e.g. each plant is x AU’s away from the sun, while star locations are measured in light years from center of galaxy.

there are plenty of workarounds. you can make some methods and transform from unit to unit, for example 1m = 100 cm, 1 cm = 10mm and so on. you will define a class which will contain meters, as double or int, centimeters and millimeters. and you’ll implement some methods to transform from meters to centimeters and so on. let’s say you havea distance of 1000m when you first start to travel towards the location you make meter --, and cm = 100; then the cm --, and mm = 10; then, based on the distance traveled, you’ll do mm–. when mm reaches 0 you’ll do cm-- and mm = 10; getting my point?

but i see no point in doing a real scale world, since no ship will move with the speed of 1km/hr or very slow speeds… so you can scale units, 1unity distance unit = 10km in you gameworld, or something like this.