Category Archives: Free Company

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.

 

 


Improved Furnishing

warehouse storeroom

click to enlarge

 

Recent work on Free Company has been focusing on improving the look of the randomly generated rooms by subtly shaping the way the objects are laid out to conform to more human norms of laying out rooms. For example shelves in the game are now no longer empty instead they are filled up with appropriate small objects . The objects as redetermined by the procedural generator-wide tagging system. Objects have tags; levels, monsters and rooms have tags; the generator attempts to assign them to each other using probabilities based on how closely the tags of each align. The way the objects are placed on the shelves is determined by three different algorithmic approaches that attempt to mimic general human behaviour as regards shelves: filling up from the left hand side, from the right hand side and alternately from the left and right hand sides. The quantity of objects on each shelf is determined by a normal distribution linked roughly to the dimensions of the shelf to ensure that the average shelf is about 90% full .

That’s one example, other new strategies have been employed to shape the placement of the shelves themselves and other objects to create the hopefully more believably storeroom like rooms you see in the screen shots on this page. To support these new furnishing algorithms I’ve also been making a whole pile of new objects, almost doubling the number of them in the past week. Some of these can also be seen  in these two shots.

 

click to enlarge

 

The basic warehouse layout and furnishing algorithms are probably done about as far as I am going to take them for the first release all the rooms now look passable and I expect I can reuse the same algorithms for a few other environment variants like the crypt and a new library layout once I create a few more objects to support them. I still have plenty more ideas for algorithmic level generation though and I’d love to revisit this area to try and  make even more believable and varied layouts in the future.

The other new things I’ve done  recently are a few minor cosmetic buffs. From feedback to my last post (thanks Stian!) I’ve switched out the general game font for a more serif ridden fantasy one, I’ve fiddled with a few of the most frequently seen textures to try and make them a little less bland (still a work in progress) and I’ve implemented a more flexible system for testing out lighting changes quickly in game (hit a key to rebuild the lights from the theme data .xml files). The last thing (which just went in today) has allowed me to fiddle with small lighting changes and see the result in a couple of seconds rather than the many minutes it was taking before, so I updated a few of my lighting themes with some tweaks too.

 

Anyway, as usual let me know what you think about the Storerooms or anything else in the post in the comments below.


HUD improvements & Memory leaks

click to enlarge

This fortnight has been spent plugging all the memory leaks that had built up in the Free Company code base since the last time I went through and plugged them all. The work was considerably eased this time by the use of a new tool I discovered called Visual Leak Detector which makes the process of pinpointing where the leaks are happening fairly trivial by providing callstacks. It also runs fairly quickly in the background so I can leave it on permanently in debug builds to continue passively identifying new leaks as and when they spring up. VLD is super simple to integrate into any project as well so if you are still struggling along with C++ out there I recommend adding it to yours immediately. The only thing it doesn’t catch are Direct X memory leaks for which a more traditional approach, and the debug runtime, is still needed.

Once all leaks were deftly disposed of it was on to a HUD tune-up, something which is still ongoing and probably will be right up until the release. You can see some of the results of the changes in the screenshot above. I was aiming for less numbers & more visual ways of showing what is going on, as well as adding more widgets to give you better control over your whole party of mercenaries. The portraits added back in January now provide a handy way to select a particular mercenary and jump to his current position in the world, and they will  also soon contain a shrunken down overview of the bars on the main HUD for each merc. There are now special pointers for all of the various ways you can control the camera which possibly only I care about. Finally, I spent a bit of time tweaking the colours of various elements to tie the buttons into the HUD better, improve consistency between different elements and generally reduce the ‘primary’ nature of most of the colours I was using before. I’m still not very happy with the layout of the bottom HUD area ( a lot of spare/wasted space, the elements are a bit boring) nor the fairly crappy skill icons but it is coming along all the same.

click to enlarge

While I was fiddling with the HUD I also went through and ticked off a whole heaving heap of bugs with the skill system so that the handful of currently implemented skills now actually work properly all the time and give slightly better feedback when they are being used to boot. Implementing a host of new skills and improving their feedback is one of the big upcoming tasks so I wanted to have the ground prepared for when that is started. And as a final thing I’ve just now tweaked the post effects again to add a vignette.

To give a sort of general picture of where the game is at I have about a week or so’s more tasks listed on my current ‘polish’ to do list to get through before I start on one of the big three remaining tasks pre-alpha release. Those big tasks are; skills, AI & real-time play between combats. I’d welcome any feedback on the changes/look of the HUD in the comments. Or really, any comments at all. Speak your brains internet.