Update 2/9/2018 - Farming and buildings


Just occasionally, work is super light, I'm inspired, and things come together nicely. So a LOT has been accomplished this week!

Tooling

  • I only just noticed that my "open source developer" license with JetBrains includes Resharper C++. I added it to Visual Studio. It's a little sluggish, but it is *seriously good stuff*. Inline warnings and the improved Intellisense are fantastic. :-)
  • After a Twitter discussion with /u/Kyzrati, I installed Very Sleepy. It's a pretty capable little profiler, and gave me some good insights.
  • I tried out the new C++ Modules system, and promptly undid my changes. It worked ok, but the tooling isn't there yet - ixx files don't get syntax highlighting, let alone Intellisense, and all the tools other than the compiler report that `import`ed modules aren't present. Needs more cooking!

Back-end Work

  • I found an issue that the ECS wasn't garbage collecting at the right time (a refactor left a line of code not running). This fixed a couple of *really* hard to debug issues with jobs not repeating correctly.
  • When you have a designated job and your tool wears out, you select a new one if they are available - or lose your job designation if they aren't. So it's worth keeping picks/axes/hoes on hand in the long term.

Misc. Changes

  • NPCs are much less likely to spawn in a river and immediately drown (or become REALLY good swimmers).
  • Trees that were hit by your crashing spaceship are destroyed at the start of the game, spawning free wood logs. Hey, it's free wood.
  • Mounts now drop dung. So enemy cavalry can literally poop on you; fortunately, it makes good fertilizer.

Farming

The bulk of this update has related to farming, which has been on my radar for a *long* time. There was some old nasty code in the farm system, and that's been given a thorough makeover. I also solidified the process, and made farmers the busiest members of your settlement.

Vegetation follows a cycle (run every night, only on tiles with vegetation):

  • Check to see if it has received light - and if it cares (mushrooms and their ilk don't photosynthesize). If it cares and hasn't received light, it goes backwards in growth - eventually withering and dieing.
  • Calculate a "growth rate". It's typically 1, but being fertilized can make it 2. Farms that haven't been weeded or watered can go backwards.
  • Plants add the growth rate to their "ticker", and check the lifecycle of the plant growing there (grass grows fast, strawberries slowly for example). If the ticker exceed the lifecycle days count, it moves to the next phase of growth (they go germinating -> sprouting -> growing -> flowering). If a plant just finished flowering, it is knocked back to a cycle determined by the plant type (some plants die after flowering, some don't).
  • Plants that are part of a farm and hit a harvestable state are automatically given "harvest" jobs.

Farming has been broken down into several interfaces and jobs:

  • On the "Jobs" menu, you can designate people to be farmers. Farming is now Wisdom-based.
  • On the Designation->Harvest menu, there are now two tabs: harvest and farm. Harvesting lets you select any plant on the map for harvest. Farming lets you designate a tile as a farm, selecting from the available seed types (and not letting you try to plant more than you have).
  • The "harvest" job (automatic for complete farms, manual for naturally spawning plants) sends the farmer to the target tile, knocks it back to "germinating" and spawns both seeds and a plant result (grass gives hay, strawberries give raw strawberries, hemp gives weavable fiber, etc.). There's 80+ types of plant (picked by biome), so lots to choose from.
  • When you first designate a farm, a "ploughing" job starts. The farmer goes to the tile, and harvests any plants that are already there. The tile is then cleared of growing vegetation. It then goes to either a "fix soil" or a "planting" job depending upon the tile material; materials that aren't soil/sand have to be "fixed" first.
  • If a tile needs "fixing", a "fix soil" job runs. The farmer picks up topsoil (a result of mining soil types) and converts the tile to soil. It then goes to a "planting" job.
  • A "planting" job sees the farmer collect the seeds, and spread them on the target tile. The tile is set to "germinating" of the appropriate seed type.
  • Plant growth is slow, but you can speed it up with fertilizer. Currently, you can make fertilizer (manure) by combining animal dung with hay (at a new Dung Heap building). Farmers will automatically fertilize growing farm tiles if fertilizer is available.
  • Farms need weeding; every night the weed ticker increases (if it gets too high you can lose your crop). Farmers will automatically visit growing farm tiles and weed them.
  • Farms need watering. This is currently the same mechanic as weeding, but that will change once weather (rain can automatically water for you) and drinking (which brings fetching water) are in place.

Building Improvements

The farming update went by faster than I expected, so I started on what was planned for next week - fixing up the buildings system. If you've played the pre-alphas to date, you will have seen that while building worked, it was far from a slick experience - and all manner of little issues plagued it. Buildings were one of the first features to be implemented, and the code has been hacked/twiddled-with throughout a number of systems changes. My goal is to clean it up and make it bullet-proof; I'm about half way there.

  • Buildings with a dimeonsion of 3 were shifted 1 tile left/up (so you are selecting the center). Unfortunately, it happened in various places that didn't quite line up. This has been fixed, and buildings appear where you click.
  • There are some buildings that aren't realy buildings (floors, stairs, walls, ramps) - they turn into terrain when constructed. These now correctly assume the material of the building components; other buildings do not alter terrain (no more pink blob underneath buildings).
  • Separated the CONSTRUCTION tag and `building_id` element of tiles. The tag is meant to indicate "this is not natural, render it as smoothed" - but was preventing building placement on nice floors.
  • Tooltips are now in color and have icons.
  • Info window tells you all about a building before you construct it, and also shows you the buildings you can't currently build and what they need - so you have an idea of what to aim for.
  • Building design mode now displays the "1 layer, flattened" display that mining uses. It also shows "open space" as a selectable tile. This makes it possible to build floors over open areas (to bridge a river, for example).
  • Did a whole bunch of logic work on the building AI, to handle cases where "building can't be built now, but can after you finish that floor," "it's ok to path to an adjacent tile rather than standing on the thing you are trying to build," and similar.
  • Started going through the building definitions, cleaning them up (removing stuff from old versions), making sure the sizes are correct, ASCII views are consistent with voxel views, and writing descriptions. All ASCII models are now made in REXPaint. This isn't even remotely finished yet, but you can now build everything.










Files

nox-futura-windows-pre-alpha.zip 49 MB
Version 4 Feb 09, 2018

Get Nox Futura

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.