Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3

Author Topic: GeoVox: World Generator with realistic geological history (in progress)  (Read 20271 times)

GavJ

  • Bay Watcher
    • View Profile
Re: GeoVox: World Generator with realistic geological history (in progress)
« Reply #15 on: October 12, 2014, 07:36:54 pm »

I'm sort of deciding since then it's not even enough detail. I think I'm going to keep the above system for rock-lookup for qualities that are needed during geology generation (like density of rocks), but then add in a lot more chemical data that just rides along and gets blended and waits to be applied only at the very end or during gameplay for placing gems and ores and things. These wouldn't use pre-interpolated lookup tables (O(1)) like the geologically relevant stuff does, but would use nearest neighbor only (O(log n)) when interpreted at the end.

Medieval and earlier-relevant (for gems/inclusions/rare minerals and for ores), 16 more x 2 bits each:
titanium
phosophorus
manganese
fluorine
barium
carbon
sulfur
chlorine

copper
tin
gold
silver
lead
mercury
arsenic
zinc


Optional 20th century games may need more elements at the expense of smaller worlds within RAM limits:
noble gases - airships, welding, insulators, many things... may not work here. May need to be shifted to a whole special system with gas goxels in general, but ...later.
tungsten - mostly structural
rare earth elements as a group - magnets, lots of random stuff
platinum - catalysts, anti-corrosive structural
lithium - batteries, ceramics, nuclear, many things
uranium - nuclear
boron - semiconductors, ceramics, lubricants, nuclear shielding
chromium - refractory, metallurgy, mordant, mirrors

and if you want a 21st century or futuristic game, 8 more:
indium/gallium - advanced superconductors, LEDs, lasers, solar panels
germanium - fiber optics
plutonium - advanced nuclear
beryllium - advanced nuclear/xray/etc control and equipment
[custom slot]
[custom slot]
[custom slot]
[custom slot]

Note that ores and gems and things are defined by ratios of all of the above, i.e. trillions of possible combos, though FPS contribution (for example generating a chunk in minecraft or embarking in DF) becomes O(log n) slower for more actual combos on file for a game.

Strongly considering also doing some bookkeeping on common rock building minerals to help with fractional crystallization and weathering different chemicals differently from a rock later on.
« Last Edit: October 13, 2014, 04:47:23 am by GavJ »
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.

jwhite.df

  • Bay Watcher
    • View Profile
Re: GeoVox: World Generator with realistic geological history (in progress)
« Reply #16 on: October 13, 2014, 10:01:00 am »

It would make sense to me to mimic nature. As things cool, decide what's precipitating out in the form of gems and metal veins.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: GeoVox: World Generator with realistic geological history (in progress)
« Reply #17 on: October 13, 2014, 02:56:10 pm »

I would suggest maybe taking a step back and thinking about the output you are interested in your program making, and how you are going to get DFHack to work. It would be a shame for you to put hours and hours into developing the actual generator only to realize that there is some unforeseen hiccup. You could make a fake "sample" output and work from there, it will give you a better idea of everything you need to keep track of and ultimately change with DFHack.
Logged

GavJ

  • Bay Watcher
    • View Profile
Re: GeoVox: World Generator with realistic geological history (in progress)
« Reply #18 on: October 13, 2014, 08:14:06 pm »

Quote
I would suggest maybe taking a step back and thinking about the output you are interested in your program making, and how you are going to get DFHack to work.
The tiletypes tool on dfhack supposedly already does what I want it to do according to IRC people--changes one tile to another type. Do this 400,000 times or whatever (after scaling to the available height and maybe offsetting to where the wagon is) and you have yourself a loaded map from outside the game.

I'm not overly concerned about whether that actually works word for word, because: 1) This is for any voxel game, past present future. I may even go on to make a game afterward if I do a good enough job to convince myself, so the core program isn't designed to be custom tailored to DF anyway nor dependent upon it. 2) dfHack COULD do almost anything like this, even if it currently doesn't completely. It's a matter of finding some additional memory addresses than what they currently use in tiletypes. But it is completely a matter of memory, and obviously, this information is all stored somewhere explicitly in memory. It should all be the easiest stuff to find too! Because tile info would use up like 40+% of memory. 3) Toady is pretty accessible and worst case scenario can be contacted for hints. It's pretty absurd anyway to have a voxel game where modders can't adjust everything about a voxel -- if that's not possible, then he need to get on that regardless of this project or not, yesterday.

