June Update – Life!

This month I’ve moved on from the lighting system that’s been the focus of development in previous months, onto getting characters into the game and moving around. The goal of the first playable prototype is to have dwarves in the game as a playable race, before working on bringing other races in.

First of all, it’s with great pleasure that I can unveil the first piece of concept art for King under the Mountain, produced by Anthony Avon. As something of a specialist in landscape concept art, I contacted Anthony with a description of the game, the setting, and a brief of producing a landscape depicting a dwarven settlement in the game world.

Concept art of a dwarven settlement

The artwork is actually meant to show different stages of the development of a settlement in the game – towards the foreground you can see simple structures for mining and a sawmill, the focus of the picture are dwarven buildings that would be constructed while the centerpiece in the background of the fortress set into the mountainside is the end goal. As part of what ended up being quite a large undertaking, Anthony first worked on some black and white concepts to feed into the final color piece.

Dwarven buildings concept sketch
Concept art of dwarven buildings

Although the game is top-down 2D, these concepts will greatly help to set the look and feel of assets produced for in-game. I’m extremely happy with how the artwork has turned out and can’t wait to see what Anthony produces next for the game! Don’t forget to check out his artstation site at https://www.artstation.com/artist/anthonyavon.

Before I started work on the AI systems which will drive a lot of the gameplay, I wanted to get some working graphical assets in place for dwarven characters rather than use abstract shapes or placeholder art. After contacting several 2D artists with a brief of requiring a few dwarven characters in a simple vector style (with no legs) I’ve decided to go with those produced by Dave Rigley shown below. Dave doesn’t have an online presence yet but given the quality of his work I hope that he does soon!

Example dwarf in-game characters
Example dwarf in-game characters

Getting the characters into the game was complicated by the fact that I want the skin and hair colors to be dynamically colored (and open to mods) separate to the other parts making up the body. This can be done by separating the characters into different layers, but to complicate matters further, they can end up facing one of several directions which has some further implications for what is drawn when. It took some time but there’s now a relatively simple, moddable system for defining parts of a character with the ability to color in different parts independently. I plan to carry this design on into most of the objects used in the game to allow a huge variety of colors and styles without requiring extra artwork to be produced.

Dwarf character layers separated

With these in place I could finally start work on the AI behaviours of the dwarves in the game which is probably one of the most important parts of the game’s implementation. For now, I’ve really only focused on path-finding and path-following. As ever, the excellent tutorials by Amit Patel of Red Blob Games were a huge help, thanks Amit!

Path-finding is a relatively mature and well-understood problem in game development so I had a wealth of experience to draw from. Although I’ve ideas for further improvements and refinements, for now the pathfinding is calculated by using good old A*. Despite the surface simplicity of the algorithm, running it over a large map or for a large number of game characters can significantly impact performance/framerate. I’ve come up with a multi-threaded solution which will use multi-core processing (as all game rendering and most updates tend to run on a single processor), which has allowed me to run the game in its current state with tens of thousands of dwarves without significant slowdown! As the final game will probably have at most dozens or hundreds of dwarves in a single settlement, this should do 🙂

Since getting the dwarves able to figure out a path to follow, actually following the path, at the same time as trying to avoid each other and not clip through walls, is another matter! Although still in progress I’ve got to a point I’m happy with and able to share an example video of it all put together in action

The dwarves in the video have a dynamically-chosen beard color based on one of several shades. The plan is for this and their skin color to be even more randomised for more procedural content. This video does not have lighting applied, shadowing of characters and outdoor lighting is something I hope to get onto in the near future. For now, I’m going to keep working away at the character movement. See you next time!

Written By Ross

Leave a Reply

Your email address will not be published. Required fields are marked *