Thursday, April 30, 2015

Arma 3, Bombing Run System

As a part of the mission/mod that I am creating, it involves a bombing run with one or multiple planes and zones.

Bombing run script

I wanted the script to be a proper bombing run, not just a red circle (bombing zone) that appears on your map and then a heap of explosions scattered around the place *cough*... as there is little to no immersion in the game-play for any players, and rather unrealistic.

I sat down, and thought about how I wanted my version to be, and came up with a rather decent solution.

When the bombing zone is spawned in-game, whether once or six times at once, each jet plane and zone is kept separate from the next. Each jet plane spawns out-of-bounds, so that any player gradually hears and sees the jet... it gives you pre-warning.

The jet plane will do a low altitude fly-over for the pre-warn (the jet sound is loud), the players would check their map (default 'm' key) to see where the bombing zone(s) will be placed, as they would be marked in an amber marker with a random size/diameter. If any player(s) are in the zone... it would be time to run run run!

The jet plane will then loop around (avoiding all other air traffic), gain altitude and fly back over the determined bombing zone which in-turn, changes the amber marker to red, and it's bombs-away!



Uh ow... bombing zone
 
Once the jet plane has dropped all it's bombs (bomb number depends on diameter of zone), it then flies off into the distance, which removes the red marker from your map... hopefully by this stage, you are still alive! :D

Bombs be dropping
I have gone over my bombing zone script multiple times, redone the procedures, redone the variable checks, redone the cleanup of entities/objects/etc... and can now say that whether I run the script once or twenty times at the same time... everything works perfectly, each jet plane does-their-own-thing and there are absolutely NO left-overs to clutter up memory (memory leaks) or affect FPS.

From being a novice at Arma 3 scripting/coding, and learning as I proceed, I'm fairly proud of what I have achieved in a short amount of time.

The video below shows an in-game demonstration of my bombing zone system in action. In this video, I ran the script/function six times at once... as you will see multiple amber and red zones on the map.



Another part of the mod created, more to follow.

-soul.

Tuesday, April 21, 2015

Battlefield Heroes, The War Is Over

I had played this game since "closed beta" (2009), and now after 6 years... the war is over. EA/EAsy are closing down the game.

From the beginnings the game style had potential, it was great fun, the game mechanics were enjoyable, and it was a unique third person cartoon style shooter. Weapon load-outs, abilities, taunt emotes, custom clothing/skins/etc... it was rather unique.... somewhat clunky, but unique.

Battlefield Heroes - War Is Over Heroes
I started off with three National and three Royal characters, one in each class, gunner, soldier and commando, and got every single one of them to max level (level 30).

I found each class as enjoyable as the next, and pretty much mastered them all. It was fun slaying opponents with a machine gun and rocket jumping over buildings as a gunner, lighting opponents on fire or blast striking as a soldier, and running around invisible and head shot sniping as a commando.

Along the way there were game-breaking game bugs, servers not being updated, a huge influx of hackers and pay-to-win update after update after update... and the game bugs still existed (as did the hackers).

Once the fun got sucked out of the game and EAsy neglected the game, a lot of players from the closed beta... up and left. I was one of them.

For what "BFH" was, it was greatly enjoyable for the most part, and it is a shame that it is now closing (as their other "free-to-play" titles are).

After months of little to no updates back in 2014, I gave the game until the end of 2014 before it was gone/kaput/dead. I posted on the "BFH" forums to show my concern and opinions about the game time and time again, but most was ignored... and quite a lot of the player base refused to believe that the "game was dying".

So now at this time... it's kind of a "told-you-so" scenario to those that didn't want to listen, even though the game will be playable until July 2015... I was correct in my prediction of them closing it all down "soon".

I met quite a lot of decent players across the Oceanic and Asia community, I played in a squad/team, played with/against other squads/teams... and it was enjoyable (apart from my ISP latency issues).

Greets go out to tN (Team Nads), db (dubbrothers), nSg (no sh*t gaming), all the independent players that were in game with me and/or use to rage against me and/or accuse me of hacking over and over and over. :D BOOM HEADSHOT!

All-in-all, it was fun while it lasted (6 years)... and I hope to see a similar (non pay-to-win) version of BFH in the future (hopefully not made by EA or EAsy).

-soul.

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.

Sunday, April 12, 2015

Arma 3, "Last Man Standing" Mission/Mod Creation

As some may already know from chatter around the Arma 3 and Twitch community, that I am currently creating my own "Last Man Standing" game mode for Arma 3.


Arma 3 Editor
Why you may ask? Well the short answer is, the game mode which is currently available for Arma 3 gamers to play is very clunky... and yes I'm talking about "Battle Royale".

