NMS HOT POST 2021/04/13

A practical look at "Procedural Generation 2.0" or template based procedural generation for No Mans Sky


So yesterday u/Viloneo made This post suggesting No Mans Sky ditch the current noise based generation for a more hand crafted template based procedural generation approach. While I appreciate the enthusiasm for addressing the issues with proc gen in the game I don't think this approach would really work unfortunately. After commenting there that I thought it wasn't likely to be the fix they imagined it to be and getting a response I went to reply and ended up writing a lot more than I had intended to.

I'm a game developer and while I've never done anything quite on the scale of NMS I have implemented a lot of different types of procedural generation (I can provide links if you'd like but I'm not here for self promo I just love this game :3 ) and while templates can work great (here's a great interactive walkthrough of how Spelunky generates with templates) they have some major downsides such as making grid structures more obvious and massively increasing dev time.

(If I have some time I might see if I can add some diagrams into this post if people are interested)

I'm curious about how this suggestions practicality so I'm going to do some math and see how it might work out in detail.

Part One. Setting up our example area:So you want a chunk full of randomised patterns and you likely want minimal repeats, lets say you're working in a 32×32 km area and each template defines a 1×1 km chunk of templated terrain using noise to add some degree of variation. That'll be 1024 chunks to be filled in. Lets be generous and say we can get away with repeating the same structure 8 times across that and hoping the noise will differentiate things enough that they won't be noticeably the same (this is likely to break down regularly and create very noticeably similar results) we'll need a total of 1024÷8 or 128 unique chunks to fill in that area.

Part Two. The logistics of designing templates:so lets think reasonably about how long it would take to create these templates. For a 1km² area I've spent multiple days in the past to create maps with the unity terrain system. However this only deals in height values without the possibility for caves or overhang that the NMS terrain allows (I believe it uses marching cubes). One positive way in which this isn't entirely comparable is that creating a template isn't necessarily filling in every single detail just laying out the rough forms of the landscape. We can assume that the talented team at Hello games could make a tool suited to this workflow(I'm not going to guess how long making the tool would take but if it's being used on a massive scale you want a pretty robust tool built from scratch) allowing the designer to define the landforms and areas where certain detail objects will be placed (eg. where forest goes). With this tool we can say the developer will take maybe half a day to make one template and another half to test it in engine with all the different biomes it can appear in and make any necessary tweaks (there's 11 major biomes in the game so I think this is a fair if not generous estimate). So for just this 32km² chunk with templates possibly repeating 8 times within it that makes it 128 days worth of work. This can obviously be split up between a team but it will still cost the same amount in wages.

Part Three. Stitching the seams:Cool so now we have a relatively varied 32km² area of template based generation. But hang on how are we even blending these chunks together. We don't want the edge of one chunk to just be a massive wall against the edge of the next. One thing we can do is to apply them to a larger height map and make sure all their edges are flat and line up this means the edges inherit the height from the heightmap but would need to be relatively featureless. Now the edges have less detail which is a problem because if you play enough you'll likely start noticing the chunk grid, so maybe we should try to define a set of rules about which chunks can go together? We could use something cool and cutting edge like Wave Function Collapse (it's really cool you should definitely read up on it here's a neat open source implementation) well okay now we have a consistent level of detail across everything. But hang on I'm playing our new template based NMS with chunks that match up nicely but what's that?! I've seen roughly that sort of mountain beside roughly that sort of lake 5 times while exploring this one planet? Hmm turns out there's a sacrifice you have to make if you're going to take an approach where certain chunks can go beside each other and others cant. each chunk now has a limited amount of other chunks it can actually appear beside and the reoccurrence of these patterns of chunks beside each other will become much more noticeable than if any chunk can go beside any other.In the end I don't quite know what the best solution for this would be but remember every piece of hand designed content can take a lot more time to develop than you might expect so it's unlikely merging the edges by hand is the right way to go.