The engine will certainly require porting to any game, to sift out the info that is useful or not from a disk file generated. But "ports" here are pretty much just big loops that read tile info, grab what you want, and then use whatever API for that game (bukkit, dfHack, etc.) to adjust tiles in a row.

tl;dr: I/O is boring, and forcing myself to wallow through the arcane DF system too soon before even really getting started could kill my motivation. But it is still almost guaranteed to be doable anyway, post-wallowing, somehow or other. Also, I would want to make it DF or not.

Quote
It would make sense to me to mimic nature. As things cool, decide what's precipitating out in the form of gems and metal veins.
Yeah, it's just a matter of memory. I could store bytes for every element at 0.5% precision, and all the minerals I've ever heard of, etc. But then you'd only be able to generate, like, a 100x200 world or something silly before overflowing.
« Last Edit: October 13, 2014, 09:22:11 pm by GavJ »
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: GeoVox: World Generator with realistic geological history (in progress)
« Reply #19 on: October 14, 2014, 02:28:42 am »

Don't forget that dfhack already has 3dveins a plugin that makes mineral veins 3d. Though it uses 3d perlin noise IIRC.

So it's possible to remake some of df in dfhack. The mineral layers are a pain though. But keep up the good work GavJ. It's really interesting where it will take you :) (as i'm a bit of simulation-ist too)

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: GeoVox: World Generator with realistic geological history (in progress)
« Reply #20 on: October 14, 2014, 02:57:32 am »

May you have better luck than my attempt at air flow simulation in DF environments.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: GeoVox: World Generator with realistic geological history (in progress)
« Reply #21 on: October 14, 2014, 11:32:16 am »

Quote
I would suggest maybe taking a step back and thinking about the output you are interested in your program making, and how you are going to get DFHack to work.
The tiletypes tool on dfhack supposedly already does what I want it to do according to IRC people--changes one tile to another type. Do this 400,000 times or whatever (after scaling to the available height and maybe offsetting to where the wagon is) and you have yourself a loaded map from outside the game.

I'm not overly concerned about whether that actually works word for word, because: 1) This is for any voxel game, past present future. I may even go on to make a game afterward if I do a good enough job to convince myself, so the core program isn't designed to be custom tailored to DF anyway nor dependent upon it. 2) dfHack COULD do almost anything like this, even if it currently doesn't completely. It's a matter of finding some additional memory addresses than what they currently use in tiletypes. But it is completely a matter of memory, and obviously, this information is all stored somewhere explicitly in memory. It should all be the easiest stuff to find too! Because tile info would use up like 40+% of memory. 3) Toady is pretty accessible and worst case scenario can be contacted for hints. It's pretty absurd anyway to have a voxel game where modders can't adjust everything about a voxel -- if that's not possible, then he need to get on that regardless of this project or not, yesterday.

The engine will certainly require porting to any game, to sift out the info that is useful or not from a disk file generated. But "ports" here are pretty much just big loops that read tile info, grab what you want, and then use whatever API for that game (bukkit, dfHack, etc.) to adjust tiles in a row.

tl;dr: I/O is boring, and forcing myself to wallow through the arcane DF system too soon before even really getting started could kill my motivation. But it is still almost guaranteed to be doable anyway, post-wallowing, somehow or other. Also, I would want to make it DF or not.

If you are doing it regardless of DF then more power to you and I would definitely continue along your current path. The only reason I suggested thinking about DFHack and DF in particular is there are certain features you are not going to want to change (i.e. underground fortresses, adamantine spires, already built structures, etc...) so you are going to need some way to avoid altering those tiles. The simple way would just be to say, if there is one of those features there, don't do anything and just move on to the next, but what if the game places a building at z-level 101, but your geography says that current level only goes to z-level 99 or goes to z-level 102? You don't want floating buildings (although buildings covered in earth might not be too bad). It just seems to me that you are going to need some pretty extensive logic system to make sure you don't overwrite unique features.

Also along that line of thought, how are you going to handle fantasy metals and stones? Can I tell your engine that I want Mithril to form veins? Will it read the raws for all your metals and stones and such and place them accordingly?

