project-image

King under the Mountain

Created by Rocket Jump Technology

A simulation-based settlement-building strategy/management game set in a fantasy world, for PC, Mac and Linux.

Latest Updates from Our Project:

Steam keys now available!
over 2 years ago – Mon, Aug 16, 2021 at 06:55:48 AM

A very short update to say that Steam keys should just now have been sent out via BackerKit to all backers.  Both the Steam and Itch.io versions will be identical and updated in sync with each other, so it's really just for those of you (which feels like the overwhelming majority) who'd rather use Steam to launch and update their games.

If you have any issues, particularly if you think you should have received a key and can't find it, either send a message through Kickstarter or email me at [email protected] from the email address you used with the Kickstarter campaign, and I'll dig your key out. 


Thank you for your patience on getting this far, and onwards to the Steam Early Access launch!

Huge news for King under the Mountain (July 2021 Update)
over 2 years ago – Sun, Aug 01, 2021 at 05:09:13 PM

Hi everyone, it's been far too long since the last dev update for King under the Mountain. Well, there were a lot of factors that fed into that, but rather than go through them, I just want to share the big news with you all - King under the Mountain has a publishing deal! There's many great parts to this announcement, but perhaps most important is that as of 3 weeks ago, I'm no longer trying  (and failing) to fit gamedev around a full time day job and family life, instead thanks to publisher funding I'm now working full time on developing the game! The roadmap is in place, most of the artwork required for it has been created, so now I'm just powering forward to bring the game to Steam Early Access as soon as possible. We're aiming at a January 2022 early access launch which is just 6 months away - almost no time at all compared to the time the game has been in development so far!


You might even be wondering why it's taken this long for me to sign up with a publisher - or why I have at all with how relatively close the early access launch is. Well on the first point, this is the first time I've spoken to a publisher who really understands the vision for the game. I've spoken to others who wanted the game completely done and dusted in 18 months time, but I see games in this genre as really benefitting from a long early access period - just look at the growth in gameplay and success of games like Prison Architect and Rimworld. Some publishers weren't willing or able to invest the amount required to allow me to quit my day job, so that was a non-starter.  As to why would I sign up with a publisher when I've already got the game so far along the road to the early access launch? Well, as you can see from the increasingly sporadic dev updates, I just haven't been able to find the time needed around everything else to progress the game - it would have still taken a crazy long time to get the game to Steam from where it was. In addition, any publisher worth their salt brings with them some great marketing clout - instead of this now being a hobby project with one guy working on it, there's a whole team pushing the game forward, with multiple people dedicated to marketing so many more people should hear about the game, rather than the small niche it's in currently.


So who is this mysterious benefactor? A fairly new publisher called Boombox, which is a partnership between Philippe Erwin who brings many, many years of experience in production and business development in games from senior positions at big names like Activision and Warner Bros, and Alexander Poysky of Poysky Productions, who produced Regions of RuinBetween the Stars and Travellers Rest (among others). I've actually been in touch with Alexander for over 2 years already, specifically around publishing King under the Mountain, and everything just lined up on both sides recently that we were able to come up with an arrangement that works for both of us. I'm very excited to be working with them and their wider team!


So now that I'm working full time on the game, I was able to wrap up development on Alpha 5 in just a few days. You might remember from the previous update that I was due to go onto constructing roofing and flooring. Well I'm pleased to say that's done now! Here's a little look at constructing roofing in the game (with a bit of a preview of rain as well):

Roofing isn't super important yet but it will be once weather effects are added (which is the current development goal!). It does change up the happiness bonuses a little though - dwarves now get a happiness bonus from working in a zone completely enclosed with walls or doors and a roof. Of course, any mined out areas come with a roof already so perhaps this will encourage players to dig into the mountainside? You may have noticed in the video that the "Quad" option for building walls has been replace by "Room" which also fills in roofing in-between the walls.


Finally you can also put your own constructed flooring down. Along with this, flooring now provides different movement speeds  depending on the type of flooring. You will find that gravel is quite slow to walk on, but any flooring constructed by dwarves speeds up movement considerably, so it can be worth laying down paths between high traffic areas. Of course, the AI pathfinding now takes the floor speed into account, so it will plan out paths based on the flooring available. This might mean if you do build quicker paths between areas, you might need to widen them to account for the higher traffic passing by!


Having wrapped up Alpha 5, it was released as Alpha 5.3 to the Itch page. Now that we're fully focusing on the Steam Early Access release, the game is not currently available for new purchases on Itch.io. Current owners will still be able to download any and all future updates, and it also shouldn't be too long before we start pushing updates to Steam as well. At that point, we'll make Steam keys available to anyone who currently has a copy on Itch (i.e. anyone who backed the Kickstarter or has purchased the game since) so look out for that news in the near future.


