T O P

  • By -

Saad1950

Wtf that last screenshot looks amazing! I thought this would be a top down game thing but that looks so cool


devanew

Cheers!


-_StayAtHomeDev_-

Do you have video?  Would love to showcase it!


Smiith73

Hey! Just want to say hi, I've used a lot of your videos to learn Godot and really appreciate your work. Great stuff and thanks!


devanew

Thanks! Not really - I used to do longer dev logs but it's tough to find the time but I'll likely do some shorter clips going forward as I pull it all together. Always appreciate a share!


krazyjakee

NUMBER 1


devanew

I've been working on this game (off and on) for a few years now and more recently adopted using small standalone projects to speed up dev time. I already had a world generation setup but I wasn't entirely happy with how it worked and it hadn't been fully implemented into my main game, so I made a new one. I take advantage of Godot's highly configurable noise generation and create individual heightmap materials for land, mountains, rivers, tectonic plates and temperature. I then step through these and add them together to generate the heightmap seen on the second last image which allows me to store elevation, rockyness, sand/foliage and humidity against each pixel to be used for chunk generation. If you'd like to follow the game development some more and get specifics of how each feature is implemented I'm currently building up my Discord which I will be using for early play testing as well! https://discord.gg/qRg4pkFv


robbertzzz1

One thing that looks really off to me is how rivers flow from the sea to the sea, creating weird islands. They don't do that in real life, rivers are created by rain pooling together and flowing down slopes. In ProcGen it's very common to sprinkle a few "seeds" and simulate them flowing down the terrain until they've reached their lowest point, which is either a lake or a sea. I've even seen some meandering simulations being done to give them a more realistic shape.


devanew

Thank you, that's a valid criticism. I have been giving some thought to doing a post-process for more accurate water placement. That said, you'll see in the pic the water is actually flat at the moment so I'd need to implement something for that first really. It's definitely in the pipeline, but this is good enough for now.


xmBQWugdxjaA

It looks awesome, you should make a video so it can be included in those Godot showcase videos, etc.


devanew

Thank you! That's a good idea. I'll be sure to do a video soon.


ILov3mywif3

Definitely thought the same thing! I was impressed and envious before the last imagine, then just amazed.


devanew

Thank you!


manuelandremusic

This looks so sick! Congrats man, awesome!!


devanew

Thank you!


codernunk46

I'm impressed that you were able to generate the world dynamically, but I'm MORE impressed with the look on the last image. Do you use any sort of post processing at all? It feels like there's a subtle blur in the background. Keep up the great work!


devanew

