PRE vs POST
❝Work them dev tools!❞ ™
My intent is not to solve, but merely to inspire HG. Erosion was a difficult problem, until it was solved. One voxel can’t know the context of another voxel. But you can know the derivative. So what else and how far?
Moist Maths & Flowing Voxels
In the above video, Innes McKendrick (a lead programmer for Hello Games) states…
At 3:08…
And finally, I’m going to talk about our simulation itself, special considerations that we have to take, because we’re working on a game that’s generated in real-time and occupies a space bigger than we can know a lot of information about.
Crim’s Commentary:
And finally, I’m going to talk about our simulation itself, special considerations that we have to take, because we’re working on a game that’s generated in real-time and occupies a space bigger than we can know (in post; RAM)
a lot of information about (in post; notice ‘in post’; or in rendering)
.
At 8:01…
We have to be able to simulate gameplay with only a small knowledge of the world. So if were generating this whole planet, and that’s a bigger space than we can really get much information about at all, you know, we can maybe know a few points of interest, but beyond that any kind of data we have about it is too much data for us to keep in memory and for us to argue about all the time. So any work that we do has to, to be able to work just within its own local space, without knowledge of whether there’s a lake over that mountain, whether you’re at the highest mountain of the planet, or just at a mountain. And that’s a really significant thing to, to keep in mind, I think, as I’m talking through this.
A final note is that our engine is really agnostic to procedural content [origin]. I think people sometimes talk about No Man’s Sky as the procedural game, and I’m not sure if that’s the right way to look at things. For us, our engine doesn’t really care if we generate the content online or whether we’ve loaded it, or where it comes from at all, to be honest.
Crim’s Commentary:
We have to be able to simulate gameplay with only a small (post-)
knowledge (RAM)
of the world (in post; notice ‘in post’; or in rendering)
. So if were generating this whole planet (in post)
, and that’s a bigger space than we can really get much information about at all (in post)
, you know, we can maybe know (in post)
a few points of interest, but beyond that any kind of data we have about it (in the game files) (((which is the result of 'PRE’))) (((pre is the initial seeding))) (((which is the result of dev tools)))
is too much data for us to keep in memory (in post; RAM)
and for us to argue about all the time. So any work that we do (((in ‘PRE’)))
has to, to be able to work (in post)
just within its own local space (in post)
, without (post-)
knowledge (RAM)
of whether there’s a lake over that mountain, whether you’re at the highest mountain of the planet, or just at a mountain (in post; notice ‘in post’; or in rendering)
. And that’s a really significant thing to, to keep in mind, I think, as I’m talking through this.
A final note is that our (post-)
engine (RAM)
is really (post-)
agnostic (RAM)
to procedural content [origin] (in post; notice ‘in post’; or in rendering)
. I think people sometimes talk about No Man’s Sky as the procedural game, and I’m not sure if that’s the right way to look at things. For us, our (post-)
engine (RAM)
doesn’t really care if we generate the content online (in post)
or whether we’ve loaded it (in post)
, or where it comes from at all (in post)
, to be honest.
Crim’s Interpretation:
‘ALL’ things are ‘1ST’ known in ‘PRE!’
Hello Games’ ‘DEV TOOLS’ (should be capable of) know(ing) (((in ‘PRE’))) “whether there’s a lake over that mountain, whether you’re at the highest mountain of the planet, or just at a mountain” (in pre; notice ‘in pre’; or at the initial seeding, of the universe, of the game files, with dev tools).
Once seeded (((in ‘PRE’))), all aspects of ‘THE BASIN’ will now (as Innes McKendrick clearly states) “be able to work (in post) just within its own local space (in post), without (post-) knowledge (RAM) of whether there’s a lake over that mountain, whether you’re at the highest mountain of the planet, or just at a mountain (in post; notice ‘in post’; or in rendering).”
How so? — Because…
ALL THINGS ARE 1ST KNOWN IN PRE!
So…
MESSAGE TO HELLO GAMES:
Consider seeding the universe with creeks, rivers and waterfalls of water, direction, intensity and flow. Also lakes, ponds and puddles, collecting in the lowest points, above the planet-wide ocean water-line.
Much love to the ancient ones. ❝Work them dev tools!❞ ™ @OldGods
Behold, THE BASIN!
So let’s finish up with Innes McKendrick’s talk…
At 34:38…
And then there’s a final point. We want our generation to be data local. And that’s the kind of interesting and tough point in all of this. So if we’re generating a single voxel, it can’t know anything about any of the other voxels round about it, it’s stateless, so it can’t know whether it’s half way up a mountain or at the top of a mountain, aside from that it is a mountain, it has, you know, maybe 50% of a mountain. And that becomes a real problem when you want to, to map out like water flowing, and things like that. So that means we have to look at generation techniques, that look as though they’ve evolved over time, that look as though they know information about what is next to them. We have to model erosion, but you don’t model erosion as the process of eroding, you model it as the end state of all those things, you model something that looks like it has eroded over time.
So, to break that down, to how we actually do it, let’s start with 2D terrain generation. And so our first stage, as an optimization, more than anything else, but also because it simplifies things conceptually, is to block out some shapes in 2D. So, we’ll split areas into mountains, into maybe some smoother plains down there, there’s a river on there, and this doesn’t come out as voxel data, this is just a series of values that are saying the extent of which this voxel is a mountain, or is smooth, or is a river. So it’s a much larger amount of data, but we’re only retaining it for a short period of time, until we go on into 3D generation. And we do this essentially for each voxel column. So if you imagine we were generating on a flat plain, it would be across the x-edge, but because were generating on a sphere, then it’s across the surface of our sphere, but without any height. So what comes out of this is like generating a height map, you know, without any overhangs or caves, we have the heights of hills, things like that.
Crim’s Commentary:
And then there’s a final point. We want our generation (in post)
to be ‘DATA LOCAL’ (in post; notice ‘in post’; or in rendering)
. And that’s the kind of interesting and tough point in all of this. So if we’re generating a single voxel (in post)
, it can’t know (in post)
anything about any of the other voxels round about it (in post)
, it’s stateless (in post)
, so it can’t know (in post)
whether it’s half way up a mountain or at the top of a mountain, aside from that it is a mountain, it has, you know, maybe 50% of a mountain (in post; notice ‘in post’; or in rendering)
. And that becomes a real problem when you want to, to map out like water flowing, and things like that (in post; notice ‘in post’; or in rendering) — Why? — Because… All things are 1st known in pre! All things must 1st be mapped out in pre! All things must 1st be seeded in pre! ❝Work them dev tools!❞ ™ Hello Games. EXAMPLE: ‘Perlin Worm’ caves, dried riverbeds and those rocky squiggles above ground, including ‘ALL’ terrain (algorithms), ‘FLOW’ across the surface of entire planets! — Why? — Because… They were ‘ALL’ 1st known in ‘PRE!’ — And only then do they render in post, ‘DATA LOCAL’ ! — So… it’s not a problem to map out water flowing, and things like that (in pre; notice ‘in pre’; or in the initial seeding, of the universe, of the game files, with dev tools)
. So that means we have to look at generation techniques, that look as though they’ve evolved over time, that look as though they know information about what is next to them. We have to model erosion, but you don’t model erosion as the process of eroding, you model it as the end state of all those things, you model something that looks like it has eroded over time (IF attempting to map out water flowing in post; notice ‘in post’; or in rendering)
.
Crim’s Interpretation:
Yeah, it would be a real problem to know, to map out, to seed water flowing in POST (in rendering), when that should have been done way back in PRE, (in Hello Games’ laboratories, before shipping said release).
Nonetheless, if all else fails…
“Consider adding small-scale isolated water features!”
Add a stream of water, flowing into a body of water, but only within a 2D block.
EXAMPLE: Mountainous (block), Smooth (block), Rocky (block), River Path (block).
These isolated streams could start out as natural springs (and/or etc.). Consider basing the direction of flow on the direction of the sun, or (even simpler) just any random direction. Or perhaps being ‘based on the direction of the sun’ could only apply to River Path (block). Whatever’s possible and renders best.
Can one River Path (block) flow into another River Path (block)? In order for this to be possible, would River Path (block) flow animation and physics need to be disabled, and River Path (block) be filled with stagnate water? River Path (block) would appear as a special case scenario and requiring some thought.
Why small-scale isolated water features?
Because…
This would be the simplest solution to remaining ‘DATA LOCAL.’ — Result? — IF you can’t know (in pre; notice in pre) enough information to provide large-scale and logical systems of water flowing, well then these streams of water will flow (both up and down) with no regard to gravity, and they can flow into lakes, ponds and puddles, which could be generated as numerous procedural varieties. — How? — Well, (1) Perlin Worm terrain (algorithm) systems that squiggle above the normal terrain (algorithms), that even lift into the air, and (2) Perlin Worm cave systems that squiggle below the ground, and (3) Perlin Worm riverbed systems that squiggle along the ground (See ‘dried riverbeds’ in OP), could all perhaps be utilized as these water features (these streams of water flowing), and such water could defy all laws of reality (and gravity) by itself lifting into the air (and/or etc.) and flowing into lakes, ponds and puddles. — Consider also adding streams of water that cycle in infinite loops. No source, no destination, they just loop. I think that would be fun, too. — Which all sounds very sci-fi, indeed! And now NMS will clearly know (in post; RAM) where a river begins and ends, because it was 1st seeded to clearly know (in pre; notice in pre), and will render the entire (small-scale isolated) feature, as we (as a player) approach the 2D block, that it is contained within. And that my friend is ‘DATA LOCAL.’ — What do you say, a good tradeoff, do we have a deal?
So it would appear then that such water features would be (like buildings are) superimposed and the normal terrain edited to fit IN POST. - And if that’s what we get, well then so be it, I think that could be very beautiful and quite interesting. Call it a step in the right direction, if not the only step toward water flowing that we’ll ever get possible in NMS, unless somebody someday has a genius breakthrough, and “Eureka!”
I also made a careful examination of the other talk by Innes McKendrick, called ‘Working with Change,’ but found nothing of use to our discussion, as the focus was on ‘project flow’ - unfortunately, not ‘water flow.’
Nonetheless…
Sean Murray has a whole lot to say about rivers!
At 30:08…
❛Analytical Derivative.❜ This though, this is the good stuff. Right? So this is really important, anyone that’s doing noise and is not using this absolutely should. Right? So, what we want, is to have our features change in relation to different octaves of noise. Like, that’s what happens in the real-world.
So, I’m going to explain a thing, but it’s probably really obvious: We have this massive array of voxels, like billions of them, and we are going to generate one voxel. So we’re just going to pick an x, y, z position, somewhere in the universe, and we’re going to say, “Fill in this voxel.” And when you do that, you can not, as part of the equation, you can never query the voxels round about you. Because if you had to do that, to generate this voxel here, like in this world, to generate this one, you needed to ask this one what was in it, then that cascades. Because to generate that one, you needed to ask that one, to generate that one, and it goes on and on and on, and it’s an intractable problem. So because of that it’s really hard to have erosion, which is what you really want, because in order - it would be simple to have erosion if you knew that when you were generating a voxel, that it was on a mountain, or that it was high up, or low down, or that it was perhaps at the bottom of like a lake or something like that, but we can’t find that out because you can’t ask any of the voxels around you.
And it seems like this so much unsolvable problem, and it’s a real problem if you’re generating caves, or your generating erosion, or if you’re generating rivers, because one feature needs to flow into another, and it needs context, and you can’t get that context. But what you can get is the derivative. If you had that, then you would know the rate of change of noise. At that point, when you have that, you know that you’re on a slope, or you’re on a flat, or you’re turning upwards, or your turning downwards. And if you have that knowledge, and you can return from Perlin Noise the Analytical Derivative, then you’re going to be able to have certain features much more prominent on slopes, so you can make them much more noisy, or much less noisy. You know, if you were in a desert, then slopes are very smooth, if you were you know in the alps or something like that, then slopes are very craggy and noisy. And that’s exactly what we need, and it’s an awesome trick. And once you have that, then there are so many things you are enabled to do. We also, from this Uber Noise function, we need the Analytical Derivative returned, from Uber Noise. So even after it’s calculated, all this Billow and stuff like that and Rigged, we need to know that Analytical Derivative, so that we can feed it in further into other things.
Sean…
This problem of voxels.
If you can’t generate flowing rivers, with one flowing into the next, because you can’t get the context… Since you can get the derivative, (which already enables erosion, caves and dried riverbeds, presently)…
- Can you generate flowing rivers, with one flowing into the next, by utilizing the Analytical Derivative?
- Can you generate flowing rivers, within the flow of Perlin Worms, by utilizing the Analytical Derivative?
- Can you generate flowing rivers by utilizing any other math(s), tech(s), or otherwise technique(s). Any other options? - If not… Can you hire specialist(s), mad scientist(s) or semi-evil genius(es)? …!?
At 34:35…
❛Domain Warping.❜ This is super cool, and this is basically distorting the domain of the noise we’re generating with another function. And often feeding noise into itself, in kind of successive octaves. So this is a little snippet, this is what normal Perlin Noise looks like…
So let’s feed it in another function, warp it and you start to get something that looks a bit more realistic…
I don’t know if that’s obvious, like I’m, I’ve looked at this for so long that that’s real obvious to me. But I’ll try and show you. So let’s do that again…
And now hopefully you can see, that looks a little bit more like an areal photograph of some terrain. Right? And in case that’s not obvious, here it is blown up. Right?..
And you can start seeing things that look maybe like rivers and things like that. ❝WE ACTUALLY USE THIS TO CREATE OUR COASTLINES, OUR RIVERS.❞ And also if you look really closely, you can kinda see shapes look like they’re flowing into one another. It’s kinda like you can see what’s called warping, you’re just warping the image.
I.Q. has an awesome image on his site, where he has colorized these…
And I think I could easily be looking at an areal photograph of some terrain. Right? Like, like if I just flipped to some real terrain, like this is real terrain…
Real terrain is really fractally, like it’s so, you know, it’s awesome. But just going back and forth between them, you can see really similar kinda shapes evolving. — And like with this…
❝If you were to start filling this with water, if you imagine water coming up from this, and then you would see all those little cracks start to fill in and you would get little rivers, you can see some of them up in the kinda top right and stuff, that, that looks really nice and it starts to not look like, you know, kind of a classic terrain sim at all.❞ — Sean
I’m ready to start filling this with water, Sean. I’m imagining water coming up from this, Sean. I see all those little cracks start to fill in, Sean. I see all the little rivers, and it looks really nice, Sean. “REALLY NICE!”
At 38:57…
❛Domain Perturb.❜ We’re gonna perturb the domain, so like Domain Warping, we’re gonna create our nice little flows of rivers and things.
I like how you said that…
❝We’re gonna create our nice little flows of rivers.❞ — Sean
At 42:08…
These overhangs, again, are super cool. I haven’t really talked about caves, but caves is a super difficult problem, much like the erosion was, because you need to know, when you generate the cave, how are you going to break through, so that it actually has a hole that comes out, and when you generate that hole — because remember, that when you’re generating any voxel, you cannot know about the voxels around it — to generate that cave and to generate it breaking through the terrain, is a difficult problem.
This is a nice image…
So, this is just actually, I happen to know, is one layer of noise. So this is just one layer of Uber Noise, and you’re seeing so many different things going on there. So down in the bottom, that’s Domain Warping, that’s giving you those nice shapes…
❝If you were to fill that in with water, you would get really nice little rivers and things going through.❞ — Sean
You’re seeing steep cliffs, and at times round edges. You’re seeing in the far distance a real change, in terms of like heights of mountains and things like that, and actually those shapes are changing, I don’t know if that’s obvious , if you can make that out, they’re going between quite round, to starting to be quite sheer.
And this is one of the things that I think really works in No Man’s Sky. One of the reasons why people play it so long is because, we get it all the time, we get people saying: “I played for a hundred hours, I landed on this planet, and it looked like something I hadn’t seen before.” And so I think that’s cool, that’s interesting, and people know because they haven’t seen it before, it’s different. It gives a real sense of exploration, it’s important to the game.
Okay, so there’s loads of stuff I haven’t talked about […], that I would love to talk about in the future. So if people want to ask me about it, they can…
NOT COVERD: ❛Erosion flowing into rivers❜ Sean…
Would you like to elaborate, please?
Also…
Did you say, “We use this to create our rivers”? What rivers in No Man’s Sky? (Empty dreams? Or) All empty crevices flowing into all empty valleys, begging for ❛Moist Maths & Flowing Voxels❜? Or ‘Perlin Worm’ dried riverbeds? Could use water and flow physics, but I do agree with you Sean, you can’t have things like erosion, or like caves, or like rivers, because of this problem with voxels, BUT since we do have things like erosion, or like caves, or like rivers, Water, Direction, Intensity & Flow: Coming Soon!™
(PRE) Permanent Knowledge vs Temporary Knowledge (POST).
❝This problem with voxels, it is a problem of the mind!❞