Clanfolk Progress Update! (Natural Environment Upgrades)

Clanfolk

Clanfolk is a colony sim set in the Scottish Highlands. Harness your environment to survive - fish, gather, hunt, and farm as you prepare for the winter. Build an inn, trade with other clans, have children and marry them off - live life and prosper across the generations.

[img]{STEAM_CLAN_IMAGE}/41036152/29a0375a64c03fcdba561a1ea647521bde912c51.jpg[/img] Hi Everyone, The Testing Branch just got another big Update, and this one is all about the Environment. The improvements brought about due to the Rivers, Beavers, and Bridges from my last Progress Update inspired me to divert from the Story Generator temporarily to see just how far these new atmospheric improvements could go. [b]Here are the details.[/b] [i]One important note right off the bat if that I am pushing the Testing Branch to the Default Branch in about 2 weeks (Probably April 20 or 21.) So those of you who have been waiting on all these changes, don't have much longer to wait! Those who want to try this out now can join the Testing Branch under Steam/Clanfolk/Properties/Betas. [/i] [h3]New Stuff:[/h3] [list] [*]New Natural Terraformer (much nicer maps) [*]Riverbank Seeding (the rivers have life growing along their edges) [*]Forest Undergrowth System (makes the forests feel a lot more "there") [*]Clouds [*]Added Heavy Rain/Snow mode to the New Game Options [*]Lightning [/list] For those who want the finer details, please once again, pull up a chair. :) After the previous progress update, I had planned to jump right back onto the Story Generator, but the response to the surprise River's update was so positive, that I just wanted to do a bit more. This once again kind of compounded on itself, but this time instead of Beavers, it all started with a quick experiment on the Terraformer... [h2]New Natural Terraformer[/h2] [img]{STEAM_CLAN_IMAGE}/41036152/904ea8adf2f1b3a449ee74d7ea2dc8250ffa91e0.jpg[/img] So for a very long while, I have not liked how the Terraformer literally shotgun seeded trees and grass on the map in blocks. The process was to fire a blast of seeds from orbit, then use a growth algorithm to spread them. It was functional but it did not look natural. One of the very active Clanfolk players has been spending years in game cultivating natural looking forests by hand as well. This showed me that the forests in particular could look a lot better, but how... The answer was a new piece of tech provided by the rivers. Rivers use a heightmap to figure out where to flow. (A heightmap is a black and white image where the brightness of the pixel determines its height) The heightmap gives the rivers their natural flow patterns, instead of looking like a grid. I decided to apply that heightmap system to the fertility of the soil and to make MANY more planting passes with the now circular shotgun seeder to see what happened. Annnd the map looked amazing. The forests had dense spots and walking paths and were no longer amorphous blobs. Thrilled, I applied the new seeding logic to... everything. Suddenly the map had well differentiated zones with personality! As usual when looking for ideas/validation, I posted some progress pictures to Discord. (I work alone, from home, so an occasional external atta boy is great) The Discord group were all very supportive and excited, but there was also one really key suggestion. Essentially: "What about the river edges?" [h2]Riverbank Seeding[/h2] [img]{STEAM_CLAN_IMAGE}/41036152/6e9f1c79fcc2ed5311f12ae91e6d3c75c7c068c6.jpg[/img] So I was blind to this, but it made perfect sense as soon as I read it. These new rivers were mostly bare on their sides... Rivers just don't work like that! Surely just one more tweak won't take too long. I set to work and started applying seeding logic to the Riverbanks, creating grassy fields, rocky areas, and thick tree lined edges. The result here was a shocking improvement, making the Rivers feel like a part of the environment "and" influencing it. The same tech also encircled lakes and bogs with new life. So now we have the map nicely delineated with the rivers and their growth on either size traversing the map, tying things together. New open areas also appeared for building due to the natural seeding. Just like there were natural forests and fields of heather, clear patches developed, begging to be built on. So "now" it was time to get back to work on the Story Generator. The map looked great! It was about a week of unexpected work in total, but well worth the effort in the end. Then the same Discord user who mentioned the riverbanks meekly asked about Ferns/Moss in the Forest. Harumph.... hmmm... So I took a look, and of course once this was mentioned, it did feel weird that the trees just kind of sprang out of the green grass... Trees usually have a mess under them and especially in thick forests... thinking thinking... I suppose it is worth a "short" experiment... just to see... [h2]Forest Undergrowth System[/h2] [img]{STEAM_CLAN_IMAGE}/41036152/9dfc4629ff7a8c2799765f5a138dd5c84dcb5224.jpg[/img] Undergrowth is an interesting problem, because trees come and go, as do whole forests. They can be planted and cut down. I couldn't just plop down a floor tile that looked like a clump of moss as it would be very jarring as trees were added and remoded. My first experiments used the Desire Path system to create patchy ground under the trees over time. This sort of worked, but didn't really look right. But, it then struck me that there WAS system that I could adapt. Most people have not seen this, but after fires, there can be very large ash areas that slowly wither away to nothing over time. I could potentially use this. So I tried applying ash over time under the forests and it worked! Better yet the ash density could grow and shrink over time with the forests, no popping! So the density of the forest determined the density of the ash. After a bit more work and yet another tile layer in the game, we had decent looking undergrowth. Undergrowth grew with forests, and diminished over time as a result of clear cuts, with the grass slowly reclaiming the land. We had decent looking ...flat... undergrowth. Time for some research! So it turned out that Bluebells are just as iconic for Scotland as the Thistle, and guess where they grow! I recommend searching for pictures of bluebell forests. They are delightful. Bluebells are also really easy to make look nice. I love you Bluebells. [url={STEAM_CLAN_IMAGE}/41036152/8bd97231c10df8ed2d0c6031f729ea357a31daf9.png][img]{STEAM_CLAN_IMAGE}/41036152/dd7d82aa2d4cfb37a2a2b46008c661f589a7d35d.png[/img][/url] Looking at you Ferns... So whereas the Bluebells took maybe an hour to make look nice, the Ferns, oh the Ferns. So many tries and when I finally had something decent, I posted it to Discord and one of the first comments was "why are they all pointing the same way" Oh no, they noticed the one thing I didn't want them to notice! Back to the drawing board.... Finally after many more attempts, the Ferns looked great, and much better than the original ones that all bent to the right. One very interesting side effect of the new Natural Terraformer was that the forest undergrowth created Bluebell patches AND Fern patches and some border zones with a mixture. So part of the map was bluebell forests and others were dark forests with fern cover. So this was great! Forests looked fantastic. About another week down, but again well worth it. Back to work on the Story Generator! ...Long time Clanfolk Discord superstar: "You know what would be great, if there were cloud shadows." Oh no, this had also been on my mind since forever, and it was brought up RIGHT when I was in the zone environment wise. Surely just one more experiment... For Science! [h2]Clouds![/h2] [img]{STEAM_CLAN_IMAGE}/41036152/40c017b1374b46a0bf6724713150c240556395e1.jpg[/img] Once again the tech from the Rivers made something new possible. (Thank you again Beavers) That same heightmap used for river pathing, and for tree seeding, could also kinds be used for cloud density... If I moved it with the wind, and hooked the results into the shadow system... Worth a try. So right off the bat, it looked like the system was going to work. The quick experiment showed me dark patches moving across the landscape, and the terrain suddenly took on a more real 3D feel. There were holes where light got through and other very dark (too dark) spots that were ominous and it all panned across the map with the wind. Sigh. I am doing this aren't I? Days of Shader work later, and the clouds felt real. You couldn't ever actually see them, but you knew that the clouds were there from the shadows. The next step was to connect the weather system to the cloud system such that there was a gradual increase in cloud as rain approached as well as heavy cloud vs light cloud days. Watching a single wandering cloud slowly cross the map on a calm day was also quite relaxing. I found myself zooming out on the map a lot more, just to look at it. That used to be a weak point, but over the last few weeks and particularly with the addition of the clouds, the zoomed out map was becoming appealing to look at. We now had cloud shadows roaming across the map, reacting to wind, growing and dispersing naturally, as well as dark spots on sunny days, and what I have come to call "sky holes" on very cloudy days. I like these in particular where a bright patch moves across the land when it is overcast. That was great. Clouds are awesome. Another week down. Lets have a nice long Easter weekend, then get on to that Story generator (rubs hands together) It was Friday afternoon. Beautiful clouds, and no lightning. That is like Beavers without Rivers... Lightning will be quick, I just flash some light and draw a white wiggly line. I will do it in the afternoon, no problem... [h2]Lightning[/h2] [img]{STEAM_CLAN_IMAGE}/41036152/d53105efbe1168ae8250d848b39ac5b600d500cb.jpg[/img] So I finished Lightning Last night (7 Days Later) It became apparent rather quickly that Lightning was going to be a bit of work. The real problem with light-ning is the light-ing. Lightning is not a light at a point in space. It is a line of light. Lightning creates VERY distinct shadows. I cannot just make the map bright for a second and be done with it. This next bit may get a bit technical, but it is really quite interesting I think: Where lightning strikes, there is a blinding flash from above. This means that there are also almost no shadows at the strike point since the light rays are pointing down. Far away from the lightning though, there are very long shadows, but not too long. Lightning is also high up. So we can't just create a huge light bulb at the strike point with infinite length shadows. We need to create a huge bulb "above" the strike point, way above. In a 2D world, with no up. This was a problem. I do already have lights that can exist at virtual heights off the 2D plane and create shadow length based on that. So a Standing Torch creates shorter shadows than a campfire on an object of the same height at the same distance, but the problem is the light rays moving out from the source point. That just won't work. A Wall blocks torch light once a ray hits it, but the wall should not block the lightning light, not all of it. I couldn't push light rays from the source pixel to the target pixel, instead I needed to pull shadows from the target pixel towards the source! So a new lighting system was born for Lightning. Instead of light travelling from the source to the target, shadows were sucked from the target to the source and would not block each other. If you pause the game during a lightning flash and look around the map, this will make a lot more sense. Imagine the difference if the lightning light was at a height of 0 vs 100 meters. So after a few days, the flashing looked perfect. I could call lightning on demand and got the appropriate lighting effect. I did channel my inner Zeus for a while with that, zapping a great many things. I have mouthed so many "Kaboom","ChhkWhoosh" sounds over the last week while tuning the lightning bolt animation and effects. Finally I added sound. Mouth can now rest. The next phase was to hook the lightning system up to the weather manager to create storms, but not to many storms (please let me know if there are too many, I just don't know at this point, so much lightning, a lifetime of lightning) Lightning will start far off the map and there will be slight flashes in the distance, then after a time, a low rumble. As the lightning approaches it gets louder and the flashes become brighter until it reaches the map. The lightning will traverse the map (but sometimes missing it entirely at the top or bottom) and then fade out again in the distance. There are different storm intensities that are triggered based on atmospheric conditions. More clouds, wind, rain, and moisture mean bigger storms (in general) but Summer storms are possible and lightning can cause fires. Lightning also lowers the moisture and create scorch marks at the point of impact (this is fun to watch.) The color of the lightning will change based on the overall atmospheric color at the time, so at night it will tend to glow more blue, whereas at sunset it may glow a bit orange. This was a nice lighting side effect that I noticed in the pictures of real lightning as well. For now, I have put the lightning in "kind mode" so strikes will not set roofs on fire, but a toggle is coming for that soon. [h2]Conclusion[/h2] I got distracted by shiny things again. All in all though, it was definitely the right move. I am very thankful that the community has been so supportive of me exploring these surprise additions. The response to the Rivers and Beavers progress update was so overwhelmingly positive that I just wanted to do more. The improvements to the atmosphere of the game have been enormous, and I think since those changes are ever present vs transient with the story events, this was probably the right time to tackle the additions. So over the next two weeks I will get preparing for the Default Branch release of all this new content, going all the way back to the Negotiation system! There have been an enormous amount of additions, and I need to test it all and fix bugs. (As well as get it all translated) Thanks very much for your support! "ChhkWhoosh" Andrew Hume (Blorf) MinMax Games Ltd.