TUXDB - LINUX GAMING AGGREGATE
 NEWS TOP_PLAYED GAMES ITCH.IO CALENDAR CHAT WINE SteamDeck
 STREAMERS CREATORS CROWDFUNDING DEALS WEBSITES ABOUT
 PODCASTS REDDIT 

 

SUPPORT TUXDB ON KO-FI

MENU

ON SALE

New Twitch streamer aggregation implemented (#FuckTwitch) due to Twitch's API issues (more info on my Discord )


Name

 MicroTown 

 

Developer

 Snowy Ash Games 

 

Publisher

 Snowy Ash Games 

 

Tags

 Strategy 

 

Singleplayer 

 

 Early Access 

Release

 2019-08-30 

 

Steam

 € £ $ / % 

 

News

 28 

 

Controls

 Keyboard 

 

 Mouse 

 

Players online

 n/a 

 

Steam Rating

 Very Positive 

Steam store

 https://store.steampowered.com/app/931270 

 
Public Linux depots

 MicroTown Linux [82.11 M] 




LINUX STREAMERS (0)




EA Update #25 - Patchtastic 4

This smaller-scoped update brings a bunch of smaller additions, changes and fixes. Mostly, I've added or changed various things based on player feedback.

The intent for the update was to do tasks that don't take more than a day or so (a rule I promptly broke). The sort of unrelated changes that are too small for their own update, but bloat feature-centric updates. I originally had the plan to do patches like these between larger updates (while taking a break from the sort of wide-scoped updates that the level generator rewrite was), but I ended just making larger updates even larger by bunching all the changes at once. I have since learned that this is not a good approach, as much as it might seem easier. Anyway, here is a bunch of... stuff.

[h2]Changes[/h2]

The biggest change is the addition of a new variant of storage building - Mixed Storage. As the name implies, this building can store multiple types of items. It stores less of each item, but instead up to 3 different items:



As before, there are Warehouse, Granary and Barn variants, now in Small, Large and Mixed selection:



I also drew new sprites for the buildings themselves so they have some visual variety:



Building construction menu will now show the number of buildings already built in the world:



Buildings with auxiliary construction buttons will also show how many of those they have in range:



Mining Tools is now a separate tech:



Small, but technically challenging task - Butchers can now self-deliver Pigs - that is, units (like items) can now be self-delivered as inputs:



Tech tree tooltips now have a bunch more organization and explanation for what and how they unlock:



When selecting storage buildings, larger in-world HUD indicators now appear to show what item each storage holds so it's easier to see what is where:



This also applies to the new mixed - multiple item storage:



I changed villager shirt colors to match their main profession to make it easier to distinguish them - red for building workers/tradesmen, blue for carriers/idlers, orange for builders and gray for kids:



Houses now have even more minor clutter around them to add some visual variety:



Selected storage (for single-item storage buildings) can now be cleared:



Import Stations now have a button to drop items that no longer have incoming trade routes to allow easier management of items:



Villagers running along roads will now pick their lane (right side) of the road to run along, so that opposite "traffic" doesn't overlap, making is visually cleaner:



Villagers returning from export-import routes will now actually bring the empty cart back (this was a super-important critical immersion breaking bug fix haha):



I removed the "sub-toggle" production buttons from auxiliary construction and placed them as a separate obvious row:



I also significantly raised worker self-delivery weight, meaning that workers are way more likely to get their items themselves instead of waiting for a carrier. This is liable to somewhat disrupt existing villages - it's really impossible for me to predict this. But after seeing a lot of save games and feedback, it seems that in general players more often have carrier shortages than excess idlers. And I suppose it's more important to resolve problems during shortages than to worry about minor balance during "normal" times. Ideally, I would make a slider for this to have some sort of "low, medium, high" self-delivery preference, but I am not sure if I want to add another layer of complexity to this (considering there are dozens of variables that could be tweaked like this).

And a bunch of other tiny changes and fixes.

[h2]Future plans[/h2]

Serious big picture time. The game has been in development for 5 years now. Barring various personal reasons, I have worked on this full-time when possible. I've taken a few breaks here and there, but it's my only project where I'm doing everything as a one-man team. This is both incredibly difficult and impossible to stay motivated and not burn out. There are still so many things I want to add and improve, but at some point I have to pick between working on it forever with diminishing returns or actually finishing the game. So the plan is to move towards the 1.0 release and to properly publish the game. Of course, this was the plan all along, but I was never in a hurry to get there. The game slowly changed from "small prototype" to something closer to a "dream game" for me, so I just couldn't "abandon" it. But to be fair, the game was more complete in its second year of early access than most games ever are. I could more or less transition from EA to 1.0 at any point, because the game is perfectly playable as a sandbox village builder. At this point, it's more about my own expectations of what a "finished MicroTown" is supposed to look like. I know there are players that would like to see many more features. And there are certain things I really wish to add still. Anyway, this is all to say that I have taken careful consideration of my plans and priorities. I am aware how easy games can go from EA to abandonware and this is the last thing I want to happen.

That said, the rarest and most precious resource for any solo project is motivation. Frankly, I surpassed all my own expectations to have worked on this project for so long and not given up. But there's a limit to this and I'm approaching a point where I get less work done than if I just took a long break and came back with a fresh outlook. In hindsight, I should have done this 2-3 years ago and then probably every year. So that's sort of what I'm going to do now. Instead of forcing myself to do barely any work at all on MicroTown, I'll focus on something else and come back in a few months with a fresh batch of motivation. (Of course, I'm still around - answering questions, monitoring feedback, fixing bugs, etc.)

There are several big features still remaining that I think are required for the game to be complete: endgame trading and resource sinks, monument expansion to world wonders, and some sort of scenario/campaign mode. This is all several posts worth of details, so I won't expand on it all here. But in short, the game lacks play time, goals and larger game loops. So those are the primary future tasks.

[h2]Full changelog[/h2]

Changes

Add storage buildings for mixed item use - up to 3 items - Mixed Granary, Mixed Barn, and Mixed Warehouse
Merge storage building HUD item display and item selection rows into a single row, new mixed storage is also a single row
Villagers now have different shirt colors based on their occupation - blue for carriers, red for building workers, orange for builders, and gray for children and unassigned (i.e. dead)
Selecting or building a storage building displays stored item icons above all the storage buildings in the world
Group tech button tooltip's unlocked entries hierarchically and add additional labels explaining their "role" as well as notes like "already unlocked" and "also requires" for other techs
Export Station workers returning from a route will bring the cart back
Buildings with auxiliary toggles (Gardener, Farm, Paddy Farm and Ranch) now use "full" per-item/unit production toggles instead
Villagers will now run slightly to the side of the mid-tile trajectory so villagers running in opposite directions won't "collide" as much visually
Storage building item selection popup now allows clearing the stored item
Stonecutter will now show an issue warning if missing Deposits
Add "clear unused items" button to Import Station selection HUD to remove item stacks that don't have incoming routes
Construction menu buttons will now show the counter of buildings in the world
Building HUD inspection auxiliary construction buttons will now show the counter of available auxiliaries for that building
Building HUD inspection production toggle buttons can be Shift-clicked to toggle production to only include the specified target
Add more visual decals to Houses - random boxes and tools
Patch notes window now lists major update numbers and names
Removed starting Stockpile storage
Items on the ground will now show as stacked items (same as in buildings)
Forester won't have Wattle Sapling enabled by default (when Leatherworking is unlocked)
Change sprites for inspection HUD buttons that toggle (I.e. have on/off states) to differentiate them from single-press buttons
Building workers can now self-deliver input units (i.e. Butcher can bring Pigs)
Item selection popup window will disable button that aren't usable/selectable
Add separate Mining Tools tech for unlocking Mining Tools
Workers will perform prop operations from random direction (left/right), e.g. tree cutting

Fixes

In-world icons are now properly depth-sorted (e.g. Markers)
Lumberjack would not show an issue for missing Trees when matching them against the toggled production
Disabling sold item in a Shop would not prevent it being brought by workers from storage building and Import Stations
Goal HUD expanding too far with many goals and overlapping operation/window button menu; added scroll bar
Roast shown as unlocked with Fishing
Kids would not idle around the correct buildings (would idle near adult-preferred locations)
Crossing independent tech panel arrow lines won't "bleed" status color on each other
Fix building inspection crop growth tooltip misaligned text
Shift-copying a building for construction would not copy production item/unit toggles
Rare bug where a fish near world edge would cause an error
Boardwalks not buildable on new tile types - Beach and mineral-based Rocks - e.g. Coal Vein and Excavated Coal Vein
Smith would unlock with Quarrying, but not having Smelting would mean it cannot produce anything
Workers would fail to work on props too close to the coastline, e.g. lumberjacks couldn't collect felled trees and would get stuck waiting forever
Lime Mine not collecting Lime

Balancing

Increase worker self-delivery weight, making workers way more likely to self-deliver items

Optimizations

Many items on top of each other on the ground won't be rendered repeatedly
Faster lookup of tiles for idling units

Rudy
Snowy Ash Games


[ 2024-02-28 12:35:40 CET ] [ Original post ]

EA Update #24 - Map Generator 3/3

This the third/last of three update posts about the new level generator. The introduction is at Post #1 and the second partis at Post #2.

At this point we have something resembling a map:



It's probably fair to say that the generation logic so far is already complex. But this is only perhaps third of the way to the final map implementation-wise. As more passes work with the data, they make smaller and more specialized changes. There aren't too many steps left, but they are generally an order of magnitude more complex in implementation than most preceding steps. This is also why I attempt to get as much top-level decision making done as soon as possible, so that the later passes work with smaller and more specific parts of the map without making any significant changes to the overall direction.

[h3]Tiles[/h3]

The next big transition between the two generation parts is to actually create a tile layout on top of the clusters. This is quite literally how it works:



The main change is that the tiles actually correspond to the in-game tile hex layout (and all the math from here is in hex grid). It's also important to note that they are much denser than the underlying clusters, so all operation are way more fine-grained:



In other words, a single cluster is represented by a collection of tiles. This is how the cell-like structure of the clusters gets preserved to the final version.

The tiles that get selected (at least, the initial version) pretty much just match the cluster they are on:



While it was not really productive to design the main shape of the island using tiles are the basic "unit", it's important to start seeing individual tiles once the main shapes are determined, so going forward all changes will be done to tiles (directly and indirectly):



The downside of using purely random points to determine the clusters is that sometimes they are just too small or too large when they get converted to tiles. And there's no good way to handle this generally. These are basically statistical outliers, so after "placing" regions into tiles, I also either trim or expand them to a maximum or minimum number of allowed tiles:



The perfectionist in me detests this kind of bodging. So this may be a good time to reflect on this.

[h3]Randomness[/h3]

Randomness is always battling with order. As a concrete example, to create interesting rocky patch shapes I have to allow the random values to be random enough that these shapes get generated. I cannot restrict it too much or I will end up generating the same blob over and over. The problem of course is that random generation has no concept of subjective values like "interesting" or "balanced" or "doesn't break pathfinding horribly". To put it another way, the more cool stuff I let in, the more bad stuff sneaks in. Consequently, the more freedom I allow, the more rules I have to write.

There are several ways to ensure that the generated result is compatible with my goals. Barring just hard-coding all the values, I broadly label these "threshold", "fix", "retry" and "accept". This might sound like nitpicking (and I certainly didn't foresee myself writing an essay on randomness philosophy). But given that I have to make dozens if not hundreds of decisions as to how I will handle each such value, there emerge several patterns.

"Threshold" means setting a strict limit to the possible output of random generation. It may be strong bias, it may be a preset range, it may be a hard limit that cannot statistically be outside the designed range. For example, the middle of the island is always solid land - the threshold for land simply exceeds the noise values that are clamped to the hex shape there. The downside is that such thresholds are often fairly restrictive and I may miss out on interesting outputs simply because I deny too many.

"Fix" is the consequence of letting a lot of randomness through. Subpar outputs and awesome outputs are different ends of the same spectrum. If I aim to preserve the good bits, I have to be prepared to handle the bad bits. Besides reading like a fortune cookie, this just means applying certain fixes to expected problems, like the above example of under/over-sized regions. There is a downside though - I have to actually implement it, test it and forever maintain and adjust it with the rest of the generator, which is all the more complex because of it. This is also an excellent reason to keep such fixes self-contained in separate passes and easily reviewable.

"Retry" means literally that - just run it again. There are two general cases when I would do this. Firstly, if something breaks or I cannot generate something. For example, I might want to place a sand patch 5 tiles away from all the clay patches, but I just happened to generate clay so uniformly that there's no place on the map to place sand now. Secondly, when I don't like the result. Like the earlier example with the island shape - I might hard-code some subjective rules, filters or conditions. As easy as this solution is, it's also dangerous to start rejecting too often rather than have better rules. It's also too easy to filter too much and not give randomness a chance to produce neat results. And with a complex generator like this, one must consider that it becomes computationally costly - I just cannot retry things hundreds of times, especially during later passes.

And finally "accept". Sometimes I just have to give up. The result will never be without fault. That's statistically impossible. The good news is that this is actually mitigated by the layered complexity of the generator as well as high error tolerance of the game itself. It's actually surprisingly difficult to generate a map that's unplayable. Even a tiny map that can barely fit anything and fails half the checks is perfectly playable (and I didn't even cherry-pick the example, I just ran the game once):



[h3]Shape cleanup[/h3]

Similarly to clusters, tiles may end up with small ponds and islets because cluster connections do not always translate to tiles perfectly and it's occasionally possible to create "gaps" between clusters when represented as tiles:



These are really rare and they also don't really matter for other non-water clusters. For example, a gap between a forest in the final layout just makes it more varied, but doesn't cause any gameplay issues:



A bunch of logic depends on coast distance, so I calculate each tile's distance to water and land:



Previously, I often encountered islands with annoying unusable coastal extrusions (long peninsulas) that mostly ended up as sand anyway. Similarly, there often appeared long water "tunnels" into land. I still occasionally get these:



However, now I attempt to find "landmass" and "water mass" areas, which are basically tiles that are deep inland or far from coast. This identifies any regions that are only connected by narrow strips of land/water:



As these are undesirable, I reject these results and retry the whole generation. It's fine for there to be extrusions like this, but they have to be "reasonable" and ensuring "wide connectivity" is the approach I found best to preserve enough interesting but not broken shapes:



Another common issue is an undesirable proportion of land-to-water ratio. Some shapes end up being too large (basically a hex), others too small (boring blob in center). So I calculate how much water there is that's not close to the coast and reject shapes with bad proportions:



A similar common issue is the whole shape being "offset" from the center so that some coastlines are really far from the "world edge", making for huge undesirable water stretches. I reject these shapes as well:



[h3]Coastal cleanup[/h3]

The height map random noise does a decent job of creating shallow and deep water around the island, but it is also prone to creating excessive shallow water. Since I cannot "fix" it during the initial noise pass (I would also affect how much land generates), I manually trim away shallow water too far from land (convert to deep water):



This basically makes deep water transitions more "aggressive". This is also mostly a result of visually confirming what sort of shallow water amounts and variations look goods.

Similarly, sometime the noise transitions are so "steep" that deep water ends up touching the coast, so I offset any deep water too close to the coastline (although I fine with there being only a little gap):



Finally, all this fiddling with water level may end up shallow offshore patches. I did consider leaving them in as small cool variations in the ocean, but they almost never actually look good because they are just extreme outliers of the height map noise. So I basically remove them:



Previous height map also controlled the beach elevation. That is, I spawned beaches based on the height map, which was based on the map size. This created really huge sand areas around the coastline, especially where the coastline wasn't regular. So far, I have completely removed any sand at the coastline except the specially designated beach regions. But I do actually want some narrow beach tiles to randomly appear. So I'm using some noise values to randomly change coastal tiles to sand but only with specific thresholds to avoid any excess:



[h3]Despeckle[/h3]

A common issue with the resulting tile layout is that they sometimes have "sharp" edges - tiles that are almost completely surrounded by another tile type. This just doesn't look good in the final version, so I added a pass to trim these to match their surroundings:



With several iterations, this cleans up any unnatural looking extrusions.

A special case of this are coasts that may end up with micro-extrusions of single-tile peninsulas. I really don't like these in the final resulting tile layout, so I trim these:



Technically, this trimming happens before all the water coastline logic because I cannot modify water/land tiles once I have established the distances. (It was a "fun" bug to chase that caused the generator to crash every 1000th run or so.)

[h3]Tile variation[/h3]

At this point I assign tile variation to the map based on a noise map:



Currently, this only affects grassland tiles (and technically forest tiles that may revert back to grassland). Compared to previous generation, these patches and transitions are a less messy shape and don't overlap contrasting variants as much. Similar to other noise maps, climate affects these for some extra variation between "biomes":



Previously, I used the same height noise map for these as all the other features and while it looked fine, it was also very obvious purely random and not following any sort of natural "land" layout.

This might seem like a fairly trivial decorative feature to discuss in such detail, but the map looks really ugly with all the grass tiles being the same variant, especially after seeing the varied background for so long. Seeing such a huge difference made by such a small variation makes me consider all the other places I can vary in minor ways but to great effect.

[h3]Fillers[/h3]

Finally, I get to filling the contents of regions. This is also what I call the process and the objects - fillers. Specifically, I will spawn trees, shrubbery and deposits all with the same general methodology and much shared logic but different details. Similarly to region creation, this will involve fewer passes that instead process numerous entries but in different ways.

First of all, I need to determine the "depth" of the region tiles, i.e. how far from the region's edge they are:



This may sound like a small thing, but it's a very important step that has huge impact on the resulting visual layout. Without this information, I wouldn't be able to make any transitions between region sufficiently gradual (or sharp) to look decent. It's also important for spawning the right amount of fillers, like deposits. This is not something I could not have done previously, because the map had no concept of "region" - all locations where only as gradual as the noise map at that location.

Currently, I do 3 runs for the different groups. Starting with trees, which get spawned in the forests (regions):



The placement rules, which are basically "how many trees per tile in which tiles" comes from the ruleset I specify:



An earlier generated noise map for tree types (which was affected by the climate) is then used to decide what type of tree to place - spruce, maple to birch. This all ends up creating a nice mix of trees in semi-contained regions:



Very similarly to trees, I place minor vegetation - shrubs, grass and flowers. They also have their own ruleset and noise map, but things are just tweaked to accomplish what I want visually (which really is 90% of how I come up with the parameters):



And finally, I place deposits in the earlier established deposit/minable regions:



Most importantly, these are not just randomly spewed across the map with too many or too few tiles, but rather deliberately chosen to occupy certain areas and be of certain size (as per their region). This is one of the main problems I had with the old generator. Now, deposits follow specific rulesets, including actual deposit counts:



It is also important to note that deposits come with the "amount" value. While count means "how many per tiles" - 1 to 3, amount means how many "logical states" they get in gameplay, which translates to how many times they can be mined.





Even a simple algorithm for "filling" the deposits into a region to look nice and natural ends up being a fairly complex process. For example, I prefer to fill in the deeper region tiles before filling the outer tiles. I also want deeper tiles to have more minable amount than outer ones. But all of this is still randomized.

[h3]Output[/h3]

At this point, we reach the end of the generation. The way I have structured the generator, I technically started implementing it with an input and an output pass, so I have always had "the output". This really is an arbitrary point, which is decided by what the game needs and when I stop. As I mentioned at the start, the primary goal was to get it back to working to the same level as the old generator plus fix the primary problem. At this time, that is roughly where it's at. Of course, it's easily extendable in all sort of ways now, so when I'm adding new features, I can now also consider making changes to the map generator.

I skipped describing much of minor logic and a lot of details. I also skipped all the things that didn't work - a lot of the above is the result of experimenting and making multiple versions for passes. I might mention some if and when I add some feature that is tied specifically to some part of the generation.

Combining all the outputs and data from the passes, I get my final "image":



Importantly, this is all not presented in the actual game, but rather only in the separate generator "project" visualized with a quick debug texture creation. And this also contains all the important data from the preceding passes, that does not appear in the final game in any form. For example, none of the cluster and region information, none of the noise maps or stuff like climates is part of the gameplay. Probably 90% of the data gets discarded. In fact, the only new data that I store compared to the previous version is the spawn location. But this data can be fed into the game now, which really "only" has to spawn the things that the output asks for - tiles and props plus whatever hard-coded spawn features. Notably, the game doesn't have to "fix" anything that the generator messed up - it's basically expected to be correct.

[h3]Final thoughts[/h3]

I've been writing the main points to these posts along with implementing the generator. By the time I'm publishing the update, I do a full write-up from these key points. And, oh boy, were there a lot of those! By the end of it, I could hardly remember what I meant by half of the stuff I wrote down at the beginning. These posts also serve not just to discuss my progress publicly, but also to help me think through many design decisions by "talking them out". And there is still a lot to talk about, but I have to keep it relatively short (I say while having to split this up into 3 parts due to length).

The main conclusions and future plans can be found in the first part: Post #1.


[ 2023-10-24 14:36:13 CET ] [ Original post ]

EA Update #24 - Map Generator 2/3

This the second of three update posts about the new level generator. The introduction is at Post #1 and the third/last part is at Post #3.

I will now go into step-by-step process of the generation passes. For clarity, I will try to explain things in the way that makes most sense rather than sticking to exact technical pass layout. I'll try to group sections by generation "topic", although there is a lot of overlap.

[h3]Clusters[/h3]

Previously, the generated terrain was based purely on a noise map (Perlin noise). This created decent-looking gradual layouts, but this did not let me actually change anything in absolute values. That is, I could adjust things relatively - for example, have sand at 5% threshold, but then it would be random amount of sand up to 5% on any size map, which might be terrible on huge maps. There was no way for me to say - I want only 3 "patches" of sand, because there was no concept of a "patch" or "scale".

So the first and main terrain step is to produce discrete "clusters" (based on the map size). First, I generate a bunch of random (shapeless) points:



Then I tessellate these (basic Voronoi diagram) into individual (shaped) clusters:



Due to randomness, some of these often end up being too large or too small, so I run an extra smoothing/averaging pass (Lloyd's relaxation):



This produces a nicely distributed and organically-looking pattern (kind of like cells). Jumping way ahead, this is what will give the terrain the "clustered" look I'm going for (warning: now you will never unsee it):



[h3]Water[/h3]

The next big thing that I generate is the separation between water and not-water by heightmap, which is a convoluted way of saying that I'm building a coastline. This is where a noise map like Perlin noise works really well, so that's what I'm using:



Now, I cannot directly apply this to clusters, because the edges need to be water and the middle needs to be the island mass - by design. Previously, I was using a squashed circle on top of the height map to "cut out" the rough shape, but this created a lot of water in some directions and too much land in others. So now I implemented a much more accurate hex shape with proper "distance to edge" calculations:



I can then overlay this shape over the actual heightmap, reducing or increasing the random value to force it below or above certain thresholds:



This makes sure that anything outside the "big" hex becomes water and anything inside the "small" hex becomes land. The in-between area is then where the noise actually affects the shape. With some visual experimentation in later passes, I can tweak the noise parameters to produce satisfactory results.

I can then apply the "clamped" height map values to the clusters themselves and decide which clusters become coastal shallow water and deep water:



Of course, due to the very nature of applying thresholds to randomness over an area, I sometimes end up with little inland pond and offshore islets. For gameplay purposes (and all the issues these cause), I am removing these when I find them:




And this is just the start of the "battle" against randomness "ruining" my islands. I'll talk about this more a little later.

[h3]Island shape[/h3]

There is no perfect way to generate an island shape. Perhaps there are more suitable algorithms just for the island shape generation, but I also have all the other generator's parts to consider and they have to all be compatible. So instead of seeking some perfect algorithm, I'm just brute-forcing the generation a bunch of times until it doesn't get rejected. Some passes are there purely to reject the result and tell the generator to restart.

One such pass is for, broadly, "island shape". I generate a few "control points" in a rough approximate ellipse around the island and check if they are land or water:



If there's too much water, too much land or too much repetition, I reject the shape. Otherwise, it's probably interesting enough to keep. There is no science behind this - I was just looking at hundreds of islands until I came up with heuristics and parameters that struck a good balance between random and still somewhat hex-like shaped.

This is a good time to reflect on just how many maps I generate throughout the process:



I have set up my generator to support output export at every step, so that I can leave it running for many iterations and then check them for any systematic problems. This is not something I could do before, and this is an invaluable methodology for designing and implementing a system like this.

[h3]Climate[/h3]

Among many experiments to make different regions of an island feel more varied, I settled on a "climate" concept, which flags clusters as belonging to a certain climate (to a certain amount) and other passes can use this data to alter their generation. So this doesn't do anything by itself, but it provides additional customization for later passes. It's kind of like biomes, but currently there isn't any biome-specific terrain, so I'm calling it "climate".

For start, I select a few "control points" in a circle around the map (I chose this shape for simplicity and because the maps aren't large enough to come up with complicated layouts). Each climate has a area it can influence:



Then several climates are assigned randomly, specifically 2 forest, 2 plains and 1 rocks (and the rest stay default):



These are just thematic names that describe my intentions. The climate regions then flag clusters within their influence with an appropriate climate value/weight for later use:



Again, jumping way ahead, slight variations is later passes would create noticeable differences:



[h3]Spawn[/h3]

Previously, I placed the starting area or spawn in the middle of the island and manually cleared it from obstructions and non-buildable tiles. And while this works, it's implemented backwards. Instead, what I really want is to decide on the spawn location and then make sure I don't obstruct it with anything and place the relevant things around it.

So now I pick a random location on the island within a spawn selection area torus:



From there, I pick a valid (for example, not too close to water) closest cluster and construct a spawn area (this uses the same logic as regions, which I will describe later):



This creates one "main" point for the spawn and "grabs" nearby clusters to expand the area to a specified desired size. In addition, I place several "meadow rocks" areas, so I can spawn starting stone deposits around but not on top of the spawn area.

Finally, I create a small spawn exclusion zone, where many things can generate normally, but it will mostly remain free of obstruction:



While this may sound simple, it's extremely easy to get wrong and took me enough experimentation to make a working version. There was a good reason why I previously kept the spawn centered and it was to avoid the many issues of random placement of potentially-overlapping terrain features.

[h3]Regions[/h3]

Most of the map is generated in two big parts - discrete features like rocks and clay patches and continuously semi-random ones like forests or flowers. Regions are for preset discrete locations, so they have to be generated first before everything else is "filled in".

It is very difficult to break down region generation into multiple passes, because they are basically all identical except their rulesets. And separating these rulesets is only useful for visualization (which would take huge amounts of work, so I didn't really do it). So what I end up is producing the region map in a single pass:



Generally speaking, regions are groups of neighboring clusters that form an area for some purpose. For example, there could be a 4 cluster region for coal rocks. Each type of region has a long list of hand-crafted rules and requirements, mostly derived from experimenting. Plus, most of these have some sort of rules about distances in relation to each other. So it makes more sense to just see the results for all at once.

For example, here is a ruleset for placing sand regions:



What this says is that it will place 2-3 region with 2 clusters semi-randomly; it won't place two regions close to each other and will place regions close to but not next to the coastline.

There are many more rules and nuances I could add, but it's best to keep it simple - more parameters just means more work adjusting them and debugging issues. And there are already 12 different region groups just to match the basic level generation goals.

There are some notable rules though worth mentioning. For instance, some regions are much more likely to generate in certain climates. Notably, all rocks-based minable regions are more likely to appear in the rocks climate:



Jumping ahead to final generation, this would allow the terrain to shape village direction and create a part of the map that would naturally focus on mining and industry:



This is not something I could have influenced like this before and is only possible because I can "direct" such discretely-selected regions towards certain results I'm looking for.

Another example is a beach region (in addition to regular thin noise-based beaches discussed later), which randomly generates along the coast in a few locations:



This adds variety to the map without covering half the map in sand, like it used to do before.

I should note that while this is how I primarily use the regions for now, they do not specifically just control tiles (grass, sand, rocks, whatever), rather they flag the clusters as belonging to that region. In fact, the number of tiles that later get converted to their "region designation" is more strict than "cover the whole region". So regions in that sense more of an abstract layer informing later generation what to select but not necessarily exactly how. More like "this is a good place for X".

[h3]Filler regions[/h3]

The second type of regions are the "filler" regions that, as the name implies, fill out the rest of the clusters that aren't already designated for something. Because this doesn't require any discrete counts, this can be done with a noise map. I'm using several slightly different noise maps for different purposes, specifically tree cover, tree types, plant type and tile variation. It's also fairly simple to add new variants and then use them in later passes.

For example, here is (part of) the tree cover noise:



This assigns a "tree cover value" to each cluster (point):



Then a bias to increase or decrease the noise value is applied based on the climate it's in:



These are small adjustments that each climate provides, but they can create a significant variation for each "filler":



Now with the noise values decided, empty clusters can decide what sort of content they want. For example, tree cover decides where the forests will be located:



These noise maps will be further used in later passes for relevant selections. The above selection was more or less binary, but there are many more things that can be decided based on the full range of the random value.

[h3]And more![/h3]

I'll continue describing the remaining steps in the next, but this seems like a good time to reflect upon all the things that I am not doing. As I mentioned, it's important to set myself some limits on what I'm implementing, otherwise I will never finish this. I am certainly thinking about a lot of cool things that I could do.

As an example, I used the cluster layout and the Voronoi diagram edge connectivity to build a cluster "height map", spawn a "lake" region and then build a river running from the lake to the nearest coast:



Of course, this is far from something that I can translate into tiles and gameplay, so it's more of a proof of concept. But I thought to mention this just to give an idea of the possibilities.

Next post: Post #3


[ 2023-10-24 14:35:48 CET ] [ Original post ]

EA Update #24 - Map Generator 1/3

This update replaces the game's island map generator with a new more robust and expandable version.



I had two primary goals for the new level generator. Firstly, to bring it up to at least the same level as the old generator - but do this with a modular, extendable and configurable approach. And secondly, to fix the biggest problems with the old one - excessive unusable land, poor scaling with world sizes, bad coastal shapes and many minor issues.

There is a lot to talk about designing a complex system like this. I won't go into a huge essay about my software architecture here. There are many reasons why I'm doing the things I'm doing even if they oftentimes feel like over-engineering convoluted solutions to simple problems. But I will go over the most important parts.

Due to Steam post limit, I had to split this up into three parts. This post will focus on the overview and general approach, and the goal of the generator. The other two parts will go through specific generation steps: Post #2 and Post #3.

[h2]Iteration[/h2]

The hardest part of making a complex parametrized system is testing and iterating its results. The faster I can preview my changes and the easier I can understand the impact of these changes, the faster I can work on it and by extension produce better results.

This is my best friend:



To accomplish fast iteration, the system has to be designed with this in mind from the start.

A map generator makes hundreds of decisions when building a map from high-level choices (for example, the number of biomes) to specific low-level choices (for example, number of trees per tile). Usually, these are encoded as direct and indirect parameters that I can quickly tweak to achieve the desired results.

The difficulty comes from having lots of parameters and wanting to understand their impact at the same time, which means previewing the difference they make to the map generation. And this is a difficult problem because any changes that happen after the relevant ones can obscure the results. Most parameters have a huge range of possible values and only a narrow band of value produce desirable (or even usable) results.

So I want to preview not just the final result, but every step of the way. To do that, I am splitting the generator's logic into discrete steps or "passes" so that I can look at the independent output(s) of any pass in the sequence.

It is also critically important that the result preview is visual. This may sound like an obvious criterion, but implementing clear and useful previews takes significant additional time and effort. It is thus a longterm strategy, which means it has all the pitfalls of additional code to implement and maintain.



Another important consideration is coding the generator, not just running it. The last thing I want is to break everything by making changes. Implementing separate passes will take more time but not nearly as much time as having to rewrite large parts of the code if I interconnect everything. If I mess up some pass, then I will likely only break its inputs and outputs to the previous and next passes. And realistically I am almost guaranteed to rewrite, remove, add or majorly change many of the passes because I simply don't know how exactly they will work.

And one final and often overlooked benefit is personal motivation. Actually seeing the system work after every change is a huge boost to my motivation. It's the difference between just making something work and investing that extra polishing time. In a large system like this, small details quickly compound.

[h2]Passes[/h2]

I would like to describe every step the generator takes, because I personally find it all very interesting and I could talk about it for hours. Unfortunately, this will end up with a hundred pages long post (and about 20 times over the Steam post limit). So I will try to summarize the most important steps and parts. And even with me being "brief", it is still about 3 times over the post limit. So as I'm splitting the update into three posts - this one (broad overview) and two step-by-step overviews of the generation process: Post #2 and Post #3.

[h2]Scaling[/h2]

One thing I barely considered for the old generator is scaling parameters with the generated world size. This is where the huge sand areas of the old generator in the large maps come from. And this is actually a much more difficult problem than it seems, which needs to be "baked into" logic from the start. Every variable that controls something size-dependent for the generator must decide how it behaves with different map sizes and I need to be able to quickly control it. In fact, there must actually be all the variables to control size-dependent features (for example, I cannot scale parts of a noise map without scaling everything). For example, I would want to specify that a beach is 2 tiles wide or 5% of map size, or 3% of map area, etc. Choosing an incorrect value or approach might work fine for the reference size, but may produce terrible result for different sizes.

So when specifying parameters, I make sure to specify (and preview) how they scale:



Generally, the options are "static", "linear" and "exponential" (with inverse variants). Static mean the same value for all sizes - e.g. number of spawn locations. Linear means it scales with the map size (width) - e.g. allowed water edge distance. And exponential means it scales with the map area - e.g. number of stone deposits.

And when testing the generator, I can run any combination to verify that they all work correctly:



[h2]Major changes[/h2]

As mentioned, this update is not meant to majorly change the gameplay beyond (A) fixing and adjusting most problems with the old generator and (B) those changes that are best done now to avoid too much disruption later. So there are still a few bigger changes that do impact gameplay:

Rocks no longer spawn all over the place, but rather in discrete patches focused towards one area of the map (this preview is from the tiny map, because I cannot get a better screenshot from a large map to demonstrate the idea clearly):



Furthermore, rocks now come in 4 variants - Rocks, Coal Vein, Iron Ore Vein and Limestone Vein, with their respective deposits only spawning there:



Consequently, the Mines now need to be placed on the appropriate type of rock:



(That is one chonker of a tooltip... I haven't really come up with a way to shorten it either other than having 8 separate lines.)

Sand and Beach are now different tiles. Minable and usable Sand now spawn in discrete clumpy patches. Beaches spawn along the coast (sometimes in clumps) and they cannot be mined.



They look a bit empty (again, because I did not want to expand the scope of the update), but there is potential to add something here.

Overall, the island shape has somewhat changed. The generator attempts to "fit a hex shape" into the game area, with a roughly-expected distance to edges, but still some larger coastal variation (I explain the various constraints in the other posts). A more "extreme" example of an island that is basically a hex:



The coastline of the island is also much cleaner. There are no extended peninsulas or closed bays - the vast majority of the map should be accessible. But there can still be significant variation of the coastline. Again, a more "extreme" example with lots of "shapeness":



Most islands end up somewhere in between the two, leaning towards more varied coast.

I also added a new grass type for some visual variety and as a proof of concept that I can vary vegetation:



Which kind of lead to discussing the possibilities...

[h2]Potential[/h2]

One of the main goals of the new level generator was to be able to extend it in linear time. In other words, add new stuff quickly. This means there are a lot of things I can now add to the map that I previously couldn't. Some are very easy, some are more difficult, some are impractical. For example, I won't be making multiple islands (impractical), but I can easily add more biomes (easy) or cool features like a river or two (difficult). The great thing is that I am not limited to any particular single algorithm that has to somehow produce all the results in bulk - the generator consists of many individual steps and I have a lot of freedom to add and modify those.

A particular direction I want is to specialize and utilize different parts of the map, so that the terrain shapes the village more than it currently does (i.e. not at all). For example, you might have a swamp in one end that is needed for medicinal plants or flood plains in another part, where crops grow best, and so on. Following this, I might be able to force some production chains to actually need transportation from their production location to their processing location rather than having everything clumped together.

Another big potential feature is allowing player customization for the generated map. For example, forest density, deposit amount, climate bias, etc. I haven't implemented any of this, but I have kept this in the back of my mind when designing systems. I basically comes down to having user values selecting or adjusting one or more generation parameters.

Finally, I could potentially add--if not full replayability with different climate zones and resources--then at least enough differences between maps and their layout to not all look the same.

So this is all something that I'm looking forward to (admittedly, I am also exhausted having spent so much time on the generator.) I won't even speculate on what I want to add next, because there are just so many possibilities. In fact, deciding what to add and--more importantly--what not to add is in itself a big design decision/direction.

[h2]Unity engine[/h2]

I am currently using Unity engine for the game. You my have heard about the recent Unity trust debacle. I won't go into details here, but the main point is that I do not wish to continue using the engine. Unfortunately, MicroTown is many years into development and strongly tied with the engine's features. This makes porting to a different engine very difficult and time consuming. I don't know if I can realistically invest that much time into this. I spent a couple weeks investigating engines and experimenting to see what such a transition would require. For now, I am still undecided. But it's likely I'll have to stay with the current engine.

[h2]Future plans[/h2]

I had to really stop myself from starting to add more features to the level generator. It has already turned out to be the largest "feature" that I have ever worked on. And the final touches and fixes again took way longer than I anticipated.

I wish I could have split this update into multiple parts over past year or so. But unfortunately this is one of those "all or nothing" features. I cannot implement half the generator or even 90% of the generator - it has to be all of it. So updates have been, shall we say, a bit slow (in addition to some other real-life stuff). So I tried to work on it 50/50 mixed with other features/updates, but that hasn't really been a good approach. I will definitely avoid splitting major workloads like that in the future.

So, hopefully, I will be making several "terrain updates" adding something to the generator and either adding or modifying something in related gameplay.

[h2]Full changelog[/h2]

Changes

Implemented new level generator algorithm
Overall terrain shape is now properly based on a hexagonal shape, but there is more coastal variation and most landmass is slightly further from the edge of the map, but with more variation
Terrain is now constructed in a more cell-like pattern, where "cells" correspond to biomes/regions, such as meadows or forests. Trees and other props will have way fewer unnatural "stretches" and "clumps". These "regions" will tend to be more uniform and connect more naturally.
Islands overall shape will avoid generating with no coastline variation or excessive water or land
Island now has several larger "climate" or "biome" sections that somewhat alter its layout and features - a part of the island has more forests, a part has more plains and a part has more rocks along with other slight vegetation biases.
Deep Water to Shallow Water transitions are now smoother
Water will not have excessive "patches" anymore
Coastline is less jagged now and fewer extended unusable peninsulas or bays will spawn
Add Switchgrass, a type of grass that spawns in Grassland
Rename "Flower" to Marigold
Add generic Flower concept
Vegetation (Tree layout, types, tile variation, and Shrubbery/Marigold) layout are all now based on a separate noise patterns to avoid unnatural patterning
Add new tile Beach that replaces Sand along the coastline, not suitable for quarrying
Coastal tiles have much less Sand (that is, fewer Beach tiles) now
Sand, Clay and Rocks now spawn in dedicated patches and cover much less of the terrain
Patches of Rocks, Clay and Sand won't spawn next to similar patches anymore
Rocks patches will spawn more in "rocky biome" and will generally include all the ores in that region (although they will still spawn randomly elsewhere)
Clay patches now only spawn further inland
Sand patches only spawn closer to coastline
Several larger Beach locations now spawn randomly along the coast
Rocks now have resource vein variants - Coal Vein, Iron Ore Vein and Limestone Vein (and their excavated variants - Excavated Coal Vein, Excavated Iron Ore Vein and Excavated Limestone Vein)
Coal Mine, Iron Ore Mine, Lime Mine can now only be built on their resource tile variant, while Stone Mine can be built on plain Rocks
Spawn point is now randomly offset from the middle of the map
Spawn region is now clear of obstructing terrain
Spawn region will always have some free-standing rocks around it
Spawn region will only be set in "regular" climate avoiding inconvenient terrain for starting
Patches with resources will avoid spawning in poorly-accessible unbuildable locations, like surrounded by water or unbuildable terrain
Animal Habitats now spawn based on distance to coast rather than distance to map edge/center making for more uniform spawning and avoiding unreachable locations
Animal Habitats now pre-spawn properly instead of appearing one at a time after the world starts
All the internal properties of level generation now scale with the world size appropriate to their purpose. For example, larger worlds do not get larger beaches or excessive rock patches while smaller worlds still contain sufficient rock patches. Terrain features, like biomes stay proportionally-sized.
World generation will no longer stall UI (some other operations will also have fewer UI stalling portions)
Older saves with Mines will have their tiles converted to respective resource tile
Older saves will have empty stone patches randomly converted to resource patches
Add worker self-delivery max distance indicator "circle" when building or selecting buildings
Add the worker self-delivery max distance value to several relevant tooltips
Item deliveries during carrier shortage will allow self-deliveries, ignoring regular priorities and proportions, but not not stalling/failing to deliver
HUD delivery info tooltip will also show self-delivery count

Fixes

Selecting Observer would not show the empty icons above observable building until they had done at least some work
Fix worker self-deliveries not working above dedicated carrier max delivery distance
Fix workers delivering 2 or 3 items of their building's output to storage removing/replacing them from the building as worker
HUD delivery info tooltip showing the wrong number of available (idle) carriers and some other slight inconsistencies due to self-deliveries
Fix props attempting to transform while a worker is using them, for example a sapling rotting while being harvested by an arborist (and this invalid combo causing games saved at this moment to fail to load)

Balancing

New terrain generation alters various gameplay elements

Rudy
Snowy Ash Games


[ 2023-10-24 14:35:28 CET ] [ Original post ]

EA Update #23 - Technology Tier update

This follow-up update adds Technology Tiers to the game, requiring Tier-specific research point production. This is a smaller update content-wise, but it does drastically change the mid- to late-game gameplay by requiring all later technologies to produce second and later third tier research items, which have their extended production lines.

[h2]Technology Tiers[/h2]

So some mid-game techs are now tier 2 and require T1 and T2 points:



And late-game techs are now tier 3 and need T1, T2 and T3 points:



The three separate knowledge items (from the Leather update) now produce their respective tier knowledge points -- notes - 1, scrolls - 2, codices - 3:



The top overview HUD now shows the knowledge amount broken into tiers:



I briefly considered making 4 technology tiers, the last being "inspiration" for the monument construction. And I still want to implement this in some form. But the game currently just doesn't have enough techs or more content to support such granularity and late-game. So for now it's 3 tiers.

I also wanted to balance the Observer (former Scholar) and reduce the "free" point gathering, but besides just making it slower, I would have to change some core mechanics for it and somehow separate buildings by industry or at least type. This all ends up being far beyond the scope of the update.

[h2]Future plans[/h2]

I keep promising smaller and more frequent updates, so finally I have a smaller update. *ahem*

My immediate goal is to integrate the new level generator system into the main game. I've been working on it as a separate project for multiple reasons. Integration is one of the most difficult parts, but it's the only remaining large task to get it into the main game. I am tempted to work more on it and add all sorts of new features, but I really do need to just get it into the game first and worry about additional content later. So that's my primary goal right now - switching to the new terrain generator.

[h2]Full changelog[/h2]

Changes

Technologies now come in three Knowledge Tiers: Tier 1, Tier 2 and Tier 3 - each is gathered as points independently
Research Scroll now produces 1 point of Tier 2 Knowledge
Research Codex now produces 1 point of Tier 3 Knowledge
Tier 1 techs require only Tier 1 points
Tier 2 techs require Tier 1 and Tier 2 points
Tier 3 techs require Tier 1, Tier 2 and Tier 3 points
Technology point cost increases in each tier individually
Goals now also provide Tier 2 and Tier 3 points according to the tech they are based on
Update various tooltips, descriptions and Micropedia entries for the tiered Knowledge points
Add Leatherworking goal
HUD top overview Knowledge amount now shows points for all Tiers
Technology panel UI tech buttons now show the tiered costs for techs
Micropedia now lists when a building can be observed
Butcher can now toggle Meat and Hide production
Butcher's Table's steps can now be discarded (like some other buildings with toggled production)
Auxiliary step discarding can now also be triggered if there's no more space for the item (that is, full inventory will no longer stop items from producing, i.e. full Hide inventory won't prevent more Meat production)
Discarding will no longer trigger if all item outputs are full (no point discarding when nothing can be filled)
Discarding will no longer trigger if it's the only item the building is producing (everything else would be discarded too)
Discarding as a task priority is now the same as the step it's discarding (so buildings where discarding is an expected operation don't leave them until last)
Buildings with produced item/unit toggles will not show them if there is only one option
Building produced item/unit toggle button tooltips will mention which item or unit they don't need

Fixes

Fix inconsistencies in observable building list
Micropedia will again list Butcher's inputs, but as animals now
Papermaking goal using wrong base tech/award
Fix incorrect tech unlock costs for later techs
Fix Research Scrolls and Research Codices not increasing the correct (internal) Knowledge value
Fix Research Notes providing wrong Knowledge point amount
Library now showing operation progress bar for Research Notes use
Fix Research Scrolls not being delivered
Fix saves failing to load due to previous patch
Fix discarding tasks taking almost no time instead of the expected short duration
Workers working with several auxiliaries will now pick the auxiliary that is closest to finishing the product instead of (usually) picking an auxiliary with the most progress
Building with togglable production will not continue working if production toggles are disabled
Some tiles would convert to Sand after removing a building from them

Balancing

Technology tier introduction drastically changes mid-game and later tech progression requirements

Rudy
Snowy Ash Games


[ 2023-07-09 14:55:00 CET ] [ Original post ]

EA Update #22 - Leather update

This smaller update (but part or a larger direction) adds Leather item to the game and the production chains leading up to it; plus various changes.

[h2]Leather[/h2]

I decided to make Leather production fairly involved with multiple production chains using all the different production mechanics - growing, harvesting, animals, crafting buildings, mining. Essentially, Leather is a high value item used for high value purposes and I wanted to represent that by having diverse and significant production requirements. (There aren't any final products yet except Codices (which are not balanced yet), but this should lay the foundation for the "next tier" items. Though I decided to publish the update before I get further carried away with changes.)

Quarries can now build a Lime Mine, which produces Lime:



Arborists can now grow Wattle tree saplings and Foresters will plant them. These don't spawn/grow naturally and need to be grown from saplings.



Wattle trees do not produce Logs, but instead Bark. These are also collected by Lumberjacks like other trees.



Bark is used in Bark Mill to produce Tannin:



The Butcher building now comes with an Abattoir and a Table required auxiliary buildings, where animals are... processed. In addition to Meat, Butcher will now also harvest Hides from Pigs once Leatherworking is unlocked.



Animals brought to the Butcher now actually hang around the building as "real" units instead of magically disappearing into it as virtual items. The worker will actually fetch the individual animal and lead it to the Abattoir. I felt it was an important part of my "every item is real" design principle that I neglected with animal transfers (mostly due to implementation complexity).



An optional Butcher's Pen can be constructed to keep the animals within certain tiles instead of wandering randomly:



This also means that animals can now die of old age if they aren't... processed fast enough by the Butcher.

In addition to Butcher, Hunter can now also skin and harvest Hides from Boars and Deer:



Similar to Butcher, Hunter now also produces Meat and Hides:



Animals will now be double-harvested - first for Meat and second their Carcasses for Hides. Before Leatherworking is unlocked, the Hunters will just leave the Carcass.



All (wild) animal (carcasses) now leave bones behind:



This adds a little bit of extra visual variety (instead of dead animals disappearing instantly):



Tannin, Lime and Hides are then taken to the Tannery building, which processes them through a Hide-preparation Bench, Liming Vat (using Lime) and Tanning Pit (using Tannin). This produces Leather.



Leather is currently used by Currier to produce Book Covers:



Bookbinder now requires Book Covers in addition to Paper to produce Empty Books:



For now, there aren't any major changes to knowledge gathering and technologies. Some techs have moved around and adjusted requirements. I have also adjusted the details and buildings in preparation of making separate technology tiers.

Notably, Scholars will now always produce Research Notes without requiring Paper and the Library is available from the start, where these Notes must be taken to get the Knowledge points.



The Scribe will continue using Paper, but will make Research Scrolls instead. These are also taken to the Library.



Finally, The Bookbinder works similarly to before, producing the Research Codices:



These changes serve to establish a common design language of a Library serving as the central location to "deposit knowledge" of different quality (tiers).



In the future, I will add additional tech tiers and unique knowledge type(s) that requires Scrolls/Codices for higher tiers. This would then make sense for Leather to be this expensive and involved to produce. Currently, Scholars are more than sufficient to produce all the knowledge you need to unlock all the techs. But I have to limit the scope of these updates or I'll never publish any at all! So for now Leather and Knowledge are not balanced. Notes and Codices will simply produce more knowledge - 2 and 3 respectively.

[h2]Accessible buttons[/h2]

One thing (that I should have done from the start) is making sure all buttons have a visually-distinct and consistent appearance when pressed. And to account for color blindness, this cannot be simply a change in hue (in fact my beige + green UI choice is the worst possible one for most common color blindness types).

Here is the setup for a "normal" UI button:



Now, I don't use every possible combination of color and state and element, but there are a lot of them. I tried to keep everything modular and only use what I need. But this has nevertheless created a lot of individual pieces to maintain, which is one the reasons for taking a long time to adjust.



I should reflect that doing such a change after so much of UI is already implemented and wired is really tedious. I basically have to adjust every single button and interactable control in-game. Some never had a "pressed" version, others mixed them up, others have conflicting states, etc. This is the sort of thing I should have done from the beginning and really planned how all UI elements would have clear states, and then never deviate from that in any particular UI part.

[h2]Drag-building roads[/h2]

I also finally added dragging to build multiple roads (in an earlier mini-update).



The most tricky part of this was choosing which way to angle the road. There are almost always 2 symmetric layouts that a road can be drawn between two tiles. For this I had to decide where the player most likely intended the road, based on the mouse movement up to that point:



In short, when dragging a road I keep track of every coordinate the player "visits". But I only keep one coordinate for every distance from the mouse. I then calculate how "far" the player's movement is from either of the two variants and pick the one that is "closer".

This is much easier said than done, especially if you consider that you could be moving the mouse around a lot in all directions, passing the same point repeatedly, "rewinding" back, extending, dragging so fast tiles are skipped, changing your mind, etc. It basically ended up with me just playtesting until I couldn't really make it any better. The real difficulty was testing it and fixing all the corner cases.

I suppose I could have done this ages ago. But, like I suspected, this one feature took me a full week to implement. If I had to do this feature by itself, it would probably take an afternoon. But within the game as it is, it has to be integrated with all the other systems - camera, input, controls, rendering, selection, construction, etc. And that's always very tricky and finicky, especially for something like this that breaks half the systems when they only expect one click and one action.

I realize that I still haven't added multiple building drag-building. But this is a slightly different problem because it is an area-based operation and the actual area you would want to fill is kind of context-based. In fact, I need two operations (with a modified key, probably) - "circle" and "rectangle". I'm sure there are other things I'm not even thinking of yet.

[h2]Miscellaneous[/h2]

Houses now have random chimney smoke. But only if they have Firewood available.



I'm sure this ranks really high-up on the important feature list. :)

But, in seriousness, I made the Houses 7-tile buildings so that I can show visual feedback as the result of the player supplying them with all the items. This is important feedback that directly correlates to player's actions, in this case long-term supply. Furthermore, stuff like there being more chimney smoke during winter and less during summer is not something most people would immediately consciously notice, but I believe that it is an extremely positive overall experience when the player notices and experiences one of the rare moments like "wow, the game actually considers the current season for smoke amount".

Selected buildings (technically, only Butcher for now) will now also have marker sprites for animals (and their carriers):



I didn't manage to add this before, because internally animals are units, which are not items. I mean, it sounds obvious, but that means all the code I have for item delivery markers needs a similar copy for animals/units. I do want to add more production involving animals in the future, so leading animals as inputs/outputs would be the kind of feedback I need markers for to be consistent. (There are other places like this - Pigs don't appear in item report and there's no designated Animal report window. So, technically, you cannot currently track your Pig production/usage.)

You can now toggle newly-placed building worker slots between one and all filled - this menu shows up when placing a building with worker slots:



[h2]Future plans[/h2]

First of all, apologies for the slow updates. The real-life has gotten in the way and I had very little opportunity to work on the game.

My immediate next concrete feature is likely the technology tiers. I don't have an exact idea of how it will work, but I have some probable solutions. As always, I suspect it will turn out more complex than I am thinking. The main goal is to make knowledge gathering more involved and less "rushable". And I just generally like the idea of multiple "science items" all needed together for late-game techs. And everything needs to be balanced.

I have some ideas for Leather as well - namely, Work Clothes for residences (along with regular linen and warm wool clothes). There are a lot of things that logically follow leather availability. I might make a mini update for this and some other residence tweaks. And now that I have animal "harvesting", I also want to add Fur and Luxury Clothes of some sort, plus something to do with birds. Although this is getting dangerously close to needing residence levels and upgrades...

The level generator has really taken the backseat for a while now. I still really want and need to finish it, so I can add some unique biomes and locations to the map that I cannot do right now due the technical limitations of randomly generating the world in a certain way. But it also has the hardest part left - the step where level generator output is converted to gameplay tiles. There is no lack of annoying technicalities to solve for this.

As always, I have a long list of ideas and changes both my own and from the community. As usually happens, I'll try to pick some more requested and/or desired feature(s) to implement in parallel. Of course, I'm always happy to hear out ideas and requests.

[h2]Full changelog[/h2]

Changes

Add Leather item
Add Leatherworking technology (requires Woolworking, Quarrying, Forestry and Hunting)
Add Hide item
Butcher now has Abattoir and Butcher's Table auxiliary buildings
Animals delivered to Butcher now wait at the building instead of "disappearing" as inputs
Butcher now produces Meat and Hide from Pigs
Butcher will now properly list Pigs as "inputs" with tooltip info similar to items
Butcher can build optional Butcher's Pen auxiliaries for animals to wait at
Add Carcass props for hunted animals - Deer Carcass, Boar Carcass, Wolf Carcass and Wolf Carcass
Hunter's Lodge will now leave behind animal Carcasses after skinning an animal
Hunter's Lodge will now collect Deer Carcasses and Boar Carcasses for Hides once Leatherworking is unlocked
When wild Animal corpses decay or Carcasses decay or are harvested, they will leave behind Bones (that will also decay eventually)
Add Bark item
Add new Tree species Wattle grown from Wattle Saplings and harvested for Bark (instead of Logs
Lumberjack can now toggle Log and Bark production
Add Tannin item
Add Bark Mill building with Bark Roller that crafts Bark into Tannin
Add Lime item
Add Lime Mine to Quarry for Lime mining
Add Tannery building with Tanner's Bench, Liming Vat and Tanning Pit that crafts Hide, Lime and Tannin into Leather
Add Book Cover item
Add Currier building with Leatherworking Table that can craft Leather into Book Cover
Bookbinding now also requires Leatherworking
Bookbinder now has a Bookbinding Table auxiliary building
Bookbinder now requires Book Cover in addition to Paper to make a Blank Book
Rename "Notes" to "Research Notes"
Rename "Codex" to "Research Codex"
Rename "Scholar" to "Observer" (and reuse the name "Scholar" for more advanced building)
Observer building no longer requires Paper to produce Research Notes
Observer building no longer directly produced Knowledge, but requires produced Research Notes to be taken to the Library
Library is now unlocked by Research from the start
Tutorial now includes Library construction
Add Research Scrolls item
Research Scroll is using visuals from former Notes, and Research Notes has new visual
Add Research Scroll item
Scribe building now takes Paper and crafts Research Scrolls (instead of Research Codices
Add new building Scholar and Scholar's Desk that now uses Blank Books to make Research Codices
Library building now accepts Research Notes, Research Scrolls, and Research Codices
Reorganize the tech tree for the new technology dependencies
Papermaking now requires Research (already unlocked at start)
Bookbinding no longer requires Research (since the required Papermaking is based on it now)
Add worker slot pre-fill toggle buttons for the construction tab/menu - a choice between default one slot or all slots filled when building
Houses will now randomly have chimney smoke when they have Firewood (more in Winter, less in Summer)
Make tech tree line intersections and splits clearer for certain ambiguous cases
Add Markers for animals being led (currently Pigs to Butcher)
Roads can now be placed by dragging (default right-click); dragging will show preview and construction availability for each tile; placing will succeed even with some tiles being blocked; dragging will also upgrade roads; dragging can be cancelled with opposite mouse button (default left-click)
Add more frame cap limit options
Diet need Sentiment tooltip for buildings will now show the underlying values
Improve descriptions for Food Quality and Food Variety
Import Stations and Export Stations tooltips will now mention that number of items types/stack and per-stack capacity

Fixes

Smith being unlocked too early by Smelting when there are no items that can be crafted yet
Rare tutorial processing exception when loading an older save that redeploys a building while tutorials are active
Fix internal exception when zooming while drag-building roads
Fix UI windows (notably, tech panel) not sizing correctly to fit on the screen
Saves would not load if there were old Quarries/Mines with disabled production
Multiple items from the same Food Category not contributing correct Food Variety values
Pickles not being included in Residence total food reserve count and thus some calculated values
Diet need requiring too much Food Variety (technically achievable, but unintentionally strict)
Some infolines not showing correctly
Minor infoline fixes
Fix error when toggling sale or export items while the building is under construction causing material items to be "reset" and cause subsequent internal errors
Fix Boardwalks not buildable on Excavated Rocks
Smith unlocking before Forge, which has nothing to craft by default
Pickling-related building not being observable by Scholar
Loading older saves could result in broken Forges, because they now require production item selection
In rare cases, changing production or selling items would break item internal state
Deposits would rarely not generate the correct amount
Fix rare bug with older saves failing if the tutorial is active and some relevant building needs to be reset
Fix rare potential exception when leaving the game world with non-default input mode (e.g. constructing)
Rare internal error when a building or road with active Markers is removed and markers potentially recreated for invalid entities
Add missing UI step for Glass Kiln
Fix internal corrupted state for a case where a building is finishing de/construction, but an item that needs relocation appears on it (such as being dropped or unit dying and leaving a corpse), thus triggering item relocation which fails as the building is completed or removed
Fix a rare case of building Markers causing an internal error when a unit performing some delivery to/from it dies
Fix a very rare case where just-selected Import Stations and Export Stations would cause a game save to fail
Fix Export Station route tooltip showing incorrect (inverted) list of items selected for shipping

Balancing

For now, Research Scrolls will provide 2 points of Knowledge and Research Codices will provide 3 points
Adjust some tech costs
Villagers will no longer die from consuming food items directly from storage without having a Residence early in the game
Stone Deposit now provides twice the amount of harvests, i.e. 6 to 12
Non-food Reserves will now last roughly 50% longer
Change Cheese quality to 2 up from 1 to make it easier to get the bonus of 2 without Pickles

Optimizations

Rendering updated sprites (especially when there are a lot) is slightly faster
Reduce lagspike when updating changes to a large amount of sprites, such as when tile construction validation appears/disappears
Reduce lagspike when showing a large number of similar sprites, such as toggling between tile construction validations
Reduce sprite visibility change slowdown when scrolling and zooming when there are a lot of sprites

Rudy
Snowy Ash Games


[ 2023-06-12 20:32:52 CET ] [ Original post ]

EA Update #21 - Deposits

This smaller update tweaks resource mining by adding early-game mineable deposits and adjusts late-game quarrying. The update also adds more depth to food items.

[h2]Quarrying[/h2]

The major change in this update is the addition of free-standing deposits around (a newly-generated) map:



The start of the game now has a Stonecutter building instead of a Quarry:



These operate basically like Lumberjacks - the workers go out and harvest the nearby deposits:



Each full-size deposit can be mined 6 times, so these patches last for a while, but not indefinitely. This makes initial stone resources much less a "build-and-forget", but something you have to keep an eye on, mine from several sites (some possibly far), and eventually transition to quarrying.

Quarry is now unlocked by Quarrying tech and each resource type has its own mine type:



Sand and Clay quarry are now also separate buildings and Sand/Clay Pits are no longer part of the Quarry:



I haven't decided exactly what I'm going to do about clay and sand mines since they have similar issues to the quarry. But they are okay as is for now, so I'll leave this for later.

Quarries can now use Mining Tools (which is what I renamed Tools). Every Mining Tool delivery will last for 6 excavations at a mine:



Mining with tools is significantly faster, but not required. Mining in general is slower now, so having tools would likely be preferable to having lots of villagers.

Besides various opportunities for balance and progression, I mainly like deposits for the visual variety and the "verticality" they add to the map. Any feature that adds new props and interactions with the world is a big plus in my book. I love the idea of each deposit slowly depleting visually watching the villagers go hit the rocks. As for balance, this changes a fundamental part of the initial gameplay, so I'll have to see how it goes.

I originally wanted quarries to be way more involved instead of just mining deposits, but I never got around to it, so it all stayed very "flat". I feel like this being literally on of the first things the player learns about, it should be significantly cooler.

What I still haven't added are rock tiles that have specific underground resources, so that the player would have to build mines in certain locations. But this requires me to make substantial changes to the level generation, which I cannot easily do with the current/old generator. Even the deposit generation needed code that is more hacks than logic. (For example, I couldn't even add deposits outside stone areas.) So I'm holding off on that for now, but will probably revisit things later. I also haven't added any sort of ore processing, which would make long-term production a bit more involved.

And stone is still not use for anything late-game, so there's that to address at some point.

[h2]Food values[/h2]

Food now has several new "properties" to make food production and use feel more meaningful.

For example, a simple food item:



Versus a complex item:



This makes me want to aim for the fancy foods instead of potato quality.

First of all, food now belongs one or more categories, like Produce or Meats:



Each food item has a set quality:



Quality is the average quality of the best 4 items. In other words, as long as there are enough high quality items, the overall score will be high.

Each food item provides variety (for each of its category):



Variety is the sum of all the varieties in each category with a limit of 3 per category (so you cannot "stack" the same category).

You'll note that Pickles are really the only item that stands out at the moment because I didn't have any such items before. In fact, it's the addition of Pickles that prompted such questions as - how is it any better than just stacking potatoes.

Villagers in Houses will now consider both food quality and variety for their Diet need (score):



To sum up, all of this mean that items like Pickles actually provide as much food variety as 3 individual vegetables and still boost "fancy" quality score. So you could start with basic food supply, but transition to better mixed foods (and stop selling "cheap" food). Now I "just" need to add a bunch of new food items to fully utilize this new stuff. (And somehow allow houses to cram all these items...)

This feature is one of those where it's not obvious just how much extra stuff needs to be added to make it work. But this does allow me to handle "better food" in a way that can be balanced and explained reasonably well. Admittedly, about 80% of this work is UI-related, but that's how some features are.

[h2]Ant trails[/h2]

One feature I have wanted to add for a long time but never got around to are so-called "ant trails" - on-the-ground virtual paths between locations. Currently, I am using these for export/import station routes:



If you mouseover a route in the selection UI, it will also highlight the relevant trail.

These use the same logic as regular in-game path-finding, so they actually follow the paths that couriers would take along the routes (and I think that's really neat):



There is a lot of potential for these in various locations, although none are really a priority right now. It was the export routes that felt more like a bug or at least a glaringly-unfinished feature since it didn't indicate where routes go. (There are the building markers, but you have to actually scroll around to find them and they didn't specify which route it is.)

It doesn't sound like a complex feature, but as always with these, it's the little things that get you. For example, I discovered some non-aligning sprites:



I won't go through a lot of detail, but I talked about path-finding and where path "nodes" are in a previous update post: https://steamcommunity.com/games/931270/announcements/detail/4748472700555436873 In short, path-finding is not just between tiles, but also between every corner of the tile. And the exact pixel distances for hex tiles the way I have them aligned means that even seemingly-identical transitions are actually 1 pixel shorter or taller depending on the exact location. Which means I ended up with a silly amount of sprites for this:



All this took a few days to do, but I think it's a nice "nice-to-have" feature.

[h2]Other[/h2]

One requested feature is that export stations can now toggle items per route:



This allows some more complex exporting rules. Honestly, export/import stations are now way more complicated (and versatile) than I ever originally expected them to be.

[h2]Future plans[/h2]

Another update so soon? What is this, Christmas?

I think I will continue to do some smaller updates for now. I have no idea what I will work on short-term since I don't want to do anything huge or overly complicated over the holidays. There are some high impact features I am looking into, but I have no idea whether they are huge changes or something I can get partly done and playable until I try. So I don't want to commit to anything. But I would really like to add technology tiers and rework scholar and library knowledge gathering. If not that, then something to do with late game, objectives and/or more involved monument construction.

Long-term, I am still aiming at a better level generator and all the features that come with it. As I mentioned before, I will try to make some updates that are "part of" level generation, like this deposit update, but does not require it. Even so, I was limited in how I could place and distribute deposits, so that's the sort of difficulty of not having supporting features.

[h2]Full changelog[/h2]

Changes

Generic Quarry Mines have been replaced by Stone Mine, Coal Mine and Iron Ore Mine
Sand Quarry and Clay Quarry are now separate buildings
Add Stone Deposit, Coal Deposit and Iron Ore Deposit props
Add Stonecutter building
Add Deposit concept
Deposits will generate in new worlds on Rocks areas - a guaranteed number around spawn, proportional further away, and then randomly
Add Quarrying tech unlockable after Mining
Quarry is now unlocked by Quarrying
Sand and Clay are now mined at Sand Quarry and Clay Quarry instead of Quarry, which is now only for Stone, Coal and Iron Ore
Quarry now toggles production by item instead of by auxiliary
Quarry now has separate mine buildings for each resource - Stone Mine, Coal Mine and Iron Ore Mine, which cannot toggle their production
Quarry Mines now have to prepare area from Rocks to Excavated Rocks
"Tools" have been renamed to Mining Tools; change icon
Quarry Mines now can use Mining Tools for 6 operations; they can still work without, but much slower
Mine building inspection UI to show Mining Tools use
Mining Tools now require Quarrying for unlocking
Add goal for Quarrying
Food items now have a Food Quality values - 1 to 3 "points" (for example, Carrot is 1 point and Pickles is 3 points)
Food items now belong to one or more Food Categories - Produce (e.g. Carrot), Dairy (Cheese), Meats (e.g. Roast), Pastry (Bread) and Preserves (Pickles).
Food items now have Food Variety values for each Food Categories.
Villager Diet need now uses Food Variety instead of counting items, however each Food Categories is limited to max 3 variety "points"
Villager Diet need now uses Food Quality as additional criteria, which is based on best available item average quality (currently, best 4 items)
Export Station can now toggle items on a per-route basis
Items now show a reserve infoline (in tooltips and Micropedia); Food items also show their food-related values - quality, categories, variety
Shack (former House) building has been removed
Building inspection HUD route removal button now requires confirmation - second click (unless Shift is held)
Selecting Export Station and Import Station will now show a visual trail to the route-connected stations along the tile path; and mousing over a route in HUD inspection will highlight the respective trail
Better infoline sorting rules (notably, production recipe is listed before usage recipes)
Minor Micropedia and UI improvements
Micropedia reserve entries to show item's recipe infoline

Fixes

Fix empty tooltips in Micropedia when trying to display locked entities in current game
Building inspection auxiliary construction button tooltips not showing construction costs
Victory window social link icons misaligned
Main menu background image to not unnecessarily upscale if UI is set to upscale
Unlocking a tech would deselect an active construction tab button
Some props having empty tooltips
Pickles not being delivered
Grocery Shop not being unlocked with (only) Pickling
Micropedia Pickling entry failing to load due to exceeding entry limit
Fix possible crash when trying to save/load the game

Balancing

Initial easily-mineable stone supply will now run out, requiring expanding via Quarrying and using Mining Tools
Food Variety now allows items like Pickles to provides greater variety
Longer mining times at the Quarries
Less Sand and fewer inland Sand/Clay areas will spawn
Medicine and Furniture as Reserves will last longer

Rudy
Snowy Ash Games


[ 2022-12-20 14:45:24 CET ] [ Original post ]

EA Update #20 - Pickles

In this small update, I'm adding a Pickles food item and a bunch of various small changes and fixes. Most of these are fixes and adjustments since the previous update post.

[h2]Pickles[/h2]

The main addition is the new Pickles food item:



First off, I've added a new produce food item - Cucumber:





These are basically identical to carrots and tomatoes, but introduce some more variety. Now, I didn't actually want Pickles to only require Cucumbers. In fact, I wanted Pickles to be made from more than 2 veggies, which just seemed a bit too simple. So they actually need all three veggies and the new Cucumber is the third.

I've also added a new farm building - Paddy Farm, which is for semi-aquatic crops. The new crop for now is Sugarcane:





Currently, paddies don't require any special tiles or preparation. This would have been one of the things included with the future level generation. For now, they act pretty much like regular Farms or Gardeners.

Sugarcane isn't used directly, but is used to produce Sugar at the new Sugar Mill:



Glassblower can now make Glass Jars ("Glass" in now called "Glass Pane"):



This means there is now a secondary use for the Glassblower, so they aren't totally useless after the monument.

From Sugar and Water, you can make Vinegar with a Glass Jar:



And finally, with Vinegar and all three veggies, you can make Pickles:



Pickles (and cucumbers) are residential food items. Pickles can be sold at the Grocery Shop. They also last significantly longer than "raw" veggies and longer than other prepared foods.

So, yes, this is a long and involved production chain, which I think is cool for endgame food items. Here are just the minimum required buildings for it:



In the future, I want this to serve as a trade item. It's difficult to produce, takes a lot of resources and is in some ways inefficient when you can just "feed" people raw vegetables. So its value would be in being able to trade it and acquire some resource you cannot otherwise. Pickles also theoretically won't spoil, although I haven't added any proper food spoiling mechanics (yet).

[h2]Infolines[/h2]

One big decision I made is to remove textual descriptions from all items, buildings, etc. where this description simply describes what the entity does as part of its "recipe line" or (internally-called) "infoline". For example, Plank describes how it's made at a Saw Horse at the Sawmill. And Sawmill describes how it makes Planks via Saw Horse. And Saw Horse describes how it makes Plank at Sawmill. This is a lot to write, maintain, and read. And it is also very much redundant to the infolines that can visually and consistently show this using the same design language. For example, Flour item would only show these infolines without any description:



It feels like something is missing, but there really is nothing else to say about Flour. I could add some flavor text about Medieval flour use or something. But there is nothing gameplay-related to write here - no information I actually need to convey.

So Instead of text, I make sure to show infolines wherever it is useful to know about the entity in question. This mostly means most of the selection/toggle/etc. buttons now have a tooltip with an infoline now:



It should also be noted that any potential translation work would be much easier when every single entity doesn't need to have 3 redundant sentences translated. I would generally want to rely as much as possible on non-textual ways to present information - icons, symbols, recognizable layouts, etc.

One non-obvious difficulty is to choose which infoline needs to be shown here. After all, I can show how Flour is used or how Flour is made. So infolines have some priorities - for example, how to produce something is almost always what they show. (I should note that this is all extremely finicky to implement - in order to make it look simple and clean, it requires an inversely complex and messy implementation.)

I made a lot of small changes to Micropedia, but among them is having lists use the infolines instead of text:



I also added a few more infoline types to show some important information and to have entities show something where they otherwise didn't: For example, resident capacity:



Or knowledge production:



[h2]Various[/h2]

Shops now can toggle their sold items:



There's a few scenarios when this could be useful. None were critical before, but now I'm considering when you wouldn't want to sell veggies that are used for pickling.

[h2]Future plans[/h2]

I am still working on the new level generator and related changes. That remains the main goal for now. Unfortunately, it's a huge task that integrates with every part of the game, which basically means I've not posted any updates for a while to the point where people are concerned.

So the plan is now to split the work between smaller updates and the future level generation update. I will try to make separate earlier updates for some changes I planned together with level generation. On one hand, this means I'll likely post more smaller updates instead of disappearing for half a year. Bu-u-ut on the other hand, this means level generation update will take longer as I package and expand updates that would otherwise be too small or too broken to publish on their own. In the end, it's roughly the same amount of content, just differently spaced-out.

I personally wanted to just get the big update out of the way. But I think I should just accept that it just never works out that way. I think I have a tendency to always want to add just a bit more stuff. And then it's suddenly 3 months later and I'm still adding "just one more thing". It's the developer's equivalent of "just one more turn". And it always feels like any updates are not large enough anyway, this one included.

I think for now I will just get a few small updates out. I'll try to mix some new content with some mechanics additions. But I'll also try to work in the direction of level generation. Which is very broad and very vague but basically means "anything related to tiles, terrain and layout". So I will probably do some mining rework features next. I've been forever meaning to change the "3 mines can support the whole village" into something more involved mid-to-late game.

[h2]Full changelog[/h2]

Changes

Add Cucumber item produced at Gardener
Add Paddy Farm with Paddy Plot buildings
Add Sugarcane item grown from Sugarcane at Paddy Farm
Add Sugar Mill with Sugar Press, Syrup Mixer and Sugar Dryer buildings
Add Sugar item produced at the Sugar Mill from Sugarcane
Rename Glass to Glass Pane
Add Glass Jar produced at Glassblower, which can now choose production for Glass Kiln
Add Vinegar Brewer with Alcohol Vat and Fermentation Vat buildings
Add Vinegar item production at the Vinegar Brewer from Sugar, Glass Jar (and Water)
Add Pickler with Packing Table and Pickling Box
Add Pickles item produced at Pickler with Carrot, Tomato, Cucumber and Vinegar
Add a new construction menu tab "Food processing" and move various buildings there from the "Food" tab, add most new ones here
Cucumbers and Pickles are now Reserve items. Cucumbers provide the same amount as other Produce, but Pickles last much longer
Items can now have distribution values for Shop target deliveries, i.e. veggies shared between Pickler and Produce Shop
Add Pickling tech that requires Brewing and Glassblowing
Produce Shop now sells Cucumbers
Grocery Shop now sells Pickles
Add "Pickling" goal to make Pickles
Shops can now toggle/disable the items that they sell
Rearrange tech tree slightly to accommodate the new tech and dependency arrow layout
Food tooltip now shows "processing" food counts for those as inputs, i.e. Pickler
Starting Food Stockpiles will now randomly pick two of the three available from Carrot, Tomato and Cucumber
Gardening goal now requires any Produce items instead of specific items
Remove most description texts from items, buildings, props, etc. that repeat what the icon- and label-based lines explain, i.e. "recipe lines"
Many tooltips will now show the primary/significant "recipe line" for related entity
Micropedia will now show the primary/significant "recipe line" instead of a description when listing various entities
Various Micropedia changes - layout, details, relations, etc.
Achievement panel to fit more items to account for new food items
Add Scholar and Library "recipe lines" for Knowledge production
Add House resident amount "recipe line"
Adjust names for grass tiles, i.e. Thick Grassland and others
Change some tooltip labels for bonus-affected values to use clearer wording "faster"/"slower" rather than ambiguous "rate"
Add various new concepts for Micropedia - Produce, Crop, Aquatic Crop, Felled Tree, Building Material, Produce, Storage
Various sprite and UI layout fixes
Some tutorial text improvements; make sprites more readable and pronounced, add some detail; adjust timing to switch steps faster
Split first construction Lumberjack tutorial into step-by-step parts and allow returning to previous step
Distribution panel to auto-size based on resolution to fit all the entries; otherwise show scrollable area
Shops can now have up to 10 dedicated sellers (worker slots) that will serve houses in 24 tile "radius"
Constructing Shops or Residences will show in-range or out-of-range basket icons and range indicator
Constructing Taverns will show Residence influence icons (like already shown vice versa)
Change Tavern's "work range" label to "service range" for clarity
Change Residence "influence range" label to "neighbour range" for clarity
Constructing Scholar will also show out-of-range knoweldge-observable icons
Crop growth tooltips to show potential stage speed variation % (e.g. seasonal growth speed)
Residence reserve item tooltips to show item/delivery demand/priority
Instead of random villagers starving, homeless villagers will starve first followed by villagers with no food reserves in their residences
Shops will warn when there are no Residences in range if worker slots are enabled
Add operation and auxiliary building range indicator/label to building inspection HUD window
Add timer to achievements in achievement progress window that need it (currently, Happy Place)

Fixes

Fix building workers swapping tasks with other workers for auxiliary tasks (including when it may be more efficient, but not intuitive/logical)
Reduce delay between a building worker finishing a task and the follow-up task being available
Add missing tooltips for entities in lists in Micropedia
Fix "recipe line" prop entity position and vertical offset
"Recipe lines" would show locked props
Outside delivery toggle button not being green when selected
Possible error/crash in some pausing interactions
Fix some very long tooltips going off-screen
Fix some singular/plural spelling/grammar issues
Remove some redundant font assets from build
Fix Export Station error when choosing shipment items while it's being constructed
Forester attempting to choose tiles with incompatible objects and then failing to plant at all
Forester placing saplings without removing existing object(s) in tiles with incompatible objects
Forester not attempting to preserve felled trees when considering what props to remove
Selection HUD for Quarry overlapping self-delivery toggles with efficiency display
Export Station over- or not delivering items in second and later "slots" based on the first slot
Export Station reporting shipment items source issue incorrectly with several selected items
Changing or removing Export Station's items in second and later "slots" would incorrectly record available space for items
Fix issue where a tile would disappear due to construction work attempting to prepare a tile that then transitioned (e.g. dirt regrowing or moss decaying), subsequently causing any interaction with that tile (location) to fail, including saving the game
Some tasks not counted for task counter totals
Removing a shipment item "slot" from Export Station could lead to delivery of incorrect number of items and broken inspection display under certain circumstances
UI elements reacting to default navigation events (arrows, enter, escape) and conflicting with custom actions; in particular, technology unlock screen would open repeat purchase confirmation dialogues, each able to spend knowledge
Fix Export Station sometimes not delivering items on "full only" setting when there are multiple items and/on targets
Fix exceptions on moving the mouse outside the playable area when constructing certain buildings
Charcoal Burner not observable by Scholar
Not showing meaningless residence empty reserve consumption info in tooltip
Crop growth tooltips showing stage time and progress without accounting for possible variation (e.g. seasonal growth speed)
Fix Mead brewing goal appearing before Beekeeping is unlocked
Villager's carried item occasionally improperly offset
Reword various incorrect and imprecise descriptions
Delivery markers for Houses will appear nearer to actual delivery location to avoid overlapping sentiment info icon
Fix periodically-updatable tooltips not updating upon moving between different elements
Residences not deducting score from Housing need with no other nearby residences
Planting Birch Sapling would not count towards "Trees Planted" goal
Top overview food tooltip not showing the correct consumption number
Villagers will resume starving and consuming Food when they have no immediate access to food (i.e. houses with no food reserves or homeless)
Micropedia infoline elements (like building icon and label) to have proper interaction/mouseover area for clicks and tooltips
Buildings with worker item delivery (Export, Large Storage) would not deliver items when the target building's capacity is close to full and would cancel pending incoming tasks at other times
Fix Charcoal not being producable with only Fishing unlocked
Herbalist would continue infinitely crafting Medicine even when the output is full
Fix Monument construction achievement not triggering
Fix achievement window not tracking achievements previously unlocked in Steam
Balanced Diet achievement not working
Balanced Diet achievement not including Cooked Fish
Populous achievement not working
Fix achievement individual sentiment checkmarks not lighting up
Happy Place achievement not working because it requires unattainable Awesome Sentiment

Balancing

Charcoal Burner now produces 3 Charcoal per Log
Residence (House) reserves will last ~30% longer
Increase Shop building space for each item from 24 to 48
Change Tavern operation range from 8 to 12, which is the same as "amenity" range for Residences
Farm Crops (Wheat, Barley, Hemp) now grow about 30% faster
Crop growth is further normalized across Seasons (i.e. growth slows down or catches up to match the season), making crops ready roughly at the start of Autumn
Crops decay 50% slower allowing them to survive into Winter
Crops won't instantly decay in the first half of Winter allowing more time for harvest
Potato now follows similar growth rules as crops
Wasted Dirt tile repairing is about 50% faster in total and twice as fast late Winter
Adjust Residence reserve demand to prioritize houses with fewer items
Starving villagers will consume Food at a rate comparable to the rate of villagers in houses with food reserves
Villagers will die quicker upon reaching the point of starvation
Villagers have a small chance of dying (5%) when forced to consume a random item due to not having immediate access to food (i.e. houses with no food reserves or homeless)
Residences require 2 neighbours (other residences) for +1 Housing need bonus down from 5

Rudy
Snowy Ash Games


[ 2022-11-27 15:38:13 CET ] [ Original post ]

EA Update #19 - Timber

In this smaller update, I'm adding a bunch of wood-related changes, additions and tweaks.

[h2]Timber[/h2]

The major change is that I "split" Planks item into Timber and Planks items, both produced at the Sawmill:



Timbers are now exclusively a construction material:



While Planks are exclusively a production input (currently, only Carpenter):



The reason for this is basically design simplicity - I want to keep long-term construction and input processing separate. I don't want one input to mess with the other input in weird ways. It's just more straight-forward to have these as different items with different proportions. Over time, I observed a few issues that would take disproportionately longer to fix "properly" than to just eliminate the cause altogether.

[h2]Trees[/h2]

I added a new tree type/species - Birch. Functionally, all trees are still the same. But a new type adds some nice visual variety:



Trees will now produce 2 logs per tree. Chopping a tree will leave behind a felled tree, which can be chopped for another log:



This makes tree areas last longer, which is most important early game, especially if you lose track of it.

[h2]Saplings[/h2]

Saplings are now tree species specific, that is, there are now Maple Saplings, Spruce Sapling and Birch Saplings:



Each can be grown at the Arborist's Tree Nurseries:





And the Forester will plant them independently by selection:



All three tree types can now be seen growing from sapling to full tree:



[h2]Charcoal[/h2]

The other major change impacting production is that I "split" Coal into Coal and Charcoal. Charcoal is produced in a new Charcoal Burner building:



Coal is now used as industrial fuel:



While Charcoal (and not Firewood) is used for cooking and similar "light" production:



The main reason is that I did not want Firewood to be shared between residences and production buildings. Same as with planks - the issues I saw are easier to "dismiss" than fix. The other reason is that too many building are using (or should be using) coal, but I did not want the same item to be used everywhere. So now there's a hefty list for both. Adding fuel ingredient makes food production more involved, which is one of the goals. And it also requires more log production and thus bigger forestry areas.

[h2]Moss[/h2]

I added a new tile type - Moss. Moss appears "under" forests and makes them look more distinct (here, cleared from trees to showcase):



Moss will decay into grass if nearby trees are cut down and no new trees are planted. Grass will also overgrow into moss after being surrounded by trees for a while.

[h2]Various[/h2]

Export station now supports up to 4 exportable items. This was one of the more requested features for logistics.



I probably should have made it this way to begin with, but there's a bunch of extra complexity I did not have time to add at the time. (I think I spent a third of the time on it for this update.) Notably, there was no way to control which items are fetched or exported internally. And random selection did not work well, so I had to consider all these things.

I also added a simple cleanup tool, which marks items in a tile for prioritized removal. So these will get chosen over other items next time an item is needed.



Building and selecting houses will now properly show the range at which things affect it:



I also (finally) added an automatic deadlock resolution if there aren't enough available building materials to (directly) construct the material production buildings (i.e. Lumberjack, Sawmill, Saw Horse, Quarry, Mine, Mason). I thought a lot about how to best fix this, but I think the most obvious solution is best right now - I just spawn the missing items for the building in question. There are other concerns and issues with starting materials, but at least this fixes the main problem of getting stuck.

[h2]Future plans[/h2]

My next large goal is to add a proper terrain generator to the game and I am slowly working on it in parallel. Depending on how it goes, I might make another smaller update or go straight for the generator. I still need to revamp and expand quarrying and mining logic and related production.

[h2]Full changelog[/h2]

Changes

Rename "Plank" to Timber, which is now used only for construction
Add "new" Plank item, which is now used only in crafting/production
Carpenter now uses "new" Planks
Sawmill can now produce Planks
Add Planer auxiliary building for Sawmill for Plank production
Sawmill can now toggle produced item(s)
Add Charcoal item
Add Charcoal Burner and Charcoal Kiln buildings
Bakery (and Oven) now also requires Charcoal
Brewery (and Brewing Vat) now also requires Charcoal
Smokehouse (and Drying Rack) now requires Charcoal instead of Coal
Firewood is now only used for Residence supplies via Supplies Shop
Add Birch tree variant
Rename item "Sapling" to Birch Sapling
Add Spruce Sapling and Maple Sapling items
Rename planted "Sapling" to Maple Sapling
Add planted Spruce Sapling and Birch Sapling objects
Tree Nursery can now select whether to produce Birch Sapling, Spruce Sapling or Maple Sapling
Forester now also accepts Spruce Sapling and Maple Sapling and can toggle used item(s)
Planted Spruce Saplings become Spruce trees
Planted Maple Saplings become Birch trees
Add Sapling concept to refer to any kind of sapling
Trees now produce 2 Logs each by leaving behind a Felled Maple, Felled Spruce or Felled Birch that can be harvested again for another Log
Rename object "Stump" to Maple Stump
Add Spruce Stump and Birch Stump objects
Add Stump concept
Chopped-down Trees now leave their species-specific stump behind
Stumps now have a shadow
Add Moss tile for forests
Grasslands and its variants will turn to Moss if there are Trees and vegetation around it
Moss will revert to Grasslands or its variants if there are few or no Trees or vegetation around it
Export Station can now export up to 4 different items
Export Station's HUD inspection shipment items can now be changed, added or removed individually
Export Station will collect and ship items and Import Station will distribute items proportionally (using global item distribution weights)
Add new "Cleanup" tool to construction tools menu that can be used to tag items lying on the ground for cleanup, which prioritizes them for deliveries
Additional crafting recipe tooltip/Micropedia lines will now display as combined (like for Brewery)
Selected building to not have blue tile overlay instead of green, which was intended for highlighting similar buildings
Similar building highlight will have an "invalid" overlay texture for buildings that do not match production
Adjust various sprites and descriptions to fit the new changes
Houses needs with range (Socialization, Housing) with show the value in tooltips and Micropedia
Houses will show need influence range tile "circle" and buildings that affect it will show an arrow icon (positive or negative, in range or out of range)
Building issue indicators will hide if some other temporary/conditional icons need to be shown for the current interaction
If there are no usable material production buildings (i.e. Lumberjack, Sawmill, Saw Horse, Quarry, Mine, Mason) and no usable material items (i.e. Timber or Stone Slab) that can be delivered to them, the game will gradually spawn in missing items at the construction site, thus preventing a "soft-lock" situation.

Fixes

Buildings with multiple auxiliaries like Brickyard would always pick the first auxiliary from its internal list
Rare case when an invalid entity would be selected when something would look for a closest entity matching specific criteria
Some buildings and items were not listed in various tech unlock lists
Selecting a building to construct would not switch UI to non-selection mode showing some incorrect UI/feedback elements
Minor fixes to various descriptions
Auxiliary building world sprites in various UI locations to have better vertical offset/centering
Buildings listing missing auxiliaries before they are unlocked
Tooltips with inner dynamic elements not correctly sizing
Worker slot for not-yet-constructed building saying that no workers are available
Change Smelting-based goal asking to deliver Tools (which cannot be delivered anymore) to Iron Ingots instead (for now)
Fix a couple invalid labels
Operation location selection not highlighting tiles out of range
Tavern not consuming its stock (for new Houses)
Adjust Tavern stock entry tooltip label

Balancing

Brewery and Bakery now have 3 worker slots up from 1 and 2 slots respectively
Charcoal extends processed food production chains
Trees now grow twice as slow (but produce twice the Logs)
Stumps remain for longer

Rudy
Snowy Ash Games


[ 2022-06-28 21:49:28 CET ] [ Original post ]

EA Update #18 - Villager Needs

In this update villager needs and residence reserves have been fundamentally reworked. Although most of the changes are internal and organizational, this still results in a fundamental gameplay presentation change. I say "presentation" because the actual gameplay doesn't really change if you consider the main player actions - supply houses with goods. It is however presented (and hopefully perceived) differently, more in line with the way I originally intended.

[h2]Ex-happiness[/h2]

I removed happiness from the game. The main reason is that it was a big simplification of how villagers "feel". It was the first version that worked decently and games have done a number-based happiness value before, but it's all very abstract and very simplistic, and I simply don't like it. A single total happiness number does not really represent villager happiness. For example, 20 happy villagers making +20 total happiness just doesn't make much sense when this number isn't capped to anything. And even if I average the happiness numbers, it still does not represent anything - 10 happy and 10 unhappy villagers does not really make 0 "neutral" village happiness in the same way as 20 content villagers would.

Then there's the question of what is "happiness" itself. Philosophy aside, what does a happiness "number" represent? Is a villager with a good diet but bad health really feeling "neutral"? In other words, how much information does representing villager's happiness only as a single number lose and is such simplification useful and fun to achieve? So, again, I just don't like doing it that way. I am simulating so many things for each house and villager, but then I just sum it up to a single number. This just feels like too many "lost" details.

[h2]Needs[/h2]

So the big change is that I added several discrete "needs" - Diet, Housing, Health, Comfort and Socialization. This lets me separate villager "feelings" into independent categories. Each need is based on different factors that only apply to that need, so it's intuitively clearer what cause and effect each would have. For example, when a player is providing medicine, they know this will affect health. I will discuss these factors a little bit later; for now I want to focus on the big picture first.

[h2]Sentiment[/h2]

Each need is separately assigned a "sentiment" value. I settled for 4 values as for now: Awesome, Good, Neutral and Bad. They get appropriate icons, colors and labels. And I only added just enough values to establish a sort of scale of opinions. I think keeping it simple is preferable to having a lot of values.

[h2]Sentiment totals[/h2]

So now I can think about expressing the total sentiment, for example, how do all villagers feel about their health? Of course, this leads back to the same problem as happiness - what is an average anyway, when opinions can vary so much? So I have to be careful trying to naively conclude the mathematical "average". Instead I need to consider sentiment level percentages of the population and how common each value is while also keeping it understandable for the player. Let's just say, this is a difficult design problem.

The system I came up with tries its best to determine the dominant sentiment, but falls back to various descriptive alternatives. These variants are:

One sentiment is totally dominant, e.g. Good
One sentiment is mostly dominant, but there is a significant portion of "neighbouring" sentiment, e.g. Good, leaning Awesome
One sentiment is prominent, and there are significant portions of "neighbouring" sentiments, e.g. Good, but disparate (i.e. "Good, but spread towards both Awesome and Neutral")
No sentiment can be said to be dominant, i.e. Mixed

This lets me fairly accurately describe the majority's opinion. And while there are a lot of ways that sentiments can arrange, in practice the whole village usually runs a certain way. For example, if there is food shortage, then it's unlikely that there are many villagers thinking Diet is "Awesome" and it is much more likely everyone shares a similar sentiment.

In fact, the above summary was my requirement for the feature. The player must be able to read the description in a sentence or less. A lot of details could or couldn't be implemented to support this result. From there, I can add all the UIs and explanations and breakdowns, but there must be this one high-level at-a-glance summary.

(A question you might ask: couldn't I summarize my sentiment totals into a single happiness value for the whole village the same way? The answer is: yes, I could. But this would actually be summarizing the wrong values in a subtle way. What I would want to first determine is the happiness for each villager and then summarize those happiness values for a total. But this creates another "meta-need" that runs parallel to the existing needs. In other words, I now have Diet, Housing, etc., and Happiness. And this just doesn't feel right to me. If happiness is the summary of needs, then why do I even need to list the other needs anymore? And this just returns back to the very start of having just one total value.)

[h2]Need factors[/h2]

Each sentiment is based on the fulfillment of its need. What this means in practice is that each need has a list of factors that increase or decrease the "score" of that need resulting in a higher or lower sentiment. For example, not having a house would decrease the Housing sentiment while having Medicine reserves would increase the Health sentiment.

Now, I admit that this gets complicated fast when I start explaining the details, even though it's relatively easy to summarize. For example, it's simple to state what a need is for:



But the actual logic to determine the score needs a very rigorous and methodical explanation:



And only then the "real" sentiment value can be concluded:



This is complicated, for sure. But I technically was doing very similar logic before with happiness, I just never really explained it. Thinking about how to explain this to the player forces me to both simplify things and also keep them well-defined.

[h2]Sentiment UI[/h2]

The major challenge is to actually show all the needs and sentiment in-game. For presentation and gameplay purposes, I am still keeping needs and their sentiments primarily as part of houses:



This does mean that all residents in the same house have the same sentiment.

Meanwhile the top HUD overview icons now show all the summary sentiments:



A tooltip breaks them down and explains them in more detail:



In addition, a new window is available that expand a little bit more about the sentiments.



So if I need to add additional UI explanation to needs and their factors, this will likely be the place.

Overall, I think the UI is doing a decent job of summarizing and explaining things. It's definitely much more intuitive than I could ever explain in text.

[h2]Reserves[/h2]

Happiness was previously based on house reserves. In short, more reserves = better happiness. I had a lot more hidden rules here, but that's the essence of it. As I mentioned at the start, these changes don't really affect the core gameplay - houses still want all the reserves from shops. Except now each reserve contributes to different sentiments in different ways that I can define and control precisely.

So the big change is that now I can add more items as house reserves easily, i.e. without disrupting anything. At its simplest, adding a new reserve simply won't change anything. But I can then integrate it in one of several ways. As an example, I added Cooked Fish as a new item and reserve for houses. It now functions like other (prepared) foods.



I definitely want to add more reserves and more items and production chains. Half the reason for reworking the reserve system was to allow more and varied items.

[h2]No hidden numbers[/h2]

I previously had something like 30 parameters used for happiness calculations. In-game, I explained may be 5 of those. Let me just say that this is definitely not how I personally would want to play any game. Hidden numbers suck. The more you play, the more they suck. So my design philosophy is to avoid hidden numbers. Of course, I cannot explain everything, so there will always be endless hidden numbers and values. But I will try to explain anything that significantly impacts gameplay and could also vary significantly.

There are two locations where most explanation would take place. Any current values would appear in tooltips. And any potential rules would be in Micropedia. Now, this isn't exactly revolutionary - I have already been doing this since the start.

(Going on a slight tangent, I know this sounds a bit silly, but this is technically gameplay. Reading tooltips and reading Micropedia is technically playing the game even though you wouldn't immediately describe it that way. In fact, most players would say that they prefer to "play the game" and not "read the wiki". But, as a player reading a tooltip, you are acquiring information and making decisions based on it. And that's the same thing as looking at the map and placing a building. This is a matter of presentation. When you think about it this way, it's easier to see why some games may feel bad when they have a bad UI, poor explanations or hidden numbers. Even though it's not actually "real" gameplay, it makes "real" gameplay worse.)

[h2]Efficiency removal[/h2]

There are two big feature sets I removed: tools and happiness productivity bonus.

I removed both for the same primary reason: hidden numbers that modify values too much and are hard to explain in UI. I just don't like the direction these are taking.

Happiness productivity also has the problem of cascading into failure. In short, losing happiness reduces productivity, which lowers produced item amounts, which lowers house reserve supply, which in turn reduces happiness again. So it turns into a viscious circle. This is exacerbated by seasonal changes and harvest timing.

Tools suffer from delivery and logistics issues. It's not too bad, but there isn't any nice way to distribute tools with export/import stations. So anyone trying to maximize tool bonus will inevitably be at the mercy of logistics and item delivery priorities. Internally, tool delivery is another "layer" of deliveries that causes additional issues. I thought the feature is cool and I still do, but I don't think my current implementation is good enough without a large rework (such as, dedicated tool stations or repair workshops).

I am also removing the difficulty option for now, which was basically whether not having items in houses results in negative happiness. This was always a temporary solution to the game being too hard when happiness goes negative and efficiency drops a lot, causing everything to spiral out of control. There are no longer any efficiency penalties, so the "difficulty" like I had it doesn't affect anything. I will revisit "difficulty" options later in some form.

[h2]Residences[/h2]

MicroTown at its core currently is mostly about production chains and supplying the houses, which are--simply put--just a place to dump the final goods. And that's the core problem here. Houses don't really feel like a residential area. They are fine from a pure gameplay loop perspective, but not in their presentation.

So, as part of house redesign, I converted houses into 7-tile buildings so I have a lot more "space" to work with:



Houses now intentionally take up a lot more space. I have always wanted the residential sector to feel larger and more prominent. Logically, villagers should want a living space that isn't the size of a workshop. In this sense, having to settle the villagers is an "obstacle" for the player to overcome. So a larger house size is one of the steps in the direction of a more involved residential area.

Secondly, I added a bunch of visual variation to houses:



As much as I primarily focus on the functional aspects of features, there are certain features that benefit greatly from visuals. And I think houses are one of those. Visual variation makes them feel more organic as opposed to strictly functional work buildings.

Now, I only wanted to expand houses as far as villager housing needs are concerned, mostly to do with nearby infrastructure. Notably, I needed them to be the "final design size" of 7 tiles so that I can adjust and balance all the related distances. But once I started changing things, a lot more problems cropped up. For one, they looked all the same and so extremely boring. So I had to add visuals at the minimum. And so on. There are a lot of ideas I still have for houses, but they are all so interconnected that it would require a whole lot more changes, which this update wasn't really about. I will work on stuff like civic amenities at some point.

The one significant factor is that this drastically reduces how many "villager per tile" can be "produced" by houses. So I increased the house resident total number from 8 to 16 and also doubled the storable reserve amount:



Previously-constructed houses will remain as 1-tile shacks with the same number of residents, but with only 2 reserve items and no new reserve items (currently, cooked fish). They will also never fulfill the housing need. These will likely get removed at some point.

[h2]Various changes[/h2]

As always, there are a lot of tiny miscellaneous changes I won't cover in detail.

Although one new UI window worth a mention is the achievement progress panel:



Since I intend some of the achievements to be more like challenges and goals, then this will track the current progress. Everything is very simple here for now, but it does let you see the progress even if Steam has already unlocked these.

[h2]Future plans[/h2]

The good part is that I can extend the need logic. I can add more needs, more factors, more evaluations, even more sentiment values. I do have to be careful though. For example, I could break down needs even further, but then I would reach the other end of the complexity spectrum - too many values that become just noise, impossible to follow and generally unfun to care about. At the end of the day, as a player, I just want to know if I'm doing good and is the number is green. So I am breaking this up into something that could generally be seen as a "single high-level need".)

I apologize for this update taking so long. Long story short, I had to take care of some real-life things. Not to say I didn't make this update way too big again by mixing a lot of different features.

I think I will focus on some smaller updates for now. I have to rework plank production and use, especially for the start of the game balance. I also want to look into mining resource changes and long-term endgame production. I can now add new house resource items, so I will think about various options there. I also have a long list of bugs and tweaks to do and I will probably look into some of the more needed ones.

[h2]Full changelog[/h2]

Changes

Replaced Happiness with Sentiment
Market squares and Stalls are now fully removed
Houses are now 7-tile buildings
Removed Happiness efficiency bonus
Removed Tools use in production buildings
Carpenter now requires Nails
Old "House" is now Shack and can only be deconstructed
Add House as a 7-tile residential building
Residential buildings are now all part of Residences logic
Reserves in Residences are now "real" items and are kept track of and shown in the inspection UI similar to other building items
Residences reserve item usage is now a timer before the next item is consumed, also shown in the inspection UI
Shack accepts up to 2 reserve items as before, but does not accept any new or future items
House accepts 4 reserve items
Firewood now lasts longer in Summer and less time in Winter
Medicine now lasts less time in Autumn
Wool Clothing now lasts less time in Winter
Add villager needs - Diet, Housing, Health, Comfort and Socialization
Remove Happiness and replace with Sentiment separate for each Need
Each villager's Sentiment is now based on the fulfillment of their Needs (rather than directly from reserves in Residences)
Villager Needs are now evaluated based on various factors specific to each need
Add information about Need and its Sentiment-affecting factors in the tooltip for building inspection
Food in Residences forms a "Food" reserve group and consumption is reduced for multiple food items
Linen Clothing and Wool Clothing form an "Apparel" reserve group and consumption is reduced when both are available
Residences total Sentiment is now an approximation of all the individual Sentiments in that Residence
Village total Sentiment is now an approximation of all the individual Sentiments of all the villagers
Total Sentiment represents the dominant Sentiment (e.g. "Good"), can shift towards a different sentiment (e.g. "Good, leaning Awesome"), can vary either way (e.g. "Good, but disparate"), or can remain "Mixed" if the opinions vary greatly and no single sentiment applies
Add Needs list to Micropedia where each is explained, including the factors that change the Sentiment
Add Reserves list to Micropedia where their use, duration and bonuses are explained
Additional information in Reserves tooltip for building inspection
Homeless villagers to only have Sentiment about Diet and Housing needs
Villagers to not have any Sentiment at the very start of the game until Residences are built and first population increase
HUD top overview now shows the summary of the 5 Sentiments instead of a single happiness value and the tooltip explains the breakdown
Add Sentiment report window with a full breakdown of Sentiments for each Need
Remove global productivity bonus (since there is no longer a single global happiness value)
Monument no longer provides happiness
Tools are no longer used as "Supplies" by work buildings and do not provide productivity bonuses to buildings
Remove villager needs difficulty option
Remove difficulty setting UI for now since the only option it had is no longer applicable
Add achievement progress panel that shows all the per-village achievements and a simple checklist of the necessary steps to complete them
Add Nails item made at the Smith from Iron Ingot
Forge now has to select if it is crafting Tools or Nails
Furniture now also requires Nails
Carpentry now requires Smelting (and Logging instead of Forestry)
Add Cooked Fish item smoked from Raw Fish at the Smokehouse (instead of Roast)
Meat Shop now sells Cooked Fish
Houses now accepts Cooked Fish as a Reserve of Food
Add various concepts like Need and Sentiment
Add many new icons, like Needs and their Sentiments
Micropedia now shows what Technology unlocks each entity, as well as what entities are unlocked by each Technology; also add to some tooltips
Add "back" and "forward" buttons to Micropedia for quick navigation between visited entries
A lot of description and label changes to reflect the new and changed features
Adjust tutorial explanation text and steps slightly to reflect the new changes
Unpausing returns the game to previous speed
Ranch auxiliary building order to match related item order
Buildings with adjustable operation location will now draw a max range tile border
Selected buildings and potential construction buildings will highlight in- and out- of range tile overlays for their compatible auxiliaries and parents as well as other buildings of the same type
Constructing Scholar will show production building knowledge icons

Fixes

Fix some building spawn/delivery positions
Adjust construction sprites for some buildings
Adjust item pickup/drop-off location for shops
Fix Monument construction Glass delivery location
Clicking fast speed UI button when paused would return the game to regular speed instead of fast
Fix tile validation overlay not changing when switching between construction of entities that have different placement rules (e.g. Stone road vs Boardwalk)
Fix tile validation overlay not updating when constructing multiple buildings/roads
Fix incorrect farm animal harvest duration and subsequent item pickup duration
Stop workers from most self-deliveries when there is work available
Fix various descriptions/tooltips with outdated or incorrect information

Optimizations

Various formatted text rendering is slightly faster

Rudy
Snowy Ash Games


[ 2022-06-05 19:18:33 CET ] [ Original post ]

EA Update #17 - Weather

In this update, I am adding weather to the game, specifically weather effects for rain and snow. This isn't something that affects gameplay (yet), so it's purely a visual update to make the game look nicer and have some visual variety. And weather is great for this type of goal.

[h2]Weather effects[/h2]

I'll start with the end result of the two effects I implemented, because it's simpler to discuss the steps that way. The two effects are rain:



and snow:



This looks relatively simple, but actually has a lot of internal considerations both from technical and design perspective. I am usually prepared that features end up more complex than they seem to be, but this one really surprised me.

[h3]Sprites[/h3]

Keeping with pixel art aesthetic, I would want to draw rain droplets and snowflakes. But for performance reason, I cannot draw separate sprites for every particle (this would be many thousands of particles). So I use bigger sprites with multiple droplets that look more or less random:



I call these "slides". The trick is to spawn and overlap, and quickly move many of these slides, so the viewer cannot easily track individual slides and they look like individual droplets.

This seems simple enough... until you try it out and it looks bad. The reason is that the sprite size and the spacing between the particles on the slide is very important. It has to fulfill 2 opposing criteria - it has to be both regular and random. If I make it too big and regular, it will look like a grid moving across the screen. But if I make it too small and random, it will have many unnatural distracting "gaps" and "clumps" of particles. In short, this required a lot of trial and error and even then the result is a compromise.

[h3]Animating[/h3]

Individual slides animate by moving downwards and a little to the side:



From there I add a little bit of speed variation to each slide and a corresponding color variation (slower - dimmer, darker). This way, it instantly looks like there are depth layers of particles:



This is probably the biggest visual impact of the whole feature. This variation is fairly subtle in the actual game, otherwise it again becomes too obvious that particles are part of bigger slides.

The depth illusion also really comes together with parallax, which I discuss later.

[h3]Margins[/h3]

New slides are spawned above the top of the screen. Then they gradually fall down though their trajectory. Finally, they despawn below the bottom of the screen. Since slides have width and height, then there is an additional margin around the viewport to fit them:



I cannot spawn or despawn slides if they are partially visible; they must have completely left their "visibility area". This means the slides "exist" (simulate, render, animate, etc.) in an area larger than what the camera actually sees. This certainly adds extra complexity and calculations.

[h3]Zooming[/h3]

Camera zooming changes the number of visible slides:



At first, I began implementing this as simply spawning extra or despawning excess slides at the edges. But I quickly ran into 2 problems.

Firstly, I don't know exactly where to spawn new slides. If I do this randomly, it looks wrong. Weather slides normally gradually fall down though their trajectory. This is theoretically a deterministic process, but practically it just isn't worth the time to re-simulate and predict sprites like that. Plus, I have to (de)spawn them at the "edges" only, which is a lot of additional math to determine the area that does or doesn't need slides.

And secondly, if you zoom in and out quickly, it is very obvious that the weather is not in the same location as before. It might not seem like a big deal, but in practice it's annoyingly way too noticeable.

So what I do instead is I always have a fixed number of slides for the entire most zoomed out view and I simulate them all as if the camera could see them. Of course, I don't render them visually. This might seem like a waste of performance to simulate them, but counter-intuitively at medium zoom, the camera can actually see about 2 out of 3 of the total number of total slides:



So this isn't at all that wasteful and the simple simulation math is fast anyway. Plus, my new rendering logic lets me process this very quickly anyway.

[h3]Camera panning[/h3]

It's a little bit difficult to think about how slides move when the camera is moved/panned. Intuitively, it seems like moving the camera would "move" everything. It's a bit easier to visualize if one thinks about the visible portion of the world changing instead:



From this perspective, the slides form a "box" around the visible world area and this box moves together with the camera viewport. In fact, without animation or parallax it becomes obvious that slides don't actually move at all in respect to the camera:



So there isn't actually anything special that needs to be done for this by itself. Of course, without animation or some movement, it looks completely flat.

[h3]Parallax[/h3]

Since camera panning is a constant player interaction, then it is very important that this preserves the weather effect depth illusion. I do this with a subtle parallax:



All slides are moved proportionally to the camera pan. Further (dimmer, slower) particles are panned a little bit less than closer (brighter, faster) particles. Thus variable speed, color and movement together form a rather convincing illusion of depth and volume.

[h3]Boundary[/h3]

So there are 2 ways in which slides can "escape" their box around the world - animation and parallax. Animating slides fall down and right, thus going off the screen. Parallax while panning moves the slides in any of the four directions, also moving them off the screen. Both cases are essentially identical in that theoretically I need to either add or remove slides.

And the solution is actually super simple - I just teleport the slide to the other edge of the camera viewport. For example, if a slide moves too far right, then I teleport it to the left side of the screen across the width of the viewport. Thus, the number of slides remains constant and they preserve the "density" on the screen.



In practice this works like an infinite repeating plane -- no matter how far and fast the slides move, they just wrap around the screen. And this works great.

[h3]Resolution[/h3]

There is one corner case to this and that's changing resolution (resizing window). This completely messes up all calculations. But I decided to not even bother with this. The visual glitch is not overly horrible and the slides fix themselves eventually. And how often does one change resolutions while playing?

[h2]World tint[/h2]

The final feature is to set the mood of the whole scene, which I do by applying a subtle tint to the game world and modifying shadow intensity. It's easiest to visualize by comparing them one after the other in an animation:



Because of color constancy of human vision (and the method I use to blend the colors) it's counterintuitively hard to perceive the change unless you focus on a specific point or the whole image at once. It's more obvious when the game is full screen and the player happens to "unfocus" and notice the difference.

It's more obvious with individual pixels (the eye can pick out warmer and cooler):



What I use for tinting are two "temperature" colors with orange for warm and light blue for cool:



I deliberately only define "cool" and "warm" colors so I can tint the whole scene either one way or the other. While technically I could tint the scene in any mix of colors, multiple colors would end up "fighting" each other and it would be a mess.

Seasons and weather presets define how they affect the world tint and shadows:



Individually, it's basically: summer is warm and winter is cool; sunny sky is warm and rain is cool.

Combining, I get combinations like: sunny summer is hot and snowy winter is cold while cloudy spring is neutral. Moreover, rainy summer or sunny winter is also close to neutral as they "cancel each other out".

Mathematically, this gives me a single "temperature" value between cool and warm, which corresponds to some color between blue and orange. Technically, it's between blue and "nothing" and orange - as the colors reach the neutral midpoint, they "fade" to nothing and there is no tint:



And then I blend this color with everything in the scene. For this, I transform the colors using the soft light overlay blend mode. The exact effect is harder to explain than it is to just show it, but it is basically like shining a weak colored light onto everything, which is essentially what I am going for.

If I were to crank up the tinting to 100% of the tint color, it would look like this:



In contrast to simply multiplying colors, overlay blending methods do not "erase" the underlying color. Meanwhile, color constancy allows the eye to perceive the original colors even when the whole scene is overwhelmed by another color. But even these extreme examples still look relatively reasonable. Which just means that the actual subtle tinting looks very convincing (at least, in my opinion).

A "proper" blending method also keeps color values largely unchanged, which is important in distinguishing elements (for example, tinting doesn't negatively affect people with color blindness):



[h2]Final words[/h2]

At first I was going to do more effects like thunder or blizzard. But the problem is that they just become so prominent as to be annoying. So I settled with fewer "gentler" effects for now.

I want to remark that a feature like this is very easy to do badly. And what is "bad" is also highly subjective. It would be much easier to make an easy (fast and dirty) version of effects and shading. But like many video game elements (such as screen shake or full-screen damage effects), it would be very obvious when done badly, with glitches and/or obtrusively. This can make the whole feature very distracting and eventually annoying.

These effects of course have a performance impact. I am drawing large overlapping sprites all over the screen. In fact, before the last rendering revamp update, I couldn't implement these effects without slowing everything down too much.

Both weather effects and tinting can be disabled in the options as well if this is not your thing.

[h2]Future plans[/h2]

As before, I'm working on housing and civilian needs. I have been working on weather effects in parallel for a while. So I released this update in the meantime just to have an update while I continue with the bulk of the work.

[h2]Full changelog[/h2]

Changes

Add Weather to the game, which includes Cloudy, Sunny, Rain and Snow
Weather gradually transitions between clear, cloudy and precipitating (either rain or snow, depending on the Season)
Rain does not occur at the very start of the world (and older loaded saves)
Add full-screen particle overlay effects during Rain and Snow weather with varied falling animation, parallax and "depth"-based coloring
Weather particles shift and scale based on camera movement and zoom
Add ambient sound during Rain weather
Add HUD current weather icon and tooltip, add weather icons and descriptions
Add world tint "temperature" color based on current weather and season, ranging from cool (blueish tint) to warm (orangish tint), as well as shadow intensity multiplier based on the same criteria
Add audio options toggle for ambient sound (currently, only weather) and volume slider
Add graphics options toggles for weather and world tinting
Add "no habitats in range" issue for Game Warden's Lodges
Custom icons for the Monument techs
Add internal world weather stat tracking
Shift-selecting a building or road to build will also "copy" its construction priority
Animal Habitat selection panel tending label to also show time since last tended

Fixes

Town Hall no longer requires Bricks for construction
Bricklaying tech is no longer required for Town Hall tech
When construction Beehive as auxiliary building, the work range is now shown (with the appropriate label)
Animals (specifically, Fish) spawning on land
Occasional internal error due to lag when playing visual effects
Housing and Firewood goals requiring Market Square and Supply Stall instead of Produce Shop and Supplies Shop respectively
"Wildlife Conservationist" achievement triggering incorrectly
"Balanced Diet" achievement triggering incorrectly due to "Cooked Fish" being required for it, but unobtainable
Deprecated or unimplemented items like "Cooked Fish" appearing in storage selection popup

Optimizations

Full-screen weather effects can affect performance somewhat

Rudy
Snowy Ash Games


[ 2022-02-14 17:37:42 CET ] [ Original post ]

EA Update #16 - Shops

This update replaces Markets with Shops and adds significant rendering optimizations. And I might as well call this "Rendering Update", because I spent most of the time working on optimizing sprite drawing.

[h2]Shops[/h2]

Shops are new buildings that are set to replace Markets and Market Stalls.



They essentially do the same thing that Stalls do, except each shop can store and distribute several item types. For example, a Produce shop would sell Tomatoes, Carrots and Potatoes at the same time:



Shops allow me to add more items without adding a lot of micromanagement to Markets and Stalls. I can instead focus on logical item "groups", such as foods, supplies, clothing, well-being, luxuries, etc. The gameplay would then not be so much about having exact items, but a decent variety of items and an overall satisfaction for that item group. It's also much easier for me to design for and players to work with fewer categories.

For now, Markets and Stalls will still work, but they are tagged as obsolete and will be removed (probably) in the next update. Basically, I'm leaving them working so anyone who wants to update their world can do so. Unfortunately, I cannot maintain two versions of item distribution, so I will have to completely remove Stalls later. I also cannot automatically replace them in-game with shops, because shops are 7-tile buildings.

[h2]Miscellaneous changes[/h2]

There are now 2 more larger world size options. Thanks to the optimizations, I am finally able to create bigger islands without lagging everything. These won't have better terrain generation yet and the camp still spawns in the middle, but at least they are an option now.

Animal habitats now have to be selected to see their information:



This is mostly because I could not easily re-implement in-world tooltips following the rendering changes. But I also had this planned regardless, so I just went with it. There isn't any new information yet (notably, about quality factors).

[h2]Rendering optimization[/h2]

So the problem is: MicroTown's rendering is fairly slow because there are a lot of things to draw. I should note that MicroTown being "just" pixel art is rather deceptive. The game needs to render more geometry than many 3D games and, for various reasons related to how GPUs work, it's not much cheaper to send "just" sprites to render than it is to send 3D models.

[h3]Game world renderers[/h3]

Optimization should generally be done based on profiling, i.e. evidence. So, most importantly, I need to count the number of sprites that are required to draw everything in the game world. For my test case, I am "looking" at a 1440p resolution zoomed-out 160-size world with 2000 villagers. These are the numbers of in-world entities that exist in the world:



This is a rough indicator of how much "stuff" needs to be drawn, but it's inaccurate because each entity does not correspond to a single sprite. There could be zero to a dozen of sprites needed for an entity, depending on many factors. This also does not account for many extra things, like effects, tile overlays and outlines, markers, building icons, etc.

So here are the numbers of individual sprites:



These can be further broken down into broader categories:



The numbers I am most interested in are the 25k/54k renderers. This is how many sprites need to actually be drawn out of the total sprites that exist. Importantly, there are 5k updates per frame, which means that that many sprites were changed, added or removed.

Which means there are two main focuses for entity processing optimization - knowing what to render and processing changes quickly. Subsequently, the main rendering optimization focus is to render the visible sprites as fast as possible. And these two sentences are so much easier said than done.

[h3]CPU rendering bottleneck[/h3]

The main bottleneck is the CPU time it takes to render the game world. Unity works with "game objects" to do things, broadly speaking. For the game world, I only use game objects exclusively for sprite rendering (no data or logic there). Each sprite renderer requires a separate game object. So every sprite I mentioned above requires a game object, which is easily 50k objects. Meanwhile, for Unity, general consensus is that 10k objects is too many.

I basically have these long long lists of objects:



Unfortunately, there is only so much I can do before Unity itself bottlenecks like this. I've squeezed out as much performance as I could with this setup. Without going into too much detail, there are too many engine-dependent things happening that I cannot change in any way like sorting, culling and communication with the GPU. Unity simply isn't built to support so many objects via its "conventional" game object means. It doesn't matter that the GPU renders everything in 0.5 ms when it takes 25 ms for Unity to prepare and send the data. It still has the overhead of all those universal game objects regardless how many are visible and how cleverly they are optimized for rendering.

So here comes the technical and difficult part...

[h3]Custom rendering pipeline[/h3]

After lots of research and experiments, I decided that I would need to bypass almost all of Unity's "standard" rendering overhead and send sprites to the GPU more-or-less directly. This is essentially how most GPU-based 2D games have always done this. Simply put, "draw sprite S at X, Y" for every sprite. Unfortunately, this is much easier said than done nor does it capture the many complexities. Unity isn't a 2D game engine and all its features have many layers of expensive abstraction. But thankfully Unity does provide rough access to lowish-level graphics logic.

In short, I can send a mesh to render directly to the GPU. A mesh is just a bunch of triangles connected at their vertices. In my case, to show a sprite, I only need a quad -- a rectangular mesh that is 4 vertices and 2 triangles.(This is also what Unity uses by default for sprite renderers, except with a lot more stuff.)



I can not only send a mesh once, but "send" the same mesh again and again, which is called GPU instancing and which saves the day. Technically, I am not even sending multiple meshes - just the one quad, but I am telling the GPU where to draw copies of it. So each quad mesh would correspond to one sprite and I would send a batch of such sprite data to the GPU to get them all rendered at once really, really fast. This lets me render any arbitrary layout:



Fortunately, I have built the game in a way that allows me to fairly easily "collect" all the sprites I need to render (which still massively downplays the difficulty of this conversion). As I described, I have game objects that correspond somewhat to game world entities. I know where they are located and roughly in what order. So I "just" need to pass these to the GPU myself. It would look something like this (with a colorful test texture):



Except, there are no "sprites" on a GPU, there are definitely no sprite atlases. All the "sprites" here look the same. Because a "sprite" is a high-level engine abstraction done through custom assets, custom shaders and lots of engine code. All I get at low-level is a texture and raw vertices and pixels. What I really need to do it specify locations on the final atlas texture, so I can draw specific sprites that would be arranged there (these are 16x16 "squares" from the same 2048x2048 test texture):



The next step is to somehow combine individual meshes and send things to the GPU in batches. The problem is communicating what data I need to send per mesh, that is, per sprite. Naively, I can only set one property per communication, which basically results in every sprite in a batch being the same:



The solution is that modernish GPU shaders can be compute shaders, which can receive and process large chunks of arbitrary data and run (parallel) processing on the GPU. This means I can actually pass all the sprite information to the shader in one big batch very efficiently. This data can then be sampled to select the correct region from the atlas texture from the sprite's location data for each mesh/quad.

And this provides the starting basic functionality of rendering sprites directly to the GPU almost the same as game object sprite renderers, but for a tiny fraction of the cost. Here is the pipeline itself working correctly if not the logic of drawing everything:



This does unfortunately come with a bunch of significant drawbacks that can be summarized as "additional complexity" and whatever is the opposite of "ease of use". But I can live with these considering the speed benefits.

The new problem is that now everything that Unity did -- sort, cull, toggle, offset, scale, etc. -- is gone. I now need to make it all myself.

[h3]Sorting[/h3]

Most importantly, I can't just "render all sprites" in whatever order they are (unintentionally) stored. I can technically do that for tiles, roads, and tile overlays, because they never overlap and are exactly spaced. But every other entity must obey visual depth sorting. Simply put, a unit can walk in front and behind a building while still being in the same tile. But sending sprites to the GPU is fast precisely because it ignores such pre-processing details and just draws things sequentially. Just rendering naively would result in this:



Thankfully, my job is simpler than it could have been trying to sort 50k entities -- I already have a game tile hex grid. Every entity has a whole tile coordinate and I can hugely optimize sorting by looping through the tile coordinates in "visual order".

Entities also have in-tile fractional coordinates. So I have to loop through the entities in a tile back to front. For optimization purposes, I have to keep the entity list pre-sorted and add and update entities as their coordinates change. And this basically correctly sorts 90% of sprites.

The final consideration is that for entities at the same coordinate (like parts of the same building), I need an extra hard-coded depth-sorting value so they appear in the right order even though they are technically at the same location.

Sorting is probably the most time-consuming part to implement because I have to change and adjust so much code. Every one of these "considerations" is another layer of complexity and difficulty. And with all that, I am only now approaching the same visual results as I had at the beginning:



[h3]Culling[/h3]

Another important consideration is to cull anything that is not visible, that is, literally not render sprites that are not on screen. It's a simple problem to explain, but deceptively difficult to implement efficiently. I cannot just check 50k items every frame. So I keep a list of entities per-coordinate, update the lists when entity coordinates change, and loop only through visible coordinates when rendering:



The biggest consideration is that whatever code logic I do, I will be CPU bottle-necked and I cannot offload this work to GPU in any reasonable way.

[h3]Effects[/h3]

All the small effects in the game were provided by Unity's particle system -- smoke, dirt, chips, sawdust, etc. It was all relatively easy to set up. And none of this works anymore with the custom rendering pipeline. Unity's particle system wasn't compatible with how I rendered regular sprites. So I had to recreate the effects myself -- all the logic, animation, sprites, visuals, previews, etc.

There are now some new optimization considerations. For example, various effects like digging dirt used the same basic logic where a 1-pixel particle would fly out. There would be some 12 particles, which equates to 12 sprites. This is actually quite a lot when you consider they have to follow all the new rendering/sorting logic I implemented. I now have to design effects paying attention to the number of sprites they produce and optimize when I can. For example, I can use only 4 sprites if I make an "animation" of the particles splitting up as they spread over time:



My favorite effect -- smoke, which I painstakingly recreated -- takes up 8 sprites:



Here, there's nothing I can do to reduce the number of sprites, and it will be slower than Unity's particles were originally. Of course, I am considering the big picture performance and presentation, and nice effects are definitely a worthy "expense".

[h3]Shadows[/h3]

There is so much to talk about, because I am now revisiting 3 years worth of various visual features. But one of the cool easy-to-add changes was adding shadows for units:



These are very subtle and usually get lost in the "noise". But they subconsciously feel good. I couldn't add these before because they would get incorrectly rendered on top of other things - buildings, other units, etc. - because units would run all over the place and cause depth-sorting issues. However, now that I am "sending" sprites into layers for rendering, I converted all shadows into a "shadow layer", so they get drawn on the ground before any sortable objects, thus they are always on the bottom. This fixes a lot of shadow glitches I had, as well as lets me add shadows without worrying about problems like this.

In fact, I have a lot of new debug tools I had to make to visualize and find all the different parts. For example, a shadows-only preview:



[h3]Fallback rendering[/h3]

All this fancy shader stuff is great and all... except many older systems don't actually support it. The whole GPU-based compute shader processing is a relatively new concept. In fact, systems older than 3 years are increasingly unlikely to support it. Whereas even 15-year old machines could run the game before. Virtual machines also don't support advanced 3D accelerated graphics, which means I cannot test the game on macOS and Linux with the new rendering logic. This is also not something I can afford.

I did not enable analytics in the game, so I have no idea what systems MicroTown's players have. But the game has a strong retro vibe and I would not be surprised nor could I fault any players for trying it on an older system. So I have to support them. Which means implementing a fallback method for rendering everything.

(Un)fortunately, I cannot just fall back to my original Unity-based rendering, as I have essentially changed and rewritten everything. Thankfully, I have about 90% of actual logic reusable, because it's only the communication with the GPU that cannot utilize fancy data transfer logic. I have my list of sprites, their location, atlas information, etc. So "all" I need to do is replace the fancy shader stuff with a dumber, slower version.

Naively, I would basically have to send a mesh per sprite to the GPU one at a time. This is too slow (even with native batching), but I can also combine these meshes together. Which is also too slow with Unity's tools (but comparable to how fast the game ran before). So in the end, I am manually re-constructing meshes vertex-by-vertex to match the expected "sprite layout". It still makes things very CPU-bound, but it's still better than before. The biggest problem is just the human time it takes to get everything implemented and running smoothly.

[h3]Final words[/h3]

Most of the time I was looking either at a complete mess like this:



or this:



Or trying to fix one of the 100 different things that were glitchy:



I even discovered 2D MicroTown:



As a final thought, I only summarized the "correct" path to implement this. I spent a lot of time experimenting, agonizing why something doesn't work and getting exhausted by debugging. And this is besides Unity crashing every time it doesn't like something. The power of working directly with shaders is great and the results below speak for themselves, but it's also equally mind-numbingly tedious and disproportionately time-consuming. As a one-man team, I can't detour through such rabbit holes unless it's absolutely necessary.

So I'll end this with some benchmark comparisons. (I am not comparing FPS, because this isn't an accurate measure for games like MicroTown. The game doesn't have a fixed time step and fewer updates just means it has to process more changes.) These benchmarks are done on a 1440p resolution zoomed-out 160-size world with 2000 villagers drawing 25k entities (same as in the section on entities above) on 4-year old high-end hardware:

[table]
[tr]
[th]Method[/th]
[th]Frame time[/th]
[th]Render time[/th]
[/tr]
[tr]
[td]New[/td]
[td]34 ms[/td]
[td]6 ms[/td]
[/tr]
[tr]
[td]Fallback[/td]
[td]54 ms[/td]
[td]25 ms[/td]
[/tr]
[tr]
[td]Old[/td]
[td]63 ms[/td]
[td]35 ms[/td]
[/tr]
[/table]

A full frame now takes 34 ms instead of 63 ms, which is almost twice as fast. Notably, specifically rendering now takes 6 ms instead of 35 ms before, which is more than 5x times faster! Even the fallback method takes "only" 25 ms. It's still only 30 FPS, but this is also an extreme case. I think I have squeezed out as much performance as I will be able to from rendering. But I could also easily add more entities and sprites without a significant performance hit. (In fact, I imagine most of the future optimization will be to the world update logic. In these examples, world update takes around 20 ms.) Of course, this will vary system by system, but there should be a significant improvement for all systems because the game is CPU-bound.

[h2]Future plans[/h2]

I originally planned for "Shops and Houses" to be the next update (i.e. this update). This would have allowed Houses to use more items so that Shops can sell more items and then I could add more production chains and variety. But I only managed to get the Shops working, so the next main goal is getting Houses working. This will likely be a smaller update, but with bigger breaking changes. The Houses will likely also become 7-tile buildings.

[h2]Full changelog[/h2]

Changes

Market Square, Food Stall and Supply Stall are scheduled to be deprecated; they will remain functional for the current version, but will need to be replaced by Shops
Optimized rendering requires compute shader support: at least DirectX 11, OpenGL 4.3, OpenGL ES 3.1, Vulkan or Metal
Older system will fall back to a slower rendering method
Add shop buildings: Grocery Shop, Produce Shop, Meat Shop, Clothes Shop, Supplies Shop, Medicine Shop with corresponding sold items
Shop building HUD inspection to show full item "progress" (unlike market stalls)
Add Shop concept
Tooltips to show sold items at shops (similar to storage building tooltip)
Export Station and large storage buildings will distribute items directly to nearby shops
Market Square, Food Stall and Supply Stall are no longer constructible but will remain functioning as before in the world
Rename "Fish Steaks" to Raw Fish
Rename new game world size options from "small", "medium" and "large" to "tiny", "small" and "medium"
Add "large" and "huge" new game world size options
Fish Animal Habitats will no longer spawn far away from coast
Remove tutorial steps for Market Square and Food Stall construction and replace with Produce Shop construction
Adjust tooltips and explanations mentioning Market Square logic to instead describe Shops
Animal Habitats no longer show tooltips on mouseover; instead Habitats can be selected in-world and show an inspection panel with the same information and changed display
Add in-world markers for Animal Habitats animals
Shadows now appear on the "tile layer" and don't overlap other objects
Tile outlines, selection indicators and other tile overlays appear above roads
Markers and various indicators now appear above in-world objects
Mine, Sand Pit and Clay Pit prepared ground sprite now appears on the tile "layer"; adjust worker position and mining effect offset
Villagers and animals now have shadows
Add water splash effect to fisher casting and reeling animation
Micropedia now has "Tutorials" section/list
Item tooltips and Micropedia descriptions now combine storage entries to multiple buildings
Add tooltip and description for Beer and Mead usage at Brewery
Add amount label to (de)construction item progress for building and road inspection
Add warning in main menu if compute shaders are not supported and the game will run a slower fallback rendering method
Path-finding will discourage walking between buildings as much
Units will no longer stick to exact hex tile centers when path-finding and choose straighter paths
Workers with carts entering and exiting Export Station and Import Station will now move at a non-slowed down speed
Hunting goal now counts skinned (but not shot/hunted) animals as part of the completion number
Add internal "animals skinned" stat
Roads to have separate sprites for vertically-mirrored bits and new dedicated sprites for the straight segments
Add a more-expensive Boardwalk type of Roads that can built on otherwise unbuildable land tiles (Sand, Rocks, Clay)
Add Boardwalks tech
Add Boardwalk construction Goal
Roads to have a new dedicated sprites for the three-way segments
Animals now walk instead of running (internally, since visually these are the same speed and animation currently)
Fish move faster to bait/hook
Idle villagers will walk more instead of running, especially for short distance
Adjust Import Stations item positioning so all stacks fit on the same tile
Import Stations will also distribute their items to Food Stalls and Supply Stalls
Large Warehouses and Large Granaries will also distribute their items to Food Stalls and Supply Stalls
Add issue warning for large storage buildings that have dedicated workers but no compatible item sources or targets
Large storage buildings to mention how workers operate in the description and change range explanation label for construction

Fixes

Micropedia search bar results would disappear when clicked before the click is processed and would not navigate to the clicked entry
Raw Fish item distribution proportion unintentionally defaulting to weight of 1 instead of 3
Oven operation progress not showing correctly when the worker is activating the cooking process
Export Station and Import Station not showing all item delivery marker icons
Florist missing tooltip/Micropedia information line about Flower "production" from Seedlings
Brewing Vat not showing cooking sprite and smoke
Building workers still accepting tasks from far away blocking other workers from and choosing them until they arrive
Building worker with no task going to the building from far away even when the slot is disabled
Building construction and deconstruction markers now appear on the tile "layer" and don't overlap other objects
Mouseover tile would occasionally be momentarily incorrectly calculated
Various sprite fixes
Path-finding will avoid leading units through single-tile buildings
Fix path-finding not considering "exiting" a building tile in a proper direction
Path-finding will prioritize "front" tiles for multi-tile buildings and avoid going through "occupied" building tiles
Path-finding will again avoid leading units through fields/plots/pens, but take corners instead
Animals will properly ignore pathing restrictions and walk in pens as desired
Fix path-finding choosing sub-optimal shortcuts
Fix villager slowdowns when running between certain road tiles, most noticeable with carts
Animal Habitats not spawning
Graph window not working when loading previous version saves
Acquiring items not present in loaded saves causing an exception in internal graph logic
Export Stations sometimes not delivering items when one of its target Import Stations has a full stack of that item
Technology panel buttons having mouseover detection region larger than the button itself
Skinned animal stat not being recorded in saves
Animal Habitats not despawning when reaching a low score
Fix large storage building worker incorrect waiting locations
Import Stations and large storage buildings would not fill up compatible building items fully
Fix exception when loaded saves would fail to assign unit idle locations
Remaining items not appearing in the world when extracted from stacks
Internal ID conflicts between units (namely Pigs that are led to Butcher) and items would cause one or the other to be excluded from future deliveries for the ongoing session
Import Station issue verification causing internal exceptions while it's constructing
Large storage building issue verification incorrectly triggering when there are compatible item source buildings in range
Building issue verification for required auxiliaries would incorrectly show double-issue for buildings with multiple auxiliaries
Building issue verification for issues that have a building of item list to report would not update the tooltip if these lists changed

Balancing

Garden Plots, Crop Fields, Tree Nurseries and Animal Pens now cost 2 Planks instead of 3 (and 1 Stone Slab)
Import Stations can now distribute up to 6 items to nearby targets
Large storage buildings can now distribute up to 6 items to nearby targets
Double Large Barn and Large Granary capacity
Increase Forester operation range from 3 to 4 to match Lumberjack operation range

Optimizations

Redo rendering pipeline and significantly reduce CPU usage and overhead
Most visual-related logic has different performance cost, usually reduced
Small, emptier worlds run slightly slower, but large worlds run significantly faster
Increased memory usage
All particle effects are redone and slightly different due to using a new system
World entering is slightly faster
Reduce redundant unit internal animation processing
Speed up villager idling location lookup
Entering (generating, loading) and exiting a world is slightly slower due to the pooled objects now having inefficient hierarchy for mass changes
Processing (pathfinding and delivery processing) threads sleep longer and more frequently when idle freeing CPU usage
Internal game logic is now capped at 90 FPS, so faster machines do not do needless processing
Slightly fewer HUD rendering batches
Building issue periodic checking is faster
Many minor optimizations

Rudy
Snowy Ash Games


[ 2021-12-13 18:56:59 CET ] [ Original post ]

EA Update #15 - Fishing

This smaller update adds fish animals and fishing to the game.

[h2]Fishing[/h2]

Firstly, fish will now spawn in their own water-based habitats:



These work very similarly to land-based habitats, except for the requirement to be in shallow water. There are three types of fish/habitats: Striper, Salmon and Marlin.

After unlocking the Fishing technology, a Fisherman's Hut can be built. The workers will go to the nearest coast with fish and cast a rod and wait for a fish to hook:



This catches the fish corresponding to the animal's species:



(I considered whether a "caught fish" should be the same item or if each species should have its own. There is no functional difference and I doubt there ever will be. But the extra items do take up the extra space in UIs. I don't really mind this too much and I find it cool to have variety. Although I might need to eventually figure out some sort of grouping of similar items, like in the Item Report window.)

The raw fish then has to be taken to the Fishmonger building, where it's prepared into a Fish Steak at a Gutting Table:



From there, Fish Steaks are taken to the Smokehouse, exactly the same as raw Meat:



In fact, this is so exactly like Meat, that the item produced is also a Roast. I guess no one can tell the difference. But, on a serious note, I do not want to add more food or supply items at this time. There are already 12 of them and the way Markets and Houses handle them is rather subpar. Taking each individual item to houses and having houses track each of the 12 items is simply too cumbersome. So this is a compromise until I rework the villager "shopping experience".

[h2]Path-finding[/h2]

No day goes by when I don't discover there is some complex backend code that I need to work on to enable a feature. Of all the things to break, I didn't imagine imagine fishing would break path-finding so badly.

First of all, fish "walk" in water, so I had to create rules and separate tile "swimmability" flags that path-finding can use depending on how a unit moves (i.e. on land or on water). But that's relatively easy.

Instead, I discovered a bug where workers could not find a path to some buildings that were built on the coast (i.e. if grass would touch the water). To explain the problem, I need to quickly explain how path-finding coordinates work in the game.

The game uses hex tiles, and so the coordinate system is not a straight-forward X-Y horizontal-vertical axis. But for that the path-finding is still not too difficult to "solve", I just have to be careful how coordinates are assigned and what directions are allowed for movement:



(If you want to know more technical details on the basics of hex grids, then look no further than the excellent https://www.redblobgames.com/grids/hexagons/ guide.)

The tricky part is that I don't actually want movement just between tile centers. You likely have noticed that workers run between buildings, although it would not be obvious how path-finding does this when you consider the coordinate system it works with. For MicroTown, I only allow movement between the adjacent centers and corners:



In fact, internally, I have 3 times as many path-finding "nodes" as tiles in each axis direction. Here are the node relative "distances" and "missing" nodes from the full path-finding data:



So in fact units cover many more "locations" and "routes" to reach them that just moving between tiles when looking for paths:



Besides walking between structures, another important reason why I am doing this is because units need to access certain buildings from a certain direction. For example, the fisherman has the door pointing South-West, so workers need to use the South-West tile or corner:



And this was where the bug happened. The design-to-implementation question here is: which tile does a corner belong to? And in what directions does each corner enable access to buildings? Because each corner is part of 3 tiles:



This does not matter on land. But I had not carefully debugged what happens near the coast (in fact, I had to implement the above visual debugging to see what was going on). Depending on direction, corners would use the water tile to decide if they can be traversed, thus making buildings inaccessible.

So to do this properly, when I update path-finding data for a tile, I am also updating corner path-finding data. I need to check all the adjacent tiles, because every corner has a combination of 3 different tiles. For land-based path-finding, this means allowing corner movement if any "connected" tile is a land tile. So, in essence, every coastal tile is fully walkable:



Of course, this is just one aspect of what is needed and there is much more happening, like road priorities, multi-tile building avoidance, full-tile movement preference, direction-dependent movement validation, preferred route distance estimation, etc. Much of the difficulty of changing such a fundamental system is all these additional factors that have to keep working.

[h2]Other changes[/h2]

One of bigger UI changed is that all technologies are now in the same window and tab:



I basically removed technology branches, because they served no real purpose other than to have empty unfinished-looking tabs in the tech window. It also seems like most technologies are some sort of production ones anyway.

[h2]Future plans[/h2]

In the future, for the fishing specifically, I can imagine adding something like fish oil item for... some purpose. I can also imagine more fancy foods, like crabs, or specific items, like pearls that could be acquired. I originally thought that fishing would be done in boats, but decided not to over-complicate the matters at this point.

I also think Hunters would eventually have a dedicated skinning/preparation building where additional items are produced, such as furs. Then I would have individually-itemed animal carcasses similar to fish species.

However, the big plan is to improve the Market logic. I am more than happy that many long production chains culminate in arrival at the market. But I am rather unhappy with how individual per-item market stalls have to then distribute the items to individual House slots. I think this is boring linear micro-management. Basically, the market may as well have come with the stalls "pre-installed" for all the use their exact layout does.

So I will likely "convert" stalls into shops of sorts, like a Meat shop or a Produce shop or a Clothes shop. That way, I can have a similar number of shops as stalls, but they can "sell" several items and thus overall, it would be a much larger variety of items. This would gradually enable me to add currency as well. Then the central Market "authority" would be responsible for taxing the shops or some such. This is very likely what I will work on next.

[h2]Full changelog[/h2]

Changes

Add Fisherman's Hut building
Add Striper, Salmon and Marlin as "wild Animals"
Add Striper, Salmon and Marlin items fished from respective fish animals
Add Fishmonger building with Gutting Table
Add Fish Steak item produced from fish
Add water-based Animal Habitats for the new fish species placed along the shore
Land and water Animal Habitats have separate spawn rules, locations, habitat score calculation rules, visuals and various other properties
Game Warden's Lodge is now specifically for land-based Animal Habitats only (and mentions this in description)
Add Fishing tech, unlockable from start
Add fishing Goal to catch fish
Add "Animals hunted" and "Fish caught" (internal) statistics
Smokehouse and Drying Rack can now also cook Fish Steaks into Roast (for now)
Adjust building worker idling locations
Idle building workers will now occasionally rotate
Add concepts: Livestock, Game, Fish
Not showing icons anymore for in-text concepts
Canceling building deconstruction before it begins will "suck back up" building's compatible items
Import Station to show item stacks separated
Remove technology branches -- all technologies are now on the same page
Technology window entries no longer show their name labels
Technology window will resize to fit more of the screen vertically and can now scroll its content vertically
Mr. Piggles' portrait is now the game's icon
Newly-available building output and stored items now have a short delay during which they won't get assigned to regular deliveries, but can still be picked up by large storage building and Export Stations workers thus prioritizing them over carriers
Building workers can now discard the resulting item of an operation if this item is no longer compatible, this applies to Brewing Vat and Loom
Import Station can now accept and store up to 6 types of items independently; it will no longer get "clogged" by one type of item when receiving multiple types of items
Up to 3 types of incoming items to Import Station are now shown in building inspection HUD with "progress" bars
Loading saves where Export Station or Import Station has to be reset will preserve previous shipping routes (although active deliveries will be cancelled)
Shipping routes can now only be set to Import Stations that are complete or under construction (but not deconstructing)
Export Station inspection shipping routes selection will only show if it is complete or under construction (but not deconstructing)

Fixes

Add missing Hunting Goal to hunt animals
Some valid coordinates were not considered for Animal Habitat placement
Fix some minor animal animation issues
Pathfinding would not check coastal corners of tiles and workers could not go to buildings placed adjacent to coasts
Fix profession distribution panel builder increase button decreasing the value instead; fix tooltips on all buttons being on the wrong buttons
MacOS builds are now Intel only until Steam-injected libraries support Universal (i.e. ARM) builds and work on M1 chip systems
Tooltips getting stuck when showing entries that check game progression while not in a game (i.e. main menu)
Internal exception when removing a shipping route at a Export Station and cancelling tasks involved with the route due to not accounting for certain tasks failing to cancel remaining tasks and corrupting the internal route state
Import Station clearing its incoming routes after construction
Export Station not clearing its outgoing routes when deconstructing
Some rare issues adding/removing shipping routes during building construction
Import Station workers would only distribute the (internally) first stack of items

Balancing

Smokehouse can now hire 3 instead of just 1 workers
Drying Rack takes longer to "cook" meat

Optimizations

Pathfinding internal checks are significantly faster

Rudy
Snowy Ash Games


[ 2021-10-18 19:34:18 CET ] [ Original post ]

EA Update #14 - Storage & Hauling

This update improves item logistics and long-range deliveries.

My goal is to give the players much more control over item deliveries. Instead of relying on the game to successfully figure out what needs to be taken where and making assumptions that may not be correct, this would allow the players to direct items with more precision and have a consistent way of having long-distance deliveries.

[h2]Courier stations[/h2]

The biggest addition are the courier stations export station (left) and import station (right):



To summarize: An export station delivers specified items to one or more import stations. Export station has dedicated workers for collecting items from nearby processing and storage buildings, as well as dedicated couriers to handle the deliveries. Import stations have dedicated workers to distribute the delivered items to nearby processing and storage buildings.

You can think of these as active item "hubs" in an area (a "passive" hub would be storage buildings). They will promptly collect nearby items and efficiently send them away to a different hub, where they can be distributed again.

Just to be clear, all the existing delivery logic still exists. The game can be played without building any courier stations. Free carriers will still grab whatever items they can deliver (although they won't
"interfere" with courier stations themselves). In contrast, courier stations is a way for the player to "force" consistent deliveries, especially across longer distances.

Most of the setup happens at the export station:



Here, you can specify the item to deliver, the number of workers for collecting, the number of workers for deliveries, and the destination import stations (and their priorities).

The items will be delivered by a worker pulling a cart with up to 12 items. These carts are efficient compared to regular carriers, however will slow down immensely outside roads. This makes planning and building roads increasingly useful if you use couriers.



The items will end up at the import station:



From here, workers can distribute them to relevant storage.

With this, I also removed storage-to-storage delivery logic, so storage building can now only collect and distribute items to and from processing buildings. Courier stations will be needed to take items "directly" to a different storage location.



[h2]Better storage[/h2]

The storage buildings can now store almost every item in the game. There are still separate warehouse/barn/granary variants and the buildings and items will show in the tooltip where they get to be stored.

The HUD has changed a little for these:



They also do not list all the items you can select, because since every item in the game can now be stored and there would be too many to show. Instead, upon clicking the selection button, an item selection menu will pop up:



This selection is now used everywhere where an item needs to be specified, including the export station.

[h2]Large storage[/h2]

The other big change are the large storage buildings:



Besides larger item capacity, the big advantage and important feature of these are the dedicated workers that will collect and distribute items from nearby processing buildings:



These workers will only ever collect and deliver items for their storage building, making these essentially dedicated couriers.

All the existing and new storage and logistics buildings are now in the logistics construction tab:



[h2]Other stuff[/h2]

There is now the option to limit the regular carrier item delivery distance:



This works best when the village has courier stations set up for far deliveries. This way, couriers can be "told" to not bother with long-range deliveries and focus on short-range.

Builders will now also follow a proportional value rather than an absolute:



This means the players don't have to constantly change (or even be aware of) the maximum builder value.

I also added a few achievements and tweaked some of the existing ones.

[h2]In retrospect[/h2]

This update is not perfect by any means. Item logistics is a massive feature set and for every feature that works, there are ten things that could go wrong. It's a relatively simple concept to explain, but a notoriously difficult one to implement. I am writing this and it feels like I just started adding the long-distance routes, but somehow it's been over three months already.

I built the game around the concept "carriers deliver everything". I eventually added worker self-deliveries, and this already complicated matters a lot (in fact, I only now fixed some long-standing bugs relating to that). But now I am adding logic where items that were previously exclusively delivered by carriers can also be freely delivered by building workers collected from outputs and storage and distributed to inputs and storage. Suddenly, internal logic has become much more complex and difficult to follow.

And this also means that I could not split the update into multiple smaller ones (i.e. Storage update & Hauling update like I originally planned). The underlying delivery logic is just too "spread out" through everything. I also don't have a stable build at any point due to the number of changes. Nor do some of these additions make a notable difference without the whole package, like large storage without dedicated workers.

I also spent a very long time hunting and fixing some of the rare bugs. These were ranging from self-fixing and annoying to actually crashing the game. Despite their rarity and inconsistency, they eventually happen if one plays long enough. Unfortunately, this also means that tracing and debugging them is very time-consuming.

[h2]Future plans[/h2]

Foremost, I want to add more content. By which I mean "immediate" features like production chains and such. I have not really decided on exactly what is most impactful or interesting at the moment. I know I want to make larger maps and more diverse resources and I will probably begin implementing some of that. Namely, long-range deliveries would allow me to spread out the resources more and larger maps won't have as many logistics issues.

On the backend side of things, I need to rework how markets work. Houses currently need 12 items and that's 12 different market stalls, each needing collection and distribution. I can't realistically keep adding more items that I want without making this whole gameplay part overly tedious. This also isn't really how I envisioned markets.

I will of course be on the lookout for how well these new changes work and will adjust things based on feedback.

[h2]Full changelog[/h2]

Changes

Add Export Station and Import Station buildings for bulk item delivery Routes
Add item selection popup window for selecting among many items, use for shipment item selection for Export Station and storage buildings
Implement Export Station item retrieval from nearby processing and storage buildings
Implement Export Station item delivery via "couriers" following specified Routes, add route priority adjuster
Add Routes creation/selection HUD for Export Station
Implement Import Station item distribution to nearby processing and storage buildings
Add markers for shipment target and destination (and active transfers)
Couriers don't carry items, but load them into a cart and pull it instead
Couriers with a cart don't experience slower base movement speed regardless of the number of items in the cart
Couriers pulling carts outside Roads move much slower
Add several issue checks for the new buildings (shipment item not set, no source or target in range, no shipment routes set)
Add Hauling technology that unlocks the courier buildings with Roads and Storage being prerequisites
Add max delivery range for carriers that can limit how far items are delivered by regular carriers (excluding couriers and self-deliveries); add UI slider next to carrier slider at the profession distribution window
Max builder value is now a proportion of total worker population (like carriers); adjust UI and controls to match
Rename "Roads" construction tab to "Logistics" and place Export Station and Import Station there
Storage buildings (Warehouse, Granary and Barn) no longer transfer goods between other storage buildings (they can still toggle regular input/output deliveries)
All items can now be stored (except Corpses) in storage; set up lists of items for each storage building "type"
Storage building stored item selection now uses a popup to show all items and a separate section to show stored quantity
Change storage building description to describe what they store better and remove explicit mentions of storage from individual items
Changing storage building's stored item now "drops" all items and "collects" any compatible items already on location
Move storage building construction entries to the (new) "Logistics" tab
Add large Large Warehouse, Large Granary and Large Barn with increased capacity
Large storage can employ dedicated workers that retrieve/collect outputs and distribute inputs to nearby processing buildings
Storage workers will also obey storage item transit input/output toggles
Add Large Storage technology to unlock large storage buildings with "regular" Storage tech as prerequisite
Add Goals for Hauling and Large Storage, adjust requirements for Storage
Shift+copying buildings also copies Export Station shipment item selection
Building workers will run to the building instead of walking if they are far away
Buildings can have 2 worker "rows" with different tasks, namely Export Station's collectors vs. couriers
Buildings can have different worker "names" for building inspection, such as "Collectors" and "Couriers" and optional description tooltips for their labels and buttons
Shift-clicking worker slot buttons in building inspection toggles multiple slots - clicking an enabled slot disables it and all slots to the right while clicking a disabled slot enables it and all slots to the left
Add icons for Animals and display them in all HUD locations - inspection, buttons, tooltips, etc.
Add Animal conservation (by Game Warden's Lodge) tooltip information entries
Builders will remain at their construction site if there are tasks pending or incoming items rather than walking off early
Building and road construction sites to show a marker for their builders
Technology window now uses large icons (that match items)
Add additional vertical space to the Technology window to fit the new technologies
Add "Monumental" achievement to construct the Monument
Add "Wildlife Conservationist" achievement to establish a Game Warden's Lodge for every species of wild Animal while not hunting at these Animal Habitats
Add "Populous" achievement to reach 2000 Population
Add "Rocky Road" achievement to have 1000 tiles with stone or better Roads
Construction menu will highlight newly-unlocked buildings
Make invalid tile overlay indicator more obvious
When placing multi-tile buildings, only invalid tiles will turn red instead of also valid tiles where the building wouldn't fit due to being multi-tile
Roads and techs to show icons in Micropedia along other icon fixes
Remove item delivery distance grace period during which newly-available items would be prioritized to closer destinations
Add building marker/indicator for non-idle workers
Add building marker/indicator for outgoing item delivery target buildings
Building marker incoming icons are now more cyan than blue
Add Marker concept and Micropedia entry explaining the individual icons
Building efficiency value now counts missing workers as being inefficient
Clicking construction tabs will not cancel the current selection
Building's selection HUD will not hide when building auxiliaries or selecting its operating location
Add next happiness level note to the top HUD happiness segment tooltip
Building sites do not affect Animal Habitats score until construction starts
Cut-down Trees during construction will leave a Log item behind
Shift-selecting an auxiliary building while a compatible parent is selected will leave the parent's selection HUD active

Fixes

Fix workers delivering items to other buildings sometimes incorrectly counting/reserving the items potentially either over-delivering items or getting stuck never receiving more deliveries
Fix rare bug where cancelling deconstruction of a partly constructed building or road would result in it never being completed due to incorrect pending material counter
Fix rare bug where delivering multiple materials to a road would not count the items correctly and would either complete the road with "incorrect" materials or get stuck with missing material(s)
Fix rare bug where saving would fail due to an unfinished road construction when multiple material delivery task incorrectly decreased the pending material counter
Fix rare bug where assigning conflicting tasks would sometimes cause another task to "disappear" and at worst cause a crash
Fix rare occurrence of food items being used up due to global hunger not properly cancelling tasks involving them potentially causing a crash and "broken" items
Livestock Animals not wandering in their pens
Minor discrepancies in counting idle villagers
Items occasionally incorrectly visually offset in Stockpile when multiple are delivered
Minor item delivery discrepancies due to using item-to-villager distance rather than item-to-destination
Minor item distribution discrepancies when reaching internal overdelivery limits
Add missing button click sound effects for distribution panel
Redeploy Sewing Desks due to incorrect internal version (that didn't cause issue before, but would cause them now)
Builders will leave their construction site if there is nothing to do rather than stay idle permanently when there are other construction sites waiting for work
Builders will actually stay at the construction site (like the tooltip says) if it is set to highest priority (even when builder proportion is exceeded)
Building workers won't accept and "lock in" tasks before they have actually arrived at their building (potentially delaying processing or item usage by other workers while they are running)
Fix Hemp description wrongly listing it as deprecated
Barn being unlocked without Storage tech
Minor marker display issues, such as with worker self-deliveries
Fix incorrect (visually missing) Town Hall shadow
Fix multiple tasks involving same multiple items not verifying that all items do not conflict and potentially causing a crash and "broken" items
Worker marker constantly removing and readding itself
Some rare marker glitches
Fix crash when a villager dies while constructing a building and leaving behind an "invalid" item
Have higher priority construction sites receive items by not having a delivery distance grace period
Fix macOS start-up crash
Cancelling building construction with an active item use by builder leaves it in an invalid state that causes saving to crash
Clearing selection with Esc not clearing internal selection and markers
Fix buildings having invalid internal item state upon loading/upgrading from an older save and crashing the game when interacted with
Fix Mason and Windmill continuing to work and failing to produce items when the output is full
Fix building efficiency value resetting after loading a game
Esc occasionally causing an internal exception when building an auxiliary building or selecting building operation location
Internal exception during selection-based input mode while the selected entity changed state (such as building deconstructing while selecting its operating location)
Internal exception redrawing tile borders when selected entity's state changes
Erratic carrier hiring and firing when at 5/6 carriers or occasionally at the exact minimum proportion value
Profession distribution carrier slider current value indicator not matching up with the slider's handle
Global self-delivery toggle value not being saved
Productivity and other "bonuses" not applied to certain auxiliary building operations
Completing certain auxiliary tasks would not update parent building's task (e.g. Farm not planting produce before continuing to repair Wasted Dirt)
Rare internal exception drawing tile borders when multiple changes affecting them happen on the same frame
Shift-selecting a building and then canceling construction would leave last selected entities selection HUD, but it would not update
Potentially fix cases of "black screen" on launch on macOS
Fix crash during saving while a worker is trying to plant something in a Dirt tile that has decayed into Wasted Dirt
Fix crash during saving when a villager dies while having an active pathfinding request queued or being processed
Fix a rare case of a carrier choosing an incompatible item for multiple item bundling/delivery
Fix a very rare crash when saving the game exactly when the path-finding process returns a result
Update game engine to (potentially) fix compatibility with latest macOS versions

Balancing

Arborist work range is now 4 tiles (from 3)
Reduce Warehouse and Barn capacity from 64 to 32
Replace "Utopia" achievement with "Happy Place" which in addition to 3 minutes of Happiness, also requires 500 Population
Wasted Dirt repair is slightly faster
Wasted Dirt repair is much faster outside Winter

Rudy
Snowy Ash Games


[ 2021-09-14 18:50:23 CET ] [ Original post ]

EA Update #13 - Construction

This update focuses on the backend features for building construction, broadly speaking. My main eventual design goal is to make construction feel like a larger part of village development. This means things like longer build times, additional construction steps, more required materials, more builders, larger buildings, more builder animations and actions, more visuals, more feedback, etc. As part of it, I also added a lot of smaller features that I wanted to add but couldn't before.

[h2]Multi-tile buildings[/h2]

The biggest change (at least, internally) is the support for multi-tile buildings. Here is the "new" town hall on a 2x2 footprint (or 7 tiles):



I have not yet "converted" any other production buildings, because this would basically remove them without replacing and break any games. Besides, I need new art for them all and this is a out of scope for this update (see also future plans).

And here is the new (unfinished) monument on a 3x3 footprint (or 19 tiles):



With this, I also added support for multiple builders at the same construction site. Larger (future) buildings will require more time to complete, but this will also be offset by more builders working on them. This is probably the primary way in which I can visually "explain" that constructing buildings is a significant endeavor.

Notably on visual side, I added the graphics for construction progress for buildings:



This was one of the visual things that has been bugging me forever, but I was not able to add it due to how the construction and deconstruction progress was stored. It is now self-consistent (and you can no longer cheese the materials by toggling between de/construction).

Buildings can now also support more than 3 materials for construction, notably the monument will now also require planks and iron ingots.

[h2]Dirt[/h2]

I added a new tile type "dirt", which is basically dug-up grass. This will be the "default" tile under all buildings:



Builders will dig up the tile at the start of construction and will now actually convert it to dirt (if it's not already dirt). Previously, only workers at places like farms and ranches would dig up the working tiles, but these were just a variant of grass. They will still do it, but now they will work directly from dirt and further prepare them for use.

This makes the village look more lived in and creates a starker visual contrast between the village and the surrounding nature.

The dirt will also slowly regrow back into grass if there's no building on it:



With dirt tiles being their own "type", I can also add transitions between different tile types. (Before, "fake dirt" was only at the borders of crop fields, animal pens, etc., so it didn't really matter if it had a "sharp edge" with the grass outside the area.)



I numbered the different transitions above and you can see how just such a small location can have transitioning surfaces from everywhich side.

I even had to work on improving my pipeline for transition creation, such as a quick preview so I can tweak any issues:



This change is similarly mostly about the backend. Previously, I would never change the tile after creating it (dirt was just a variant of grass). But this also meant that everything assumed that it can "connect" to tiles safely and the tile would never disappear or change its type. So now I have the ability to transform the tiles as desired, which paves the road for various tile-related features.

[h2]Self-delivery toggles[/h2]

Buildings can now "decide" if the workers will self-deliver items, that is, bring nearby input items and deliver nearby output items to other buildings or storage instead of waiting for a carrier. This behaviour is both a positive and a negative feature and the line is very blurry and based on so many factors. When it works, it's great. When it doesn't, it can ruin production. I thought about this a lot and in the end I decided to allow the players to enable and disable it. This would still be important even after upcoming updates and changes to logistics, so I might as well do it right.

Firstly, each building with workers now has a toggle to either allow or disallow self-deliveries or keep it at the default setting:



Secondly, the item distribution window now offers a building self-delivery toggle tab that lists all the building types and each has its own toggle for all buildings of that type:



There is also a global toggle to simply disallow all self-deliveries by default. This can result in very different layout and carrier requirements. With a small village, it almost always works better with self-deliveries, and this is the default option and this is also part of my "just works" design goal. In the end, I am allowing the players to choose how their workers spend their time and if they want to optimize long-term or react short-term, I'm happy either way.

[h2]Markers[/h2]

Selecting a building, will now show the a small in-world marker above the items that are being delivered/imported to (blue, arrow in) or taken away/exported (orange, arrow out) from the building:



This will also show the villagers performing the delivery before the items is yet picked up:



This should make it much easier to see what items are being delivered without needing to check the tooltip that can only show a list of items and their approximate distances.

I will likely expand this to "mark" other related things as well, like workers themselves. However, this is a finicky feature that takes a lot of time, so I will work on this at a later date. My primary goal was to show the items and carriers since these cause the most confusion, especially for construction. This will also be particularly helpful for the future logistics updates.

[h2]Various[/h2]

Most of the work was in the backend, but here as some notable changes.

All buildings with workers now track their efficiency and show it in the HUD:



This is simply the percentage of time that the workers spent working. In addition, I also show the time spent self-delivering items so it's clear when workers are spending time hauling items versus doing the building's designated tasks, which is not necessarily bad but also not necessarily good. In any case, the player can decide what they want to do with this information and possibly use the self-delivery toggles.

I (finally) changed the minimum carrier value from an absolute number to a proportion and changed the UI to be a percentage slider:



Importantly, I made it so that going under this limit will start dismissing workers from the buildings. For this, I use the most occupied and then least efficient workers.

This now functions more intuitively like "I want X% of villagers to be carriers" rather than the more convoluted "minimum".

I also changed how the UI shows the de/construction material items:



This is an extreme case for the monument, so there a lots of items. But for regular buildings, this should work up nicely. The old "button" was just too unclear and cramped.

I split the top HUD overview and their tooltips into the tradesmen/carrier/builder sections:



I removed trying to show green/red status icons for these, since they are almost always just a little wrong. The end result is that a village working 98% of the time has red icons while a village not doing anything can have green icons (since technically all tasks are fulfilled). I think I was trying to be too smart trying to "tell the player" what the goal should be when it's not actually a goal at all.

[h2]Future plans[/h2]

This update took way longer than anticipated because of a fundamental backend assumption that tiles map 1:1 to buildings and that tiles remain "fixed" throughout. Adding such fundamental features retroactively is never fun. For example, path-finding had no idea how to handle not being able to walk between multi-tile buildings. I think it was worth it just to allow the larger monument. But, of course, there are tons of buildings that could be multi-tile.

The next thing I am working on before anything else is a delivery "caravan" system. There is a lot to discuss about it and I will probably leave it for the next update notes. I didn't do many logistics changes in this update mostly to not delay it any longer. For example, there are still various issues with construction, particularly with priorities and deliveries. But much of it needs logistics "fixed" first.

For the more distant future, the next part of building changes would be making all primary buildings be 3x3 tiles. That is, for example, a farm would be 3x3 while the fields would remain 1x1. However, I will not do this change right now as there's a specific problem I want to focus on.

Of course, there are all the other things I have mentioned here and there before - markets, better civilian needs, happiness overhaul, more production chains, trading, etc. etc.

[h2]Full changelog[/h2]

Changes

Monument is now 3x3 (19 tiles)
Town Hall is now 2x2 (7 tiles)
Multi-tile buildings are now supported by the backend: currently used footprints are 2x2 or 7 tile "circle" and 3x3 or 19 tile "circle"
Add multi-tile outlines for building selection and construction
Selecting any tile of a multi-tile building selects both the exact tile and the building itself and with separate outlines
Add (de)construction markers for multi-tile buildings
Buildings are now (de)constructed through several visual construction steps; add in-progress sprites for primary and auxiliary buildings
Update (de)construction item progress UI to be shown as a progress bar with sections for used/delivered/pending/needed items with appropriate icons
Make (de)construction progress bar advance smoothly and more accurately than before
Town Hall's footprint is now 2x2 or 7 tiles
New larger Town Hall sprite
Monument's footprint is now 3x3 or 19 tiles
Monument now also requires Iron Ingots and Planks for construction
Add Iron Ingot to building proportion item distribution window
New large Monument sprite and its construction steps
Make Dirt tile a separate tile for "used" tiles, including its previous "variants": Tilled Dirt for farming and Stomped Dirt for animal husbandry
Builders clearing a tile for construction will now convert it to Dirt
Dirt tiles will slowly revert back to grass as Regrowing Dirt and Regrowing Dirt if there is no building on top; other dirt types will first turn into "regular" dirt
Tilled Dirt under Crop Fields and Garden Plots will turn into Wasted Dirt at the arrival of Winter and workers will need to retill it
Tree Nurseries don't need the tile tilled anymore
Buildings with workers will show their work efficiency percentage in inspection HUD based on their time spent working
Building workers will now follow a self-delivery setting and not bring or deliver items to and from their building if self-delivery is disabled
Add self-delivery toggle (enabled, default, disabled) to building inspection HUD
Add a "Self-deliveries" tab to item distribution window with a global self-delivery toggle (enabled/disabled) and per-building type (enabled, default, disabled) delivery toggles
Change profession distribution carrier minimum value from an absolute value to a percentage value
Workers will now leave their buildings to become carriers to reach the global carrier threshold
Split top overview work section into individual "Tradework", "Deliveries" and "Construction" sections and simplify the tooltips
Remove unclear and often incorrect green/red-colored status colors from top overview worker numbers/labels
When a building is selected, items being delivered as inputs or carried away from outputs and carriers coming to take the items are indicated with in-world markers with appropriate icons (blue - incoming, orange - outgoing)
Add UI/HUD button pressed variant and change various buttons that are "toggled" to have the pressed version (instead of just color change)
Add water tile animation
Update and improve various tile transition sprites
Remove old save potential upgrade notice from save/load menu

Fixes

Toggling between construction and deconstruction no longer returns material items randomly, but proportional to what was actually used
Item distribution UI stuck with previous world's values after load or new game
Rare exception when moving obstructing items from a construction site when the items are chosen for delivery
Incorrect partial tile border outline for selected buildings with no auxiliaries
Rare exception when selecting between buildings that have differing border logic
Switching between different building construction would not update the invalid tile outlines in some cases
Butcher producing Meat without Pigs
Young Deer walking sprite animation mismatch
Wrong tooltip info for Codex production "recipe"
Wool Fabric production chain missing from Carding Machine tooltip
Shift-selecting unbuildable building would change selection but not visuals
Certain world changes would not be reflected as current selection changes
Wrong Sapling removal animation
Worker digging animation not showing particle effects in many cases
Minor selection change trigger issues
Occasional tile transition sprite overlap flicker
Minor tile transition sprite issues
Brewing Vat to not individually select production, rather parent Brewery to decide what to brew
Confirmation window to use the Enter/Submit input instead of passing it to window under it
Saplings to not grow in Winter

Balancing

Increase various construction costs
Increase various construction action durations
Saplings grow faster
Trees grow slower
Tree Nursery workers plant and dig up Saplings faster

Optimizations

Optimize tile updating speed (however, all water tiles need constant updates, so overall the game is slower)
Improve certain redundant frequent update calls

Rudy
Snowy Ash Games


[ 2021-05-21 14:27:03 CET ] [ Original post ]

EA Update #12 - Micropedia

This UI-focused update adds Micropedia, a browseable in-game information "encyclopedia". Together with improvements to tooltips and presentation as well as nicer-looking icons for all the important buildings and items.

[h2]Icons[/h2]

Over time, I have been drawing icons for buildings in the main construction menu. I wanted to replace them because of how unrecognizable they are. It's one of the first things a player sees in the game and it remains the primary mechanic, and all new building unlocks appear here. So it sucks when the sprites are so interchangeable and it takes clicking and reading tooltips to find what one is looking for. (And it is unlikely that the in-world sprites could ever not only be distinct enough but also fit in the small buttons.)

Long story short, here's a comparison between an old and new construction menu page:



Even if not immediately obvious, these should be infinitely more memorable and recognizable. You don't even have to play the game to guess most of these. There are still tons of auxiliaries, but these mainly appear under their own parent buildings, so it's not such a big problem.

Originally, I was trying to come up with unique icons only for buildings in the construction menu. I was mostly using their tools (pickaxe for quarry, saw for sawmill, etc.) as icons:



But I very soon ran out of tools, so to speak. Some buildings I could still represent with unique objects (like an anvil for smith), but others I had no idea how to represent (e.g. an icon for paper mill that isn't paper). So I ended up just drawing the primary items produced. And this actually worked out better than tools, so I drew items for most buildings instead.

Before long, I had about 70% of in-game items drawn, so at that point I might as well draw the rest. So now I had icons that I can use in all the HUD/UI elements with items, "automatically" improving these:



[h2]Tooltips[/h2]

The majority of the work was actually for the tooltips. Micropedia is just a consequence of creating a structured easily-browseable repository for "all the tooltips". It has a bunch of extra information, but the data backend is the same.

Now, old tooltips did and still do their job:



Not great, not terrible.

However, my primary goal was to create extremely simple tooltip presentation that is also visually appealing. Like construction menu, this is the first place where a player looks to understand a building or item or anything. For example, the first thing a new player might learn is these:



Lumberjack and sawmill aren't exactly complicated, but a player who has learned this "language" can look at a more complex tooltip and understand what is required:



Then, from there I can use the same formula and expand until I have, for example, cheese inspection:



There's a whole lot of different things I can show. My main design problem was actually limiting which info I show. For example, tooltips are limited to the most important stuff.

[h2]Micropedia[/h2]

And so the Micropedia is a separate in-game window that has an organized list of every entity and concept in the game. (Well, not every every one, but all the main ones anyway and then some.)



I expect that Micropedia would serve two primary use cases - (1) looking up something specific and (2) just browsing.

For the (1) case -- the player likely has a question about something, probably what some entity is or does or needs. If Micropedia can actually answer such question, then the quickest way to the answer is most likely through a search:



Opening Micropedia instantly focuses on the search bar and you can start typing. Hit Enter and it will go to the best result.

Or alternatively for (2) browsing, everything in Micropedia is broken down by categories (items, buildings, animals, techs, etc.) and then each item is listed (mostly, alphabetically). So you can see and browse all entries.

Currently, Micropedia is rather technical and doesn't list many specific values or go into explainations. I will be adding more of these in the future.

[h2]Intermediary items[/h2]

I combined several buildings, and removed all intermediary items (see the full notes for the list). This may or may not break some games, depending on how those building were arranged. The merged building are Brickyard, Paper Mill and Textile Mill:



There are a few items in the game that are "intermediate". For example, Cheesemonger first brews Milk into Curd and then pressed Curd into Cheese. This Curd item is a real in-game item with all the related features. Then there's buildings like Brickworks and Brickyard which not only have intermediate Grout, but also Unfired Bricks delivered between them.

I think it was a cool idea to show these items and to see them carried around. The problem is that these clutter up the UI -- every place that lists items, like item report, also lists these items. (And if I were to just hide them, then what's the point of having them?)

I also adjusted the inspection HUD to better show to the player that there's a "virtual" item that gets transferred between auxiliaries. For example, Brick Moulder:



[h2]Future plans[/h2]

This update was a little more chill in terms of workload. It still took twice as long than I had planned. And the UI work is always tricky. But it was still "holiday reduced workload update". However, I do need to get back to some of the tough changes.

I want to get back to expanding the end goal and making the monument a larger objective. And there are numerous steps along the way. I'm not even sure how large and complex each step would be. For example, I have to make multi-tile buildings. I need to change how construction tasks work and allow multiple builders. Builders need to be able to carry items. I need to rework how construction input items are stored and used/reclaimed/counted. I want to add multi-step construction for the monument. This probably means building upgrading. Likely I need foundation/platform construction. I need to add more and new materials for all of it. Etc. In short, my main goal for "endgame" has a lot of mini-goals that I will likely add one at a time.

[h2]Full changelog[/h2]

Changes

Remove Brickworks, Grout and Unfired Bricks
Grout Mixer and Brick Moulder are now part of Brickyard
Brickyard now directly receives Sand and Clay instead
Remove Pulp Mill and Paper Pulp
Pulp Vat is now part of Paper Mill
Paper Mill now directly receives Hemp and Water instead
Remove Carding Mill
Carding Machine and Spinning Mule are now part of Textile Mill
Textile Mill now directly receives Hemp and Wool instead
Remove Linen Sliver, Linen Yarn, Wool Sliver and Wool Yarn
Remove Unfired Pottery
Remove Clean Fleece
Remove Curd
Remove Honeycomb
Add Micropedia window - an organized information repository - split into categories and their entries
Add categories for Micropedia - concepts, items, buildings, roads, villagers, animals, props, tiles, technologies and seasons
Each entry in Micropedia shows its information - description, sprite(s), usage and some hard-wired related info
Entities and links are clickable in Micropedia, switching to the corresponding entry
Add unique recognizable icons for all items, roads and most buildings
Most places in UI/HUD use the new icons for entities
Expand entity tooltips to include usage/production information and other most-relevant information
Add various new concepts
Add and tweak various icons
Add and tweak various sprites
Change descriptions for all the changed buildings, items and others
Remove Water Tower
Add "Hide UI" button to pause menu that hides UI/HUD in-game (and prevents input for the duration of it)
Building workers are now more reluctant to carry their own items
Beehive now shows a warning when no Flowers are in the operating range
Add a privacy notice and some extra info to save upload window; make toggle for optional Steam ID submission
Remove the Population count requirement to unlock the Technology Branches
Add a goal for building Town Hall
Add wild Animals - Deer, Boars, Foxes, and Wolves
Wild animals will spawn in Animal Habitats up to a limit
Animal Habitats spawn and despawn in the world based on surrounding forest "score"
New worlds and worlds loaded from older saver will have up to the default number of Animal Habitats spawned
Animal Habitats show an in-world indicator and the mouseover tooltip provides additional information
Rename Pork to Meat and Ham to Roast
Add Hunting technology available for research from the start
Add Hunter's Lodge building unlocked with Hunting
Wild animals can be hunted - the worker will approach, shoot and harvest the animal for Meat
Recently deceased wild animals can be skinned - the worker will harvest the animal for Meat
Hunter's Lodge can individually toggle which animals are hunted
Wild animals that die leave corpses instead of despawning immediately; the corpses eventually decay
Add Game Warden's Lodge who will tend nearby habitats
Herding now requires Hunting instead of Farming
Smokehouse and Drying Rack now unlock with Hunting instead of Herding
Add more particle effects to Drying Rack
Add Animal and Animal Habitat concepts
Trees no longer grow during Winter
Forester and Florist no longer plant during Winter
Various text and sprite adjustments
Add wild Animal "baby" versions
Only grown Animals can be hunted or skinned by the Hunter's Lodge
Animal Habitats in new worlds generate with the appropriate number of Animals

Fixes

Animal Habitat improved quality score from Game Warden's Lodge not being deducted after the improvement time runs out
Workers at some buildings with multiple auxiliaries would not complete work at auxiliary but run off to another auxiliary
Tooltips showing "through" opaque/blocking UI elements
Mouse scroll wheel no longer zooms in/out when over HUD/UI
Keyboard numpad +/- zoom keys now have a reasonable delay to zoom in/out one "step" at a time
Water not being "unlocked" from the start and inspection HUD not showing Well items
Barn is no longer unlocked if none of the items it stores are unlocked yet
HUD pause menu button not playing a "click" sound
Incorrect distance calculation for pending deliveries
Farm, Gardener and Arborist planting and collecting their production entities on unfinished auxiliary buildings and on untilled tiles
Transit toggle buttons blocking storage selection in storage building inspection HUD panel
Fix Water Tower being treated like a Tavern and fulfilling Houses tavern resident sentiment
Fix rare exception/stall bug when a worker switches a harvest task at the same as the target plant decays
Fix rare exception bug when an animal regains its product at the same time as dying
Fix Gardener and Arborist occasionally not tilling a tile just after planting in all other tiles
Fix wrong Drying Rack meat sprite layer
Correct Unfired Pottery plural name typo
Play the correct UI sound for road upgrading via the U shortcut
Fix a very rare error where a task for livestock animal is assigned right as it is dying
Fix animal inspection HUD box lingering after animal leaves the selected tile
Fix Windmill starting milling and creating Flour without any Wheat
Fix Hunter's Lodge workers sometimes running on the spot when approaching animals
Fix Farms, Gardeners, Arborists planting things in the wrong Seasons
Fix building workers occasionally not doing anything (because they had another task planned, which is no longer valid), for example Farm workers not tilling a field
Animals in new Habitats start aged proportionally (instead all dying at the same time)
Closing early access intro window with Esc doesn't open patch note or link window with main menu

Balancing

Wild Animals spawn a bit slower in Animal Habitats

Optimizations

Faster tile border and indicator re-drawing and minimize the lagspike on swapping/relocating them
Buildings to not look for tasks for disabled worker slots
Remove redundant task condition checks when first deciding on a task
Add delay between buildings failing to assign potential tasks
Remove expensive periodic task checks that can instead be aborted later
Check building tasks according to priority to avoid unnecessary checks

Rudy
Snowy Ash Games


[ 2021-02-05 18:20:09 CET ] [ Original post ]

EA Update #11 - Hunting

This smaller update adds hunting and wild animals that can be hunted for meat.

[h2]Wildlife[/h2]

I added several wild animals -- foxes, boars, wolves and deer.



These wander around, graze and generally hang out in the forests. I think they add some nice livelihood to otherwise extremely static forests.

[h2]Hunting[/h2]

I added a Hunting technology unlocked before the Herding technology. The Smokehouse will now also unlock with the Hunting tech.



I added a new building - Hunter's Lodge. You can adjust its operating range to cover the nearby animal location. You can also toggle which animals get hunted:



The workers will then run out to any wild animals, shoot them and then harvest them for meat. Meat can be taken to smokehouses same as from the butcher.

Smokehouses will now require Firewood:



This makes early high-quality meat food production more balanced.

I also renamed Pork to Meat and Ham to Roast since multiple animals now "drop" meat and it would be slightly confusing. I might eventually differentiate between the different types of meat, but I don't want to add more items to the market and houses at this time. This is also the reason why animals only drop meat for now and not other stuff like leather or pelts or something.

[h2]Habitats[/h2]

Something to consider is where I would spawn the wild animals. As simple as that sounds, it quickly becomes a rabbit hole (har har) of design questions and decisions.

A naive approach would be to just spawn animals randomly in the forests. I would add some rules to not spawn too many or to not spawn "incompatible" animals together or to choose "nicer" less-populated locations to spawn. I can even simulate some rudimentary population growth. The player would just place hunters randomly around forests.

But there is a major usability problem with all of this. How do I explain to the player how many animals there are in any particular place? And whether they are breeding or spawning or anything else? You can may be individually track them, but this is rather silly:



And secondly, if the player was to hunt out all animals, then there is no guarantee that more will ever spawn right there and the production rate would be inconsistent at best. As a player, I can see how I might completely avoid hunting, especially if I didn't know the rules of animal spawning.

I can add further rules that prevent animals from disappearing and spawn animals for hunters. But now I'm 3 layers deep into spawning rules and this just doesn't feel right. It doesn't fit the sort of structured approach to resource management that I want to have.

So I decided that animals will instead spawn in species-specific habitats, which will have an in-world indicator:



You can mouseover the indicator for all the info in the tooltip:



I think this makes it instantly clear that animals are a "resource" in this location and that it can be "harvested". This becomes a clear source of a renewable resource chain. This is something you can plan for from the start of a new game.

There are some rules to the habitats (which are similar to what individual animals would have had without habitats). They will only spawn in forested areas on around grassy tiles. They won't spawn near buildings or roads. They will decay if the forest is cut down or things are built nearby. Animals will only spawn in habitats. These factor contribute to the habitat's "quality score".

The tooltip also explains when things aren't "working", mainly when new animals won't spawn:



[h2]Game warden[/h2]

Going with habitat quality concept further, I also added Conservation tech and a Game Warden's Lodge building. The warden will tend a nearby animal habitat, improve its quality (and thus spawn rate) and prevent it from decaying even under poor conditions. This is reflected in the habitat's tooltip:



This isn't a big or important feature; I just think it's kind of cool and I haven't really seen it done in other games. It's relatively easy for me to add, yet provides an extra level of depth.

[h2]Parameters galore[/h2]

The habitat feature happens to need a lot of parameters and I think it's a good opportunity to provide some technical insight into these:



Since I am dealing with randomness and procedural generation, everything that can go wrong will go wrong. Every time I add a parameter, I am essentially trying to extract order from randomness and prevent things going wrong. (For example, I would not want to spawn a habitat right next to another one. But this is a perfectly valid random result unless I stop it. Hence, I need a parameter that says how many tiles must be between habitats. In other words, I reduce the number of garbage results from randomness.)



I can change these values on the fly as the game runs. I can also restart/regenerate the world quickly while running to preview changes. Most of the time I start with a few parameters that I expect I would need and gradually add more as I find various edge cases and "problems".

For example, here's me debugging the validity of spawning a new habitat in different locations:



Some of these never get modified unless I make drastic changes. These values may as well have been written directly in code, but having them external makes initial testing much faster. Others I would tweak continuously and those parameters determine balance and gameplay. Of those, some are "public" and these are values you see in the game, in tooltips and such.

Of course, it's not like every parameter belongs to an exact "group". It's more like a way of converting design into implementation. I know I want to show some values to the player. I know I will need other constants to determine high-level decision. I know I will need to cover edge cases. Etc.

A final note is that every parameter adds maintenance. To be accurate, each parameter represents underlying code, which adds maintenance. Having parameters displayed like this together gives me a good estimate of complexity. When I see the parameter list growing, I know that I am increasing the feature's complexity and may be that's not always a good thing.

[h2]Future plans[/h2]

As before, I intend to be making smaller more frequent updates. I don't want to do heavy programming or involved design during the Holidays (especially after last patch's backend work), so I will probably work on some graphics and informational stuff. I think the in-game info codex is a likely addition.

[h2]Full changelog[/h2]

Changes

Add wild Animals - Deer, Boars, Foxes, and Wolves
Wild animals will spawn in Animal Habitats up to a limit
Animal Habitats spawn and despawn in the world based on surrounding forest "score"
New worlds and worlds loaded from older saver will have up to the default number of Animal Habitats spawned
Animal Habitats show an in-world indicator and the mouseover tooltip provides additional information
Rename Pork to Meat and Ham to Roast
Add Hunting technology available for research from the start
Add Hunter's Lodge building unlocked with Hunting
Wild animals can be hunted - the worker will approach, shoot and harvest the animal for Meat
Recently deceased wild animals can be skinned - the worker will harvest the animal for Meat
Hunter's Lodge can individually toggle which animals are hunted
Wild animals that die leave corpses instead of despawning immediately; the corpses eventually decay
Add Game Warden's Lodge who will tend nearby habitats
Herding now requires Hunting instead of Farming
Smokehouse and Drying Rack now unlock with Hunting instead of Herding
Add more particle effects to Drying Rack
Add Animal and Animal Habitat concepts
Trees no longer grow during Winter
Forester and Florist no longer plant during Winter
Various text and sprite adjustments
Add a privacy notice and some extra info to save upload window; make toggle for optional Steam ID submission
Remove the Population count requirement to unlock the Technology Branches
Add a goal for building Town Hall

Fixes

Fix wrong Drying Rack meat sprite layer
Correct Unfired Pottery plural name typo
Play the correct UI sound for road upgrading via the U shortcut
Fix a very rare error where a task for livestock animal is assigned right as it is dying
Fix animal inspection HUD box lingering after animal leaves the selected tile
Farm, Gardener and Arborist planting and collecting their production entities on unfinished auxiliary buildings and on untilled tiles
Transit toggle buttons blocking storage selection in storage building inspection HUD panel
Fix Water Tower being treated like a Tavern and fulfilling Houses tavern resident sentiment
Fix rare exception/stall bug when a worker switches a harvest task at the same as the target plant decays
Fix rare exception bug when an animal regains its product at the same time as dying
Fix Gardener and Arborist occasionally not tilling a tile just after planting in all other tiles

Optimizations

Buildings to not look for tasks for disabled worker slots
Remove redundant task condition checks when first deciding on a task
Add delay between buildings failing to assign potential tasks
Remove expensive periodic task checks that can instead be aborted later
Check building tasks according to priority to avoid unnecessary checks
Faster tile border and indicator re-drawing and minimize the lagspike on swapping/relocating them

Rudy
Snowy Ash Games


[ 2020-12-22 17:26:55 CET ] [ Original post ]

EA Update #10 - Seasonal crops

This update adds seasons and seasonal crops to the game.

The game's save format has changed, see the "Save Upgrade" section below. To preserve old saves, you will have to upgrade them.

I thought about titling this update "Winter is coming", but that just describes my update schedule.

Key changes

The game now has seasons. I went with the "standard" temperate ones: spring, summer, autumn and winter.



You can now see the season progression in the HUD and more info in the tooltip:



For plants, seasonality means that crops and produce will now quickly decay in winter:



In fact, all farm crops (wheat, barely, hemp, herbs) have to be planted in spring or they won't have enough time to fully grow and be harvested. Gardens will be able to (re)grow produce some 2-3 times a year.

Crops will also decay naturally over a period of time if not harvested:



This also means that gardeners and farms will not remain permanently idle and just stockpile ready-to-harvest fields. (You can still endlessly sow and not harvest anything, but you will need the workforce to maintain this cycle. And perishable/food items do not yet decay.)

As a consequence of seasonal harvests, the village will see a brief, large influx of harvested items. To support this, I added barns that are specifically for storing such crops:



I also adjusted how much food houses need. Simple foods (carrots, tomatoes, potatoes) will now run out quicker, while complex foods (bread, ham, cheese) will last longer. The values aren't perfectly balanced by any means, but this does move the game in the direction of complex food production chains being useful.

All crops (technically, all farm crops, gardener produce and arborist saplings) will now be planted and grown as three entities per tile (similar to trees):



Gameplay-wise, this means the space can be used more efficiently. Conversely, this means I can increase the plant growth time without sacrificing a lot of area, which I did.

Visually, having 3 crops per tile instead of just 1 means more animations and activity as they are sowed, grow and get harvested individually. The crop sprites are also simpler, more readable and easier to adjust as needed. And this also means I can add more growth stages, thus further increasing the amount of animation per crop.

Since crops are now individual entities, they are shown individually in the building inspection as well:



Crop fields and garden plots are one of my favourite features visually. I updated all the sprites, for example tomatoes and carrots:



For seasons, other plants will also change in various ways. For example, deciduous trees will yellow in autumn and shed leaves in winter:



Seasons do make balancing more difficult both for me and for the players. Basically, anything that fluctuates like seasonal crop yields is hard to balance. Previously, I could safely solve it with "whatever number feels cool", because the game just auto-balanced itself. If you lack something, you just build more production for it. It's still mostly true, but fitting things to seasons where crops actually die in winter means that I have to consider some timing values carefully.

I ended up coming up with and analyzing duration proportions in-depth and coming up with a theoretical model:



There is an interesting gameplay consequence to trying to fit production results into a specific time frame. Normally, the first crops you plant will be ready before the last ones planted even begin to ripen. This ends up with very unequal field growth and just doesn't feel right in-game. To counter this, crops will grow slightly slower or faster based on their stage and the current season (red and green cells in the above image).

In short, I have to tie all the duration values together from crop stages to year length.

This update is not too large content-wise given how long it's been since the last update. And because some of the changes I decided to make are disproportionately tricky to how much they actually add to gameplay. There are still more things I want to add related to seasons, but I decided to publish the update.

I also decided against adding more crops and grown food items, because this would bring the number of foods really high and micro-managing markets and houses demanding each type is too much of a mess. I will come up with a solution to this before I add extra foods (and supplies).

Save system

I rewrote the save system and changed the save format.

There is a lot I can discuss about the save system. This would get very technical very quickly because it's basically 95% about code specifics and how I handle each case. (In short, it's a fancy serializer. I tag my classes and variables with saving attributes and the system automatically saves the entire structure and then recreates it later. For the new system, I changed reflection-based value reading/writing to using automatically pre-generated code. The tricky part why I cannot use a ready-made serialization solution is that my code changes frequently and I need to be able to easily upgrade things through consecutive versions. With hundreds of classes and thousands of variables, the system need to be specialized to my needs.)

Here are the primary benefits:
* Saving and loading is much faster (with a caveat below), which was my primary reason to do this
* Saves can support many small entities better, which means I can have bigger maps with more stuff without exponentially increasing save processing times
* I can store metadata within the save files themselves, not limiting save info to slots and profile data
* I can potentially have an unlimited number of save files with unrestricted file names
* It's very easy to use, has minimal restrictions and barely distracts me from the actual programming, thus speeding up development
* The system is more robust and hopefully won't have to suffer breaking changes any time soon
* Saves have better data markers and extra data that allow me to debug code compatibility much easier
* Faster saving/loading means I can test old save loading/upgrading much faster and thus more often

Basically, there are no real downsides except the initial time required to implement it.

My save loading bottleneck is now the Unity engine itself and having to create/move/toggle all the objects in the scene. There is not much I can do about it and I am already employing all the immediate tricks I know of.

Here's a preview of the new save format:



Okay well, *I* think it was funny.

Save Upgrade

If you want to convert/update/upgrade your old saves (up to 0.5.x) to the new format (starting 0.6.x), you will have to follow these steps:

Open Steam client; right click MicroTown in the Library; Properties...; Select BETAS tab; switch the "select the beta [..]" dropdown to "saveupgrade" branch. Wait for the update and run the game. It will open the UI to convert your saves to the new format. Once that is done, follow the above steps again but switch back to the default "NONE" branch.



I apologize for the convoluted way of doing this. Unfortunately, I am not able to implement this conversion within the game itself, nor can I easily include a second executable in the build (especially for non-Windows). But I still wanted to preserve the save compatibility, (even though the game is in early access and "things may break" is partly expected). I also wanted to personally preserve all the older saves the players have sent in (even if the original issues wouldn't be present after the conversion).

(Note that the last 0.5.x version is also available here as "lastversion" branch and will remain there for the duration of 0.6.x release cycle.)

More updates

I've said before that I want more frequent updates, but this time I spent literal months on the next one. The main reason is that I'm working on both internal backend development and gameplay content additions in parallel. It's not too difficult to estimate the time needed for content updates (and I can always adjust on the fly). However, backend work is a complete lottery whether it will take a day or a month.

My backend is way more complex than a game of this scope would suggest. Often, the internal complexity gets in the way of content creation. But this means less bugs, more stability, better optimization, more consistent long-term changes, etc. I think it's a compromise I would like to see in the games that I play.

The reason for complicating things is that I have always loved games with attention to detail. This is also the design philosophy I am taking. For example, items stocked at buildings or placed in granaries or sold at markets aren't just "combined" into an internal counter. They all still exist as independent entities with all their attached data. For example, I could "poison" a tile next to a smeltery and then track it all the way from growing a crop there to being harvested to being stored and then brought to the market and sold and taken to the house to the villagers who eat it and get sick.

Future plans

I have worked on quite a lot of features, just haven't completed any fully. I am fairly confident that I can release next several updates much quicker. In the nearest future, you can expect more season stuff, weather effects, wildlife and hunting and an in-game information codex. These are most complete features that I can finish before I approach some of the larger planned changes.

Full changelog

Changes

New save format; old saves (<=0.5.x) are no longer compatible, but can be converted via the separate build on Steam's "saveupgrade" branch
Crop Fields, Garden Plots and Tree Nurseries and their fields are reset
All props (like trees and such) are reset
Added Seasons - Summer, Autumn, Winter, and Spring
Added Season HUD showing the current season
Farm, Gardener and Arborist now grow their production as individual plants and not "as a building"
New world prop objects for all the plants: Carrot, Tomato, Herb, Seedling, Wheat, Barley, Hemp, Potato
Cultivated plants (crops, vegetables, saplings) are now grown 3 per tile and are planted and harvested individually
Cultivated plants have more growth stages
Cultivated plants now decay after some time of not being harvested; they will stay around in their decayed variant for a while
Farm crops will slow or increase growth based on Season tending to be harvestable in early Autumn
Farms won't plants crops in Autumn (since there isn't enough time for them to grow)
Farms and Gardeners won't plant crops in Winter
Crops and most plants will now quickly decay/rot when Winter arrives
Garden Plots, Crop Fields and Tree Nurseries now show in HUD what crops are growing there and their growth progress (similar stages are grouped)
Add Barn building to store intermediate harvested items: Wheat, Barley, Hemp and Herbs
Trees (i.e. Maple and Spruce) will change leaves/needles as Seasons rotate
Most plant sprites are adjusted or expanded, some shadows added
Simple foods ( Carrot, Tomato, Potato) are consumed at a faster rate than complex foods ( Bread, Ham, Cheese)
Flowers can be harvested by Bees more times
Shift-picking building for copy building also copies the worker slot status (i.e. the number of workers)
New less harsh pickaxe, axe and shovel sound effects

Fixes

Cheese food amount missing from some formulas
Tavern now serves a random item instead of prioritizing Beer over Mead
Various particle/effect issues
Some missing and incorrect task/command description labels
Building workers will now work at the closest auxiliary as was intended (instead of randomly most of the time)
"Replant tree" goal to show counter for Trees and not only Maples
UI/HUD changes would not invalidate a tooltip properly and cause it to "stick"
Fix road construction button tooltip bad syntax

Optimizations

Eliminate lagspike when changes occur to tile borders, overlays and/or ghosts due to having to modify all tile game objects
Much less overhead (such as when creating a world or loading a save) from having dedicated border, overlay and ghost sprite renderers on every tile game object
Much less overhead from having multiple hex tile-shaping colliders on every tile game object
Very slightly faster lookup for the current object under mouse, including much faster tile lookup
Start preloading internal world objects while in main menu to reduce world entry times
Reduce the number of redundant rendering
Slightly faster animation processing

Rudy
Snowy Ash Games


[ 2020-12-07 13:49:58 CET ] [ Original post ]

EA Update #9 - Soundtrack

This small update adds a soundtrack to the game.

Key changes

The game now has a proper custom soundtrack made by composer Jos Ramn "Bibiki" Garca. There is the main theme and 8 gameplay tracks. This is obviously not a large update, but I'm super-excited about the new music and wanted to add it to the game as soon as possible. Previously, there was a single gameplay track running on a loop. It was a lovely track, but it got old really, really fast. And it was a stock track, so not original work.

I also needed a proper music system to support multiple tracks and proper transition between them. It's mostly just picking a random track with a bunch of rules about not repeating things. There is one interesting consideration though. If you've ever listened to a soundtrack/album on repeat, you know that your brain learns which tracks follow which. Even years later, you can instantly tell which song will follow next. This is something I wanted to avoid, so the music system stores the history of recently played tracks and avoids repeating the same consequitive tracks.

Here's an example of a random track order:



You can see that all tracks appear roughly equally, but the order is different and there is always "spacing" between the same track.

Here's an example of the sort of debugging I may have to create to support a new system, like the music system in this case:


You can see a bunch of things that hint at the internal logic. I could probably make a full write-up about all the decisions and details of the music system, but now I'm just padding this update post :)

Future plans

I am currently working on the season update and this is my planned next update in the near future. It's about 85% complete for the immediate milestones.

The main reason for the update delay is that I had to work on a new save system. I will talk about this properly in the next update post. Unfortunately, new saves won't be compatible with the old save format. However, I intend to release a separate save upgrade release of the game that can perform a one-time conversion of the saves should you wish to do so.

Changelog

Changes

Added new game soundtrack (menu track and 8 gameplay tracks)
Gameplay tracks will play randomly, but avoid recent repeats or following the same order
Music tracks swap with an interval in-between (instead of cross-fading)
Music toggling now quickly fades out/in the track (instead of instant switch)

Fixes

Selecting between buildings with different item transit setups would not update the HUD transit selection buttons properly

Rudy
Snowy Ash Games


[ 2020-11-22 18:32:42 CET ] [ Original post ]

EA Update #8 - Tech Direction

This update brings changes and an expanded framework for technologies that will drive the future expansion of progression features. (I know this sounds a bit abstract and wishy-washy and this update is a little bit all over the place.) In short, I added a bunch of technology-related stuff.

Key changes

The big change is the way the knowledge is gained. A new Scholar building will generate research points. However, it won't just "magically" produce points. The worker will have to visit nearby production buildings, observe their operation and return with their findings. This will earn them a knowledge point.



So the player will have to actively "produce" knowledge. And the bigger the settlement, the more the opportunity for knowledge (as it realistically should be) and thus quicker expansion. So while it's perfectly possible to have a village with a minimal number of buildings (and I'm sure I'll add an achievement later), it's not as fast.

To that end, there's an obvious restriction to production buildings that can be observed -- they must have generated enough "observable knowledge" by being actively worked. In other words, you cannot learn from idle buildings. To help visualize this, I added appropriate icons to observable production buildings when selecting a scholar:



Once papermaking is unlocked, the Scholar can use Paper to record Notes about their observations:



These notes are now required by the Scribe to make the Codex books for knowledge:



Previously, these got "magically" written up with knowledge. So if Scholar learns from practice, then Scribe works out the theory, so to speak. The goals will still provide small knowledge boosts, but much less for later techs than before. So the player needs to build Scholars. I feel it's an opportunity to add more depth to technology/discovery mechanics in a way that actually explains where the knowledge comes from. I'll see how it goes and may be add more flavour to these interactions later.

Another big change is that there are now several (future) technology trees:



These are production, civics, economy, and culture. The current techs are all in the production branch for now. I might still rename or change the new ones, depending on what future features make most sense. The new trees are basically empty, but I will be adding and adjusting techs as I add the relevant features.

The tech trees unlock automatically based on the population:



This is primarily so that I don't overwhelm the player with a hundred techs at the start. But this works intuitively too -- the community has to advance far enough to worry about more than just survival. First, civics or population needs; then trading and economic growth; and finally culture and entertainment and such. Kind of like that . At least that's the rough idea, we'll see how it goes.

I also made a dynamic arrow system that can connect everything neatly:



Except, hold up... does Cheesemaking require Linen? I didn't realize I would have this problem, so I needed some special cases and tons of extra sprites:



Such a small change making all the difference. In fact, the number of sprites I ended up making is rather ridiculous (and I didn't even make "exotic" combos for things I don't expect):



All in all, I'm pretty happy with how it turned out:



This also made me appreciate the work that must go into making tech trees and such in other games.

The Monument now requires a few more techs, one from each branch:



This will be the direction I will be heading and expanding until it's a sufficiently epic project to become a "world wonder" objective. I am avoiding just adding tons of techs for now, because I want them to feel sufficiently diverse.

I've also been working on various delivery-related backend improvements. One notable addition is that buildings now have "demand" for deliveries. This demand can be thought as priority for buildings that have less items than others. However, distance is still a considerable factor. Previously and when there aren't many items available, only the closest building will get items:



However, once there are more items, the further buildings will also start getting items:



This isn't efficient for immediate processing, but I think it feels more natural and intuitive. So I'm happy to sacrifice some marginal efficiency for more spread-out deliveries.

The settlement's starting layout has changed as well to a more ragtag arrangement (town hall and warehouses are now unlockable):



I did a whole lot of additional UI work, including standardizing many UI elements, adding icons, and various QoL improvements. Here's an icon creation example:



I have also added automated tests for various simple gameplay scenarios. This adds a bit of time to development, but it also saves me a lot of time should I accidentally break something (this has happened quite a few times already):



And of course, the most important update, a cobweb:



As always, I did a good chunk of work on the backend as to not accumulate
technical debt and to keep updating on a steady (if not as frequent as I would want) schedule.

Iterations

I don't usually go into detail about iteration and features that don't make it in. But I think it's important to mention the direction I considered but decided against, because it sort of explains what kind of game this is. (And because this update is twice as late due to redoing a bunch of things.)

Firstly, I was going to split techs into tiers/levels:



And these tiers would have to be unlocked. And for that I added a bunch of town milestones or "town stages":



Gameplay-wise, this would stop oneself from rushing technologies before having established a stable settlement, including an adequately-satisfied population. It also would stop the village from advancing with just a tiny population or only satisfying basic hunger needs.

This felt too artificial and not really the sort of "milestones" that a real settlement organically goes through. Or rather, such stage labels normally come as a consequence of organic development and not because the population decided to "advance to the next stage".

So I added "civic branches" that would drive the direction of development that closer represents the sort of governing decisions and planning that might be done:



One would have to choose what direction to take once all requirements are satisfied.



This meant the town stages would gradually "unlock" when enough civic development has taken place:



At this point, I was unhappy with the whole premise. These are features that artificially limit progression. It's a blurry line of what is "artificial", but a menu window telling you to "get X things" for undisclosed reasons likely fits. I think a game can easily become unfun if such restrictions are overdone. At the same time, they can serve as concrete goals. So I wasn't sure what to do at this point.

So I decided to get rid of town stages and just leave the unlocks:



But after playing around with it, it still just didn't feel right. I am having trouble just explaining it succinctly. In fact, none of this felt right and was just taking steps away from in-world gameplay and into menus. Now, I don't consider heavily UI- and menu-based games to be bad design or anything. I am sure this could work in a different game. But I don't think such direction fits MicroTown.

So, in the end, I made the call to scrap most of this and go back to focusing on in-world features and fewer separate menus. At least, nothing that feels too artificial. At this point, I had also planned and designed a whole load of future civic branch features and I am going to implement them as part of technology unlocks instead.

Future plans

I am not completely over some sort of civic development direction. One such path is adding "policies", which would allow the player to shape the high-level development of settlement in different directions (as opposed to tech tree(s), which are basically linear). However, with hindsight of the iterations above, this will not limit the progression, but rather enhance or change it. This would be a pretty large feature (and it will likely not be in the next few updates).

I also want to work on a bigger objective building than the current monument. But this requires me to rewrite the building and construction logic to allow larger building footprints, construction stages/upgrading and multiple builders. This would be a whole update by itself in terms of work. But I feel it is necessary to make buildings feel grander.

Some of the new buildings, like bursar or hospice, hint at the sort of "city service" management direction I plan to work on. This involves a lot of individual moving parts, so I will be adding them gradually one at a time. I have mentioned before that I dislike the current "happiness" system, because it is too broad and too vague. So I will be replacing and expanding it into more logical "sections", like health, education, entertainment, etc. the sort of stuff you would expect a population to need and care about. This way the player has clear targets, such as "raise health", and ways to accomplish this that vary from specialty features to mixing together with all the other needs and production chains.

I also need to make a "bonus system", broadly speaking. If policies or special buildings add or deduct some sort of bonuses (like work efficiency from happiness at the moment), then I need to show this in a consistent manner and this means having a solid system to begin with.

I will also likely do a couple minor updates with smaller feature sets, because I've been working on random stuff in parallel. For example, I've made some cool weather effects ages ago, but still have not added them. There is no "weather" or "climate" or "seasons" in-game (yet) and having it rain or snow wouldn't change anything practically. So on one hand, making such additions is only for some visual variety and I could add them sooner than later. But on the other hand, I really want there to be gameplay difference (like crop growth or something), so I've been postponing finishing it.

In short, there are a lot of plans and much work to be done. But I do have concrete goals and designs for the steps to reach them.

Price change

I will raise the price of the game from 8$/6.6 to 10$/8.2 at some point. I believe the game is in a solid state and offers enough content to warrant a higher price point.

Full changelog

Changes

Scribes now require Scribe's Desks and Research Notes from Scholars
Technologies now come in 4 branches - Production Technologies (where most of current techs are), Civics Technologies, Economics Technologies, and Culture Technologies
Tech branches require a Population threshold to unlock
Tech costs increase as more techs are unlocked (there are still several cost "tiers")
Rename "knowledge" when referring to unlocking techs to Technology; keep the term Knowledge as the "currency" for unlocking; adjust tutorial and other texts
Add additional UI for technology panel, such as branch tabs and tech connection/progression arrows
Goals still award some Knowledge, but not enough after first few techs
Add Scholar building that continuously gathers Knowledge from nearby active production buildings
Separate Papermaking tech (i.e. Paper) from Bookbinding (i.e. Blank Book)
Add Research Notes production from Paper at Scholars once Papermaking is unlocked (without Paper, they will still gather knowledge, but not produce notes; this can be disabled on a per-building basis)
Scribes now have auxiliary Scribe's Desks required for operation
Scribes now require Research Notes in addition to Blank Books to produce Codices
Scribe's operation now takes significantly more time, but 3 workers can work from the same building
Library now produces 2 Knowledge per Codex
Town Hall is now (de)constructible and unlocked by Town Hall. however only one can be built
A new settlement starts with a Tent (instead of Town Hall) and Stockpiles (instead of Warehouses and Granaries)
Add a Camp Site starting/default tech to "standardize" what technologies lead to what; Dirt roads now require this tech
Roads now require Stoneworking and Camp Site technologies (practically, this doesn't change anything, because those are unlocked from start)
Add Storage tech that Warehouses and Granaries now require; add corresponding goal
Monument now requires Monuments technology (instead of just Monument Schematics, previously "Monument Construction"), which itself requires Monument Schematics, Monument Design, and Monument Financing from all the tech branches
Add Architecture tech unlocked by Papermaking and required by Monument Schematics
Various minor technology changes
Update tutorial to include building a Scholar
Deliveries are now prioritized to buildings that have none to fewer items and deprioritized if they have a lot, effectively leading to a wider item distribution rather than nearest/most effective
Certain buildings, like Scholar and Market Square can now receive items even at long distances
Add separate sprite for when Crop Field, Garden Plot and Tree Nursery are harvested but not yet collected
Indirect outputs (currently, Pigs from Ranches) are shown with other "real" output items in building inspection HUD
Add U shortcut key to upgrade the selected entity (currently, Roads)
All buildings now require holding Shift to continue building multiple; explain in tutorial
Add gameplay option to always build multiple by default
Add various additional concepts with tooltip explanations
Change various UI sprites and icons; adjust many tooltips, texts and UI elements
Construction HUD button column now always shows all buttons (practically, village/town building button is now always shown)
Item report window selected item overview label with the total amount and storage amount versus capacity

Fixes

Buildings that have auxiliaries producing items as input not working (Potter, Beekeeper, Brickyard, Wool Scourer, Carding Mill, Cheesemonger)
Villagers not delivering multiple items to Market Square stalls.
After loading a save, villagers being reported as ready for tasks when they are not yet, then sometimes failing delivery assignments
Villagers bundling Market Square distribution deliveries that are too far away from each other (practically, different market)
Villagers bundling deliveries of items on the ground that are too far away
Construction occasionally halting when both stone road and building sites are pending and a bundled material delivery is scheduled
Deliveries not being assigned with items remaining waiting and carriers remaining idle potentially forever on busier worlds where generated delivery count exceeded the update capacity
Fix flag wave animation "direction"
Fix mistakes in various texts and tooltips
Construction HUD window becoming laggier after repeated world entering
Fix tooltip panel text alignment issues
Fix item report button clickable area overlapping nearby buttons
Fix villager not holding carried item properly after picking it up for certain actions

Optimizations

Deliveries are assigned faster on busier worlds
Displaying texts that contain formatting/links/icons is now much faster and allocates comparatively very little memory

Rudy
Snowy Ash Games


[ 2020-07-27 12:48:59 CET ] [ Original post ]

EA Update #7 - Patchtastic 3B

While I've have been working on the next update, a lot of additional delivery-related stuff crept in. So this patch is to summarize more of the bigger delivery-related changes.

Key changes

Villagers can now deliver up to 3 items at a time. Originally, I didn't want villagers to carry more than one item, because I wanted the screen to be filled with the peeps running around. This is a subjective reason, but then again, so are many of the decisions I make anyway. But in the end I convinced myself that having multiple deliveries per villager is actually perfectly fine.



If there are enough carriers, then most deliveries are currently still for just one item, because carriers run to deliver as soon as possible and don't know how to "trade tasks" or "add items" to their current delivery. In fact, the only reason they would need to carry more is when there's not enough carriers.



The item stack size is now 12 (up from 4). This means way more items can be brought and stored at buildings. The actually difference is mainly noticeable for larger maps and farther deliveries when carrier numbers and distances become the bottleneck.



These two changes shouldn't really affect small villages much, but should have a more major impact on larger villages and more spread-out villages.

Technicalities

So here's my "fun" design problem: pretty much all delivery issues I have or had can be solved by having more carriers. In fact, all my fixes and extra features are 85% mitigation of low carrier numbers with more elaborate ways to balance deliveries. And I am now mitigating the mitigation of these features...

Take this chain of delivery logic as an example:
Only carriers used to carry items to a building (but this meant workers idled while a compatible item sat nearby)
Then I made the workers themselves carry a nearby item (but this meant they spent half their time carrying instead of working)
Then I added weights to prioritize carriers (but this meant single workers would still carry items over a far carrier bottlenecking their own production)
Then I made worker wait a bit before deciding to carry (but this meant extra-far carrier was chosen even if the worker had nothing to do in multi-worker buildings)
And then I made worker not prioritize work if they had none or there are others already working


This isn't too bad, but there's the rest of the game to consider. The biggest difficulty is adding all the tasks and commands that a villager could potentially do and then making sure everything is linked up correctly. I have an upwards of 200 commands right now. And more than half deal with deliveries.

Every item in the game is "real" -- it exists from the moment it is crafted until it is consumed. When a villager picks up an item or puts it in storage, it doesn't become a "number in a spreadsheet", it is still the same actual item with an in-world state, location and any history or properties it may have. The UI might not show it:



But all of them are separate internally:



Of course, all of that and other similar decisions were deliberate choices on my part. I knew I was adding complexity and difficulty for myself. But I really want the game to remain true to its simulation nature as much as possible.

Future plans

My future plans are pretty much as they were before. I'm working on the next update and it's most of the way done. It will add some high-level progression milestones and steps to the city as a whole. It will not hugely affect gameplay (yet), but I want to see how it feels and works before committing to further changes. There's also many other small changes that I can publish.

There are still various major and minor changes and improvements I want to make to the deliveries. But I will work on these at a later date, because they aren't critical and I really want to get the next update out soon.

Full changelog

Changes

Change item stack size (i.e. building inputs and outputs) from 4 to 12
Villagers (both carriers and workers) can now carry 3 items simultaneously for deliveries to building inputs and storage as well as building and road construction sites (it has to be the same source and target)
Villagers carrying 2 or 3 items of the same kind will show a 2/3 stack sprite of these items (instead of a Basket)
Villagers run slower when carrying multiple items
Workers at buildings will prefer to continue their trade work rather than delivering items (e.g. Well worker will keep pumping Water instead of immediately delivering it)
Rename "Book" to Blank Book to mitigate usage confusion with Codex

Fixes

Pottery Wheel getting stuck in last production step thus providing infinite Unfired Pottery
Fleece Tub potentially being able to skip needed Water for repeat operations
House sentiment box tooltips not working
High construction delivery priorities being ignored when there are many construction sites
Clay Pit and Sand Pit not resetting the digging step, thus allowing quick item gathering
Sound not playing on game launch if audio options background toggle is disabled
Error when changing something in UI for inspected entity right as its state changes invalidating that change (e.g. switching construction priority of a building right as it is completed)
Leaving a world to main menu with a window open and starting a world again would get the button responsible for that window stuck
Top HUD tasks overview icons and numbers will now report based on tasks/deliveries/items that have been queued/waiting for a little while, thus preventing them from fluctuating wildly (e.g. on larger worlds they could be permanently in the red, while in reality all were being assigned, but with a short delay)
Carriers would also wait a short while before accepting item deliveries like building workers (mostly just having a small pointless delay, but rarely also making an inefficient delivery choice)
Building workers will not always prioritize their own task over delivering items if there are already other workers working (thus avoiding a case where a really faraway carrier would be called for something a worker can deliver nearby)
Farther distances over which an item will be chosen for a delivery grows gradually over time (thus having a short grace period where a closer/nearby delivery could be chosen even if it becomes available after the item)
Rare error when a supply task with multiple items was aborted
Selecting a building would become increasingly laggier each time a save was loaded
Items being dropped or consumed in some cases would momentarily be available and passed to threaded delivery processing causing them to be occasionally pointlessly picked for delivery only to be discarded
Items would not get delivered when their internal delivery proportion demand values reached extreme thresholds

Optimizations

Only several alike items from a larger stack (previously storage, but now also inputs/outputs) will report for delivery processing, thus reducing number of entities to check


[ 2020-06-03 17:35:22 CET ] [ Original post ]

EA Update #6 - Patchtastic 3

This summarizes the changes after the delivery update. There aren't many significant additions, mostly just usability improvements. (I kind of skipped the patch update after the animal update, so I want to post this one at least. And I can't devote all time to tiny features when the main game is waiting, although I try to ration in a good bunch of QoL stuff.)

Key changes

The one big thing is that the game got new commissioned cover art that I'm using for Steam and in-game, and just generally for promotional material.



I added global item distribution, which determines which items--roughly speaking--have priority over others. All items still get their chance, but some get more depending if they have a high weight and if they haven't been delivered recently. I also add nicer bars rather than number that weren't actually representative of an actual "proportion" value.



I started some preliminary work for better explanation when placing buildings about their areas and requirements. Mainly, these are important during the very first tutorial. But they also introduce any new building's "range" and I can add additional notes in the future. The "label" system itself lets me quickly attach a label to any tile/location, so I can show such hints.



I readded the labels for tasks tooltip (because it wasn't really obvious what the icons meant), but in a much nicer way than before:



I spent a lot of time debugging deliveries and fixed a lot of various issues and problems, not to mention tweaking many backend numbers. I would love to make some in-game UIs to show the details of the things that I can only print out (badly) in development debug locations.



I have been thinking back at other games that do logistics and some of the "sacrifices" they have made so that the overall system runs more predictably. I have from the very beginning gone for a very simulated logic, where every person and every item and delivery are "real", that is the actual item is delivered to the actual building by that actual villager, etc.

I also worked on increasing UI sprite readability, especially intractable buttons versus generic panels/boxes. I will likely work on these further, but for now they all have their own consistent custom sprites and I changed them to at least use the right "logical version".



I added some icons for building operation. These are the sort of things I add because, simply put, I like them. I like watching things happen and I like if a game doesn't hide this from me. So I could literally watch a progress bar if I knew it represented something "real" in-game. I started added icons here too and I will eventually add them to many other places.



Technically, I redid the whole backend for how buildings present their progress steps. They were very much literally the same steps the villagers follow logically to complete tasks. I have not added anything different yet, but now I can and I expect to tweak these for the needs of various buildings.

Also trees are now known as maple and spruce and got new sprites:



Future plans

Always a difficult question and a tough commitment. For example, I had to do the delivery update to be able to support future expansion, even though I really want to work on endgame and such. It took a lot of time and I could swear that for every thing I fixed, I broke another two.

So I will likely work on town progression next, which is--roughly speaking--milestones/stages/tiers that you have to reach and unlock. Sort of like hamlet town city or some such. I guess it's sort of like the "era" in civilization/empire games. This would pace the gameplay, pace the technology unlocks, and set up a hierarchy of progression (something like goals techs milestones objective(s)). I am still unsure about any details, because I will have to design and try things out first. But I am fairly sure that the focus will be these town growth tiers. They will require some conditions, like a number of unlocked techs or population size and likely future things. Technologies will likely become tiered as well.

While likely not for the next update, my ideal plan is that every town tier (besides being a goal itself) serves to unlock a new mechanic and add some sort of meaningful specialization. I won't speculate too much about this because I really have no idea yet. All I know is that I want an overarching "progression" flavour to the game, if that makes sense.

Eventually, I will also expand the residential side of the town. Again, I don't want to speculate, but a natural town progression would imply villager class/caste progression and corresponding residential needs. If my design and plans work, then I can gradually insert these features additively, because they all build up on the same overall premise.

Full changelog

Changes

New background and title
Add label to building work and auxiliary range when placing buildings
Make construction delivery selection weights higher, especially for priorized ones
Add small note to Quarry tutorial that Rocks may not be nearby
Add warning label if placing a building in a location with no compatible tiles for auxiliaries (e.g. Quarry with no Rocks nearby)
Add max range label when placing buildings with movable operation location (however, there is no outline for now)
Add extra labels when constructing buildings during first tutorials
House supply delivery is greatly prioritized over other purposes
Market Square supply is somewhat prioritized over other purposes
Construction sites will follow build order even closer
Add global item distribution tracking and proportions/weights to balance deliveries of different types
Add a tab to item distribution panel for changing global distribution weights on a per-item type basis
Item building proportions (and new global proportions) now use a "flattened" value for counting delivery targets - having many more targets will not "consume" all deliveries
Add "progress bar" indicators instead of a number for weights in item distribution window
Rework the "delivery" number in the top overview tasks tooltip to include potential deliveries (thus signaling lack of carriers)
Add labels to the top overview tasks tooltip
"Tree"s are now known as Maple and Spruce and a generic Tree link explaining trees as a concept when used in descriptions mentioning trees; adjust relevant tooltips
New sprites for Maple and Spruce
Rename "Usage" to "Change" in item report window for clarity
Add toggle to audio options to disable audio when the game (window) is not in focus (in background)
Add target building/road name to villager task description; replace "delivering" with "bringing" and "transferring" for tradesmen doing their own import and export, and to "taking" and "returning" when taking or returning auxiliary building items
Add Food and Supply concepts for description texts; update various tooltips
Operation windows (from bottom left menu) don't block gameplay input anymore and the menu is usable while they are open
Adjust UI button and "block" sprites to be more consistent, pixelated and readable; differentiate clickable buttons from frames; tweak various UI sprites and elements
Esc now closes any active window, otherwise cancels input mode (like auxiliary construction, work location selection, etc.), otherwise clears current inspection, otherwise closes open construction tab, otherwise opens pause menu as before
Add icons to building inspection operation progress bars
Hide items and buildings in windows (item report and item distribution) until they are unlocked
Add gameplay option to show not-yet-unlocked features for adjusting

Fixes

Fix certain scenarios when construction sites would not receive materials
Coal tooltip no longer talks about Coal Maker
Item deliveries are no longer "skipped" due to a lack of immediate carriers and round-robin selection favouring items due to their arbitrary order
Older loaded saves with missing path coordinates will not hang game on busy worlds waiting for paths
Units won't lose their paths (as quickly) on very busy worlds
Animals being led will not lag behind the villager if they are walking quicker on roads
Building workers would not deliver their own output items (only fetch input items)
Loaded saves would not restore Pigs pending being led
Fix inconsistencies for top overview icons not changing when there are moderate issues
Fix location where villagers stand when chopping Trees
Count Corpse as "production" for item report window stats (technically, all deaths produce a corpse)
Memory leak due to a cache list keeping hold of removed entities
Animal harvesting task description saying "delivering"
An exception when a tooltip is being shown but data changes on the same frame in a way that would show invalid values
Volume sliders now use logarithmic formula to fit the actual loudness better
Fix outline for road icons (e.g. construction menu, selection)
Options run in background check using incorrect tooltip
Checkbox control not storing its value
Unit distribution panel wrong text labels


Rudy
Snowy Ash Games


[ 2020-04-27 18:15:28 CET ] [ Original post ]

EA Update #5 - The Delivery Update

This mostly-technical update brings a major rewrite of the game's backend delivery decision-making system. There were a lot of small and larger issues surrounding item delivery, warehouse use, delivery priorities, inefficient routes, carriers idling, etc. At the end of the day, I couldn't solve many of these without adding substantial complexity and processing time. So I rewrote the system to run in a separate thread and be able to handle more workload and thus more logic and future changes I will need.

Key changes

A major change is to civilians. I did not like how their only job is to deliver goods from markets to houses. It sounded cool in theory, but residence deliveries were disproportionately cumbersome in practice. In fact, many players werent clear on when and why they idle. Instead, I made workers deliver the supplies to houses. However, that brought another problem that now half the population is ferrying residential supplies. So I made workers able to carry multiple sold goods at a time:



Civilians are now basically children:



A few players remarked that warehouses (and granaries) don't work well at all. And that's true -- their purpose was cold storage rather than active use or buffers. But I realize that when a player builds a warehouse somewhere between the producer and the consumer, then their intention is likely to buffer the items through it. So the deliveries will now accept retrieving from and stocking to storage based on distance more than necessity.

There are still scenarios where the default logic wont work. So I decided to allow toggling of all the permutations of deliveries for storage buildings:



To illustrate, these work like so:



(And if you see the infinite loop in there, thats the one case that is not allowed; although it also means that you cannot daisy-chain warehouses).

I also received comments about tasks and worker jobs being unclear (not helped by civilians adding their own numbers to the fray). So I converted the text-heavy detailed version into a more streamlined one and excluded civilians completely:



I think I will take this approach in designing tooltips going forward replacing text-heavy explanations with a more visual approach. (This also cuts down on any future translation work.)

Some other small changes include adding change indicators for item report window:



Storage building now show the item they are storing:



Planks no longer break furniture production due to too many construction projects:



In fact, construction and material deliveries are now done on a queue basis:



Selecting a house will now show sentiment over all houses:



And a bunch of other small things.

Future plans

Theres so much else I want to do and fix, but at some point I have to push an update, even if its mostly just fixing existing issues. The backend rewrite took a long time, so I will try to focus on a content update next. I also recognize that there will likely be new issues that I will iron out over time.

My main long-term goals are extending the gameplay length and adding endgame. I already began some work on this, but I postponed it because of the reports and bugs with delivery logic. This is because larger cities suffer from logistics issues and adding content that encourages larger cities will only make the issues worse. But now I really want to get back to this, such as adding stages of city progression.

Full changelog
(including 0.3.1+ stuff)

Changes

Civilians no longer deliver items to Houses, instead regular Workers do; civilians are now children that don't work and just wander about
Workers can now pick up and carry up to 5 items from Market Squares in a temporary Basket (only to the same House, however and one worker at a time)
Fewer Civilians will spawn, especially at the start of the game
Warehouses and Granaries can now toggle whether items are received from and delivered to other storage buildings (in addition or exclusively)
Deliveries--Warehouses and Granaries--are selected to maintain efficiency rather than priority
Logistics no longer uses hard priority for items, but a variety of weights -- distance, item state, destination, etc.
Construction site deliveries are prioritized in the order of placing them (i.e. build queue)
Increase building worker item fetch distance up to 20 tiles
Carriers will take slight priority over building workers when fetching items, but workers will fetch their own items when it's clearly faster
Items left on ground will be delivered with some priority over others; stored items will be delivered with slightly lesser priority over others
Building workers can now fetch internal supply items themselves (i.e. Tools)
Item distribution window now allows setting Plank ratio for construction sites
Many small logistics adjustments
Improve top bar task tooltip overview legibility
Warehouses and Granaries now show their stored item in-world
Add Water Tower for Water storage for (future) emergencies
Selecting any House will show a sentiment icon above all Houses
Add unlock confirmation for technology unlocking
Cloning buildings will also copy the delivery restriction toggles
Profession adjustment window numbers can be adjusted in increments of 10 by holding Shift
Item report window shows growth/decline indicators for all items
Tooltips, tutorials and other text adjusted for new Civilian-related changes
Carriers no longer prioritize output items (e.g. sawmill) over stored items (e.g. in a warehouse)
Add zooming (mouse scroll wheel or numpad + and -)
Add "X / sec" per item production and usage stats to item report window
Bees are now units like animals
Beehives no longer automatically produce Honeycombs, but require active Bees that fly to nearby Flowers and bring back nectar, filling up the Beehive
Workers at a Beehive can spawn the first Bee; afterwards Bees that deliver nectar to Beehive can spawn up to 2 additional Bees
Flowers can be gathered a limited number of times before they need to be replanted and go into short "downtime" after being harvested by Bees
Beehives now show the range that Bees will harvest Flowers
Increase Florist's max work distance and work area slightly
Change Flowers graphic to single flowers; add 3 more variants
Florist now has 3 work slots
Well is now always unlocked
Update Mason sprite, add sprites for active work, add item delivery/retrieval steps, add custom unit animation with sound and particle effect
Increase icon and "button" size in item report window
Brewing Vat now assumes input item ( Barley or Mead) based on selected production (even if it hasn't started producing yet)
Add explanation notes to profession distribution window to bring attention to how the values would impact the game
Bees will continue spawning for full Beehives so they don't "run out" if Honeycombs are not taken away
Bees that successfully return harvest to Beehives will always spawn a new Bee if the hive is close to "running out" of bees
Add version number to pause window

Fixes

Workers will pick more important building tasks first (such as milking Cows over "spawning" new ones)
New Plank construction use ratio prevents Furniture production halt
Building site material deliveries will not try to consume all carriers and break other deliveries
Update Herbalist steps and HUD to show used items properly
Rare error where a Beehive is still used by a Bee returning harvest to it
Rare error where a Ranch worker would attempt to spawn an animal for an Animal Pen where a wandering animal decided to stay
Fix momentary item "drop" when villagers are picking up items; adjust animation to match item elevation; add idle holding item animation while the villager is thinking
Reduce tooltip flicker
Units fetching stored items now properly use the building's "entrance offset"
Many logistics issues fixed
Units that can't find a path within a certain time will gracefully abort and retry path-finding (mitigating being stuck waiting forever in case the path is "lost")
Tavern no longer says that it is "producing" drinks
Graphics option resolution dropdown showing duplicates
Occasional cases of black seems between tiles when moving the camera
Ranch showing auxiliary build buttons for locked animals
Buildings showing empty production and item sections if potential items are still locked
Woolworking now properly requires Herding, without which Ranches can't be built anyway
Multiple restarts or loads leading to game being unresponsive and hanging
Fix building inspection auxiliary building construction button getting improperly selected
Well not unlocked for Woolworking
Fix window header text for victory and save upload windows
Fix food production tooltip value for top HUD food info
Mason not having an operation progress bar in UI
Building workers not positioning correctly for Mason and Well
Fix worker hammering animation offset
Fix building particle effects sometimes not appearing
Brewing Vat always showing Barley as input item
Fix error when a worker aborts harvesting an animal
Rescue animals stuck forever following a worker
Fix error when a Bee is left without a Beehive
Fix Bees not returning harvest
Stop Bees making Cow sounds
Animals won't wander on roads
Florist not planting Flowers to replace Shrubbery

Optimizations

Delivery calculations running in a parallel thread, now with minimal overhead in main thread
Much more efficient one-time entity flagging for deliveries and tasks
Faster and more efficient entity lookup (used all over)
Memory optimization for heavy UIs and tooltips


[ 2020-04-08 14:26:34 CET ] [ Original post ]

EA Update #4 - The Pig Update

Key changes

For this update, the main focus has been on adding animals as proper "units". This means they can move, have animations, make decisions, age and die, and generally interact with the game world.

For now, I added three domestic animals to see how it goes -- pigs, sheep and cows:

Pigs have basically the same purpose, but with the updated interactions:



Carriers will lead the animals from pens to the butcher, scheduled similar to carrying items.

Sheep are used to produce wool clothing:



Cows are used to produce cheese:



Both wool clothing and cheese are stocked at markets and used by civilians at houses.

I have not yet added a proper way to breed and acquire new animals. The workers are able to "spawn" baby animals in animal pens as before. I have some ideas for handling this, but many of them rely on future content (like trading for certain non-native animals).

The new items have also complicated the UI a bit, and I'm not happy with it yet. For example, there are now linen (hemp) yarn and wool yarns, and they are processed separately but in the same building with an intermediate product in-between:



I also added a toggle for relevant buildings to choose the production item (and enable corresponding input items), so that buildings can focus on a specific item rather than process all as by default. Especially, if they are not located at a place where having both chains would make sense. (I thought about making these separate buildings, but opted out to have toggleable production instead.)

I (finally) added a deconstruct tool (X) that allows quickly (un)marking buildings for deconstruction:



I also added an item usage chart section to the item report window that shows how many items are being added and removed over selected time periods:



I've kept it very simple for now and I will likely extend this in the future (it's mostly about UI and doing some maths).

There are a whole lot of other internal and backend things I've been working on that will facilitate further features.

Future plans

I want to add more animals and interactions, including wild animals and hunting. However, I need to make other adjustments to make these viable first. So I'll be adding additional features and backend stuff and adding new animals "on top".

There are certain mechanics I'm not I'm not happy with. For example, I need to redo civilian logic (especially idling) and how they choose and carry items to houses. There are now 12 different items that they have to individually take from market to houses and it's becoming a chore to micro-manage and visualize it all. Similarly, there are 10 house desires each driven by its own conditions. I want to consolidate and group desires and simplify what it means that a residence is (un)happy. And make markets more productive, especially for supplying houses.

I also want to start working on expanding endgame, adding trading and reworking research and goals. But these are all big features that will likely slowly come together over many updates.

Full changelog

Changes

Various buildings are reset/redeployed for loaded games
Change Pigs to mobile mobs/animals (instead of item Pig)
Animal Pens no longer "grow" Pigs directly and Ranches no longer directly produce Pigs as output items
Add Cows and Sheep
Animal Pens house individual animals (Pigs, Cows and Sheep) that wander around the enclosure; workers must prepare the area and can spawn animals there (for now)
Animals will randomly walk around and graze; animals in pens will stay within the pens
Add animal sounds
Pigs are now led from Animal Pens to a Butcher by a carrier
Animals grow over time and only grown animals can be "harvested"
Add Milk milked from Cows
Add Cheesemonger with Curd Vat and Cheese Press; add Curd and Cheese
"Sliver", "Yarn", "Fabric" and "Clothing" are now Linen Sliver, Linen Yarn, Linen Fabric and Linen Clothing
Add Fleece sheared from Sheep, which can be processed at a Wool Scourer with Fleece Tub into Clean Fleece and with Wool Comb into Wool
Add Wool which can then be processed to Wool Sliver, Wool Yarn, Wool Fabric and Wool Clothing similar to Linen Clothing pipeline
Houses now accept Cheese and Wool Clothing as reserves; Food Stalls and Supply Stalls can now stock Cheese and Wool Clothing respectively; add the related sentiment and needed amount for happiness
Buildings with multiple auxiliaries can now support multiple work slots; Ranch, Beekeeper, Carding Mill, Brickyard, and Potter slots increased from 1 to 3
Buildings with multiple outputs or intermediate items can now toggle their production (and corresponding input item delivery); enable this for Ranch, Carding Mill, Wool Scourer, Brickyard, Brewery and Tavern
Add item production, consumption and usage over time charts to Item Report window
Adjust Drying Rack presentation
Replace full "close" buttons with "X" buttons for most windows
Clicking on knowledge section in top HUD overview bar opens the knowledge research window
Add Tool tab to HUD construction menu, and add deconstruct tool for quickly marking building for deconstruction; add shortcut X when not inspecting
Add low disk space warning

Fixes

Villagers always facing left when randomly moving around
Building input and output items duplicating and mixing intermediate products
Civilians idling next to Brewery instead of Tavern

Optimizations

First map generation or load has much faster entity creation for larger maps
Pathfinding runs in a separate thread, now taking almost no time in main thread
Pathfinding checks are pre-calculated on changes only and repeat lookups do not consume additional time on main thread
Post-pathfinding path cleanup/smoothing is now part of pathfinding thread


[ 2020-01-11 17:18:42 CET ] [ Original post ]

EA Update #3 - Patchtastic #2

For the past few weeks, I have worked on mostly backend things and quality of life features, as well as tons of fixes and optimization.



Key changes

A major issue was being able to tell what items buildings have and what is happening with them. So the building inspection window now shows selected building's items. Firstly, this provides a straight-forward "explanation" about how the building processes these items. And secondly, it shows items that are going to be delivered (lighter yellow) and stored items that are pending for pick-up (cyan):



All other places where items appear and are delivered, like houses, construction, or storage, also show the same indicators:



And furthermore, the tooltip for each item "stack" provides additional information about the exact state of items being delivered or scheduled for pickup, including the distance the villager has yet to travel to fulfill the delivery:



Another annoying issue was trying to build "on trees", which is now solved by the builders clearing the area of any trees, shrubbery or flowers first:



Buildings can also be built on top of items, and the builder will move them away before construction. Furthermore, if these items are compatible construction materials, then they will just be directly used for construction instead.

Another nicety is task status icons for the top HUD overview bar that show the active trade, delivery and construction tasks:



A red icon would mean that the tasks are missing villagers and aren't being done.

I also moved the task information tooltip content to this section's tooltip and expanded it to show additional details.

I also added a much easier way to upload a save for bug/issue reports rather than having to manually navigate to the save folder and send the saves:



And a whole lot of other small things and fixes, including several optimization passes, especially for larger worlds.

Future plans

I may have again underestimated the time it takes to fix and adjust things. And I have a long list of tweaks, fixes and QOL features that I need to do. But for the next update I am primarily going to focus on some content addition. As the main goal, I really want to add proper animals to the game.

Full changelog

Changes

Tradesmen can now also deliver their own building's outputs to nearby buildings as input or storage
Building inspection to show its input and output items
Building inspection input, output, stored, material, and house reserve and road inspection material item indicators to visually show pending and reserved amounts and have tooltips list these pending deliveries and pickups for tasks, including delivery distance
Add in-game "soft" pause button and shortcut P
Tooltips only update every second by default
Add gameplay option for tooltip update frequency - periodic (new default) or continuous (old)
Adjust Herb sprite
Buildings can be placed on tiles with items
Builder will move items out of a tile before constructing buildings
Roads can be placed on tiles with items and built "under" them
Buildings and roads placed on tiles with items that are compatible building materials will use them
Buildings and roads can be placed on tiles with obstructing props (trees) and previously-discarded props (shrubbery, flowers) will stay
Builder will remove props from a tile before constructing buildings and roads
Add shortcut X for building and road deconstruction
Population overview tooltip to separate number of idle vs carrier workers and also show these numbers for civilians
Remove Tool label from top overview
Add task status icons and label to top overview
Move task info from population tooltip to task tooltip
Expand task tooltip info with additional details and numbers
Top overview labels to update continuously periodically
Add "bug report" button to save/load menu that allows directly uploading a save

Fixes

Incorrect road pending construction material counter
Housing goal requiring more villagers than the houses that it requires can provide
Lumberjack occasionally not cutting trees when using operation location
Fix Ham description
Crowded villagers getting stuck idling in a tile between finishing a task and reporting for the next one if there aren't compatible nearby locations to avoid crowding
Idle villagers shuffling around will not choose inaccessible tiles (water)
Villagers previously stuck in inaccessible tiles (water) will be teleported to nearby valid tiles on load
Typo in tutorial text, in Medicine description
Fix Water not being unlocked by Bookbinding or Brewing
Fix building inspection arrow not appearing in correct location when some items are not yet unlocked by technologies (for example, Brewery before Beekeeping)
Fix villager path-finding skipping certain tile points and in rare cases causing path-finding to fail
Some villagers taking a very long time to choose the next task after having juggled idle tasks
Lack of carriers causing items to (not) be delivered based on item type and ignoring delivery priority
Fix P shortcut for pause not working
Fix typo in controls info window
Building and road pending material indicator/tooltip saying that an item is being delivered, when it's only queued
Rare profile loading failure due to data conflict
Forester not planting trees on Shrubbery or Flowers
Task tooltip not grouping workers that are delivering/retrieving items as workers
Restore the flag on the Town Hall
Invisible sprites due to off-screen optimization issues
Top overview villager count won't show the second limit number past 1000 and won't badly wrap when reaching high population
Brewing Vats not switching production
Paper Rollers using twice the amount of Paper Pulp
Rare case of tree being still used after it's removed when workers aren't available to chop it immediately
Occasional conflict between construction clearing tasks and regular tree chopping tasks using the same trees

Optimizations

Faster thinking for villagers going to building positions
Faster villager animation and other moving entity updates
Much faster carried item updates and rendering
Faster entity lookups with less lagspikes
Building task checks with less lagspikes
Task searches with less lagspikes
Villager path processing slightly faster and with much less lagspikes
Saving and future loading larger saves is slightly quicker
Entities off-screen are not visually updated until visible (panning camera is slightly slower than idling, but still faster than idling previously)
Less entity logical animation overhead
Idle input processing more efficient
Skip redundant entity transformations (rotation, scale)
Faster entity ranged lookups
Reduce save size slightly


[ 2019-11-09 15:48:39 CET ] [ Original post ]

MicroTown EA Update #2 - Civilians

Key changes

For the past few weeks I have been working on adding civilian needs to MicroTown, among many other improvements. The population is now divided into workers and civilians. Workers will continue as before -- carrying items, constructing things and working at buildings. However, civilians will not do heavy work and will instead supply houses with items from markets -- food, firewood, medicine, etc. Several new items and simple early production buildings have been added to that effect. Clothing finally has a use!

Each villager is now assigned a residence at a house:



Markets have been repurposed. Civilians will come to markets, where food and supplies are delivered:



They will take these supplies to houses, where they will be stored as reserves and gradually used up:



This also brings a large change to how happiness works, which is now primarily based on how well a house is supplied:



Each house will provide one or more (un)happiness points, depending on resident sentiment, which is mainly fulfilled by keeping the residence well supplied.

This means most existing villages will end up unhappy until the new supply chains are built. I decided not to penalize high unhappiness yet any more than the previous small reduction of worker operation speed. However, extreme-size villages may not make it past this update without making the mortician very busy.

The tutorial has been updated to include housing and market explanation.

Many other improvements were added. For example, workers will fetch their own input items if there's no one closer or carriers are busy:



Many usability thing are added, for instance, I'm working through the tooltips and trying to make them more understandable and explanatory and to avoid "hiding numbers" from the player:




Reflections

Adding this civilian feature set turned out to be a much larger endeavor than I expected and took 2 weeks longer than I wanted. Partly, because I was also adding a lot of enhancement based on feedback. And partly because it was a pretty large feature that I should have likely split into a couple smaller updates.

Future plans

There are still many improvements that I need to do. I will likely work on adding various report tools (like production rate overview) and quality of life improvements (like manually clearing forests) before other stuff. After that, I want to do another content update.

Full changelog

Changes
* Separate Worker and Civilian villagers (villagers working at buildings are now called "Tradesmen" instead of "Workers")
* Houses now have 8 resident slots that get occupied by villagers and are shown in building inspection HUD
* Add Woodcutter] (with Chopping Block) and Firewood unlocked by default; add goal
* Add Carpenter] (with Carpentry Table) and Furniture unlocked with Carpentry; add goal
* Add Potter (with Pottery Wheel and Pottery Kiln) and Pottery unlocked with Pottery]; add goal
* Bricklaying now also requires Pottery
* Warehouses can now also store Firewood, Pottery and Furniture
* Houses now have residential supply item stores for all food items and Firewood, Pottery, Furniture, Clothing and Medicine that are shown in building inspection HUD
* Tavern and Market Square no longer provide global happiness
* Market Square now serves as the parent building for individual stalls
* Food Stalls and Supply Stalls now supply a selected residential food or supply item respectively for Civilians
* Civilians "work" at Houses, bringing food and supplies from markets
* food is now consumed by its residents from Houses first; understocked and homeless villagers will consume food items "directly"
* Food consumption and production info in food tooltip
* Remove requirement for minimum distance between Taverns and Market Squares
* Houses now have a sentiment for each various factors, like having food and supplies
* Additional sentiments unlock when corresponding techs become available and sentiments become important to residents once the house is supplied for the first time
* Total sentiment in a House awards or deducts happiness for the village
* Happiness is now primarily based on the total sentiment of Houses
* Tavern now provides a sentiment point for nearby Houses and uses drinks proportionally to the number of nearby residents
* New villagers spawn from Houses (or Town Hall if there aren't any houses)
* Town Hall no longer provides housing, but initial population does not require housing to spawn
* Villager spawns faster in larger population towns and will not spawn if housing, food or happiness threshold is not met
* Villager happiness from population increases in "brackets" as population grows; shown in population tooltip
* Top HUD overview bar no longer shows Clothing
* Deliveries now have better internal priorities, for example items for processing or items on ground are now chosen first for deliveries
* Tradesmen at buildings will now fetch their own nearby input items for the building if they have nothing else to do
* Stored items (like at Warehouse) now shown as icons instead of text
* Brick and Glass production buildings are now in resource building tab
* Shift-building copies now also copies the storage item, like for Warehouses
* Monument now also needs Bricklaying and Glassblowing
* Arborist and Smeltery now have more worker slots
* Victory window shows total play time
* Items now shown in a single inspection box
* Various sprite and text adjustments, various UI tweaks and layout adjustments
* Item in-world stack sprites now visually show only up to 3 items
* Add tutorial steps to include Market Square construction and related features; tweak wording
* Tutorial arrow now point to in-world building for steps that need such selected
* No parent building in range reported as issue for auxiliaries
* Idle villagers will spread out instead of grouping up in large numbers
* Idle villagers mostly walk instead of run

Fixes
* Building deliveries being chosen by carriers closest to the building rather than the (closest selected) item
* Saved game times not being shown in local time
* Items rarely being ignored when differently prioritized for delivery
* Delivery proportions not adjusted when only one building at a time requested items
* Delivery proportions incorrect entries after loading older saves
* Starting to deconstruct and then cancelling for buildings with multiple production items (like Garden Plot) would have the production item record stuck
* In rare cases, a random consumed food item could stay reserved
* Goals with item consumption not triggering updates
* Mead to only unlock when both Brewing and Beekeeping are unlocked
* Error when moving mouse across tiles while confirming operation range range

Optimizations
* Faster item and building lookup for large quantities
* Faster delivery task assignment for large number of requesters
* Faster compatible worker search with many tasks and workers
* Slightly faster save loading


[ 2019-10-10 19:39:02 CET ] [ Original post ]

EA Update #1 - Patchtastic

It has been a busy time since the Early Access release on 30th August. I have received so much feedback and suggestions! And so many people have made videos and held streams. You guys are amazing!

Key changes

For the past two weeks, I have been fixing bugs and issues as well as adding most pressing quality of life feature requests. All in all, 14 patches were uploaded.



Among the top feature requests was the construction task priority toggle:



In fact, the construction HUD received a full overhaul to clearly show the progress and used/available/needed materials:



Similarly for deconstruction, which now reclaims some of the used building materials:



Both construction and deconstruction can now be canceled/reversed at any time and will account for progress and materials proportionally.

Other important feature interactions were changed instead; for example, you could previously Shift-click on an auxiliary building button to enable/disable that production:



But this wasn't obvious and required the player to fully read the button's tooltip. So I added a distinct toggle instead, which should be much more intuitive (and also turns green if compatible buildings are in range):



A lot of tooltips received improved information, such as the population summary listing a breakdown both by occupation and by task purpose:



This is still a very high-level overview and lots more work needs to be done to provide feedback on individual villagers.

A bunch of gameplay additions were also included. For example, a proper Mortuary and Graveyard for the deceased villagers:



Higher road tiers have also been requested and are now available, including an easier upgrade (you can also just "build" over old roads and it will upgrade instead):



And let's not forget the permanent speed-up toggle (Tab can still be held to temporarily speed up or pressed to toggle):



Future plans

I believe that a balanced long-term expansion and a more realistic civilian needs system are the most needed goals. Currently towards the end, materials simply stockpile, food is a non-issue, and majority of villagers just stand idle, while happiness skyrockets. Villagers are perfectly happy with their houses being cramped together in a giant patch with the nearest tavern 50 tiles away while food magically teleports to support them. In other words, changes will be coming to address unreasonable village logistics and layouts as well as balance higher population needs and (non-existent) resource usage.

Full changelog

Changes
* Building output items are now in separate stacks by item type (no more clogged up outputs)
* Framerate capped to 120 by default
* Added VSync toggle option, disabled by default
* Add separate building inspection auxiliary building toggle (instead of Shift-click)
* Tree Nursery minor update
* Add unit breakdown by profession to population overview tooltip
* Added toggleable construction (and material delivery) task priority in building inspection
* Clearer construction material info in building inspection
* Construction progress bar in building inspection
* Add Mortuary and Graveyard to bury Villager Corpses
* Shift-building did not set production item causing crashes
* Shift-build allowed placing copies of unique buildings
* Hidden goal display would not show complete goals for claiming
* Glassblowing not unlocking Sand
* New game window tutorial dropdown showing "Yes" when locked
* UI scaling graphics option (auto by default)
* Add Mead
* Construction and deconstruction of buildings and roads can now be canceled/reversed at any time
* Buildings and roads return a portion of materials when deconstructing
* Add Stone Road and Brick Roads unlocked with Roads knowledge
* Add road upgrading to higher "tiers" (including directly building on top)
* Add permanent speed up toggle in HUD and short Tab press to toggle
* Add update summary window when loading an older save
* Remove "display locked features" option
* Various sprite tweaks

Fixes
* Wrong info in some tooltips
* Tutorial arrow stuck between worlds
* Auxiliary building disable toggle not working for non-built buildings
* A couple rare crashes related to items at buildings
* Invalid production item in buildings due to version conflict
* Crash when units start idling after a job too close to the edge of the world (mostly on small maps)
* Buildings not updating values between save versions and potentially corrupting saves
* Catch and remove phantom objects like already-chopped Trees persisting through saves
* Extra objects like flag persisting through transitions
* Music starting to play on entering game when disabled
* Framerate was capped to auto-enabled VSync
* Abrupt window background blinking, smoother window transitions
* Items believing they belong to a phantom building between saves
* Minor tooltip typos
* Forester not planting more than 1 Tree per tile
* Items getting dropped from buildings between saves
* Goal HUD broken for matching goals between worlds
* Remedy attempt for a few crash cases
* Villagers occupying building worker slots thinking they need to observe minimum carrier limit
* Minimum carrier check ignoring idle (i.e. available for delivery tasks) units
* Multiple tasks at once over-assigned over the unit limit
* A delivery task marked as work task
* Buildings that need all auxiliaries (like Beekeeper) allowing auxiliary toggle
* Building inspection auxiliary button clickable area outside expected bounds
* Hide objective display once complete
* Units forever idling when surrounded by blocked tiles (like buildings)
* Workers of similar clumped buildings with multiple auxiliaries (like Carding Mill) would get stuck not doing anything
* Some items ignored for certain uses between reloads
* Forester would not plant different Trees together
* Incorrect sprite lookup for some buildings between saves
* Confirmation window passing through input to windows below
* Buildings keeping incorrect disabled production list (and toggle not working) between saves
* Buildings not keeping items properly stocked, like the Brewery, between saves
* Building not accepting deliveries between saves
* Rare delivery task assignment hang/error with many items for competing tasks
* Toggling production on storage buildings like Warehouse could fulfill construction materials
* Buildings under construction could get stuck if the builder leaves
* Previously-built roads before their time reverted back to dirt roads
* Woodcutters chose closest tree to custom operating range center instead of the building itself
* Windmill sails not spinning

Optimization
* Reduce memory juggling in some hotspots

Rudy
Snowy Ash Games


[ 2019-09-12 13:35:17 CET ] [ Original post ]

MicroTown is now in Early Access!

I'm happy to announce that the early access version of MicroTown is now live!



It's been a really busy time getting the game to a playable state. There is still much to be done, so I'd like to hear your feedback on the Steam forums, Discord or otherwise.

Rudy


[ 2019-08-30 18:05:28 CET ] [ Original post ]