Part Four. 32km² would be a very small planet:Lets assume we get over our chunk boundary issues and we have a lovely 32km² area of procedural generation with only minimal repeats and some variation applied to the repeats. now we need to fill 18 quintillion plus planets with this stuff. I did some searching and found this post about estimating the sizes of planets in NMS. For the planet they use in the example they get a total area of 478,000,000,000m² or 478,000,000km². That's a lot bigger than 32 if we take our current set of 128 chunks we'll have roughly 3,734,375 repeated occurrences of each chunk. Even if we can scale up and produce 512 unique chunks that's still about 933,593.75 repeats on this single planet. In practice I suspect even a really good implementation of a template system for No Mans Sky would lead to a very similar level of infinite variations on the same thing as the current system does.

Some unfortunate side effects could also be:

  1. It would likely eliminate the current possibility that the noise and other structures used to generate the existing planets have of creating super rare combinations of features that are nearly unpredictable.
  2. Larger form features such as the curved trenches that form on some planets would be very hard to keep around.
  3. More than likely this would have big performance overheads.

In conclusion while I also want improved variation to the generation I can't say I think templates are the right approach and I'm going to wait and be patient and try to make the most out of the current generation while it lasts. If it is ever replaced I'm sure there'll even be people going back to previous versions of the game to revisit it just like people do with pathfinder nowadays.

If you made it this far I hope you enjoyed what I was saying and maybe learned a thing or two. I'd love to write a bit more about topics like this so I'll keep an eye on discussions of the proc gen going forward.

TLDR:Planets big, templates small. You need a lot of templates to fill a planet with minimal repeats and matching up the edges of templates in a natural way is a major task.

edit: fixed some weird wording.

submitted by /u/Breoganhackett
[link] [comments]

Source: No Man's Sky | Reddit

関連記事

My First Three Days

So I downloaded this game on Saturday to try it out. See what all the fuss was about. Oh boy, I was not prepared for how much fun it is.

I started off in the middle of nowhere on a planet that seemed ok at first. As I’m coming to grips with the controls, and following the tutorial, learning to mine and gather resources … etc. I hear “Warning. Storm approaching”. Then my screen flashes that a “wall of fire” is happening, and I need to take shelter.

As far as I can tell, I’m not within 7 zip codes of one. As far as I can tell. I might be the only living soul on this burning rock. So I start running in a random direction while watching my environmental protection bar drop real fast.

Still fiddling with the camera I miss a trench the size of the grand canyon and fall. Thankfully, the Jumpjets allow me to land without breaking my kneecaps. Downside: No way in hell can I jump jet back up to the surface. Upside: My environmental protection is stabilizing.

As I’m stumbling in the dark getting farted on by poison sac plants, I find these things called “Humming Sac”s. They look like the face hugger eggs from Aliens. I was worried that I might have to go to the new character screen real soon, but figured “Eh. Let’s let it play out”. To my surprise, they had pearls in them. Me being the hoarder that I am (I’m the guy who ends up with 10,000 potions in my stockpiles due to not using them because “I might need it later”. There’s no later. The final boss and main quest were done months ago. Without a single potion being used.) I started gathering these. By the time I found my way out of that cave I had 25 of the darn things.

To my pleasant shock, the cave exit lead me to a “Minor settlement”. It was a shack that had two dudes in it, and a landing pad. I breathe a sigh of relief and run inside. Soon as I walk in, this console on the wall opens up and it looks like it has a gun in it. I check it out. Oooh, it’s a multitool with a gun. I feel bad for dumping my current one after I had just put in the upgrades from the tutorial, but let’s see how much this will cost. It has a big “B” next to its description. It has the advanced scanner that the big crystals kept telling me I need. Costs 3.3 MILLION. At this point, I was worried the game was going to be abysmally grindy. I feared that I may be uninstalling it sooner than expected, if my FIRST tool upgrade was 3.3 million.