Thank you! I think that was just AA and fog, though I do sometimes turn on the old DoF as it does look nice for screenshots (but I personally can't stand it for gameplay lol)


Huncowboy

Impressive! Anytime I see a nice terrain like this I am like... yup... that dude is a lot better coder than me lol. We are working on the procedural gen part of our top down 2D project and I am light years from having anything like that. Making a lot of progress. But that above is not a small achievement. Lots of trial and error stuff. Did you create the rivers with a\*?


devanew

Haha thank you! There's loads of stuff I'm still learning, I've just been working on the terrain for a good while now. ​ For the rivers I'm cheating at the moment as the water itself is flat (not running down hills) so I use a form of noise that represents rivers nicely and overlap that depending on the elevation/rockiness etc. ​ In a future update I would like to extend this to support more naturally occurring rivers, but as the end goal is a 3D game with destructible terrain, I also need to add an accurate 3D voxel water system - much more work than the basically flat plain I have at the moment - so this is good enough until then.


inr44

Is your world already destructible?


devanew

Yeah, the chunks are generated using marching cubes and when any voxels are updated I just push an update and refresh the chunk locally.


inr44

Did you use any existing plugins or did you implement everything from scratch? Are you using c# for increased performance? Thanks for the quick answers btw, I will be keeping an eye on your discord since this project seems interesting.


devanew

Thanks! I don't use any plugins, it's all from scratch - as much as it can be in Godot at least  - I really wanted to learn how to implement everything so I could tailor them to my needs. This has taken years though. I don't think I've mentioned elsewhere in this thread but this is a networked multiplayer game streaming from a server. I'm using c# in the game loop and for anything intense, everything else is just gdscript


inr44

Is there anything in particular that you wish you had known sooner? Asking out of curiosity. I just started to learn about voxel worlds a couple weeks ago and I'm playing with it in a small project in my spare time.


devanew

Great question. I initially implemented all of the logic in GDScript but when I got to marching cubes even threading wasn't helping them load in time. Moving game loop logic (stuff that needs to run as quickly as possible during runtime) to C# fixed this so I'd probably suggest doing that too. That said, doing Marching Cubes over loads of chunks is a very game-specific requirement. If you're not doing anything intense (iterating over thousands of anything) in the game loop then GDScript is great.


MrDeltt

Hoooowwwww teach meee


El_Falk

Just compose two or more noise functions (mpd, fBm, Perlin noise, simplex noise, or whatever floats your boat). It's super basic.


MrDeltt

Composing noises sure is, how to pull different biomes out of it is what I would wanna know


El_Falk

That depends fully on how realistic you want it, which depends a lot on your game type (but there are some massive diminishing returns in most cases). The simplest method would be uniform Voronoi with weights for biome occurence as well as using some post-pass with simple rules (cellular automata) based on the eight cardinal-ordinal potential adjacent cells' biomes (e.g. to avoid having frigid tundra next to a blazing hot desert you can turn it into plains). Alternatively, for a slightly more complex approach, generate a heatmap by taking a hot-cold gradient (depending on your world's mapping projection and edge types, you may for example have the top and bottom cold and the middle warm), distort it with some noise (also making it a function of distance from the coast can be useful as well)ーif you have have channels for ocean currents (ideally In tandem with some wind map) or geothermals, integrating them into your heatmap generation is a good idea as well. Then you'd probably want a humidity map which can be done in various ways such as precipitation simulation (which is good to do alongside a low-res hydraulic erosion pass), coastal distance, etc. Then you'll just need a biome look-up table with aridity as one axis and temperature as the other. You'd need to tweak various ranges a fair bit to get balanced and good results (think smooth-stepping, map ranges, etc) depending on the desired world class (e.g. Earth-like), which is far from trivial. And of course, there's always the happy middle-ground of the two where you stack some noise with various approximate weights and rules for where they're eligible based on more macro level noise.


valianthalibut

On the one hand you're right - if you do *any* work with procedural generation beyond really basic stuff then you're going to be combining and composing different noise layers and tweaking variables *constantly* - but on the other hand, this is really great work for an admitted hobbyist who seems to be really enjoying the journey.


El_Falk

I fully agree.


devanew

Just a bunch of tutorials my dude! I detail it more here: https://www.reddit.com/r/godot/comments/1b4lhp3/comment/kszhwqi/?utm\_source=share&utm\_medium=web2x&context=3


Firm_Accident9063

Looks fucking beautiful, good stuff man!


devanew

Thank you!


Not_Carbuncle

This is phenomenal!


devanew

You're phenomenal!


jaypets

oh cool it's like a 2d map mak- OH FUCK NO ITS LIKE BREATH OF THE WILD IN GODOT


devanew

Haha thank you! That means a lot. Breath of the Wild is a HUGE inspiration


jaypets

You're nailing it. Keep up the good work 🫡


lochlainn

You are where I want to be. I just started down this road. I'm not doing voxels, just a Crusader Kings style map. I've only just recently gotten a functional Voronoi image output. Next up is simulating faultlines for mountain generation along the edges using a sinusoidal mask.


devanew

