Dec 22, 2016

Development Snapshot 15

In this latest snapshot my main focus was on further survival-related mechanics, such as food and water borne illness, as well as typical game functionality such as loading and saving the game. The snapshot took a bit longer than anticipated, as I also did a complete refactor on my user input system, which ended up creating some nasty bugs.

The end result is much cleaner and is not bound to the keyboard or mouse devices directly anymore, meaning I can inject faked keyboard or mouse events really easily, which is great for testing.

Food and Water-borne Illness


The main survival mechanic I implemented this time is Food and Water-borne illnesses. Basically, if you don't cook meat before eating or decide to drink from a random puddle you'll probably become sick. The consequences could be dire as this type of illness lasts several hours and during that time your food and water usage rates are increased.

Not quite sure about the wording at this stage.

I've also introduced the ability for effects to debuff the maximum value of stats. This makes for some interesting consequences. Starvation now reduces your maximum health by 20%, and dehydration reduces it by 40%. These two effects can combine (for a net loss of 60%), making you more likely to be killed by pretty much everything.

I like the nuance of the maximum value reduction because it enforces an immediate penalty eg: loss of health when the current value is clamped to the new maximum. For example, Food Poisoning lowers your maximum food by 50%, meaning you'll get the "hungry" debuff. Since your max food was lowered you cannot eat food to remove the debuff. You'll have to wait for the food poisoning to wear off. In this fashion, debuffs can trigger other debuffs causing an escalation of problems.

Another significant change to game mechanics is that health no longer regenerates passively all the time. Health regen now only occurs while you are sleep, which gives a further reason for players to not avoid it for too long.

With these changes in mind, I've grown to dislike the energy stat again. I think I've added and removed it 2 or 3 times since I started the project, and I've convinced myself to get rid of it for good. The Energy stat's role in the player character's economy was mainly to force the player to rest or sleep periodically, and ensure they can't work non stop for hours without consequences. Penalising this behaviour can now be achieved in different ways, so its largely unnecessary.

I'm planning to introduce another stat in the future that model's the player's need for shelter in a survival situation. This stat is related to surviving in cold or very hot conditions. More to come on that in the future.

Save/Load


Saving turned out to be pretty easy. I'd already written most of that code previously when I overhauled my serialisation system a little while back. However, it seems I'd only half-finished the loading code as it turned out to be full of bugs and took quite some time to get under control. But now it is possible to save and load the game state. Hurray!

The game currently works in a partial client/server configuration. Eventually the server will be used by the client for all game logic, but at present it's just responsible for generating the world and then going to sleep. The client then takes over and does all the simulation. The save gamestate code should be run against the server, but it doesn't have the latest information as entity updates are not yet flowing back to the server (perhaps in a future snapshot). So for now the save code runs against the client gamestate.

In theory, having access to save/load should also help debugging, as I don't have to start from a blank canvas every time I want to start up the game.

Onwards to Snapshot 16!


Snapshot 16 is going to feature some graphical overhauls to the game. The most significant of which is starting work on a skeletal animation system, so our poor protagonist can finally put his arms down and walk like a human. 

I'm very excited about this, as it's long overdue. I started building the basics of this a few years ago but abandoned it and moved on to more interesting things. In fact, there are several partially implemented bone/animation related classes tucked away in the source code that haven't been used for several years. I suspect I'll end up throwing most of it away to be honest.

Another upgrade is making the waypoint system work a bit nicer. The main problem is that it only ever displays the waypoints after its done a full plot of the path using A*. So if you decide to change direction midway through a tile movement it can be up to a second before it clears the existing waypoint path, plots a new one, and then draws the new path in the world. This lag between clicking on a tile and a marker appearing there is disconcerting to the player, and shouldn't be too hard to tweak to feel punchier.

On the survival front, I'm planning to implement poisonous foods such as mushrooms or berries. If the player character has a sufficiently high survival skill they should have no trouble identifying which is safe to eat and which is deadly. 

No comments:

Post a Comment