I've spent some time yesterday evening and today thinking about how to deal with this "humans versus demons" feature. I'm boiling it down to this: you have an army, which is a collection of soldiers of various types. The demons also have an army, but it's represented by a simple number, the army's strength.

Once every few turns (currently, 3), the demons will send their troops your way, and a fight will ensue. If your army is stronger than the demons, you win, you can keep on. If your army and the demons' are of nearly equivalent strength, you'll lose a few soldiers randomly. And if the demons army is much stronger than yours, you'll lose your village, and thus lose the game.

Now, this morning, because I knew I was going to be creating soldiers sometime today, and I knew that would require some iron, I added that resource to the game. Of course, I also added a building to produce that iron: the mine.

screen_04.png, mai 2020

I moved on to the army work by creating a very simple type of soldier, the infantry, with a strength of 1. You start the game with 5 infantry. Each turn, they eat one of your precious food rations — but other than going into negative food, nothing happens yet…

Then I added a demons army, whose strength goes up every time it attacks you. My function to compute the demons strength is very basic so far (x + cos(x) where x is the turn of the next attack), and it will need a lot of love to make the game challenging while being rewarding at the same time. I intend to spend a full day on balancing the game, probably on Friday.

After a bit of UI work to show all that information better, here's what I ended up with:

screen_05.png, mai 2020

Now, what is a game without challenge? A toy, if I remember correctly what Jesse Shell wrote in his The Art of Game Design book. And I'm not one to build toys, no good sir, no my lady! I want to build games! So, challenge.

The first thing I did to challenge you when playing my game is to have your soldiers die of starvation if you run out of food. The death is random, taking the common soldier as easily as it takes the war veteran. Every time you fail in feeding your soldiers, some more will die: first 1, then 2, then 3, and so on.

But soldiers can also die when they go to battle. I believe that is the main risk of war. Arguably that's the main risk of life, but let's not talk about that now… Anyway, your army is going to be attacked by the demon army every three turns. When that happens, I compare the strength of your army with that of the demons. If yours is largely superior to theirs, you win and none of your soldiers perish. If your army is largely inferior to the demons, then you lose your village, and at this point, that means you lose the game. If armies are of comparable strength (meaning they are in a 20% variation of each other), then your army will take some casualties based on the strength difference.

With the game as it is at that point, you can only hold for 12 turns. Then, inevitably, you will encounter…

screen_06.png, mai 2020

If we're going to win this war, we will need soldiers! And where do we train soldiers? In a barrack! That is what I did next (among with a bunch of UI tweaks), and it took a while longer than I anticipated. I added a new building category, separating them into "production" or "military". The barrack can be built, and if you click it you can see what it's supposed to produce. But… you can't train any soldiers yet! Damn you time! Why do you pass so quickly?

screen_07.png, mai 2020

Click that "Recruit" button as much as you like, it doesn't do anything.

Well, at least I know what I'm going to do tomorrow morning… Because that's where I'm stopping today! Few, that was quite a day! After about 8 hours of coding, I almost got where I wanted to be. Once again, the code is online on GitHub: adngdb/village-builder. And you can play my latest build here: Play Village Builder - Day 2 Build.

/me can't wait to recruit soldiers to bash those demons into the ground.