Realistic geology is great, and I am fully supportive, and will even help on the DFHack side of things, or the geology side (Physics PhD, so not a geologist by any means, but it is one of my interests), just wondering how you will encorporate fantastical elements into realism, and how you will handle DF unique features (some research might need to be done on cavern levels as well, pathing info for underground features might be stored outside of the standard tiletypes information, should still be alterable though)

EDIT: Another question, I assume you will keep the slade layer as a basis and place your geology on top of that. Will you correlate the slade to a particular feature on a "typical" planet's geology? (i.e. tectonic plates, mantle, etc...)

EDIT2: Will your geology engine allow for more a-typical planet formation (a-typical only in reference to our solar system) with features like multiple moons, binary planet effects, increased/decreased meteor bombardment, etc...
« Last Edit: October 14, 2014, 11:42:31 am by Roses »
Logged

CLA

  • Bay Watcher
    • View Profile
Re: GeoVox: World Generator with realistic geological history (in progress)
« Reply #22 on: October 14, 2014, 12:27:21 pm »


If you are doing it regardless of DF then more power to you and I would definitely continue along your current path. The only reason I suggested thinking about DFHack and DF in particular is there are certain features you are not going to want to change (i.e. underground fortresses, adamantine spires, already built structures, etc...) so you are going to need some way to avoid altering those tiles. The simple way would just be to say, if there is one of those features there, don't do anything and just move on to the next, but what if the game places a building at z-level 101, but your geography says that current level only goes to z-level 99 or goes to z-level 102? You don't want floating buildings (although buildings covered in earth might not be too bad). It just seems to me that you are going to need some pretty extensive logic system to make sure you don't overwrite unique features.

That's why I think it's better to output as DF world file (seed? not sure about the terminology) you can then create history on top of. From what I understand, underground fortresses, etc only get generated during history, not the generation of the world per se. Same for other structures, obviously.

Although I'm not sure if seeds even save layers below the surface.
Logged
CLA - an ASCII-like Graphic Pack with simplified letter-like creature graphics. The simple and clean looks of ASCII with distinct creature graphics - best of both worlds!

http://www.bay12forums.com/smf/index.php?topic=105376.0

Roses

  • Bay Watcher
    • View Profile
Re: GeoVox: World Generator with realistic geological history (in progress)
« Reply #23 on: October 14, 2014, 01:08:57 pm »

The problem with that is seeds are very basic. Even PerfectWorld only lets you configure some things, not nearly as much as GavJ is envisioning. I don't think there is anyway to further PerfectWorld's features. Basically you will have two programs for creating worlds (assuming this project works as expected)

PerfectWorld - Generate world creation files that the game uses to generate the world off of based on it's own world creation engine.

GeoVox - Create world outside of DF using a completely custom geology history (allowing for more realistic layering and other features that are absent in DF currently), then overwrite entire world using DFHack.
« Last Edit: October 14, 2014, 01:15:54 pm by Roses »
Logged

GavJ

  • Bay Watcher
    • View Profile
Re: GeoVox: World Generator with realistic geological history (in progress)
« Reply #24 on: October 14, 2014, 01:19:42 pm »

Quote
The only reason I suggested thinking about DFHack and DF in particular is there are certain features you are not going to want to change (i.e. underground fortresses, adamantine spires, already built structures, etc...) so you are going to need some way to avoid altering those tiles.

I can't see any way to reasonably accommodate villages and fortresses and things while radically changing the geology, so it probably would have to just be a "too bad, overwritten" situation. MAYBE. Maybe there's some clever solution, and if anybody suggests one or I think of one later, I'll try to pull it off. Especially since this may also be relevant for minecraft and lots of other games too. So I'll certainly keep it in mind, thanks, but won't be relevant for quite awhile.

Height in general is fairly flexible, because the voxels in the geology engine ("goxels") are abstract in size. I plan to write algorithms that flexibly interpolate curves in rock strata and stuff in actual game tiles for any number of game tiles the user specifies for a goxel at the very end / when requesting final map sections. This could also just be an automatic process potentially if you're using something like dfhack that can detect the available airspace itself.

Likely what you'd do is choose a size that fits in as much geology as possible without clipping the bottom, then fill in the gap between geology and semi molten rock with something sensical like just eclogite (high temp/pressure metamorphic) or peridotite (i.e. the rock term for "nearly pure olivine").

