Bay 12 Games Forum

Please login or register.

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

Author Topic: Supercompression via Fractal-like Iterative generation  (Read 4301 times)

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: Supercompression via Fractal-like Iterative generation
« Reply #30 on: July 12, 2008, 11:27:56 am »

Presume that each square of land is one of 6 basic types - plains, forest, swamp, mountains, lake, ocean.

Now, take the smallest possible world. 17 by 17 squares. 289 squares, each can be one of 6 types. The resulting number of combinations is 7.7e+224. It doesn't convey the actual amount of worlds we can get, because the game will never chaotically place those tiles. So we'll trim it down a bit. Alright, go ahead and divide that by a googol, 10^100. You still get 7.7e+124. To compare, the total number of possible seed combinations represented thus is 2.5e+19, so it would take another division by googol, and thirty thousand more, to get it to that number. And that's for the smallest possible world. And we're comparing against the seeds total for all world sizes and with two separate seeds for terrain and civilization taken into account.

In other words, they will not be trilliards of worlds different by a small parameter. They will be different, noticeably different.
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Doppel

  • Bay Watcher
    • View Profile
Re: Supercompression via Fractal-like Iterative generation
« Reply #31 on: July 12, 2008, 12:32:48 pm »

"noticably" different is subjective. Just ask yourself what you consider to be relatively "noticably" different. If you take any random world out of those trilliard and compare them against any other random world them obviously they will be noticably different, but even if one world is unnoticably different to another world out of those trilliards that means that that world also is unnoticably different to another and that one to another and so on, till you gone through those trilliard worlds. Simple logics really. It would be simply impossible for every world to be noticably different to another. There simply aren't enough "unique parameters" for that to occur, and even if a trilliard worlds would be "noticably" different to eachother then we are dealing with either a trilliard parameters or with a trilliard trilliard worlds.
Logged
Doppel has been ecstatic lately. He took joy in playing DF lately. He slept on a rough cave keyboard recently.
He is a member of the Dwarf Fortress Forums.
Doppel likes the color Dark Blue, cats for their aloofness and girls for their silky soft brea beards.
He appreciates art and natural beauty.

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: Supercompression via Fractal-like Iterative generation
« Reply #32 on: July 12, 2008, 01:46:54 pm »

Ok, no. First of all, you seem to refer to "each world" being drawn from the multi-trilliard figure I made. That is not true. Any given world size would get its usual 4.3 billion variants, for terrain alone. Only 4.3 billion compared to the 7.7e+224 figure I got, that even when divided by a googol squared (an immense number by any but the astronomic account) is too large to be covered by any possible combination of seeds for all the world sizes, and with the civilization options taken into account. What I generally mean is that 4 billion isn't all that much for random landscapes. Think a square space 65.5 by 65.5 kilometers divided into 1x1meter chunks. Combine varying elevation with temperature, rainfall, erosion all factored in, and you'll see that with all the details on the landscape alone, 4 billion different variants is absolutely plausible. Rivers, lakes, volcanoes, all the little and not-so-little details will add up and make every world unique.

Although the point is moot, for me anyway. I hardly remember any details about the world I've been playing in for the last few months, so differences between worlds would go past me completely.
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

bigmcstrongmuscle

  • Bay Watcher
    • View Profile
Re: Supercompression via Fractal-like Iterative generation
« Reply #33 on: July 12, 2008, 02:12:24 pm »

You COULD look at seeds as a compression scheme, but only a VERY lossy one, and non-reversible to boot! Compression schemes have to handle all possible permutations of data, not just a small selection you've seeded ahead of time.

Okay. I have just generated a pocket world. Investigating the save folder of that pocket world, I find that it has generated roughly 270 KB of information. Each of those kilobytes is 8192 bits. We'll call it about 2.2 *10^6 bits, in total. Some of those bits are probably redundant, overhead, or wasted space from non-entropy-coded ASCII representation. So let's assume that only about 1/4 of those bits are directly relevant. This is arbitrary, but functional. It leaves us with 5.5*10^5 interesting bits.

The highest seed of any world I've looked at was somewhere on the order of 3*10^9.  That suggests that the seed is something along the lines of a 32-bit number.

