Category Archives: Free Company

Warhammer, Mafia and endless winter


Somehow it’s mid-April already and this blog has been growing a little neglected. The past month has been filled up with a pile of things other than working on Free Company, so that I can barely recall what I was doing on it last time I worked on it. Such is the chaos of life, we’ve had Ofsted inspections, blocked exterior drains, a mini Warhammer tournament and most recently I’ve been distracted by working on a helper utility for people who want to run variants of the party/forum trust game Mafia.

Last time I was talking about building a notification system for Free Company which is something I went ahead and did, you now get popup messages when you’ve finished researching lores and that kind of thing which helps keep you informed about what’s going on in the strategy layer. Some of the notifications are pretty elaborate; like the one you get after fighting a tactical battle  but most of them are fairly simple affairs and it’s easy to add more of them should the need arise.

Then I worked on the path-finding code again so that it could properly take account of the ‘zones of control’ around players and not try to navigate through them midway along a path as was happening before. Zones of control also became a much more interesting part of the combat system in that, now, if you try to leave one the owning player will get a free out of sequence attack against you. In practice this gives players a strong incentive to leave their mercenaries that are in close combat, in the fight and not run them out of it.

The lore system became ‘structurally’ complete in that you can now properly research every one of the planned technologies and they properly unlock when you obtain the correct prerequisite technologies and items. None of the technologies actually have any other game mechanical effects yet but we’re halfway there.

So that’s Free Company. I then spent an inordinate amount of time assembling, gluing & painting miniatures for a planned Warhammer mini-tournament against my brother. Warhammer is a game of fantasy table-top battles, there are hundreds of miniatures per side and they fight in large ranked units through a mixture of dice rolling luck and strategic calls made during the game over unit positioning and so on. I had a goal to try and make two completely painted armies this year after our tournament last year with two ‘fresh from the box’ unpainted sets that come with the Warhammer starter set. Unfortunately I didn’t quite manage to make it because damn, there are a lot of Skaven in a functional army, but I was definitely over halfway there with almost every unit having some painted stuff.

I won’t reveal the results of the tournament here because that will be the subject of a couple of lengthy battle reports with maps when I get the chance to make them.

Then we get to Mafia Helper. This is a utility I started tinkering with back in February after participating in particularly elaborate version of the game and getting a sense of how hard it is to balance games of this type due in part to the large quantity of variables but also due to the psychological variables of a trust game. So I decided to build a simulator that could attempt to run thousands of test games of Mafia with a given setup of players, teams and special powers and produce some odds on how likely each team in the game was to win. The idea is then to expose the ‘psychology’ variables so that each game runner can adjust them in line with his or her feelings about how players interact and gain or lose each other’s trust. So far I’m about halfway through the initial planned feature set from working on it here and there in between everything else.

The tool is also serving as a way to make a series of improvements to the cross program UI Library I created for Free Company. Mafia Helper is entirely UI so it serves as a great test bed for the kind of more complicated UI elements I use in Free Company without the chaos of Free Company’s other code getting in the way of debugging. I’ve already managed to make a couple of big improvements to the UI system that finally squashed an annoying bug with flickering  in UI elements that’s been in the code for possibly years, and there has been a host of smaller improvements to the functionality of the generic elements like buttons, text boxes, tool-tips and scrollable lists that help make the UI feel a lot more solid.

Finally, a word on the endless UK winter which has finally broken this week. Good riddance.

Real Time and Technology trees

Is what I’ve been working on recently.

January is an exam heavy month so a lot of time was spent outside of the office working for cold, hard immediate cash but I did find some time to keep the Free Company fires burning. The grand strategy layer has now been moved over completely to a controllable real time based system (though the amount of time that each thing takes to do still requires much careful balancing). Instead of having to hit ‘end turn’ to advance progress you can just unpause and watch events play out at whatever time speed you like. This system will be further upgraded (probably soon) with a system of notifications that pause the game and automatically present you with some information when some important event occurs (lore research complete, building constructed etc).

