Terrain test Pictures
Confused
Wait. What? Join Date: 2003-01-28 Member: 12904Members, Constellation, NS2 Playtester, Squad Five Blue, Subnautica Playtester
So, It looks like Hugh has made the terrain test available to everyone. And since A few of us tester types have been playing around with it, and maybe, might have, definitely written the generators for some of the Steam app page of the terrain test. I thought it might be nice to share some screenshots and sort of maybe some code/mods in case you want to paly around with generated terrain etc.
http://tinyurl.com/sttguide
First off, Let me tell you this very important detail. Those .dlls I'm gonna link can do anything. So, really only run ones that you trust.
Do you trust me? If not, I provided source code for them so you want to build your own. You need mono develop, and you need to reference 3 dlls in the Installed copy of the Terrain test tool: Assembly-CSharp.dll, Assembly-CSharp-firstpass.dll, and UnityEngine.dll. Once you have the compiled dlls, or if you trust me, they go in the mod folder of the terrain test tool install.
Get some mods and source code here: https://www.dropbox.com/s/0npnkbkk9ztbno5/Confused.zip
I think I scrubbed all the old mods. If the don't let you make a world with them they are broken. Let me know and I'll fix the dlls and source. Look for Not implemented exceptions if you want to fix it yourself.
Now that that is out of the way, some screenshots, There should be waaay more of these but I foolishly have been overwriting them all, so these are the ones I found stumbling across things. The link above has a dozen or so mor incase you want more of them.
http://tinyurl.com/sttguide
First off, Let me tell you this very important detail. Those .dlls I'm gonna link can do anything. So, really only run ones that you trust.
Do you trust me? If not, I provided source code for them so you want to build your own. You need mono develop, and you need to reference 3 dlls in the Installed copy of the Terrain test tool: Assembly-CSharp.dll, Assembly-CSharp-firstpass.dll, and UnityEngine.dll. Once you have the compiled dlls, or if you trust me, they go in the mod folder of the terrain test tool install.
Get some mods and source code here: https://www.dropbox.com/s/0npnkbkk9ztbno5/Confused.zip
I think I scrubbed all the old mods. If the don't let you make a world with them they are broken. Let me know and I'll fix the dlls and source. Look for Not implemented exceptions if you want to fix it yourself.
Now that that is out of the way, some screenshots, There should be waaay more of these but I foolishly have been overwriting them all, so these are the ones I found stumbling across things. The link above has a dozen or so mor incase you want more of them.
Comments
Now to see how the water works out in proper.
Tested at 1440x900, 1680x1050, and 1920x1080 in "Good" mode on LavaExample
While generating new areas, there was hitching once a second, even if I didn't move around much. Otherwise, it was relatively smooth. It seemed a bit choppy at high res.
Is there a way to enable showing FPS or anything? I couldn't find any metric to report.
Other comments:
- Collision worked well. Are we going to be allowed generation of "squishy" surfaces?
- Distance fade needs to be much more gradual.
- You can REALLY get lost inside those caves. The game is going to have to provide a way for the player to find their way out, or it could quickly become annoying.
- Suggest online site for players to post (source code for) there own terrain mods, to allow sharing.
MSI GE60 - i7 3610QM (2.3-3.3GHz 6MB cache) - GeForceGT 650M
Awesome Really nice caves there. Is that like two layers of perlin noise?
(hey Josh!)
Tweaking with numbers, mostly exclusions--- come up with some impressive looking terrain
Can't wait to get into all the nooks and crannies
Draw your weapons.
also, some playing around with caves and building interesting looking connections into them:
Played around with reefs today:
more:
http://minus.com/mblQk5b3wz3upB
The code for most of it is in the first post. I just added padReef.cs and dll to it, which is what that last bit was. Most of the screen are me playing with everything up to the algo pass to make interesting terrain to cover in pads
For the sake of simplicity, I am gonna do some hand wavy type thing, but, basically, imagine that you and I are drawing a map on some graph paper. For each square we assign a tile type to it. for now we are gonna deal in 2 kinds of tiles. forests and fields.
We start off by looking at each square, and just roll a dice and we get this really odd looking patch work of forests and fields. If white is forests and black is fields we will get something like this:
Which is pretty cool. But, isn't that cool. After all its hard to get like a deep dark forest since most of them are right next to some fields and fields are pretty small as well.
The obvious choice is to use something other than random luck to pick what something should be. Some sort of function. Now, given that we are huge nerds we decide that the obvious choice here is to use the x ,y coordinates of the place on the map to pick what it is. This is a great idea. We can make checkerboards, and lines and stuff.
In subnautica something like that looked like this:
(that is something like (x +y) modulo number of Textures)
The thing is that it looks pretty cool but its sort of repetitive. What we need is some sort of function that takes coordinates and turns them into a semi ordered but still random looking pattern of forests and fields. It turns out that people, Notably for us Ken Perlin for the movie Tron, have been tying to figure out ways to make interesting looking patterns of dots for a long time. As good programmers we are bright enough to know a good thing when we see it and we decide to use his noise. His noise looks like this:
. For what we are doing you really don't need to know how or why this works, just that it does. The function here could be anything, cosine, tangent, anything that makes data from some numbers.
Now, that, my friend, is so cool. Right? We are gonna make all the light areas forests and all the dark ones fields.
With me so far?
Good.
So, to step back to the terrain test it basically asks you what to do with the square at (x,y,z) You wave your hands, plug the numbers into some sort of function and tell it one of the things in this picture by number with 0 being water. There are 11 textures as of this writing. This will explain why I keep multiplying things by 11 later.
So to make something that is pure random we do this, assume that Random.NextDouble() makes a number between 0 and 1 with a boat load of decimal places:
As you can see that should make a purely random, but mostly solid world that looks like say, this:
Right, what do we do to make this work with a function like say, perlin noise?
So, that means that in the picture we have up there lighter stuff is further down on the list of textures and darker stuff is more likely to be water. For that map on graph paper this is kick ass. We have this really cool bunch of stuff grouped into clusters and just basically looking ultra cool.
Okay, so how do you use this to make mountains? The short answer is math.
The long answer is we take perlin noise, we spread it out so that the white bits are really stretched out, we then us the value with the height of tallest mountain we care about. We then check to see if y, out altitude, is above the resulting height. If it is make the square water, in all other cases make the square rocks.
At this point, I am gonna give up. But, that is generally how it works. If you want i can cover the algo pass as well, but I think that Steve does it all pretty well here: http://steamcommunity.com/sharedfiles/filedetails/?id=225171191
I might give the terrain test a try though and see if I can manage anything... (or nothing :P)