In the beginning "Battle Royale" was pretty much all I played (version 0.4.0) on Arma 3, I quite enjoyed the game mode and the play style. Since each update, the game has become more unplayable due to bad scripting/coding, which caused desync issues, game bugs and overall frustrating game play... which therefore, the frustrations/annoyances outweighed the enjoyable gaming experience, so I stopped playing.

Having a scripting background, I have found it fairly easy to adapt to the Arma 3 scripting/coding structure... I have dug around in the code, wrote my own code, tested, debugged, tested more, etc etc... and have now scripted quite a chunk of my game mode.

So far I have successfully scripted, tested and debugged the following parts of my game mode...

+ Parachute Fix (a custom parachute script which allows the parachute to instantly release upon touching the terrain/object beneath your feet).

+ Loot Spawn (with random building damage, random open doors,
dynamic and static loot spawn positions, custom loot table).

+ Land Vehicle Spawn (vehicles spawn at random positions around the map on/beside roads).

+ Water Vehicle Spawn (boats spawn at random positions around the map shoreline at a minimum water depth to prevent beached boats).

+ Wreck Vehicle Spawn (wrecked vehicles/road blocks spawn at random positions around the map with deceased soldiers with custom clothing/weapon/item load-outs).

+ Bombing Run (Jet planes fly over the map as a warning, then loop back and drop bombs).

+ Care Package Run (A cargo plane flies over the map and drops a random military care package crate. Custom colored smoke will show you where the package will or has landed).

There is a lot more for me to learn, understand and script, as it has been a learning curve for me, but there is progress on my game mode each and every week.

I am doing this currently as a solo project, so it may take some time to implement to an alpha stage.

I have a lot of ideas on the game mode structure, timing and sub routines to put into script/code... but am excited in seeing my hard work come to fruition.

For those that have given their support and continue to give their support, I thank you.

I will post up more blog updates with screen shots and video demonstrations on progress and where the game mode is headed.

View my blog regularly to keep informed.

-soul.

Friday, April 10, 2015

Arma 3, Mute/Unmute Script

Whilst playing Arma 3, I found it frustrating that one could not easily mute/unmute the sound.

I had to go into the Arma 3 menu for audio, drag the slider down... then drag it back up again... and had to do this over and over and over... rather annoying.

I then did some research on a solution and couldn't find anything that would help. That's when AHK aka AutoHotKey came to mind.

I ended up finding some example code of what I wanted to achieve and continued from that.

AutoHotKey mute/unmute script
The script is coded for AutoHotKey Version 1.1.19.01 which you can download here. You MUST download and install this in order for the script to run and function.

You can view and download version 1.1.6 of my script here. The script also needs VA.ahk which you can also download at the github link above.

Once AHK is installed, the two script files are downloaded and expanded/unzipped, place the two .ahk scripts into the same directory and run/execute (double click) the "arma_3_mute_script_for_autohotkey_-_osd.ahk" file

A green icon should show up on your task bar to show that it has successfully loaded.

Go into your Arma 3 window, so that the game is focused and press the combination hot keys... 

"ctrl and numpad *" which will mute/unmute your audio for Arma 3 with the OSD showing.
"ctrl and numpad -" which will lower the audio for Arma 3 with the OSD showing.
"ctrl and numpad +" will increase the audio for Arma 3 with the OSD showing.

OSD when muted
OSD when adjusting volume
The script works with Arma 3 in all screen modes, full screen, window and full screen window modes, and are currently bound to keys on the numpad - + and *. The OSD will only show when the Arma 3 window is active and focused. The OSD also has a visual time-out set to 2 seconds, so it will remove itself from screen.

Please read the text at top of the script in order to understand how it functions, what is needed to make it function and how to customize the bonded hot keys.

Enjoy.

P.S. If you would like a compiled executable (stand-alone) version of this script, please message me.





-soul.


Tuesday, April 07, 2015

Arma 3, Loot Spawn System

So the loot spawn system is what I initially worked on, due to curiosity more than anything to find out how loot spawns and how difficult it is to correctly calculate in world positions.


Loot spawn script
I then expanded upon that script whilst learning the Arma 3 code structure, etc and created my own custom loot spawn system (small preview of the code above).

Basically what my initiation system does is this...

It gathers ALL buildings on any given map within a radius from a center point (currently set for 6000m on the map Stratis). It then damages buildings and opens doors on buildings based on probability, so each and every game is random. You will no longer be able to know if someone is or has been in the area based on doors being closed! That's right... not every door opens.

It then reevaluates the buildings and gathers all possible available building positions (green circle markers), as well as calculates a number of random building positions outside of the building model (red circle markers), as well as gathers manually placed building positions (set by myself in another config file, yellow circle markers). This structure is static and dynamic at the same time, which makes for a more random outcome for possible loot positions.

The colored building markers are to show which buildings have default loot positions available (green), and those that don't (red). The other building colors of khaki green (with default loot positions) and black (without default loot positions) tell me that those are damaged buildings.

