How gibs are generated in Brigador Killers


For this month we’re going to explain how the Brigador Killers engine handles the emission of gib sprites from entities during gameplay. In other words, this.


We’ve established in previous news posts that all you’re looking at on screen are flat 2D sprites and that BK’s systems can overlap in interesting ways to create unexpected outcomes, but we haven’t touched on the data end of these things.

First off, to save on space, both the Brigador and the BK engine store all assets in a large collection of compressed data called a pack file which has the exciting name of assets.pack. By using the game’s debug panel, we can look up these assets via the Pack file tab. At time of writing there are roughly 19 thousand assets categorized into 60+ different “resources”. Sometimes these assets are .png image files (such as the various sprite sheets for all the building props and characters) but a large portion of them are JSON files which allow us to specify the values of all sorts of various things in a human readable manner. Most of the screenshots in this post are of the game’s debug panel, which is a version of Dear Imgui that among other things allows us to look up and iterate on data values during a game’s runtime without having to make a new build of the game.


The JSON for a specific unit can be made up of several JSONs itself. For instance, let’s look at foot_loy_bd_01.json, which is the JSON file for a typical enemy infantry unit, and which turns out to be made out of a lot of JSONs.


The keen of eye will notice that, yes, infantry in Brigador Killers are all technically mechs behind the scenes - anything in assets/data/vics/units is a mech, be it the player in a carmine suit or an NPC-controlled forklift truck. This is just how the game data is organized. From this list of JSONs, we want to inspect the unit’s salvage, which is a file called salvage_foot_01.json.

Here you can see not only even more JSONs attached to this one, but also the types of values that can be assigned to its salvage “hulk”. A unit’s “hulk” is what is left over after its health has been fully depleted. Vehicles that have been destroyed will leave a wreck, which is usually just the top part of the same model but desaturated to give the appearance of burned out armor. From the above menu most of the values are set to zero, as the hulk left over is for a body instead of a chunk of metal, but for purposes of player reactivity, hulks will still have some amount of health. Tangentially, infantry units as seen from the opening GIF will go through a series of animations as they are being attacked, which is not handled in this menu - that’s part of what’s called Flinch, Suppression, Flop and Weapon Stability, which looks like this:


Getting back to the gib sprites, we look at what’s assigned for the on_damage_pyro, which is pyro_blood_mist_01.json, which is emitted by infantry-type NPCs and is a pyro-type resource.


Within that JSON we look for the gibs assigned to that pyro, which leads us to gibs_blood_mist_01.json. Explosion layers and lights are for “bigger” pyro effects. For instance, a gas station blowing up will need a fireball attached. Three layers down we have arrived at the resource that handles the attributes of blood sprites that an infantry NPC will emit on receiving damage: gibs_blood_mist_01.json


Here we can see what type of sprite has been assigned and how the animation for that sprite is set to play. We also get to decide how many blood mist sprays shoot out from the unit and at what speed, height, angle etc. These numbers are kept low for infantry gibs but, if we want to get silly, we can crank the numbers up and end up with something like this.

Again, the use case for more flamboyant gibs would be the destruction of a bigger entity like a heavy vehicle or a building prop that will have their own pyro and gib effects. Note again like in the first GIF at the top of the post an entity will do more than just shoot out a blood mist spray - just like a practical effect in movies, a “squib” also plays out to leave a blood stain on the ground. But unlike movie FX, we have to account for more situations than a carefully staged scene. Therefore one of the many other things to bear in mind with making these gib effects is that they have to have different “spreads” depending on what caused the hit. Here for instance is what happens if we put a bunch of infantry NPCs in a straight line and attempt to drive a heavy caliber round through them.


On top of the fireball explosion sprite and the bloom of light for the explosive bullet, you’ll notice that there’s some uniformity to the ground spatter. This is because the sprites will only shoot out from an entity a limited number of ways. It would be too expensive (and a waste of time) to have our artists render out every single possible angle. Instead, the hope is that the gibs are done in just enough ways that the player fantasy is maintained.

Thanks for reading, and happy halloween! 




Get BRIGADOR KILLERS

Buy Now$25.00 USD or more

Leave a comment

Log in with itch.io to leave a comment.