Spires are easy by just adding them in a special script as a modder on top of the geology at the end, part of the porting code (which I might do myself too).

Quote
Also along that line of thought, how are you going to handle fantasy metals and stones? Can I tell your engine that I want Mithril to form veins? Will it read the raws for all your metals and stones and such and place them accordingly?
Yes absolutely!! In spades. My goal is to get as close as possible to not putting a single string or constant anywhere in the hard code (other than stuff like pi of course), but to have it all in "raws." And a consequence of that is that you end up having most of the same tools I have for control and distribution of almost any material, because I have to code all the same tools for myself using the raws too.

Basically, every goxel keeps track of the elements and their proportions in it, as well as its largest mineral components. The game tries to move elements around between rocks (such as when smushed together or melted together or eroded) in mineral units, beginning with the ones specified as being there, and after that, going by nearest valid matches from the mineral database. Whatever is left over just gets homogenously blended.

So you can actually add mithril in SEVERAL levels of complexity, depending how dedicated you are. Simplest would be definining it as a mineral of existing elements in the mineral raws, like I dunno, hydrated manganese iron aluminum sulfides or whatever. Bam. done.

Or if you want to be more hardcore, you can put it in one of the custom chemical element slots, which will eventually include original chemical source (like is it a radioactive decay product? or asteroidal? or just an original constituent of Earth's dust cloud?) and then potentially indicate several different mineral ores of mithril -- this will end up affecting how it gets distributed, because different minerals can have different weathering resistances and can be more or less likely to form sands for instance, or to dissolve in water, and end up in different characteristic places where the player can know to look for mithril ore (or learn to).  Minerals also crystallize in different temps and pressures, so it may only be found deep underground or only near the surface, etc.

Most complex would be also adding rock classifications as well with characteristic mithril mineral components, which allows more options for control even still.

Quote
EDIT2: Will your geology engine allow for more a-typical planet formation (a-typical only in reference to our solar system) with features like multiple moons, binary planet effects, increased/decreased meteor bombardment, etc...
Meteors yes, definitely to be included, since I plan to use them for element introduction, extinction events (for carboniferous strata), and physical features. And anything like that included will be controlled by init parameters like everything.

Tidal forces I'm not sure. The simulator is happening way faster than any tides, even inter-planetary ones, since a timestep is like 1-10 million years. Tides matter for erosion, but it might just be something more like each goxel being "0-3 level of tidal activity." And regardless of how I implement that (anything from simple water depth to pathfinding where fjords are), I'm not sure how number of moons or planets would be immediately obviously relevant

Also, the simulator begins with flat, oceanic basalt crust, so it's mainly skipping right past / ignoring hotter rock stages, plastic tectonics, etc. and making some simplifying assumptions about everything during roughly Earth's Hadean eon or equivalent. That could change, but not for the first version.

Quote
That's why I think it's better to output as DF world file (seed? not sure about the terminology) you can then create history on top of. From what I understand, underground fortresses, etc only get generated during history, not the generation of the world per se. Same for other structures, obviously.
Well I certainly can't output to a seed, because that means DF is doing all its own world generation, i.e. vanilla worlds...

I also can't specify a detailed map for it to just read ahead of time. You can't specify custom game tile maps in dwarf fortress. You can't even specify custom embark tile maps. You can only specify custom REGION tile characteristics (see PerfectWorld mod). Everything smaller than that is dynamically generated on the fly by DF only as needed.

So there are really only 3 options:
1) Get Toady to implement a world gen API to allow coders to reach in and manipulate stuff during world gen prior to structures being placed.
2) VERY skilled dfhack people to figure out how to do the same thing (still wouldn't be a seed -- it'd be a complicated dfhack script you would have to have running during worldgen). That's not going to be me as I know little about memory hacking, but I could use it if somebody else figured it out.
3) My preferred solution: let it go ahead and generate whatever it wants, then just overwrite it with my own regional interpolator. But that includes most likely overwriting structures.
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.

Roses

  • Bay Watcher
    • View Profile
Re: GeoVox: World Generator with realistic geological history (in progress)
« Reply #25 on: October 14, 2014, 02:43:04 pm »