Possible loot spawn positions
(red = random outside, green = default inside, yellow = custom inside)
Once all the building positions on the map are calculated and acquired from the default config as well as a custom config, it then initiates the actual loot spawn and makes calculations based on map size, playable area and item/weapon probability.

Loot spawn positions vs actual spawned loot
The loot table is fully customizable and easily configurable to add in new items/weapons or increase/decrease probability of loot spawning in each possible position. The debug markers in the above screenshot show what spawned where, the quantity and how high the item is above the terrain/floor level.

Look Ma, no floating loot!
As you can see in the above screenshot, loot will spawn at ground level each and every time, no matter what building the loot is around or inside. Scripting calculations FTW!

I am in the process of also adding custom buildings/towns to the map Stratis, so that loot spawn points are not concentrated on the air field, marinas or camps. There will be town(s) in the south of the map, north of the map and east of the map... to keep things more in balance (similar to what the wasteland mission has), as well as "beefing up" the existing places.

I will post a proper video demonstration of the debug markers and actual in-game "loot mongering" to show everything in action.

I have tested this script over and over again, rid all the scripting errors, optimized the code structure, and am quite pleased with the outcome.

I am also able to easily swap the loot spawn system to any map I decide to throw at it with very little manual configuration... (map size and probability) and it will run flawlessly. I've tested the script on the maps, Stratis, Wake Island, Gorgona and a few others... every time... flawless.

I hope that gives some insight on the loot spawn system in which I have been working on for the last few weeks.

Dynamic coding/scripting FTW!

-soul.

Hey, I'm soul.


For those that don't know me, I'm 'soul', I'm a current player of "ArmA 3" with it's various multi-player missions and mods. My in-game-nick is usually 'soul[kobk]' or a variant of it.

KOBK - Kill Or Be Killed
Within Arma 3 I started off playing "BR" aka "Battle Royale", which is a last-man-standing mod... but due to the annoying game bugs (specific to how it's coded/scripted), I stopped playing.

During my "BR" gaming, I wrote/compiled an "Auto Hot Key" mute/volume script for Arma 3, so that players and streamers (twitch.tv) are able to mute/un-mute and adjust volume with the press of a key. You can find the latest/last version here on my blog.

It also seems that the staff/developers of BR don't like suggestions about enhancing the game play for all involved, since I was banned from their forum for 'attacking others' *rolls eyes*. If you care to have a read... you can view the forum threads here and here (links updated due to the forums being removed). The basic point I was trying to get across within my suggestions was... "if the frustration outweighs the enjoyment of the game/mod... people will stop playing it and supporting it". (stahp causing drama!).

Since I stopped playing "Arma 3 Battle Royale", I thought to myself "how hard would it be to code my own version?"... and began digging.

Over the last few months I have read, learned, read, learned, debugged and fixed code within Arma 3, and now have coded roughly 50% of what "Battle Royale" is... minus all the annoying and frustrating parts... and somewhat better.

Better as in...

A proper and less frustrating parachuting experience to the ground, you won't get dragged across terrain when you land, as the parachute instantly releases upon touchdown of the ground/surface you are landing on. Yes you can land ON buildings, ON rock formations, ON hillsides with ease. The game mode should be less about parachute mastery and more about PvP survival... hence the "last man standing" game mode.

No bugged loot (below ground level) or floating loot (floating 3 meters up in the air) or disappearing loot (crap... where did that go? *scratches head*) which is unobtainable.

No beached boats... yes that's right, I actually coded my own version, the way it should be.. and spawned boats IN the water, not on shore (my boat spawn script calculates depth of water before placing a vessel).

A proper "bombing run" scenario, that jet planes do a low fly over as a warning and then loop back to drop bombs (all with warning markers on map). Whether there's one zone or ten zones on map at the same time, they all execute flawlessly.

A proper "care package" scenario, that a cargo plane delivers packages at random, in a proper military crate, and all the item/weapon contents is kept INSIDE the crate. Custom colored smoke also add to the immersion and effect from when it is dropped from the cargo plane (not just red smoke grenades).

... and many more features including decent wreck sites scattered around the map with custom dead soldier item/weapon loud-outs, drivable civilian vehicles scattered around the map and extra manually placed buildings/towns (especially in the map Stratis, where some sections of the map are scarce for loot spawn).

Over the next few weeks/months, I will continue learn/code/script my own Arma 3 "last man standing" mission/mod, but thus far, everything works 100%, no bugs, no errors, just enjoyment.

I will begin to post screen shots as well as videos of my progress on my youtube channel for all to see.

Once everything is coded, I will Alpha test with help from those that support me in the Arma 3 and Twitch community and those who are eager to just play, suggest and help out in the debugging process (although most debug is already done).

Whatever the case, this blog is the place to keep informed on the progress.

-soul.