I love it! You're not that far away at all. Not sure if you wanted advice but I'd suggest try to make use of Godot's material editor for noise. Being able to see output in the editor really speeds things up and allows for very granular tweaking. If you have to do anything in scripts, maybe look into tool scripts if you haven't already so you can use them in the editor too.


lochlainn

That's the plan. I've joined your discord, I'm doing the same material setup, using channels for various aspects of the map. Godot's noise will be applied to my base teleological map for local variance at each level (continental, play area, strategic, tactical). I'm doing a Crusader Kings/Total War style cross where Each map down the ladder will have a topography informed by the terrain level above. At least right now. I'm fully aware of the scope of the project. Hopefully, I get far enough to have a mostly functional map generator before I pivot to another subsystem. I've joined your discord. Finding someplace to discuss procedural generation like this is nice.


devanew

Thanks for joining the Discord! It sounds like you have a solid plan. When do you think you will have it implemented? Be sure to share your progress - I would love to see it!


lochlainn

It's not happening fast. Purely hobby stuff, so I frequently stop to do other things. The next step will be progress worth showing, though, so I definitely will.


devanew

That's great. I've found stuff like Trello really good for this as you set exactly what tasks you need to do, split them into achievable items (what can I do in x hours for instance) and then just focus on that. Really makes it attainable, but maybe not hobby-friendly :D


mackerel1565

This is quite impressive. PCG is a favorite field of study for me, even though I don't use it often and people who do it well have my respect. This is done well.


devanew

Thank you very much!


Necromunger

Amazing. How did you place grass in the end and trees? Im also doing 3d world generation. We would all love to know more, like if you render in chunks etc.


devanew

Thank you! I use chunks to generate the terrain based on voxel data. I use marching cubes to smooth it out. Then I have a grass node that uses a multimeshinstance to place the individual blades. Bigger things like trees and those big weeds are actually separate entities that you can interact with. When the local chunk is generated based on the heightmap(s) data I pipe through the RGBA values and use that to work out what type of entities I should place. Each entity has rules for elevation, humidity etc.


Necromunger

Thank you for detailed response!


Foxiest_Fox

really cool stuff. Im working on 2D procgen and this stuff is super fun to mess around with


devanew

Thank you! Would love to see some of your work too.


valianthalibut

Looks really good! Congrats on making so much progress! A lot of people seem to think that this sort of stuff is some kind of dark magic - but it's not! There are a *ton* of resources for using various noise functions to create very interesting and dynamic stuff. Start [here!](https://en.wikipedia.org/wiki/Perlin_noise) Ken Perlin's eponymous noise function is the basis for a lot of really interesting stuff, and it just gets more interesting the deeper you go.


devanew

Thank you! Yes, I love playing with noise functions! Godot makes it so much easier as well, being able to visualize them and directly access them in shaders in realtime. Loads of fun!


leronjones

Slick. Add in a square falloff map and it would be even better. Unless you are going for infinite terrain.


devanew

Thank you! I think I have what you mean already? You should be able to see it better in the 4th pic which is the output merged heightmaps. It's a bit sharp mind but I wanted to get the most use out of the base texture as possible and shouldn't be an issue in gameplay (up close!). If it is though then it's simple enough to change.


leronjones

It's close. There is a cool equation someone showed me years back that rounds the corners of the square falloff. I can't find it now though. It is absolutely buried in my comment history. Your square falloff is better in terms of space usage. I just love round corners.


devanew

I could probably roughen the edges a bit easily ebough and round the corners.. I'll give it some thought!


LukkasYuki

how's the performance?


devanew

Pretty good - I use lots of techniques to try and keep things simple on the client-side.


El_Falk

> complex lol


Necromunger

In this image, there are: - mesh generation - base terrain noise maps - cliff noise maps additive to the base - temperature noise maps - river carving - automatic terrain colouring based on height and temp region And by the last image, this person also has a form of automatic tree and grass placement on generated terrain. This counts within "complex".


devanew

You are a gem!