Week 43 Sowing

08 Jul 2020

Sowing Seeds video Sowing Seeds

This week has been all about farming and the cold, bleak winter music. Back in week 24 when I was adding stockpiles, I mentioned the job-system needed refactoring. While adding farm-jobs I found myself about to duplicate behaviour that the existing job-system already did. So now is the time to do that refactoring. The plan is to organise collections of jobs into providers. Each provider is keyed on a responsibility so that when prioritising of responsibilities per Dwerg is added the system will support that. Parts of the existing system can be shared between providers and parts can be moved into a general provider. Move jobs are an exception as they take priority over all others. My first step in doing this refactor was to add comments to each function indicating what needs to be done. This game me a refresher on how the current system works and allowed me to think through the new system. I’ve since extracted the move-job-provider and all the tests pass, so the next step is to make the general job-provider.

To help Frans balance the combat audio I made a short trigger and script that continuously spawned dire-wolves. It was encouraging to be able to use scripts for testing in development. While doing this I added a bear behaviour to attack dire-wolves, they are notoriously natural enemies.

Over the weekend I continued work on the flex-box implementation in my UI system. I’m developing this using TDD as an exercise. The UI system does not have any tests around it as I, mistakenly, thought that unit tests around UI code is a bad idea. I think that is true for producing UI with a system because the product is entirely visual. Developing the system itself can be done with very simple elements so unit tests are a quick way of verifying behaviour. The next time I do some UI work that uses my flex-box-layout I’ll let you know how successful it is.

We’ve finally decided to loop the background music continuously rather than just play it once per day and night. Frans has finished the winter music and it has made me really want to develop the weather system further so we can have snow. I’m going to restrain myself here as the current goal is to make the game fun.

Farming work has started with three different crops; blueberries, oats and potatoes. Blueberry seeds are now dropped when a Dwerg eats blueberries and they can then be planted. These three crops are each an example of fruit, cereal and vegetables respectively and they each behave slightly differently. Fruit can be eaten immediately and the plant remains after harvesting. Cereals and vegetable both have multiple tiles indicating their growth with the final tile being specific to the type of crop. Cereals are removed when harvested and must be processed to get seeds and food. Vegetables provide seeds when harvested and some of them will be immediately edible while others will need to be cooked. For this first implementation of farming only blueberries will be useful as the processing and cooking are not currently possible.

For the next week Frans will be working on night-time variations of each of the seasonal music tracks. I’ll be finishing off the farming and extending the second tutorial to cover it. There will be a new release next week so I’ll also be fixing the release pipeline.

- Jock

Enter your email to receive a summary of new features whenever a new release of Dwerg Saga comes out. Between 1 and 3 months.


This website uses cookies to anonymously track traffic.
Privacy Policy