Category GameDev
Game Design Essentials: Single Button Controls
I hope you agree with me: controls are the true essence of every game. Sometimes, controls schemes are enough to define the game itself: once you decide the game controls mechanics, the rest of the game will follow. So I thought to start exploring controls schemes in a more formal way, searching for a way to analyze games from the user interaction point of view only.
We will start from the simplest control scheme possible: a game with a single button. These kind of games are recently more common than ever: they are easy to implement, easy to play and very suitable for smartphones (touch screens can be seen as single giant buttons). In other words, they are the perfect candidate for a funny mobile game.
Inventory-Aware Pathfinding - Part 1
Everybody know what pathfinding is. I don’t think I have to explain to a game developers audience why pathfinding is so important in games. If something in your game is moving not in a straight line, then you are using some kind of pathfinding.
What is less evident is that pathfinding is the only place in which “searching” is generally accepted. Except for GOAP and other planning-based techniques, the big part of the NPC’s decision-making techniques are reactive-based.
This is not a bad thing. Reactive techniques are an amazing design tool. However, this raises a question. Why is this? Mainly because of computational limits - full-fledged planning still requires an impractical amount of time - but also because of design unpredictability. The output of planning decision-making techniques is hard to control and the final behavior of the agent could be counterintuitive for the designers and, at the end, for the players.
Why can pathfinding play a role in this? Because it is possible to embed in it a minimal, specialized, subset of planning, especially if these planning instances require spatial reasoning. A common example is solving a pathfinding problem in which areas of the map are blocked by doors that can be open by switches or keys sparse around on the map. How can we solve this kind of problems?
Convert images to MovingAI maps
The MovingAI Benchmark Database is one of the most famous collections of maps for benchmark on pathfinding algorithms. I use it a lot during my work, it is useful to test an algorithm over a lot of real-world game maps. The consequence is that I developed a lot of tools to work with the map format of the MovingAI database.
The last of these tools is a straightforward Python script to convert images into maps in the MovingAI format. It is useful when you want to quickly develop some test maps.
Postmortem: Writer's Block - 1GAM January
The first month of the year is gone and I’ve made a game! The January 2016 entry of 1GAM, namely “Writer’s Block”, is now completed (kind of)!
January 2016 has been a great start for this year! During the last months of last year I started a personal journey to fight my inner demons. I don’t want to bore you with some self-improvement/productivity bullshit -it is not the place for that- so I will not. You just have to know that after 6 months of trying and failing this January is the month in which all the good habits really start to stick.
The “One Game A Month” challenge was the perfect way to test myself and doing one of the activities I love most. As usual, we will start from the beginning.
Fast (Approximated) Moving Average Computation
Computing the Moving Average of a sequence is a common task in games (and other applications). The motivation is simple: if something happened too far in the past, probably it does not matter anymore.
One of the main problems with the standard average is that it “slows” over time. This can be a serious problem. Suppose that you are designing a game in which your player have to quickly press a button to keep a value (e.g., player speed) above a certain average. If you use the global average, after a certain amount of time, your player can stop pressing the button and still keep the average above the threshold.
The demonstration of this is quite intuitive. If you have an average a(t)
at frame t
and the player will not press anything in the current frame, the average at frame t+1
will be
This factor depends on the elapsed time and becomes “almost 1” very quickly. You don’t want that. You want to keep your player on the narrow land between “boredom” and “frustration”. You cannot give to your player the possibility to win without doing nothing for 30 seconds.
The solution to this problem is simple. Use a Moving Average. The player will have to push the button faster than the threshold, but the average is computed only using the data from the last 5 second (or any other time window you want).
Turn-based Battle Systems - Chapter 2 - Analytical Analysis
Hello everybody! It is time to continue with our series on Pokemon-like battle systems. In this chapter I will be more general: now we have our beautiful damage formula and a draft of our characters sheet, it is time to quickly check if the game the formula is balanced. There are a lot of questions that we want to answer as quick as possible. How much HP the enemy must have? What is a good value for the attack power? Is the damage formula fair enough? The critical strike is too much? The randomness is too much? Is it fun?
Except for the last question, we can try to answer them just looking at the damage formula. Obviously we can not answer all the questions now, but if there is some evident mistake, we will be able to catch it as soon as possible. There are several ways to analyse the tuning and balancing problem for a damage formula (and thus for a large part of the combat system): analytically, with Google Sheet/Excel, and with a quick software prototype.
In this article we will start from the first step: the analytical analysis.
The Challenge of Infinite Space
A.K.A. why Elite: Dangerous, Star Citizen and No Man’s Sky could be doomed to fail
Since the beginning of the videogame era, developers aim to reach a perfect simulation of the world. “So realistic!” is probably one of the most abused comment to a videogame ever. The videogame industry tried to reach realistic graphic, realistic sounds, realistic landscapes and realistic Non-Player Characters. However, reaching the perfect realism is a never-ending quest. As soon as we reach something, desire drives us to seek more.
Now that we have extraordinary graphic capabilities and stunning landscapes, some developers are going to raise the bar to a much bigger task: simulating the universe (or at least, the galaxy). We are not in the first (game) generation who is trying to achieve that (the original Elite is a very old game indeed), but we are for sure in the first generation who can reach this goal; at least to some extent.
We have the technical capabilities for doing amazing things: we can generate and simulate hundreds of billions of star systems, we can allow the player to travel to every one of them, explore and land on every square unit of the planet surface, every asteroid, every satellite. Software/games such Space Engine can clearly show us what a lonely developer can do in its spare time. Imagine what a game developers team can do on their full time job! It is not a surprise that several studios spotted the niche in the market and tried to use this power for a real game. After all, it is not “simulation of experience” one of the meaning of “game”?
How to design a Pokémon-like Combat System
The Combat System is one of the main gameplay element in a game. Of course there are a lot of games without “combat”: puzzles, simulation games, driving games and so on. However (and you know this in the depths of your soul) that your game must have an amazing combat system because we LOVE beating the crap out of our enemies! Other games mechanics are good, but a good fight can be AMAZING.
There are several ways to implement a combat system but, at the end of the day, we can divide the heterogeneous world of combat systems into two big clusters: real time combat systems and turn-based combat systems. The first are exciting but they rapidly becomes hard to implement. We will need to do a lot of animations, tuning collision boxes and tons of graphical stuff. If you are a poor programmer like me, you cannot do that (sad face :<).
With turn-based combat system, instead, you can do the most complex things you can image! You can take into account hundreds of variables and statistics, create complex strategic combinations, evocations, magic, everything. You can use dice, cards, tokens, everything in order to emulate an epic combat between a dragon and drunk dwarf with a wooden leg. Because turn based combat systems are an explicit abstraction of a real combat, the player can absorb without complaining a bigger level abstraction. The same cannot be said for a real-time combat system in which just an ugly animation can be labeled as “ugly designed and sluggish combat” and provide frustration to the player.
So we are going to implement a turn-based combat system! But how? Well, this obviously depends on which type of turn-based combat system you want to do. For now, we will try to do a replica of the first turn-based game I’ve ever played: the Pokemon Combat System!
This is a nice combat system to replicate as a tutorial because is not too complex (especially in Gen. 1 or 2), but contains several tricky points that we need to handle! We will explore the design and the implementation of this combat system in details. We will see how to design the combat system, how to do a first balancing and test on paper, and every implementation step! So let’s start!
Boost Hierarchical Pathfinding with Extended Graphs
As you may already know if you follow me on Twitter (why not?), I often work with pathfinding. This thing started as a small side quest during my Ph.D. and then grew up to become the main topic of my future Ph.D. thesis. I’m still quite sure that this is not what I chose back in the day but, well, now that I’m on the dancefloor I have to keep dancing.
Returning to the subject, my work is totally focused on pathfinding with cognitive capabilities. This means that I try to embed pathfinding into a more high-level reasoning pattern or, if you prefer, to push high level elements - such as reasoning with keys and equipment - down into the pathfinding level. As a consequence I use hierarchical abstraction of the map space a lot and for “a lot” I mean that in the last year and half I’ve implemented Hierarchical Pathfinding (HPA*) at least 4-5 times in different context and languages.
Bacon Game Jam 09: Back in Business
Hi everyone! I’m here to tell you the story of my last game jam: the Bacon Game Jam 09. It was a long time since my last game jam (and my game-dev stuff in general). I was a bit distracted by other part of my life and, in general, I wasn’t in the best mood. Because of this, I’m very happy to partecipate to this jam, also if the final result is not completely satisfying.
Anyway, let’s start!