Monday, April 13, 2015

Arma 3, Loot Spawn System - Video Demonstration

As promised, here are a couple of short videos of my loot spawn system in action, with an explanation on what the colored markers represent.

Loot Spawn - Debug Markers

The green circle markers are default loot positions retrieved from the configuration within Arma 3. 

The red circle markers are dynamically/on-the-fly generated loot positions on the outside of any given building

The yellow circle markers are static positions which were created for each building model, as some building models had a shortage of possible loot spawn positions. Each position was created manually via some in-game positioning code, then pasted into a separate configuration file. The result... custom and more possible building positions to spawn loot at.

The video below shows the loot position calculations in action in debug mode.



The green building markers are to show which buildings have zero damage and have default loot positions retrieved from the configuration within Arma 3.

The khaki green building markers are to show which buildings are damaged and have default loot positions retrieved from the configuration within Arma 3.

The red building markers are to show which buildings have zero damage and have no default building positions.

The black building markers are to show which buildings are damaged and have no default building positions.

The debug marker colors above make it an easy way to first configure the buildings on any map I decide to run the script on. I also have building model names and other information I can turn on If I choose (makes it quick and easy to debug issues).


The video below shows the loot spawning in any given possible loot spawn position.




The loot is spawned with a probability set in the configuration file, based on size of the map, the playable area and number of accumulated loot positions.

The markers are self-explanatory. "<amount>x ItemConfigName @<height above terrain level>". The colors are used to differentiate each item class.


The video below shows some in-game footage in relation to the above two debug videos.


Within the Arma 3 engine, it is hard to properly calculate the relative position for each item, whether on the ground, or on a surface (2nd and 3rd level buildings), sometimes the "loot" can glitch just below or just above the surface.

Example... if you encounter any loot that seems to be glitched into the floor/terrain below, pick the item up and drop it again. 9 times out of 10, the item will glitch back into the floor/terrain. This is due to the physics in the Arma 3 engine. Sometimes it can be scripted/coded to correct it, but other times not.

In my loot spawn system, you will not find loot spawned 3+ meters up in the air which is unobtainable, nor loot that has disappeared underneath the floor/terrain. If the loot calculations do glitch, they will either be half visible or floating less than 1 meter from the floor/terrain below.

In reference to the above statement, I could possibly create some code to precisely calculate the exact positions in relation to the floor/terrain below... but it would take 5x longer for the loot spawn system to complete... so for the time being, I have reached a mid point on calculation speed versus glitched loot.

Each script/code for my last man standing mode is rather involved, has many of many of many calculations are involved. The debug process and optimization process is rather satisfying when a script/module is completed with no bugs/lag/desync issues in-game.

I hope that gives insight into my loot spawn system.

-soul.