Interactions!

This week was a little bit painful. This little addition called for pretty substantial reworking of both pathfinding and map logic, and all because the resource piles are both obstacles and something you'd want to be able to interact with.

On the bright side, game logic is now pretty much decoupled from most of the rest of the game, and I thought I'd throw in some basic sound effects while I'm at it. Behold!

Ideally, when an object gets removed from the map, it should fade out rather than just disappear like that, but I'll save that until I've got sprites to fade out in the first place.

Next up — proper resource management. I have some static placeholder sprites and sound effects prepared, now to get some tiles and generic music.

Kingdom of Ithear

Ithear (ee-THE-ar) is a kingdom on the western shores of Ishon (EE-shon). It is the largest state on Ishon and is inhabited almost exclusively by humans.

In the year 1227, previously small and peaceful kingdom of Arrath turned to theocracy under the rule of king Cassius the Pious, who has established himself as the Patriarch and started the Ithearian Conquests. The Conquests lasted ten years, until in the year 1238 king Lionel the Uniter has annexed the last of the eleven provinces of the Itherian Empire.

Now, Arrath is the capital province of Ithear, though it is sometimes subdivided into North Arrath and South Arrath along the river Faeran (fah-er-AHN), mostly for the sake of being able to say that Ithear consists of twelve provinces. Capital of Ithear, Faereth (fah-er-ETH), then ends up on that division line.

The province of Uther, named Demakh before its annexation, is the most restless of the provinces. The duke of Uther is on good terms with both neighboring dukes and queen Flavia herself, and was invited to Arrath on a few occasions to advise at the royal council. There are rumors of another insurgence brewing in Uther's many abandoned mines, but the duke of Uther staunchly denies them all.

Ithear doesn't get along well with neighboring nations. Reasons for that are many territorial disputes in the aftermath of the Conquests, and general attitude of Ithearian nobility towards non-humans and heathens.

Schools of Magic

Let's talk about magic and spells.

Being a fan of the four classical elements, I am very much in favor of keeping Water, Earth, Fire, and Air as the schools of magic. But to avoid any of the schools being inherently superior / inferior to others, each can be assigned its specific role.

What is magic usually used for on the battlefield? Well, virtually anything, but as long as we're fitting stuff into boxes, let's split them into Offensive and Defensive spells. On the other hand, by the nature of the spells, they can be used to strengthen friendly units or weaken enemies. Both of those can be used offensively and defensively, so I think it's fair to say we got ourselves a new axis, Buffs / Debuffs.

In general, an offensive spell lets you deal more damage, and defensive one will let you avoid or revert damage. So an example of an offensive debuff would be something that lowers the defense of an enemy stack, and an offensive buff would be something that increases speed of your units, allowing them to get closer to the ranged enemy units. You can see where I'm going with this.

Font: Morris Roman

So if we want to assign each school something it would focus on, we can borrow a bit from our good friend Aristotle and divide them like so. I think it's fair to say that Air with its speed and lightnings and Fire with its... well, fire plant themselves firmly on the Offensive end of the spectrum, which leaves slow and sturdy Earth and gentle Water on the Defense. Power of healing in Water and, once again, speed of Air put them closer to the Buffs than Debuffs, and the abilities of Earth to slow enemies down and raise walls and Fire to hurt them (not necessarily in the damaging sense) edge them towards Debuffs. Notice though that the focus of a particular school doesn't mean it can't do other things; for instance, Earth magic buffing defense, or Water spells inflicting cold damage.

There are also certain spells that, I think, shouldn't be tied to any particular school, as they utilize "pure" form of magic. Things like Magic Arrow or Dispel Magic can have their own little category.

Another thing that I think is worth talking about is Mass spells. Any HoMM III player knows that Mass Haste and Mass Slow are among the most valuable spells in your spellbook, simply because they consume tiny number of spell points, but produce great results. In HoMM II, on the other hand, Mass versions of the spells had to be learned separately from their basic counterparts. I think, those two solutions can be combined. A hero with high enough X Magic skill and Wisdom (speaking in HoMM III terms) that knows basic version of a spell will find a Mass version in his spellbook as a higher-level alternative. So he can cast a basic version for few mana points, or Mass version for many more.