Next it came time to make a start on Alpha 6. Looking into it, I was still waiting on a few of the art assets which were being produced which made Alpha 6 all work together. To avoid any waiting around (though those assets have since been completed), I ended up swapping the contents of Alphas 6 and 7 with each other, so now Alpha 6 covers fire and weather effects. On that note then, I started with fire, and as a good indication of how much more progress is being made with me focusing fulltime on gamedev, the entire fire feature has been completed as well! Here's a look at it:

The game's now getting to a point where the different systems really start to get to interact with each other. Fire spreads to nearby things depending on if they're flammable, which itself is determined by the materials that form each item/entity in the game. Unfortunately for your dwarves, they count as flammable too, but at least a dwarf will roll around or seek out water (when not running around in a panic) in an attempt to put themselves out. Everything else will require the use of a new order to extinguish flames, which involves filling a container with water and dumping it over the fire to put it out. Failing that, fires will either spread to nearby entities or else eventually consume and destroy the thing on fire. Here's a tip - don't build things around the blacksmith's forge out of wood!


There's good news for your flaming dwarves though, with fire done I'm now working on adding all kinds of weather to the game, first of all rain which you can see a little of in the roofing video above. Rain has a good chance of extinguishing fires, but only if they are outdoors! Rain will make your dwarves a bit upset at walking or working in it, but especially upset at having to sleep in the rain (wouldn't you be?) so you'll want to dig those bedrooms out fairly quickly. Rain will tie into the more advanced modelling of farming crops which is now part of alpha 7, and perhaps most awkwardly of all, introduce the system of oxidisation to certain metals (i.e. iron and steel items will eventually rust and become useless if left outside). And that is just the first type of weather! Look forward to snow and cold in winter which will be harder to survive, thunderstorms with fire-causing lightning strikes, and more, all to be released as Alpha 6 in the next couple of weeks.


And that's where we're up to! I am very sorry this update is such a long time since the last, but now with the publishing deal in place, I can't imagine missing another one until the not-too-long-in-the-future Steam release and beyond! See you next month, or if you want to keep more up to date, join the King under the Mountain Discord server.

April 2021 Update
almost 3 years ago – Fri, Apr 23, 2021 at 02:39:21 PM

It's the April 2021 dev update for King under the Mountain! I am truly sorry to have missed a couple of monthly updates. Until the Steam Early Access launch, the game is basically a hobby project and real life has endless ways of getting in the way of that. I'm happy to say it's fully back on track though and we've had some great progress this month!

The major milestone achieved was the addition of the initial list of particle effects that have been added to the game thanks to the particle effect system. In fact this month I had enough time that I was able to stream some real time game development on Twitch, and below you can watch me go through the steps needed to create and add a new particle effect to the game (from 12:24):

So there's been a whole bunch of new visual effects added to the game using particles. One I'm particularly happy to get added is leaves falling from trees in autumn, which was promised all the way back in 2016 with one of the very first looks at the game!

While it's not exactly a particle effect, setting up that system also allowed me to add a much needed quality of life feature - progress bars when working on jobs! No longer do dwarves just stare at a blank wall or piece of furniture until it happens, now particle effects and a progress bar all appear to really tie everything together. Here you can see mining incorporating chips flying off the rock wall being mined, a cloud of dust as the wall is removed, and the progress bar that's displayed.

Rather than list them all here, you can try them out for yourself with the latest version (Alpha 5.2) from the usual Itch.io page.

And that's not all either - perhaps the single most requested display feature has finally been implemented - you can now run the game in borderless fullscreen mode! The new setting should be set by default if you were using the old exclusive fullscreen display mode, and the exclusive fullscreen option is still included for those that prefer it (mostly for older hardware that might struggle with games not running exclusively).

As ever, there's some bugfixes included, mostly thanks to the help of the community and member SirRockstar in particular who's been invaluable in providing reproducible problems with larger settlements. There was an issue with soup getting mixed up with water in a kitchen and buckets ended up full of soup and stuck! In fact there's now an in-game option to get  a dwarf to empty the contents of an unused container as a workaround for similar problems in the future, though primarily I want to stop them from happening in the first place.

Also a big thank you to community member Lyserg who has translated the game into Turkish. The latest update includes his translation as part of the community translations mod, and perhaps just as importantly also includes the Turkish flag to display alongside it.

Looking ahead, the roadmap has been updated and the only part remaining for Alpha 5 is constructing roofing and flooring to have proper rooms and buildings in the game. I've been toying with the idea of roofing not needing any input from the dwarves, just being a kind of UI setting which has an effect in-game, but that doesn't really go with the simulated world I'm aiming for in King under the Mountain so I suppose that means placing roofing will need a dwarf to get the right resources and do the work after all! Following that, I'm very excited to get stuck into Alpha 6 as it'll be the first time in a long time we've had new art assets added to the game, things that have been ready and waiting to go on the artwork side but waiting for the implementation to catch up!

That's all for this month. Again, sorry for the lack of communication for a while but we're back on top of things now. Please drop by the game's Discord server if you haven't already, it's the only true community hangout at the moment, and see you next month!

Update coming soon!
about 3 years ago – Tue, Apr 13, 2021 at 02:04:47 AM

​Just a quick note to say - I'm very sorry there's been no update on ​ King under the Mountain ​ for a while.  I've been pulled to a  couple of other side projects for the last couple of months but I'm happy to say I'm fully back onto    ​King under the Mountain​ now, as and when time allows -  as ever! Thank you for your patience.

January 2021 Update - Particle Effects
about 3 years ago – Fri, Jan 29, 2021 at 09:24:18 AM

Welcome to the first King under the Mountain dev update for 2021! This month has been entirely focused on implementing a particle effect system into the game. But that might lead you to ask...

What are particle effects?  

Particle effects are a graphics technique where lots of small and usually simple images or models are rendered and often animated to produce a single complex effect. Here's an example from the official Unity tutorial (the particle effect is the pink glow and sparks):

In the above example,  a simple coloured sprite is being used lots of times for each of the particles flying off the main large effect on the kart's wheel.  If you look closely you'll notice they're also decreasing in size as well as moving in an arc until they disappear entirely.  Simply put, a particle effect is created by applying several effects on lots of instances of small "particles" like this. Particle effects are used extensively in games, for explosions, spell casting visuals, impact effects, almost any visual effect you can think of is often done using particles, though in other cases techniques such as using shaders give a better result. As an aside, a shader is a program that runs on the graphics card to adjust the geometry of models/shapes, or the colour of individual pixels - sort of - which can have some incredibly powerful effects, see shadertoy.com for some good examples to play around with. The dynamic lighting and flowing water in King under the Mountain are both achieved using a shader.

Particle Effects in LibGDX  

King under the Mountain is written using LibGDX, which is a game development framework, which is a bit different to a game engine - an engine is a bit more prescriptive about asset formats you have to use, how levels/maps are handled and that kind of thing, whereas LibGDX is at a lower level than an engine, giving you access to underlying graphics and audio programming interfaces (OpenGL and OpenAL) with a good amount of "helper" code on top for common game development tasks. That said there's much, much less that you get "out of the box" for using LibGDX compared to a standard engine, for example I had to implement something as seemingly basic as multi-line text in LibGDX!

One of the utilities that LibGDX does provide is a good particle effect implementation and GUI editor for defining your own effects:

You can see some of the many parameters that can be applied to a set of particles in an effect (you can have different sets of particles each with their own "emitter"), such as the angle of emission from the starting point and the range of velocity they have. The blue-line-graphs are used to adjust these values over the life of the particle. There are more parameters which have not been used in this example such as rotation, gravity and "wind" that can be applied (all with the ability to have a different amount over different times).

When you load up the particle effect editor, it starts with an example particle effect of lots of semi-transparent red circles (up to 200) used to create a flame effect:

The first particle I decided to implement myself was a simple but important one for a game about dwarves digging into a mountainside - chipping away bits of rock while mining!

Unlike the example flame effect, this uses far less particles at once, but also makes use of rotation and gravity to give the effect of a chip flying away from a point.

But what about lighting?  

In most games the above would be great and all you'd probably need to look at with particle effects in a game built using LibGDX. In the case of King under the Mountain however, things are made a bit more difficult by the dynamic lighting system. If you've ever looked in the data files, you'll likely have seen that almost every sprite in the game has a matching "NORMALS" version, like with the following:

The _NORMALS file is a visual normal map (or bump map) that uses the red, green and blue colour channels to describe which direction each part of the "surface" is pointing in 3 dimensions. This information is combined with light sources - each light source is casting light from a certain point, and this is combined with the normal map to figure out how much light will be hitting any given point. At least, that's my attempt at explaining normal mapping without getting too technical into vector maths! It's much more commonly used in 3D games rather than 2D ones, but one of the very first things I wanted to implement in King under the Mountain was a truly dynamic lighting system so that a dwarf carrying a lantern around tunnels and halls would be suitably evocative, and help distinguish the game from its peers.

It helps to see everything combined in-game:

In the above screenshot, the top left is the game world rendered without lighting, using the sprites as they exist in the data files, also known as the diffuse sprites/layer. Top-right is the same scene but using all the _NORMALS versions of the same sprites to build a normal map of the entire scene. Note that the sack in the lower-right does not have a normals-sprite for the label on the sack, so this is not rendered in the normal map scene, meaning it will be lit the same as the layer below (the sack itself in this case). Bottom-left is the lighting information, which is made by using a shader to add an amount of light based on the normal-map version and data from point lights in the scene (a white light from the cursor in the upper left, a yellow light from the miner's helmet in the lower right, and a small amount of global lighting so unlit areas are not pitch black). The lower-right is the combined final result that you see in-game, which is made by simply combining the two images on the left hand side.

That's a very quick run-through of the lighting system, but I bring it up because it occurred to me that I wanted the lighting system to work with the particle effect system, at least for some particle effects that want to be "in the game world" compared to ones which should not be affected by the lighting and would be more like UI information (for example, thought bubbles above settler's heads).

The naïve approach would be to have two sets of my rock chipping particle effect running at the same time in the same place, one with the diffuse (standard colour) rocks and one with the normal maps (even though normal maps don't really work when rotated - this is an issue I'm going to live with for now). Unfortunately, there's a lot of randomness in a particle effect but there's no way to set a "seed" (an initial value used to make a random number generator give the same sequence of results multiple times - like the map seed when starting a new game) in the LibGDX particle effect library, and in fact the randomness is buried quite deep within the workings of the library so there wasn't a simple option of just replacing all the random number generation with random number generation using a supplied seed.

Instead I had no option but to take a copy of the main part of the LibGDX particle effect codebase and modify a lot of it, I ended up making it be aware of an optional extra set of sprites for the normal maps, and any randomness would apply to both sets of particles that were created at the same time. It doesn't seem like much but it took a lot of effort to have a particle effect which could spit out diffuse and normal-map versions of the particle in the same way at the same time!

And a little extra on top  

There was just one main hurdle remaining - the particle effect shows chips or rock flying away to the right, but what if the miner is facing a wall from the left, or above, or below? But also where should the particle be positioned relative to the entity in game that is creating it (if it's even attached to an entity at all)? The LibGDX particle editor saves and loads in its own file format, named by convention as a .p file. It would be a bad idea for me to add or make changes in this file as then I wouldn't be able to load the .p files in the visual editor in the future, so each particle effect in King under the Mountain is defined with a type in JSON (like almost every "type" of thing in the game files) that looks like the following:

  {

   "name": "Chipping rock",

   "particleFile": "rockparticle.p",

   "scale": 0.4,

   "usingParentOrientation": "LEFT",

   "isLooping": true,

   "isAffectedByLighting": true,

   "usesTargetMaterialAsTintColor": true,

   "distanceFromParentEntityOrientation": 0.8,

   "offsetFromParentEntity": {

     "x": 0,

     "y": 0.3

   },

   "attachedToParent": false

 }  

The key to the direction problem is the "usingParentOrientation" property with a value of LEFT - I then added some code which readjusts some parts of the particle effect, like the initial angle of emission based on this property for use with other orientations. "attachedToParent" with a value of false means the particles won't move (once created) when the parent entity moves - this would be true for things like speech and thought bubbles which would also have "isAffectedByLighting" as false so they appear above everything else and are not affected by the lighting system.

Putting it all together, we can now have rocks chipping away with any mining direction!

What's Next?  

All the particle effects! Or at least, a good set of effects for where the game is now, focused around different job types and crafting types. It's always been a long-held ambition to have leaves falling from trees in autumn according to the changing colour of deciduous trees during autumn, and this finally makes that possible (or rather, fairly easy instead of some long-winded and complex way of achieving it with a different approach).  However many particle effects I come up with at this point, I'm sure there'll be lots more that could be added to the game as it is - just looking at the animation above, when a wall block is removed it could really do with a burst of clouds of dust type of effect, things like that. I'd absolutely love for the player community to suggest more that they'd like to see - now that the particle system is in place it should be fairly straightforward to add more effects - so get involved via the Discord server.

It's a bit of a shame that after the initially swift progress of Alpha 5 that I've had to spend the entire month adding this single feature, though it is quite a big one which will add a lot in the future, and was a bit of hurdle to get over but we're there now! The intention was always that this can also be used for the "Visible job progress" item on the roadmap but there's also lots more that could be included now or later. Hopefully, particle effects are wrapped up soon, then constructing flooring, roofing and rooms is the next step to complete Alpha 5. See you next month!