This smaller update adds fish animals and fishing to the game.
Fishing
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".
Path-finding
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.
Other changes
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.
Future plans
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.
Full changelog
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 17:34:18 CET ] [ Original post ]