[quote]Restitution - Physics. the return to an original physical condition, especially after elastic deformation.[/quote]
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 wont suddenly create shock waves or distort space time around them if the engine running that game doesnt have systems trying to simulate those things. Generally speaking, games trend towards simplification when recreating the underlying chaos of nature. Note that this doesnt mean work isnt 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 isnt necessarily bad - in the above case its 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 its 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 its 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:
[quote]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).[/quote]
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 doesnt 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 theres 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 weve 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 whats 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.
Over on the Brigador: Up-Armored Edition news section weve just announced four new pewter minis are coming to our merch store, as well as a 20% holiday discount. Full details can be seen here.
https://store.steampowered.com/news/app/274500/view/4488495001178736877
Alternatively, if you want to go straight to the store, click here and dont forget to enter HOLIDAYS2024 at checkout.
[ 2024-11-28 19:21:42 CET ] [ Original post ]
🎮 Full Controller Support
BRIGADOR KILLERS is an intense story-driven isometric action game. Can a secret hit team of Solo Nobreans get revenge on the traitors deep in enemy territory, and still get out alive? The mercenary violence of BRIGADOR (2016) spills over onto a new planet, with revised controls and an all-new storyline mode.
WISHLIST NOW!
- Processor: 2.6 GHz or fasterMemory: 4 GB RAM
- Memory: 4 GB RAM
- Graphics: AMD Radeon 5770 / NVIDIA GTX 460 or better
- Storage: 1 GB available spaceAdditional Notes: Mouse and keyboard or controller required.
[ 6086 ]
[ 3241 ]