Whilst we generally understand that game dev is difficult, it’s more an understanding born out of the end product, due to delays, failures, bugs, and oversized budgets.
Because it’s viewed as an amorphous blob, I feel that outsiders don’t quite get the more micro level nuances that make games development hard. This leads to unhelpful rhetoric in both professional and individual commentary.
I’ve been trying to find an example, that I can quickly use to give a glimmer of how difficult making a game can be, and I’ve landed on one.
It’s not representative of the wider struggle with budgets, engines, art, narrative etc, but more a “if you started to make your own game, what key issue would you first encounter.” From there hopefully people can understand that a game is hundreds of complicated systems layered on top of each other.
The example is the super simple platform jump….
Jumping in video games is a tentpole mechanic and despite fifty years of games development this relatively simple thing you can do in a game, requires some complex problem solving.
Problem #1: The environment
Before we even get to the point where the press of a button causes our character to jump, we need to solve factors in the development environment.
Button Mapping
Gravity
If you are making a game, you need to solve for multiple kinds of input. Even if you are not allowing buttons to be remapped, you still need to account for the differences between a controller and a keyboard.
Many engines have an Input Mapping system, so you’ll need to set that up to register the expected defaults (unless you are going for something different). That is Space on the keyboard, A on the Xbox Controller, X on the Playstation Controller, and B on the Nintendo controller.
Ensuring that you have set up your input map to allow any one of those buttons to correspond to the same response, is vital to allowing jump to be efficiently handled, regardless of the input device. Normally in prototyping we’ll start by telling the game engine to look for ‘space’ being pressed to trigger the jump, but once we move into production ready practice, the piece of code that is waiting for a jump command, needs to be flexible enough to take any of the accepted inputs.
Secondly is gravity, if your engine has gravity built into it, it will make the next two steps of the process easier. If you’re one of those mad men making an engine from scratch, or are using an engine without gravity, you need to go build that, or plan for a way for gravity type actions, such as jump, to work.
Assuming you are using an engine with gravity, you need to go then ensure that gravity is acting on your objects. It’s off by default because many elements like platforms and UI don’t need a gravitational pull moving them from their position.
Normally this looks like selecting your character and making sure the shapes that make up that character are compatible with gravity mechanics, it normally states it in the description, and that you have enabled gravity for that object.
Unless you have a specific reason for changing it, you shouldn’t need adjust the gravity drag.
Problem #2: Going Up
Right, now we have gravity and a way to tell the player to jump, now we have to move the player.
Objects in a game are set in a two or three dimensional environments so when we order our character to jump, we are moving them up in that space.
However, there’s two way to move objects in an engine’s space, you can either physically move it, or propel it. It’s easy to say a jump moves a character ten pixels upwards but that’s point to point and looks rigid and doesn’t flow.
Instead, you need to add momentum to the character so the character goes up and looses it’s momentum at the apex of the jump allowing the drag of gravity to negate the momentum. You’ll need to play with the momentum placed on the player as too little and you' won’t jump that high, too much and you’ll fly off the screen (i’ve done this several times).
Problem #3: Landing and handling bugs
Now your character jumps up and comes down you’ve opened up a new issue.
You’ve programmed the character to be propelled upwards every time you hit the jump button. This opens up a problem where a player can hit jump whilst the player is still in the air, repeatedly hitting it would send them off the screen.
The common way of resolving this is by adding land detection, a way of turning off the jump command until the character lands on the ground again.
If you wanted to have a double jump, then you’ll need to limit how many times jump can be activated before the land detection kicks in.
At this point all you need to do is change the sprite to a different one to show the character jumping.
Now if you are making a simple Mario -like platformer then this is all you need.
If you’re making something a bit more complicated like grappling on edges or flips, you’re going to need to increase the complexity.
Simple right?
A simple game mechanic such as jumping required eight-hundred-words to explain at a medium-to-high level what it takes to implement it into an off the shelf game engine.
Take a moment to think of your favorite game, which will contain a multitude of different systems, from running, jumping, shooting, game UI, save state functionality, and probably the most complicated of them all, multiplayer.
It’s actually a miracle that any game gets made, to be honest, you’ve got hundreds if not thousands of systems all working together, after months if not years of testing, play testing, tweaking, re-building.
While game development is more accessible to anyone these days, it doesn’t mean that it is easy, and it definitely doesn’t mean that any random Joe off the street knows what they are talking about when the criticize lazy devs. 🤣