Parallel to that I’ve also been building up the lore research sub-system gradually working out new technologies and what buildings, skills, items and further technologies they unlock. The tech tree helps provides a kind of narrative to the strategy layer and some interesting prioritisation choices when multiple projects are available simultaneously. As in X-com I plan to gate some lore/technology based on the discovery or ‘recovery’ of certain items from the tactical battle component. It is just one way that helps tie your actions in the two layers together in a deeper way than just a win/loss dynamic.

My todo list informs me that I also have tasks coming up to work on a proper injury system for mercenaries, the aforementioned notification system and some more work on buildings.

Inspiration wise I’ve been drawing on a few new games recently that I’ve finally gotten round to playing in the post x-mas period.They are  Eador: Genesis (a HOMM-alike with excellent AI) and Dark Souls (a properly rewarding and challenging action RPG with a classic D&D inspired melancholic mythos). I heartily recommend either.

Christmassy Update

I thought I better make another progress update before the holiday season sends everything into chaos for a few weeks. The strategy layer is progressing nicely with new screens produced for assessing your company accounts and researching lore and the early stages of switching the layer over to pauseable real-time has begun. I’ve made a few more of the buildings have actual effects beyond just item production and even spent some time thinking up thematic overall victory conditions.

Right now I’m thinking there will be two initial victory conditions; winning a ‘lore victory’ which will be similar to the science victory in civilization in that you progress to near the end of the technology tree which allows you to unlock some kind of final hard tactical battle which inn turn leads you to the end of the game and the secret of monkey island/why magic has returned to the world. The second type of victory will involve clambering the feudal ranks by attaining or claiming titles and eventually dominating all opposition on the map by declaring yourself ‘king’. Claiming the king rank will require a certain amount of the respect resource, some favours accumulated through contracts, an impressive central castle and of course controlling around 60% of the map through the territory control mechanics (a combination of economic power, and military/political influence).

Perhaps more interesting will be the mechanics of losing. You will also lose the game if a state of secure peace persists between all the main political factions on the map for longer than x months. A mercenary company lives by the sword and peace is death. Hopefully you will be able to use intrigue, assassinations and other manipulations to  keep political tensions in a continuously heightened state and thus protect your income stream. At some point in the future I may provide a ‘holy warrior’ path of mercenary company that subverts this failure condition by striving continually for peace  but for now there will be only war. The second less pressing failure condition concerns the ‘ruin’ spread by the chaotic magical monsters if you fail to fulfil enough contracts related to suppressing the monstrous threat then it may eventually grow too large and overwhelm the entire realm.

None of that is implemented yet but hopefully when it is it will provide a couple of varying paths through the game, add some all important mercenary flavour and just give the players something to aim for beyond just growing their company’s power.

Have a lovely Christmas, I’ll be back in the new year with more steady progress updates I’m sure. Hopefully some screenshots should resume too once I get back to the more camera friendly tactical portion of the game.

A more gentle introduction

I’m still hammering away at Free Company, even though the blog updates have been even more sporadic than usual. Mostly the reason for that is that nicely functioning UI menus, vital though they are, don’t particularly make for thrilling screenshots to blog around.

I’m still working principally on the campaign strategy layer of the tiered game cake that this thing is, though I have recently dipped back into the tactical layer a couple of times to fix a few bugs and keep myself appraised of roughly where it is at. I find in a large creative project like a game it is often easy to get lost down the rabbit hole of a small part and forget the whole. That rabbit hole for the past couple of weeks has been the Company creation screen, in which you put your initial stamp on your newly minted group of mercenary minions.  Formerly it was the most primitive of affairs, featuring a text box into which you could input the company name and another button to get-on-with-it-and-start-the-game-already. Now it has been ‘dramatically’ expanded with options to pick some company colours for use in the game UI, a company battle standard (coloured in your company colours) and a starting theme for your company that determines roughly what introductory, buildings, resources and mercenaries you’ll start out with.

