Sign in to follow this  
ne_xim

Unity Distributed procedural (inside-out) map generation

Recommended Posts

I'm playing with a terrain generator and renderer in Unity3D. The terrain renders properly, assuming it is passed reasonable values.

I'm attempting to construct a world generator using a set of filters and a port of the libnoise code. (Perlin generator, mostly.)

I'm attempting to wrap my head around the idea of biome generation using complex perlin noise filters. I'm aware that generating terrain from perlin fields on the fly takes a lot of time. I know you can lessen the time by pre-rendering the terrain, but this trades cpu for memory and network usage.

Instead of streaming world data to the clients, I will be using a perlin noise generator on the client side to generate the terrain. Are there any serious pitfalls to avoid with trusting the client to generate the terrain on the fly? Under what conditions would this be problematic?

I'm currently trying to figure out how to handle world generation as a whole, though. I'm doing some pregenerated stuff using a voronoi model of the world on the server, and then calculating the biomes of each cell by a quick noise elevation model, compared to an A* distance map from water for moisture, and a reflected gradient for temperature. From these three variables, I am getting the biome of an entire voronoi cell. All of this data is pre-generated, and each pixel in the model corresponds to a 16x16 tile block on the client. Only the minimum amount of data will be sent to the client to build the local region.

On the client end, this means I don't have to do much sanity checking, as the local terrain is not wildly variant. This means I can generate data from the inside out, as the server has met the client halfway, generating a plain world from the outside in.

The client takes the data the world has sent the client, and it uses it to locate a preprogrammed noise filter. Each biome uses its own filter, saving time pulling data from each filter, as data only needs to be passed through the biome filter the tile belongs to, or possibly a neigboring biome if it differs.

I'm running into a few conceptual problems:

How to store changes to terrain, such as cut down trees, player-made roads, etc. I could store it as a raster, but taking 16^2*2B + 17^2*2 bytes of data per tile just to save the data of a single tile change seems inadequate. Is there a more effective way to compress and process regional data pertaining to tile or vertex altitude changes?

Also, in addition to how to store the regional data, what would be the different ways I could store terrain on the server? Would it be better to break up the world data into raw map files and stream them into memory when needed, or would it be better to put the data into some kind of database. If database, what exactly would be the optimal method of storing it within a database? What would the pros and cons be of either?

Second, is there a good resource available for generating random terrain? I've been manually experimenting with how to use filters to randomly generate swamps, mountains, hills, plains, etc, but I'm really not seeing a lot of good documentation on how to get specific terrain effects out of a generator. Any documentation, or examples would be awesome.

Thanks,

Ne_xim

Share this post


Link to post
Share on other sites
[quote name='ne_xim' timestamp='1335470045' post='4935195']
Second, is there a good resource available for generating random terrain? I've been manually experimenting with how to use filters to randomly generate swamps, mountains, hills, plains, etc, but I'm really not seeing a lot of good documentation on how to get specific terrain effects out of a generator. Any documentation, or examples would be awesome.
[/quote]

