.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Air Assault Task Force- Save $8.00
World Supremacy- Save $10.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 3: The Awakening

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old May 3rd, 2009, 06:56 PM

Omnirizon Omnirizon is offline
BANNED USER
 
Join Date: Dec 2007
Location: Illinois
Posts: 1,133
Thanks: 25
Thanked 59 Times in 36 Posts
Omnirizon is on a distinguished road
Default OT: Making a Game System (part 4: A Game World)

so summer is creeping ever closer, and when I gets here the plan is to have time to pick up working on the Dominions Roguelike once again.

The goal set for myself to accomplish over the semester was get some sort of map generation. Tiles are the typical roguelike representation of a game world and there's lots of resources on how to implement them. I really wanted to not do tiles (since I've avoided them completely in everything else so far) but with little to no knowledge in map generation (or high level math in general) I was feeling hopelessly overwhelmed.

Fortunately, lch pointed me to some styles of terrain generation that are not archaic roguelike tiling algorithms. I found some existing implementations I could start with. Along the way I learned how PixelArrays work, so I could automatically generate a surface without needing to glue together a bunch of tiles.

I found a Python implementation of an algorithm called Perlin noise. I played with it, tweaked the interface and output, and eventually got it working the way I needed it to. Right now I've got it making greyscale texture surfaces. The plan is to make some color gradient functions that map the greyscale to discrete color values (for example: at some threshold, darker colors will become water, which then can become deeper water).

So that's it right now. In a couple of weeks I hope to post some screenshots of textures mapped to color values, forming landscapes with oceans, lowlands, and mountains. The exciting thing is that I can make a landscape representing terrain height, and then generate another layer of perlin noise to lay over this for placing forests, swamps, and other features.

So here's a pic I generated using my current implementation. It is nine octaves of noise linearly blended with a period of 256, an amplitude of 1, and a persistence of 0.5. This is a pretty typical noise pattern. The algorithm has different parameters that may be modified to influence how the noise looks. This pic has a lot of even clumpiness, but different parameters can make pictures with just a few big clumps, pics with even more granularity, or even pics with a tile pattern

Imagine now the darker portions mapped to water, and the whitest portions as mountain peaks. The greyscale makes it hard to see the difference inbetween, but with a nice lowland green to brownish grey highland gradient the real texture of the noise will become apparent.
Reply With Quote
 

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 03:05 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.