We may earn a commission when you buy through links in our articles. Learn more.

The Gunsmiths: The deadly bullet ballet of Max Payne 2

The Gunsmiths - Max Payne 2

This is The Gunsmiths, a PCGamesN series about videogames’ favourite interaction: shooting people directly in the face. There is no shortage of great games where gunplay is the main draw, so we wanted to dig down into these games’ inner workings, breaking them apart at a tool bench and seeing the components spread out across its surface. For our fourth feature in the series, it’s the balletic bullet dance of Max Payne 2. 

The past is a puzzle, like a broken mirror. As you piece it together, you cut yourself, your image keeps shifting. Still, I remember it like yesterday – my first victim in Max Payne 2: a balaclava-clad goon near a doorway, his back to a shelf filled with medical equipment. I fire a shot – straight to the head, dropping him faster than a grenade with a pulled pin – and he hurtles backwards as time slows to a crawl, knocking the shelves onto the floor, spilling the equipment everywhere, and causing another unit to crash into his limp corpse. 

Read The Gunsmiths part three: Turok 2.

All of this was unscripted. It was the first time I had seen real-time physics, and it made that single, simple encounter endlessly replayable. The thuds and crashes as body parts interacted with their surroundings, kicking up dust with every collision gave the entire scene weight. All of these interacting pieces made every encounter feel unpredictable. Of course, this also added to the workload for the developers. The audio designer had to create collision sounds for every type of material a dynamic prop could have, just in case any flailing body parts decided to donk into them.

Peter Hajba worked on Max Payne 2’s impressive audio – including foley work for some of the ambient noises to back its noir-style comic strips – but he also has a hand in creating the look of the game’s bullet impacts and particle effects. “For as long as I remembered, I had been kind of obsessed with bullet impact visual effects, not just in films but also in games,” Hajba tells me. “It felt like they could be done better. So for both Max Payne and Max Payne 2 I basically just wanted to do the most awesome bullet impacts ever made for a game. Impressive puffs of dust and sparks, pieces of tiles, bits of paper and the like.”

Max Payne 2Before joining Remedy, Hajba had gone to an animation school in Dublin. Remedy was still a small company back then, so everyone took on multiple roles. Hajba did sound, animation, texture art, some 3D modeling, and even work on particle effects. It was very hands-on. At one point, the team even went to a local dojo and threw themselves around on jump mats, recording deaths, running, jumping, and rolling on an old VCR. Hajba then watched these recordings as he did the work, animating these dives and tumbles by eye.

“Max Payne’s shoot-dodge dive was an interesting idea that our graphic artist Teemu Heinilehto originally came up with,” Hajba remembers. “He just wrote this enthusiastic ‘what if you could do this?’ email and we rolled with it. Our programmers needed to figure out a way to blend together eight diagonal dives, and for that I had to animate eight directional versions of the dive we could blend in between. So you could dive in any direction, then point the guns in another. It allowed aiming the guns horizontally quite seamlessly – but upwards and downwards aiming would have required additional layers of blending. We couldn’t just rotate the arms as that would have misplaced the grip and looked odd, so we had to drop it. Comical moments of diving down a staircase and pointing the guns forward but shooting straight down ensued.”

Before this, Max Payne could only dive in a single direction and aiming was locked to a limited cone straight ahead. The decision to add this twisty animation blending made the gunplay feel much more fluid. A similar thing happened with Max Payne’s Bullet Time mechanic. Originally, time slowed at set points in the levels and was not player-controlled. 3D Realms came up with the concept of making it player-triggered and turning it into a resource that Max needed to earn. Without these innovations, Max Payne and its sequels would have been rote third-person shooters, if sequels ever even happened at all.

Max Payne 2

To really get across that Matrix-esque bullet dodging fantasy – complete with slow-mo shell ejections and sliding mechanical parts – the game’s bullets had to exist physically. A lot of games use hitscan methods that instantly damage their targets with every accurate shot, but Max Payne’s bullets actually travel through the world. They are barely seen during normal speed gameplay, but become clearly visible during Bullet Time. “This took an extra effort to get working correctly, especially at high speeds – where you need to interpolate the hit detection so the projectile doesn’t miss a target between frames – but in the end it paid off well,” Hajba explains.

Max Payne’s engine allowed Remedy to make the bullets travel at realistic, supersonic speeds, should they wish. But this would have meant they would be hard to see, travelling as fast as they were, even during Bullet Time. So they did the sensible thing and slowed them down, ensuring Bullet Time lived up to its name.

“The particle effects were also calculated accurately and frame rate independently,” Hajba says. “Theoretically, if a projectile traveled at 10,000 m/s and the particle effect attached to it emitted particles at 10,000 per second, you would get a ten kilometer row of 10,000 particles one metre apart, as opposed to common cases where emissions are buffered per frame and you would get clusters of particles emitted at each frame – known as ‘popcorning’ of smoke trails. This caused extra CPU load – the Max Payne particle engine was more expensive than other systems at the time – but it was truly worth it during slow motion.”

Max Payne 2 made this process more complicated still, introducing stretched or elongated particles, rather than the more simple square billboards of the first game. Snowflakes and bullets sparks in the original had to be rendered into a baked sequence of frames, due to texture memory limitations, which gave them a pixelated look.

Max Payne 2

“For Max Payne 2 we made a rather clever particle stretch system which allowed screen space stretched billboards: a billboard would stay aligned towards the screen, but it would be skewed according to the direction it was traveling in screen space,” Hajba recalls. “This allowed very nice looking bursts of not just elongated sparks, but also smoke and dust being stretched a bit to give a sense of motion and connecting even a smaller number of particles nicely. We watched some action movies that had plenty of bullet squibs frame by frame, and noticed how the dust clouds looked ‘stretched’ due to motion blur.”

Layered over the top of these effects were the decals, bullet holes, and the like littering the environment, making you feel like you had caused chaos in the aftermath, perhaps when backtracking. The programmer, Olli Tervo, ensured every room had its own decal buffer, and that these actually got saved in the game save state – so if you came back to your game session later, all the bullet holes and blood stains in the level were still in place. To lower GPU stress, all of these decals were merged into a single mesh per room. This compromise did mean that there was a limit on how much chaos you could create, but the cap was high – you had to really try to reach the limit.

Of course, none of these visual flourishes would matter if the audio didn’t make the act of shooting sound satisfying. Unfortunately, they couldn’t exactly mirror the weapons’ real-life counterparts, since the rate of fire for each gun had been slowed down to work with Bullet Time. “The dual Mac-10 submachine guns were an extreme case,” Hajba says. “The high firing rates and dual guns meant that spraying projectiles at a realistic rate would have caused just way too much CPU load. So a bit of smoke and mirrors were applied. The firing sound was a queue of bursts of four (or eight for dual) shots, to drop the projectile rate to a reasonable level.

“I went more or less by feel and ear, but with some principles: gunshots shouldn’t be fatiguing or annoying to listen to; there needed to be variation on repetitions; they needed to sound powerful; and the player’s guns should always sound more powerful than the enemies’ guns. It was all very much learning while making, but a good few lessons had already been learned during the development of Max Payne. The iconic Bullet Time start sound was a bit of a lucky accident. I mixed together a few impacts and explosions that I pitch bend down with Sound Forge. Done.”

So, the next time you diving down some stairs in slow-motion, filling some goons full of lead as your cartridges gracefully eject from you dual pistols, spare a thought for all the components that fit together to make it work. Show some appreciation for the gunsmiths at Remedy.