Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: World creation as a mental exercise  (Read 1743 times)

LumenPlacidum

  • Bay Watcher
    • View Profile
World creation as a mental exercise
« on: July 03, 2008, 02:28:56 pm »

I've been giving some consideration to how I would go about doing something similar to the DF world generator.  It wouldn't turn into an awesome game, like DF does, but it might create some very pretty landscapes if I team up with some friends of mine who do terrain rendering.

I'm curious; does the dwarf fortress world maker use plate tectonics to create its terrain heights?  How does the process differ now from the original ambitions of how it would work when the project was started?

Here's what I've got so far as a skeleton for the process.  Let me know what people think.  Oh, and I'm not much of a programmer yet, I'm a mathematician.  So, I'm more approaching this as a mental sketch initially than as a program.

1. I'm thinking of using a spherical geometry for the world.  The finite, boundless surface created seems like it would be essential for the accurate representation of everything to happen afterwards.
2. I want to use plate tectonics to create the differences of elevation in the world.  I can generate rough ideas of tectonic plates by randomly creating vertices radiating out from the center of the planet (uniform distribution over the sphere, but of slightly different lengths for initial terrain heights).  By connecting the tips of these vectors, I can create the boundaries of each plate.  Then, I can assign each plate a movement vector across the surface of the world.  Convergent plates would throw up mountain ranges and volcanoes and would create a trench.  Divergent plates would create rifts.  Transform plates would have very jagged terrain.
3. After running the plates for a while, I think I'd have a lot of varying terrain heights.  At this point, I'd add the forces of erosion to the world in the form of water and weather.  I don't want this to get so complicated that it would drive the simulation to a complete halt, but tracking annual rainfall patterns, river flows, and winds would give me a very accurate representation of how the land gets further shaped.  The process can be diligently tracked for ten years, then those can be repeated for a hundred years.  Then tracked for ten years, etc. until the end age of the world is reached.  The rainfall would be most greatly affected by winds, mountains and oceans. 
4. Rivers, oceans, winds, and rains would erode the rocks.  Rivers would act to make their beds smooth by digging down.  Oceans would cut away at the shorelines.  Winds would cut mountains into jagged cliffs, and rains would generally carry rock downhill.
5. Plants would have to be added.  Elevation, rainfall, and temperature would determine how this happens, but I'm relatively clueless as to how at the moment.  I do know that the algorithm doing this would have to be recursively applied while the weather patterns occur.  This way, populations of flora can be changed as the climate patterns dictate.
6. Once plants have been applied, then I have a nice setting to look at.  I figure that I could select times of year for viewing the terrain.

I know this is ridiculously ambitious, but hopefully I'll manage some interesting time-saving optimizations to help things along.  I think it'd be a very long-term thing.
Logged

Andy Korth

  • Bay Watcher
    • View Profile
Re: World creation as a mental exercise
« Reply #1 on: July 03, 2008, 03:48:05 pm »

Dwarf Fortress uses fractal terrain generation, like this.

http://www.google.com/search?q=fractal+terrain

The first link is a very good article on the topic.
http://www.gameprogrammer.com/fractal.html

After the terrain heights are generated, I believe Toady does the same things for temperature and rainfall (or evilness/goodness). Then the maps are overlayed, and biome types are inferred from a combination of those three factors.

I'm not sure how rivers and the like are generated.

Spherical worlds are a pain, because you can't represent them accurately on a square grid. If you want a wrapping world, I'd suggest a toroidal world.

A more realistic model like you've described would be pretty interesting, but probably a lot more work.

P.S. I've done some game development and that has included fractal terrain generation... nothing nearly as cool as what Toady's done though!
Logged

Fourth Triad

  • Bay Watcher
    • View Profile
    • http://www.bay12games.com
Re: World creation as a mental exercise
« Reply #2 on: July 03, 2008, 04:08:27 pm »

Nope, no plate tectonics in df, just a flat region of a world. If you ever get this thingy up and running I'd like to take a look at and/or bug test it, i love random world generators.
Logged

Lyndon

  • Bay Watcher
    • View Profile
Re: World creation as a mental exercise
« Reply #3 on: July 03, 2008, 04:54:01 pm »

I second what Fourth said.
I think Maps in DF have lakes generated on top of the mountains first at the higher points, that or they are procedurally placed on the mountains.
Logged
The Dwarf Fortress Forum has been attacked with the toolbox by The Signature.
The Dwarf Fortress Forum has been knocked unconscious!

You hear a gunshot.

Duke 2.0

  • Bay Watcher
  • [CONQUISTADOR:BIRD]
    • View Profile
Re: World creation as a mental exercise
« Reply #4 on: July 03, 2008, 07:01:46 pm »


 From what I remember from an interview:

 1. The world uses random heightmap generation. No fancy plate tectonics.

 2. Water filles in all land below a specific elevation. It is set to 100% saltiness.

 3. Lakes are placed where the local moisture levels are really high. Rivers are generated near high terrain and move towards low terrain. No river sources in the middle of nowhere.

 4. http://www.gamasutra.com/view/feature/3549/interview_the_making_of_dwarf_.php

 Most of what we know about worldgen is there and splattered through the Devnotes.
Logged
Buck up friendo, we're all on the level here.
I would bet money Andrew has edited things retroactively, except I can't prove anything because it was edited retroactively.
MIERDO MILLAS DE VIBORAS FURIOSAS PARA ESTRANGULARTE MUERTO

Idiom

  • Bay Watcher
  • [NO_THOUGHT]
    • View Profile
Re: World creation as a mental exercise
« Reply #5 on: July 03, 2008, 08:19:00 pm »

PLAY SIMEARTH.

Want re-make! *Drool*

You've seen Terragen I'm guessing? Last I saw, Terragen 2 could even do overhangs. Take a look at the indie Infinity: The Quest for Earth. Procedurally generated planets with no loading screens or hang ups, beautiful results, and great dev notes in the forums.
Logged

Javis

  • Bay Watcher
    • View Profile
Re: World creation as a mental exercise
« Reply #6 on: July 05, 2008, 06:49:58 pm »

Just make sure that it reticulates splines.
Logged

Koji

  • Bay Watcher
  • Kobold
    • View Profile
Re: World creation as a mental exercise
« Reply #7 on: July 06, 2008, 04:04:07 am »

Something that always bugged me about worldgen was that forests are based on high rainfall+high drainage, but aren't forests low drainage alluvial plains?
Logged
Dwarvenrealms
ASCII | Graphical
Over 220 new creatures, new civs, new industries, and a fully customized tileset!

McDoomhammer

  • Bay Watcher
  • Uses: Ore of irony
    • View Profile
Re: World creation as a mental exercise
« Reply #8 on: July 06, 2008, 07:29:56 am »

Just make sure that it reticulates splines.

Don't they have Llamas to do that?
Logged
"KILL, KILL, KILL! NOTHING SHALL STAND BETWEEN US AND THE CEREAL BAR!"
-The Violent Council of Breakfast

Tamren

  • Bay Watcher
  • Two dreams away
    • View Profile
Re: World creation as a mental exercise
« Reply #9 on: July 07, 2008, 09:36:16 pm »

Don't forget to lubricate the freewheel unit
Logged
Fear not the insane man. For who are you to say he does not percieve the true reality?