The whole idea of this screen is to give the new player a better feeling of agency and creative control over their company and also set them more quickly on the path to their chosen style of imagined mercenary company. Hopefully it’ll do that a lot better now than before. I’ve been pondering other ways to ease new players into the game world on top of this screen, perhaps some general setting flavour text that gives more narrative to the largely free form strategic gameplay ahead. I’ve also been considering the other end of this spectrum, how to bring the game to an ending. Multiple types of objectives in the manner of civilization seem a certainty but what exactly those will be and how to give the player an overview on progress toward them are still problems to be solved.

What you can do right now is ‘level up’ your bunch of mercenaries through playing a series of randomly generated dungeon type tactical battles. and accumulate cash for doing so. Cash can be spent on building a bunch of buildings at your base which – right now – don’t do that much beyond allowing you to construct a few basic items. BUT, but it all just about works as an endless game loop without crashing (that often).

What’s next? There are a couple more broad ‘screen concepts’ I definitely want to work into the strategy layer; ‘lore’ (a tech tree type of thing), ‘finances’ (tracking your money), ‘trade’ ( a fancier version of the current shop), victory condition progress tracking & something, something with graphs. Plus  I want a simple popup notification type system to try and tie it all together, it will alerts you to happenings across the world and in the other screens as they occur from the main screen while the clock is running (switching from turn based to real time is another change that I want to make in here). Then there is the main map screen itself, its a visible thing now but I want to tie the abstract screens into the map now so that your base exists *there* and the contract is taking place over *there* and your iron ore mine is over *here* so that’s another job for the list.

Then there are the mostly missing systems that cut across both layers of the game cake; mercenary skills and mercenary injuries too big broad topics that will need a lot of work to feel right. And.. loads of other stuff, too much to list.

Anyway, as always feel free to ask any questions via email or the comments.


Holdings, production and stacks

A quickie update because I’m a bit short on time at the minute.


The last two weeks have been spent trying to further build up the sparse systems of the strategic layer, so the buildings from last time around are being given a new feature; item production and I’ve added another new system and screen to support that. The idea is that once you’ve built your blacksmiths workshop at your mercenary camp you can hire a blacksmith to go in it and set him to work turning raw materials into usable weapons and armour for your mercenaries to use in upcoming missions. At first it’ll just be a cheaper way to equip mercenaries over what you can buy from local traders but as your blacksmith gets better, your tech level increase, your workshop gets upgraded you’ll be able to craft better gear than you can buy.

To support this I also needed to add raw materials into the game so your blacksmith (and other craftsmen) would have something to work with. So there are now a range of raw material resource items that you’ll be able to find and trade like the normal items but the main way of obtaining them will be through the new ‘holdings’ system. Holdings represent the lands and properties your mercenary company has bought, seized or been granted through their activities, they come in different types from empty lands to gold mines and you can exert some control over what exactly they do but, what they do in the main, is pump out resources and ship them to your mercenary camp.

Getting this working required some adjustments to the item and inventory system as previously the grid was strictly a one item per square deal which works fine when you are dealing with small numbers of finished mercenary gear but becomes a little unwieldy when you are getting shipments of thirty charcoal every turn into your company stores. So I spent a bunch of time adding support for items stacks, splitting stacks and merging stacks. Only some items can be stacked at the minute I’ll just limit it to whatever makes most sense I think.

And that’s about it. I’m currently still working through the actual production of the items at the blacksmith as that’s all very bare-bones and I want a proper build queue so that you can queue up a whole set of gear if you have the materials.

Base camp

Base Camp screen

click to enlarge


One of the things Free Company had been missing from the classic X-Com design locker (that I have been so gleefully looting) is some kind of base building mechanic in the campaign layer. Well no longer, despite the lengthy pauses in keeping this blog up to date I have been steadily trundling away on new stuff for the game here and there in between some minor computer troubles and a new gym regime (designed to keep me alive long enough to finish this game).