Oh hey, they have a Galactic Market hub thingy. Maybe I can sell some of the stuff I’ve been collecting there. Oh, most sells for pennies. Well I’m definitely not making 3.3 million anytime this decade off of this. Then I see the pearls. 25 selling for over a quarter of a million. You ever seen old cartoons when the guy’s eyes shoot out of his skull? That basically happened to me.

So I spent the next X amount of hours (this will become very relevant) cave diving for pearls. Ran into these weird knowledge stones. Hey, they help me figure out what the other aliens are saying, nice. I figured I’d farm the 3.3 million get the multitool and call it a night. Eventually I did. I then got my tool. Naturally, I wanted to test it out. So off I went to test it. Oh hey, it has another mode, plus a rifle mode, and a shotgun one. Neat. Looks like I can mess with the terrain and mine ore veins. Awesome. Let’s try that.

Next, I followed the tutorial to base building. I figured since this one shack is the only sign of civilization I’ve seen, I might as well claim it as my base. Nice. Built the base. Built a teleporter and powered it. I don’t like this reactor powering it. Let’s use solar panels. Farmed some resources and built those along with a battery. Ok. Good point to stop now. Oh hey, it’s 8 AM. IT’S EIGHT A.M.!!!!!! That was day one. That was my first day in this game.

Day 2, I decided to finally check those burial sites, and discovered how much money can be made off of them. Especially those intact skeletons that are 2000+ years old. So I handed in my moral compass and started grave robbing right up until a very late hour in the night. By the time I want to bed the sun was closing to being up.

Day 3, I’ve been exploring a lot now. Have multiple “bases” on a few planets across 3 solar systems. Been doing missions, and have gotten so many words out of aliens and stones that I can understand most Vy’keen I run into. Started doing some main quest missions and a few others things on the side. Been farming more bones and underwater relics to try and get a new ship instead of my starting one. A couple of bad sales (didn’t realize I had to manually move my cargo, so I had to rebuy my ship to get the cargo out of it before I scrapped it for a pittance). I’ve gotten more comfortable now. Even had a few pirate fights under my belt (Those were rough at first because the controls are clunky. Until I discovered the S key basically auto pilots for me better than I can maneuver with a mouse and keyboard).

I’m system hopping having just finished some deliveries for the merchants guild, and as soon as I exit warp on my main system, I’m caught in the middle of a space battle. 6 pirates, and some traders. The traders hail me asking for help. I managed to kill the pirates, since they follow Hollywood rules and only attacked me in pairs. Photon cannon turns their shields to mush, missile launchers one-shot their hull. Nice one-two punch. Freighter captain hails me and tells me to come on board for my rewards.

“Neat!” I say to myself. Big ship like this, I hope he gives me something good. He gave me the WHOLE SHIP! Flabbergasted as I was, I expected (Upon checking the wiki this morning, I now realize this may have been, in fact, a mistake). So now I have a freighter with a frigate. I start getting acquainted with the layout. turn in some missions at the nearby station, and start moving things around in my inventories/storage/freighter to see the fastest way I can upgrade this one, or trade it in for good value and get a better one instead. I log out, and go to bed.

Thank you to anyone that read through this whole post, or even skimmed it. Seriously though, how do you guys stop playing this game. I’ve already spent 2 hours today looking up videos on how to turn the freighter into more money so I can trade it in for a better one.

Also, the wiki says that the freighter captain will off you the freighter if you have none. Does this mean if I sell my current one, I could get the next one for free too?

submitted by /u/IraqiWalker
[link] [comments]

続きを読む シェア
0

Comfort Game

Comfort Game

Sorry it’s not an actual screenshot ((PS player)) I’ve been playing NMS for about 4 years now and I will keep playing it until I leave this universe for the next one,whenever I’m sick,which I currently am,ill boot up this game and explore the universe until I almost fall asleep,I just love space and everything about it,the vast unknown,not knowing what you’ll find next,and with that I bid you all a goodnight,Ad Astra per Aspera!

submitted by /u/HotPocketGoddess
[link] [comments]

続きを読む シェア
0

Community

Popular Posts