Flat, seamlessly wrapping 3D world?

To best describe the point I’m trying to achieve, think of a real-time 3D flight simulator. I want to have a sense of freedom by being able to fly forward endlessly without hitting a border wall other than the sky or the floor. I don’t want an infinite world though, as the world is essentially a planet in terms of surface area with a fixed size, except completely flat.

How would you go about making a seamless flat plane world? I want to represent a planet surface as a huge plane that wraps around itself seamlessly. I’ve got two solutions, but I’m not sure which is better or if I’m missing something that would bite me in the ass later on.

The first solution is to have a single huge plane that stays completely still with the camera pointing at the character, while movement is achieved by an illusion of scrolling the a tiling texture on the plane like treadmill. This kind of “terrain” is pretty much just a visual trick, while the actual logic of positioning things happens seperately in an abstract code layer.

The second solution is to use a dynamically loading infinite terrain, which works by loading a new plane in front of you as go forward infinitely. This more of a real physical terrain rather than a visual trick, since in this case the player character actual moves, instead of the world moving around the player.

If you were making a simple 3d flight simulator and you needed a limited, but looping world, what would you do?

check this as basis. when the planet should wrap around you need to feed it with 3d perlin/simplex noise which is sampled along spheres with different radius for the different octaves.

You lost me there, why do I need noise if the terrain is 100% flat? :?

Why do you need “Terrain” when it is 100 % flat?

how do you create variations on the plane? i guess you will use some (multi)texturing. texturing is often done according height. and height can be created by noise. so you most not use the noise to create a terrain in means of a mesh, but in means of a texture. and using 3d noise ensures you have no seams. that was my point. if it was not what you need i probably got you wrong. sorry then.

1 Like

3D noise generated texture, huh? Thats something new to me and actually very clever too. At first when you said noise, I thought you meant in terms of making the terrain bumpy. Also I suppose I misused the word “terrain”, since I meant it simply as a surface to stand on in a world, regardless of its shape. My bad.

In terms of variation, my initial idea was to simply have a plane with a repeating seamlessly tiling texture I made by hand, while on the surface of the flat world, I’d randomly scatter various pre-modeled scenery objects like trees, rocks, clouds and such.

In the end, a single world might be very monotonous and generic, but it can greatly vary for each individual world, simply by changing the scenery objects and the textures of the surfaces. Its a 3D high-speed flying mech action game, so given that you’re flying high and going really fast, variation of the world doesn’t matter that much.

I wonder how big a sphere you’d need to use to make it seem effectively flat, which would solve the issue without requiring any trickery. Though you’d need to adjust your height while flying above the surface to keep it relatively constant (some kind of constraint range maybe?)

I might try that out, sounds fun :wink:

And I like the example above, pretty cool!

If you want to create a full on planet, you might like this example I stumbled upon a few days back: http://www.etereo.com.br/WebPlayer/

However, for my purposes, I need simplicity, performance and ease when it comes to scripting. Rendering an entire planet is a performance heavy operation, so thats a no go. I also don’t want to deal with the spherical shape of the planet over a flat plane, which is much easier to script for. Thats why the two solutions I describe in my first post are ideal, but I’m not sure what kind of drawbacks might they have or if there is even a better way of doing a flat, seamlessly wrapping, finite world.

Here is an example i created long time ago during playing around with 3d noise. the texture tiles perfectly and is meant to be used on a lat/long sphere (which causes ugly singularities at the poles).
i just read

so my suggestion for the seamless point was to use 3d noise at is seamless in 3d space (in opposite to 2d noise!).

this would become quite boring soon for the player. and albeit its not a real border its also not a real planet you can fly around.

the important question is if you want a consistent planet or not. consistent means that you see the same texture, objects etc when you return to the same position on the planet. then you need a system which handles that for you fe you create “patches” with a latlongposition (for 3d noise) and a seed for the distribution of the objects. when it must not be consistent you can use a way simpler aproach.

so you can visit the surface of different planets?

it depends on the degree of freedom the player should have. when he can roam around freely it should be consistent. when you provide him with a direction for the next target and he only stays on the planet some minutes variation is not so important. also consider what you do in mountainous regions or over sea where there is even less variation and very few objects. also its the question if you want to provide a minimap of the planet to increase imersion.

i would also suggest to buy a ready package as it handles the creation and management stuff for you. you only need to place your objects and do your game logic.

imersos package does not render the entire planet. it renders only the parts visible to you. its highly optimized so you can have several planets at screen at same time as it uses some lod technique. i don’t know if it runs on mobile but for a desktop pc the performance is way enough. the only “problem” is that it creates a real terrain and not a flat plane as you wanted. this may become difficult when targets are behind mountains so you can’t hit them. also i don’t know if the package creates a mesh collider for you.

Was this texture procedurally generated? I can make a similar texture by hand fairly easy in Jasc Paint Shop Pro 9. Either way its cool.

Nah, consistency isn’t important at all. The player rarely returns to the same planet or area, and even then the main focus is on combat against hundreds of enemies over a very large area at high speed, that you wouldn’t even notice or care about it.

Yes. Not just planets, but areas in space too, althought space would use a slightly different world system than a planet. The game is about you going from one star system to another, blowing up space monsters from trying to conquer the star system. You do this by moving on a turn-based meta game that represents the map of a star system, and where you and the enemy meet, you have a battle in that limited area.

This area will be defined by where you and the enemy met. If you met on a planet, it takes places on that planet. If in space inside an asteroid field, then it happens there. Each area is very simple and single-minded. You can look at a playthrough of Starfox 2 on youtube to get the sense of how it works.

To give a visual example of how it would work, look at these pictures:

http://imageupper.com/g/?S020001001E13675902851588365

Do note, this is just a rough example.

During combat, the player has complete freedom to do and go anywhere. The only restrictions there are is the limits of the area. For planets, its the sky. You go too high, you fly off into space, exiting the battlefield. For space, if you go far enough from the center of the area, you will also leave the battlefield.

A single battle may last anywhere from a few minutes to an hour and during that time you don’t build anything on the planet or do anything else that would make you feel attached to it.

For my overall game design, imerso’s package or any other space packages are essentially incompatible, so I can’t use them without having to restructure the way the entire game works. Besides, its not really a big deal since the system I need is fairly simple in design, I’m just unsure if it has some flaws that would screw me over later.

yes, 3d simplex noise sampled on a color ramp.

i don’t know this program. but for mapping on a spherical mesh you need to take the noise from the actual position of the pixel in space as they are distorted and not equally distributed (look at the lower detail at up and down (poles), the sampling points are much closer together there). also i don’t know if your program can make it seamless that easily. as most seamless methods create artificial patterns with other statistical properties. also this test was intended for procedural generation, if you want to store dozens of textures for your planets/moons you get storage problems quite quickly.

that makes things easier for you. then why so complicated? just use a large plane beyond the player (keep it there) and adjust its uv coordinates when he moves. as you can’t store that large textures you could generate the content in the shader. but i have no experience with that.