Screenshots of menus are never that gripping but this particular one happens to capture almost everything I’ve been doing recently. First up was a code refactor of the campaign UI to support multiple potential screens worth of menus ( rather than having everything stupidly dumped in one rapidly filling up place). This was to support a couple of new screen ideas, the first of which is the base building one you see above in it’s first incarnation. To sell the base screen I decided to make a whole bunch of fancy images in a consistent style to represent the ideas I had for buildings. I think it came off reasonably and it is a lot more satisfying to gain that little icon of a tavern than it would be just building a bunch of text descriptions.  Though I also spent a bit of time revamping the text description displays by making the tool-tips used throughout the campaign (and in some areas of the tactical battles) more aesthetically pleasing. They now have slightly rounded corners, a carefully adjusted amount of alpha and the use of new text rendering options. The engine can now, with a little bit of text markup, render a bold version of a font (as long as you remembered to load one) and assign text colours with a much more dynamic system of css like id tags loaded from an xml so it is easy to add new colours and easy to adjust the colour of all the text that uses the same tag.

And finally you can actually use that menu now to start construction of the available buildings and as long as you have the cash and wait a few turns your company will be the proud owner of a new tavern/stockade or whatever. Of course at the moment all of the buildings are somewhat ceremonial as the other systems they are going to unlock , contribute to or  buff have either yet to be built or are yet to be decided upon. I have a few ideas of what they are going to do but nothing is set in stone yet.

I’m quite enjoying working on the campaign layer at the moment as I feel that every time it improves it’s helping to add the purpose and context that I feel has been a bit lacking in the tactical battles. However, there is still a chunk of necessary work that needs to go into the current tactical battles around mercenary special skills, path finding and play speed improvements and better enemy AI. At some point soon I want to muster the drive to finish off those areas to an ‘alpha-ready’ standard so I can start to think about some kind of release that will garner much needed player feedback.

In not-Free Company-news there is a new remake of X-Com due next month by Civilization developing titans Firaxis.  I have of course preordered it out of my ‘research’ budget mainly so that I can swipe all of its good ideas and twist them to my own dark ends.


As always any comments or encouragements are welcome in the handy box below, or you can follow me on twitter and bark commands to me via that instead.



Olympian feats

…are pretty distracting!


Work has been progressing slowly on Free Company the last couple of weeks, school has broken up for the summer so my teacher girlfriend and I have been enjoying the freedom from the school schedule by larking about. Now the Olympics has proven to be an additional distraction as I try to type code on my laptop while being constantly glued to the tv.

Anyway, I’m working on expanding the thin campaign layer a little bit  at the moment as a change of pace from the tactical battles code. I’d found myself struggling to get back into the programming while I was working on the tactical battle path finding for whatever reason but the grate thing about indie game development is that if you get burned out you can try coming at the game from a different angle for a while (there is always plenty of work to do). So I drew and painted up some little building icons and I’m now re-factoring the existing morass of the campaign layer so I can squeeze them in on their own screen.

The idea is to introduce more and more systems that feed into one another, so the buildings will be built and upgraded with gold and prestige that you earn from completing contracts and they will in turn unlock more ways to improve your mercenary specialists, boost your prestige and add more ways to earn gold. I guess the goal is to one day have something as satisfying as building your base up in X-Com or improving your towns in a HOMM-alike game. For now it’ll be fairly simple though, columns of little icons and descriptions.

After that I may pirouette back to the tactical battle code I was working on before, which was the rather tricky process of adding penalties for trying to disengage from, and move through melee combat opponents. Right now one of the most effective tactics in the tactical battles is to run away from an opponent for half of your allowed moves and then charge back in to get a charge bonus every turn. Obviously that is a bit ridiculous and not the tactical game of positioning I’d like to move towards. Instead I’m going to allow a free ‘unopposed’ attack on a mercenary that tries to move out of  hex adjacent to an enemy. Sounds easy enough but it means I have to rework the movement interface and logic for this special case to a) allow the unopposed attacks to be shown and b) to indicate to the player that he is about to make a special kind of move that he might want to think carefully about. I also have to change the regular A* pathfinding code to avoid including this type of special move in the middle of a normal path, instead it will attempt to give enemies a wide berth unless you specifically ask to attack them or otherwise enter their threat radius.