Crash Test Dummies In Brigador Killers


Restitution - Physics. the return to an original physical condition, especially after elastic deformation. 

Video games are not bound by what we understand to be the laws of the universe. Objects can be given ridiculous values for their acceleration or mass and they won’t suddenly create shock waves or distort space time around them if the engine running that game doesn’t have systems trying to simulate those things. Generally speaking, games trend towards simplification when recreating the underlying chaos of nature. Note that this doesn’t mean work isn’t involved - the math for things like real time fluid simulation are very complicated and resource intensive, so to get the thing running at a steady framerate concessions must be (literally) made. At the same time, this simplification process is where things that might be referred to as “jank” can appear.

Entities in the Brigador engine love to spin


Jank isn’t necessarily bad - in the above case it’s just an example of the Lobo inflicting pure impulse on the car with both set to deal no damage - but it looks “off”. Within the game data, impulse is the value that decides how much “push” another entity has. In this instance the Lobo is applying impulse with its arm swing, while the car is applying its own pushing force by driving into the Lobo, but it’s not quite right because the Lobo is being shunted slightly while the car bumps off it and spins nearly 270 degrees. In isolation this might look fun, but in the heat of gameplay a vehicle wildly clipping into the player might get old fast.

[Tangential: one in-game distance unit is equivalent to just over 8 ft (or 2.44 meters). A “tile” in-game is two units by two units. Mass correlates to kilograms 1:1. For example, “Dave” who has featured in previous posts has a mass of 70 kg.]

Dave standing on a tile

To keep things simple in the Brigador engine, only NPCs are affected by impulse. Props (static objects like lampposts or office buildings) are not affected by it - though that is not to say props do not have an effect as was discussed in this previous post. So how do we go about reducing janky moments like the one above? It sounds crude but in truth we just start smashing things into one another and keep changing the values until it’s right. In other words, a crash test.

Two identical Lobos at one end, with two cars going at full speed towards them. The car on the left can go faster than the other one, though in this next gif the “slower” one arrives first in frame.

In this demonstration the slower car (with all its doors) has a mass of 615 kg, the faster one (no doors) has a mass of 750 kg. The Lobos are both 1000 kg. 

There is a name for the phenomenon when two bodies collide with one another: Coefficient of Restitution. To directly quote the wikipedia article: 

…the Coefficient of Restitution (or COR) is a dimensionless parameter defined as the ratio of the relative velocity of separation after a two-body collision to the relative velocity of approach before collision. In most real-word collisions, the COR lies somewhere between 0 and 1, where 1 represents a perfectly elastic collision (in which the objects rebound with no loss of speed but in the opposite directions) and 0 a perfectly inelastic collision (in which the objects do not rebound at all, and end up touching).

For our purposes, we need the COR for the bodies involved to be neither too close to 0, nor too close to 1. In the example above the COR is about 0.35.

In this next example, the Lobos have a higher COR of about 0.75 meaning they will spring back more than in the previous GIF - notice how the Lobo on the bottom being hit by the slower car doesn’t get knocked over until the second impact.

If we keep these same parameters but decide to increase the mass of the Lobos up to 1500 kg from 1000 kg, then the impact will look like this.

Neither Lobo is knocked over on the first hit and both cars bounce back pretty hard. Since there’s a greater disparity in mass between the two entities, the resulting bounce is harder. 

Because restitution is basically how much inertia is preserved after an impact, this ties into another system that we’ve mentioned before - reverse trample (short version: both rapid acceleration and deceleration can be deadly). So if cars end up having a default COR of 0.35, and that at full speed that deals about 50% of their HP on impact (such as from hitting a wall, or hitting another NPC of equal or greater mass with a COR of 0.35 or lower), then hitting a unit that is both bigger (like the Lobo, or a mech, or a tank) and has a higher COR means the impact will be more destructive.

Whether that destruction is fun, however, is a different question. We expect players will want to gun the engine, but we might not want to make every impact potentially lethal to the player.

Something else discovered during these crash tests is that reverse trample damage does carry over into what’s called overkill damage. In plain terms this is what happens if you drive a 2000 kg cop cruiser into four Daves.

In other words, if you have a heavy enough vehicle moving fast enough, you will insta-gib infantry.


We've just launched four new pewter miniature Brigador models for our merch store and a 20% holiday discount from now until the end of 2024. Full details can be read in this post over on Steam


Alternatively, if you want to go straight to our merch store, click here and don’t forget to enter HOLIDAYS2024 at checkout.


Get Brigador Killers

Buy Now$25.00 USD or more