Yes, if you are skipping past early formation stages than moons and binary planets wouldn't be nearly as important (one current theory is that our tectonic structure is largely due to the moon's influence during early formation, remember that it was much closer then). Although if you had multiple moons you would also be better shielded from meteors, but if you just have a slider to control number (or rate) of meteoric impact that would handle that.

I think, overall this sounds like a very very ambitious project, but one that isn't limited to DF and is actually fairly interesting (especially to just think about in general).

One thought for the villages and fortresses would be to do some sort of interpolation, something like, replace all of these tiles, oh, you found a village, move back to previously replaced tiles and create a valley/hill to adequately house the village. It wouldn't necessarily be very realistic, but it would also allow for villages and fortresses to exist, which is a rather large part of the game. Although it may make mountain fortresses no longer appear in mountains, or tree villages not in forests which would be weird. I wonder if it would be at all possible to interrupt world generation in between the actual geography creation and the social aspects. Then you could place your realistic world, and have the fortresses and such be placed in correct positions, without needing any special logic.
Logged

GavJ

  • Bay Watcher
    • View Profile
Re: GeoVox: World Generator with realistic geological history (in progress)
« Reply #26 on: October 27, 2014, 04:28:42 pm »

New blog post on the materials storage and lookup systems for the program (minerology and petrology!):

http://cauliflowerlabs.blogspot.com/2014/10/geology-simulator-minerology-and.html

Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: GeoVox: World Generator with realistic geological history (in progress)
« Reply #27 on: October 27, 2014, 05:01:40 pm »

This look very, very cool!

I can't wait for a demo :)
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Icefire2314

  • Bay Watcher
  • Programmer and Space Enthusiast
    • View Profile
Re: GeoVox: World Generator with realistic geological history (in progress)
« Reply #28 on: November 04, 2014, 04:20:17 pm »

You, sir, are ambitious.

In a good way though. What you're attempting is amazing.
Logged
"ERUTH PULL THE DAMN LEVER THE ZOMBIES ARE ABOUT TO GET INSIDE!"
"zzz"
BAY 12 MINI CITY: http://bay-12.myminicity.com/

GavJ

  • Bay Watcher
    • View Profile
Re: GeoVox: World Generator with realistic geological history (in progress)
« Reply #29 on: November 04, 2014, 08:08:24 pm »

Thanks!

Thermodynamics pretty much working now. The image below shows locations of mantle plumes (superimposed black dots) and a map of the crust, blue = cold, red = hot, each pixel = column of goxels, with an overly dramatic amount of heating going on. The crust is currently stationary.  The temperatures you see are actually being filtered through conductiveness, specific heat, and density all properly by Fourier's law, with just a couple shortcuts (causing the minor and insignificant banding). Heating follows Gaussian, not linear falloff too! And since the plumes are all equally active for now, reads from a dynamically stored table of circle distances.

For a thin ocean crust, this algorithm goes quickly enough on a 300x300 map that I can't even snap a screenshot quickly enough before it gets too hot without adding in pause functions.

Next step is cracking the crust along the weaker hot paths (pathfinding with temperature as cost, for now), to form plates, then determining Voronoi maps of nearest plume neighbors for calculating plate movement vectors, and filling in new ocean floor and volcanism where stuff collides.

For now, volcanism is just a number stored in the column so I can show it in the images. Later will mean actual volcanism and trigger new algorithms, etc.

This isn't just a simple image of only thermodynamics. The coordinate system is already in place to handle all the wrapping of coordinates, and all set up to be ready to handle plates moving independently too (they're stored in separate vector lists of columns, so I only have to chnage one offset number to "move" the plate basically). System already loads up all the goxels as basalt, and has 3D structure, etc.

Getting there!



Top left panel is the actual map. Rest of it is copied/pasted to show how it wraps around correctly.
« Last Edit: November 04, 2014, 08:13:47 pm by GavJ »
Logged
Cauliflower Labs – Geologically realistic world generator devblog

Dwarf fortress in 50 words: You start with seven alcoholic, manic-depressive dwarves. You build a fortress in the wilderness where EVERYTHING tries to kill you, including your own dwarves. Usually, your chief imports are immigrants, beer, and optimism. Your chief exports are misery, limestone violins, forest fires, elf tallow soap, and carved kitten bone.
Pages: 1 [2] 3