That means that out of all the 2^550,000 possible worlds you could generate in a hypothetical map editor, saving that world to the nearest seed would result in the loss of some 549,968 bits of necessary information. Odds are the nearest match, assuming you have a good enough computer to find it algorithmically, (which you don't - remember, it has to generate all those seeds in order to check them. Imagine how long THAT would take) would be radically different from the data you entered. And that's a pocket world.

This is why you can't generate a world, play a fortress, and save the results to a seed again.
Logged

Doppel

  • Bay Watcher
    • View Profile
Re: Supercompression via Fractal-like Iterative generation
« Reply #34 on: July 12, 2008, 04:02:04 pm »

Ok, no. First of all, you seem to refer to "each world" being drawn from the multi-trilliard figure I made. That is not true. Any given world size would get its usual 4.3 billion variants, for terrain alone. Only 4.3 billion compared to the 7.7e+224 figure I got, that even when divided by a googol squared (an immense number by any but the astronomic account) is too large to be covered by any possible combination of seeds for all the world sizes, and with the civilization options taken into account. What I generally mean is that 4 billion isn't all that much for random landscapes. Think a square space 65.5 by 65.5 kilometers divided into 1x1meter chunks. Combine varying elevation with temperature, rainfall, erosion all factored in, and you'll see that with all the details on the landscape alone, 4 billion different variants is absolutely plausible. Rivers, lakes, volcanoes, all the little and not-so-little details will add up and make every world unique.

Although the point is moot, for me anyway. I hardly remember any details about the world I've been playing in for the last few months, so differences between worlds would go past me completely.

Wasn't that what i was saying? Some have "little" and others "not so little" and yet others "little and not so little" differences that in the end say "4 billion" noticably different world would stem out of atleast a "trilliard" worlds. I think we have a misunderstanding about what defines "unique", i'm looking at it with more of a "what exactly makes a world unique" question instead of a "every difference, no matter how small or relevant makes whatever unique", if the latter then everything is unique, even if its not.
Logged
Doppel has been ecstatic lately. He took joy in playing DF lately. He slept on a rough cave keyboard recently.
He is a member of the Dwarf Fortress Forums.
Doppel likes the color Dark Blue, cats for their aloofness and girls for their silky soft brea beards.
He appreciates art and natural beauty.

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: Supercompression via Fractal-like Iterative generation
« Reply #35 on: July 13, 2008, 12:52:03 am »

No, I think you were saying that with the sheer amount of variants on the trilliard scale, the worlds themselves would not be altogether different, simply because there is a limited amount of details that can make a world "noticeably" different from another. However, any world of any given size is still drawn from a mere 4 billion variants, not the multi-trilliard total figure I posted, not because they are the only "different" ones, just because the seed itself provides for 4.3 billion variants, and everything else is size settings.

If you think "what defines unique", then look. If a world is a flat plain, it can be different from another world that is a flat plain if it has a river running across it. Another world may have two rivers. Another may have a round lake in the center. Another may have the lake flat against the world's edge. One may have a volcano. Another may be littered with volcanoes. One may have a volcano inside a lake.
There are countless variants that can make even a set of flat worlds unique. Factor in forests, mountains, elevation changes, temperature effects creating glaciers and deserts, good/evil biome alignment, even stone layer placement, and all these details will overwhelm the 4.3 billion figure. In the end, each world will have enough of the "little details" to be noticeably different, though with the way the randomizer works, there are bound to be a few worlds that differ by a few mountain tiles.
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Abaxial

  • Bay Watcher
    • View Profile
    • http://www.xanga.com/stultiloquent
Re: Supercompression via Fractal-like Iterative generation
« Reply #36 on: July 14, 2008, 02:49:46 pm »

Well, it is interesting to look at it that way, but it really isn't compressed into 12 ten digit numbers. 

That is to say, I can do nothing with those 12 ten digit numbers unless I have the entire code base on my system.  The code itself is what creates the world from the seed.  It is not as though the numbers "2" and then "4" in sequence means a mountain exists in quadrant Ax5 and Ex13.

I get what you're saying though, and I agree, it's wonderful that we have the ability to supply a seed that creates such a world of depth. (No pun intended), while we dig even deeper into the world once we begin.  (Okay, pun intended.

I like teh big words.

It occurred to me that in a way, Toady one has struck on a method of compressing about 20 megabytes of data into 12 ten digit numbers (a 4 Kb text file)- and what's more, utterly losslessly. That is a compression ratio of 5654 to ONE.

Logged

Jifodus

  • Bay Watcher
  • Resident Lurker
    • View Profile
    • Dwarf Fortress Projects
Re: Supercompression via Fractal-like Iterative generation
« Reply #37 on: July 14, 2008, 05:50:27 pm »

Can I point something out? DF uses the Mersenne Twister (MT) to generate the world. So you can only easily access the N number of seeds (I'll leave the it as N for simplicity) which means there's only a limited number of initial MT states accessable.

Now if you consider the raws, minor changes* to the raws will vary the world a little, usually succeeding on the same state as it would unmodded. But much larger changes* will definitely change which state the world gen will succeed, and a different state means vastly different results.

* I have not extensively modded DF so I can't comment as to what changes affect the world in what ways. But I do know that adding a single reaction can shift locations of some features.

I like teh big words.

It occurred to me that in a way, Toady one has struck on a method of compressing about 20 megabytes of data into 12 ten digit numbers (a 4 Kb text file)- and what's more, utterly losslessly. That is a compression ratio of 5654 to ONE.

Try 100MB into a 12 ten digits numbers/4Kb text file.

And yes, it really is 100MB, Toady manages to get around 80% compression of the save files.
Logged

Faces of Mu

  • Bay Watcher
  • I once saw a baby ghost...but it was just a tissue
    • View Profile
Re: Supercompression via Fractal-like Iterative generation
« Reply #38 on: July 15, 2008, 10:47:40 pm »

So !
Has anyone started making their own succession game, where they create a fort in one seed, build it up, abandon, then create a new world from the same seed but with one major variable tweaked a little, then go and recreate the fort of the previous world in the same spot? Would love to see the snapshots of forts made like this from one 'reality' to the next.
Logged

Zemat

  • Bay Watcher
  • Zemat, programmer, cancels coding: Too insane.
    • View Profile
Re: Supercompression via Fractal-like Iterative generation
« Reply #39 on: July 16, 2008, 04:04:43 am »

That might not work since changing a vital parameter could cause the new region to have more or less rejects than the previously generated region even if they have the same seed. You'll need to insure that same seeds with different parameters have the same number of rejects.
Logged
You too can help bring to life the RogueLife Project!

Anu Necunoscut

  • Bay Watcher
    • View Profile
Re: Supercompression via Fractal-like Iterative generation
« Reply #40 on: July 16, 2008, 10:09:28 am »

It wouldn't surprise me if Starflight was a big inspiration for Toady.  It made extensive use of fractals, cramming 800 unique, huge planets onto two 5.25" disks.  What a fantastic game that was.  The languages and planetary wildlife actually remind me quite a bit of Dwarf Fortress.
Logged

Areyar

  • Bay Watcher
  • Ecstatic about recieving his own E:4 mug recently
    • View Profile
Re: Supercompression via Fractal-like Iterative generation
« Reply #41 on: July 25, 2008, 07:34:25 pm »

Does anyone have a copy of Starflight? +scanned booklet.
I still got my C+64, but lost the game during a move. had this pretty map too.
Logged
My images bucket for WIPs and such: link

Shadowlord

  • Bay Watcher
    • View Profile
Re: Supercompression via Fractal-like Iterative generation
« Reply #42 on: July 25, 2008, 07:51:14 pm »

Now if you consider the raws, minor changes* to the raws will vary the world a little, usually succeeding on the same state as it would unmodded. But much larger changes* will definitely change which state the world gen will succeed, and a different state means vastly different results.

* I have not extensively modded DF so I can't comment as to what changes affect the world in what ways. But I do know that adding a single reaction can shift locations of some features.

New DF versions tend to cause seeds to no longer generate the same worlds they used to, so... I wasn't checking to see if the raws were changing at the time I noticed it happening (I'd find a good location, settle there, then restart in the next version with the same seed and the location was completely different... Then the same thing happened in the next version too).

Internal changes to the world generation algorithms, not just changes to the raws, would affect the map you get, so...
Logged
<Dakkan> There are human laws, and then there are laws of physics. I don't bike in the city because of the second.
Dwarf Fortress Map Archive

Mr.Person

  • Bay Watcher
    • View Profile
Re: Supercompression via Fractal-like Iterative generation
« Reply #43 on: July 25, 2008, 08:27:45 pm »

That might not work since changing a vital parameter could cause the new region to have more or less rejects than the previously generated region even if they have the same seed. You'll need to insure that same seeds with different parameters have the same number of rejects.

Nullify all the reject parameters. You get the first thing the world spits out, unless all the dwarves die out or whatever.
Logged
Youtube video of the year, all years.
Hmm...I've never been a big fan of CCGs - I mean, I did and still do collect Pokemon cards, but I never got heavily into the battling and trading thing.

By definition that makes you a fan since you still buy them.

Draco18s

  • Bay Watcher
    • View Profile
Re: Supercompression via Fractal-like Iterative generation
« Reply #44 on: July 25, 2008, 09:03:26 pm »

I suspect that in the case of a rejected world it uses your seed to pick a new seed. If that is the case, then the number of possible worlds is much smaller than people are guessing, although still pretty large.

Nope.  The Mersenne Twister RNG system, it just uses the next value presented by the Twister's Stack 'O Numbers.
Logged
Pages: 1 2 [3]