These kind of algorithms is usually hard to predict, and experimenting is usually the way to go. If you want to accomoplish something specific, you need to think about what kind of "fractal" components possibly could accomplish it. For instance, if you'd want to create a volcanic surface, you could start by generating the basic surface with perlin noise, wich should produce smooth hills, and combine that with voronoi to produce cracks. That's the way to go.
As for references, the internet is flowing over with people doing proceduralism right now. http://vterrain.org/ is a great source for different techniques, although many examples are a bit dated. As for books, this one is fantastic, with many code examples: [url="http://www.amazon.com/Texturing-Modeling-Third-Edition-Procedural/dp/1558608486"]http://www.amazon.com/Texturing-Modeling-Third-Edition-Procedural/dp/1558608486[/url]
Good luck :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Forum Statistics

    • Total Topics
      627711
    • Total Posts
      2978751
  • Similar Content

    • By Canislupus54
       
      I'm looking for a team to help me out with a 3D platformer. Basically, you jump between platforms with parkour elements and you fight enemies with a mix of melee and ranged attacks. This is purely a hobby project. I'm not promising any payment, ever. You can do it for experience, to learn, for fun, whatever, as long as you don't expect to get paid. Right now I need a 3D modeler and animator. Reply or email me at jordestoj@yahoo.com if you're interested. Thanks.
    • By Pixelated_Nate
      Hi all!
      We are looking for a C# programmer for our 2D Action RPG titled Adavia, made in Unity.
      The game itself is akin to Legend of Zelda: Link to the Past, though we're also adding in traditional RPG elements such as Character Creation.
      This is more of a hobby than anything commercial, if it somehow does manage to go commercially, all revenue will be split equally among the team.
      If you're interested, we ask that you be comfortable with:
      Unity Coding A.I's for enemies and NPCs. Working with GUI's. Communicating regularly with the team via Skype (text only). If you have any questions or would like to apply, please contact me at nathan.jenkins1012@gmail.com
       
    • By MrGiratinaORIGINAL

      I'm the co-director of LM Team, a 7-member team currently constructing a fangame based upon the Mega Man series. We've been working for about 2 years now, and both of our current programmers are busy for the next 6 months or so. Because of this, we're currently looking for a programmer (or more) to take care of gameplay and animation programming. We already have a base system in place that may optionally be built upon. This will be a hobby project to invest your free time in, not a gamedev gig.
      We're currently about 67% done with the OST, 75% done with the design work, and 33% done with the graphical work. As such, the specifications of what we need should remain pretty stagnant from now on.
      Here's some links of our team's work, to give you an idea of what we're currently capable of achieving:
      Actual Y+1 Stuff:
      - Current public playlist of music
      - Old footage of the first boss of the game, since been altered slightly based on feedback
      - Mockups
      m9m (director, composer):
       
      - Grand Dad Reboot - Ominous Cavern
      - Lands of Onlup
      - Mega Man Revolution Remix - Wily 2
      MrKyurem (co-director, main designer, me):
      - Boil Man - 10th place in Make a Good Mega Man Level 2 Contest
      NaOH (programmer [not programmer who is currently working on the engine]):
      - Programmer for Make a Good Mega Man Level 2 Contest's release game (did co-op mode and leaderboard functionality)
      - 15 years of programming experience
      - Castlevania 3 controls romhack
      - GML code beautifier
      - Beat-Em-Up engine
      Alm (artist):
      - Cutscene for a personal project
      - Tileset for Boil Man's stage in MaGMML2
      - Concept sprite
      Valo (artist):
      - Jungle Man tileset in Mega Man SD
      - Boxart for Mega Man SD
      - Wily sprite
      Karakato (artist):
      - Robot Masters in BCA
      - Idol Woman
      - Stage Select for separate project
      Deathro (composer):
      - Through the Eye of a Prism - 2nd place in Famicompo 2015's Original category
      - Mega Man SFR - Wily 2
      - Geno Force - Silent Breeze
      Contact
      If you're interested in joining, I'd recommend signing up to Discord, as we almost exclusively communicate through this.
      Discord Tags:
      MrKyurem#8741
      m9m#1104
      Email:
      LMTeam.Y1@gmail.com
    • By ilovegames
      You are the commander of a special forces squadron. You were given a task that appeared simple at first glance - to check for suspicious activity in the building of an abandoned psychiatric hospital. But you could not even imagine what you will actually have to face.
      Download https://falcoware.com/HospitalSurvival.php



    • By ilovegames
      You find yourself in an abandoned place full of mutants in the dead of night, and have to kill waves of monsters with a different kind of weapon. The main goal is to survive through the night.
      Controls:
      WASD – Walk
      Shift – Run
      Mouse1 - Attack
      Space - Jump
      Scroll Down – Change weapon
      Esc - Exit, pause
      Download https://falcoware.com/NightSurvival.php



  • Popular Now