- Home /
Tile to Sphere world algorithm
Came across a few thoughts in my game developments. Originally, it was going to be large maps that acted as levels. When the bare code was lain down, I decided it might be far more fun to make a survival game with the code. I've been scanning the nets for different implementations of making the world, and it seems most developers do flat worlds of varying sizes. I wanted to create a spherical world that appeared flat. My first approach was to create an actual spherical world that was so large, that it looked flat (like earth). This cause numerous problems between scale, and unity float accuracy limitations. The second issue with this, was that I couldn't rotate the capsule collider, and would essentially have to rewrite all the necessary collider information from scratch, alter gravity, etc. Next, I thought to create a flat map, and wrap/bend it into a sphere. Using max3ds, this actually worked to some degree, but I still had a huge world and various coordinate issues.
The question here is, what is the most direct way to tile a map in such a way that you would simply render, and walk into the tile at the top of the map after reaching the bottom. Part of the complications with such an idea is getting the top and bottom tiles to accurately mesh with hills and structures. Are there any rendering tricks I should research as far as loading detailed terrain closer, and vague terrain farther? Links are great, terms and descriptions are also greatly appreciated.
Interesting problem. For a design discussion like this one, you'll likely get more help on Unity Forums. With that said, there have been a number of interesting posts on UA in the last year dealing with large spaces and the floating point problem. One solution is to leave the character at the origin and move the world. There are other solutions as well. One paper referenced is:
http://www.floatingorigin.com/pubs/thorneC-FloatingOrigin.pdf
Researching deeper, and with the assistance of people with preexisting game design knowledge, I've come across a few ideas I need bounce off of knowledgeable Unity developers. Initially, I was going to render it as I did some of my 2D games and split a world into a grid of 3D tiles, load them into a script through prefabs, and render them with a tiling engine. This is a very similar method $$anonymous$$inecraft would use to generate chunks, and 'would' allow me to tile straight into the other side of the world, but it appears this isn't as efficient a route. I'm being told that creating the world in unity, and running a script to conform objects, and toggle renderable sections based on view distances is more the direction to take. $$anonymous$$y biggest concern is the edges of this world.
Say for instance, I have a 3x3 plot of land. Now say I'm in coordinate 0,1 (top middle) and I'm looking north, I should be looking at 2,1 (bottom middle) and all mobile objects there. The current suggestion is to render bordering sides, display characters and NPCs offset from the player location (not world location) and teleport the player to the bottom upon crossing a border. Do you guys know of better methods to get this done?
I've managed to write a custom array that returns rolling values for a grid based on coordinates that may be outside of the bounds. I've been trying a few different methods to move smoothly from one to the next, teleporting the existing terrain, and generating new terrain, but all I can seem to come up with is a full reset, which can be rather taxing. Really need a generic chunk load/unload system to go along with it.
Answer by Komak57 · Mar 29, 2014 at 06:06 PM
Found an end-game solution to fast, real time, infinitely sized (yet still static), rolling terrains. This allows you to use a heightmap (of any size) and render it in variant degrees of detail from close, to far, asynchronously (meaning it doesn't lock up your FPS). It's called Geo Clip Mapping : http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter02.html
Thanks goes out to fholm and the IRC community.
Your answer

Follow this Question
Related Questions
board game algorithm 0 Answers
Random tile map algorithm 0 Answers
How can I set World Builder to generate right to the edge? 0 Answers
My precedural Algorithm for Tidy TileMapper is not working! 3 Answers