And Now It Moves

And so, quite a bit more groundwork has been laid. There's your basic animation, mouse interface, and a few more pieces of API for pathfinding and drawing. You can make Kaz move and stop, change direction, all the sweet stuff.

Do you see how yellow cell shading lags behind Kaz? That's how the Map object sees the scene. You can't stop Kaz moving midway between two cells, so Map only updates when Kaz has reached the one he was moving towards. That's when Kaz's Path updates, too.

Next up — interacting with objects on the overworld map. Let's pick some gold up!

Focus & Intellect

Let's talk about hero ability scores.

Each hero has four primary abilities: Offense, Defense, Focus, and Intellect. Offense and Defense, also known as Might skills, are added to corresponding abilities of the creatures. Focus determines power of the spells cast by the hero, be it damage, duration of status effect, or something else. Intellect determines how many mana points a hero has at a maximum. These two are called, unsurprisingly, Magic skills.

The idea is to go back to HoMM II ideas of having one type of hero per faction, which means factions will be more or less specialized in one of the two sets of skills. This can cause problems.

A Barbarian with a full week's worth of units should be able to stand his own against a Wizard with week's units and her powerful spells. Now imagine the same Wizard's clone with a week's worth of Barbarian units. Greatly more powerful. On the other hand, a Barbarian commanding Knight units will get more damage out of them than a Knight ever could.

This can be solved by abusing synergy, making Barbarian creatures weak on their own and relying on the hero's Offense and Defense, but you can probably already tell what I think of that solution.

All factions' units can be made balanced overall, with assumption that the same hero is running both armies. This isn't great either, as it makes the factions less distinct. After all, it only makes sense for Barbarian creatures to have better Offense than Wizard creatures.

Instead, I suggest strengthening synergy between hero and creatures of the same faction, and impairing it when factions differ. Normally, creatures under command of a hero of different faction would get a Morale and Offense/Defense hit. High Focus will help with control of Might creatures, reducing the penalty, and high Intellect will do the same for Magic creatures. (By the way, when I say "Might / Magic creatures" I don't mean the faction they belong to. That distinction is decided case-by-case.)

I know what you're thinking. Yes, that still leaves Wizards (who will have high Focus and Intellect) able to command basically any army. My reasoning is this: Might heroes are good on their own, and as such are a greater threat to the overall balance. Magic heroes, however, require Magic Guilds to equip them with spells in the first place, which a Barbarian player that hires a Wizard hero will be hard-pressed to find.

Pathfinding

Booyah! I may be overly excited for this, but cut me some slack, I'm pretty new to this.

So yeah. Pathfinding. Each time the map changes, each hero's pathfinding component will recalculate costs and paths to each cell. That shouldn't happen often. In fact, far more often the cursor will move and have to show how many days it will take to reach the cell it's hovering over.

The hero, whom I shall dub Kazimir (or Kaz for short) from now on, cannot yet move. That's the next step!

These posts may be cutting the development a bit too thinly, but I think it's going to be great seeing how far this game has come in the end, and having all these screenshots from the very beginning.

It Begins

After a few months since posts on reddit and Celestial Heavens, I am feeling confident in actually starting a devlog. I mean, look at this beauty!

Well alright, it doesn't look like much, or even do much, but there is a lot going on in the background. I'm actually fairly proud of the ECS system I've got going on. No, it didn't take me five months to make that, although the source already spans 27 files, despite my intentions to keep premature abstraction to a minimum. I was drafting the GDD for most of that time, which is very helpful for keeping my priorities in check.

I was going to make this project crowdsourced, but I'm not sure about that anymore. I will release the source on github once I'm comfortable with it, for all to see, judge, and submit pull requests.

End goal for phase 1: something remotely playable. A hero, couple creatures, town screen, combat.