ID:100716
 
Keywords: planetbreakers
Two awesome contests popping up, run by Tiberath and LummoxJR, and here I am deeply immersed in my own projects. It's tough being a temperamental artist of a developer. Who knows? Maybe I'll be able to release something for either party. After all, LummoxJR's contest only requires I keep the source code under 8K, and Tiberath's contest is for the casuals. Either way, I'd have to keep it simple by the rules of the contest.

For the time being, work is indeed proceeding with Planetbreakers. I still need to knuckle down and produce the solid game aspects of it - it seems the sooner I practice doing that, the better. However, before I could get myself to do that, I decided I'd like to tweak the wrapping a bit. I modified the flow of the screens the players go through when they log on. Then I moved along to perform some heavy tweaks of the map generation code.

Photobucket
Before
Photobucket
After
If I had to guess how long ago it was when I did the original map generator, I'm going to say towards the beginning of April. Some time later, I added lakes and rivers that branch between them. Today, I removed the old big kludgy mountains (mostly generated by drawing circles) and added a cellular automata method. It's not quite natural looking as a mountain range would be, but it does provide a rather cool modifiable maze for the players close up.

Next milestone is this: get all three factions in and playable in a rudimentary fashion. The goal has always been to have a persistent virtual world that the players can make changes to. However, to make the gameplay novel, I decided what I'm going to do is have each of three factions play differently.
  • Terrans - These guys primarily are concerned with breaking down rocks and turning them into buildings. They're somewhat RTS-style, but this will play differently than most RTS you've seen. Less Dune 2/Command & Conquer/Warcraft. More Perimeter/Majesty.
  • Natives - These guys are primarily concerned with agriculture, as their technology is largely biology based, and will control in a more Dwarf Fortress/Dungeon Keeper style of designating things to be done that the natives carry out.
  • Independents - These guys are basically mercenaries. The Terrans and the Natives are out to wipe each other out. The Independents are out to get rich. They actually receive the greatest incentives to side with the underdog. They'll play out somewhat RPG style, probably more of an upgradable vehicular combat sim.
The actual scope is a bit simpler than I originally planned. I originally planned to have a bit of a M.U.L.E. game played by the Terrans who could harvest four resources: mass, organics, energy, and biomass. Then they would trade it between their fellow Terrans on an open market. I decided it's better to let M.U.L.E. be M.U.L.E. and go in a different direction. I'll keep you posted.
Perimeter was a fantastic RTS.

I still prefer the old method of map generation. Maybe you can mix the two, like say instead of circles you place down the peaks and have the altitudes drop off from there.

Unless you use a large number of iterations, a cellular automaton is not very good at generating nice mountain ranges.
More than iterations, I think what cellular automata is best at is providing a decent starting position. It takes a scrambled bunch of turfs and makes them look less scrambled. Less scrambled turfs have a semblance of order, but still no real identity. You need something more specific for that.

Right now, what I've got is a very uniform surface, the rock formations are in the "less scrambled" phase. In order to make them look like something with structure, such as a mountain range, I'd need to implement some kind of heuristic specifically built with that in mind. For example one that strives to set up some areas of stronger density and other areas of lighter density.

For the time being, I've got to stop screwing around with map generation and get to adding a game.
I had originally written a Perlin noise function for generating icons but also used it to generate the maps in A Miner Adventure. I'm not sure if it's something that is typically used for map generation but it has enough parameters that you could easily make something like the "before" map but with less circular mountain ranges.

I planned on releasing it as part of an icon generator so I wouldn't mind sending you the code if you're interested in trying it out as another form of map generation.
Thanks for the offer. I probably wouldn't use it for map generation, but it does look like an interesting thing to use for texture generation. But then, I can hardly be critical if I'm trying to generate maps using cellular automata methods... well, that wasn't my idea, it's something i read about on Roguebasin.
Geldonyetich wrote:
More than iterations, I think what cellular automata is best at is providing a decent starting position. It takes a scrambled bunch of turfs and makes them look less scrambled. Less scrambled turfs have a semblance of order, but still no real identity. You need something more specific for that.

Are you using a 3d cellular automaton with an altitude map?
D4RK3 54B3R wrote:
Are you using a 3d cellular automaton with an altitude map?

Nope, just a 2D cellular automaton generation method as described in that article I linked.

It did occur to me that, if I had a 3D model it would work a bit better because I could take the particles left after a few iterations and just extrapolate down, increasing the mountainous base as I go.

However, as much as with early Dwarf Fortress, I'm saving 3D calls for after I feel the game is up and running comfortably. (Besides, Dwarf Fortresses' 3D presentation leaves something to be desired.)
Not that you have to use it, but I'd like for people to be aware of it. Until I put together a library this seems like as good of a place as any to mention it (as long as you don't mind). Here are some examples: http://files.byondhome.com/Forumaccount/ perlin-noise-examples.png

The first row shows how you can vary the number of "layers" of noise to create more or less rounded features.

Because all values are between 0 and 1, you can raise the noise value to a power and still get a number in the 0 to 1 range. The second row shows how you can use this to suppress higher or lower values.

The third row shows maps that are similar to the rightmost map from the first row, they use the same number of layers but a different random seed.

These aren't nearly all of the parameters you can play with. These two sites are much better than the wikipedia page and should give you a better idea of how flexible it is:
http://freespace.virgin.net/hugo.elias/models/m_perlin.htm
http://www.noisemachine.com/talk1/


I don't have examples of it, but in my mining game I generate the noise values and sort them. Then I find specific values to use as cutoff points so I can enforce very specific requirements (ex: exactly 100 tiles are water). This can be useful if you're using the noise function to place resources, hazardous terrain, or something else that might have a strict limit.

This method has always been sufficient for map generation for me so I've never needed to look into other methods. I really don't know what the alternatives are or if they offer more or less ways of controlling the output.

It's also worth noting that the code used to generate these examples is incredibly simple:

var/n = noise_value(x,y)

if(n > 0.5)
// mountains
else if(n > 0.4)
// trees
else if(n > 0.15)
// grass
else
// water

Using multiple noise functions would be desirable so you don't have the strict form of: mountains border trees, trees border grass, grass borders water. It would take a lot before complexity becomes an issue.
Forum_account wrote:
> var/n = noise_value(x,y)
>
> if(n > 0.5)
> // mountains
> else if(n > 0.4)
> // trees
> else if(n > 0.15)
> // grass
> else
> // water
>


Geldon, please stop using "shadow-jutsu" on code blocks!!
Toadfish wrote:
Forum_account wrote:
> > var/n = noise_value(x,y)
> >
> > if(n > 0.5)
> > // mountains
> > else if(n > 0.4)
> > // trees
> > else if(n > 0.15)
> > // grass
> > else
> > // water
> >

Geldon, please stop using "shadow-jutsu" on code blocks!!

I'll have to remember to go into my CSS and leave an exclusion for the comment bodies.