Thursday, October 18, 2012

[FS] BoOm Headshot!!!

Infinite-Gaming.com Presents:
A Tannz0rz and Cyber_Punk Production
(in other words scripted by us)

BoOm Headshot


Intro:

Before I get to the nitty gritty, first off I would like to explain exactly what this script does, what it intends to do and finally what it will pull off. This is nothing more than a line tracer that takes 3d camera coordinates and translates it on your screen. The goal of this line trace is to have the line end in the location you had your cross hairs at the moment you hit the fire key. While that's what the line does, the script on the other hand checks at a per unit basis (1.0 GTA unit) if a player happens to be in that path at the moment that line hits him. If that line is near his head, BoOm Headshot.

There is no hocus pocus, no trickery and defiantly no hit boxes involved.


Before we released this script we wanted to get a good understanding of just how everything would play out, especially in the processing department. We could have had it out sooner but there was some testing to be done and also had to fix bullets from shooting out behind you :P (yes thats fixed).


What you need to know:


Surprisingly with a 50 player loop (standard loop) it took the headshot function an average of 7 to 8ms to complete that was at the max distance of 100.0 units (Sniper Rifle), with foreach it was 0 to 1 but that was with one player on the server. To further test the function I made the loop max at 500 and stuff an array of 500 locations into the IsPointInRangeOfPoint. The end result with 500 players (pseudo connected test - real results may vary) was about 76 to 78ms. The ranges used for the weapons all came from weapons.dat, the amount of time to process the function decreases after the Sniper Rifle. Small handguns take an average of 22 to 25ms with 500 players (due to the shorter distance checks).


For a high player count server it is recommended that you do not comment out CONSERVATIVE mode


How To Use:

Code:
//======Config Options
//#define DEBUG
//#define NO_LOS //Uncomment this if you want no "Line of Sight" with your DEBUG mode
//#define FOR_EACH
#define CONSERVATIVE  //Comment for servers less than 100 players....Use @ your own risk.
#define DESTROY_LOS 500 //Time in milliseconds to remove line of sight objects
#undef MAX_PLAYERS
 #define MAX_PLAYERS 50 //Set to your max players

//======End Options

This is the default configuration, first be sure to set your MAX_PLAYERS. Then if you prefer foreach (by Y_Less) and you have it in your include folder you can uncomment #define FOR_EACH, this will set up its own itter for the processing. For everyone's curiosity I left the debug mode in including the line of sight code. To use debug simply uncomment the line, if you don't want the i icons uncomment #define NO_LOS, alternatively you can also set the amount of time before the icons disappear with DESTROY_LOS.

Conservative Mode:
There are 2 modes to run BoOm Headshot by, the default is a conservation mode to prevent rapid fire headshot detection from lagging your server. While it has not been test in the real world, speed test results on a dual core processor shown that an extreme numbers of players firing weapons at the same time might lag your server (again all theory haven't really tested on that scale). To comment out conservative mode on a high player number server is done at your own risk.

For servers with 50 players the time to process was much much faster, 7ms and allows for rapid fire weapons to potentially detect headshots with every shot fired (give or take a few sync/timing isn't always perfect)

Videos:
http://www.youtube.com/watch?v=w1R-n9S4oMg#


Final Notes:
The distance loop will end if a success full hit, this further helps speed up processing time. There is no object or health detection method on this script. During testing we found that it was hardly an issue, to be honest I have never seen so many draw kills (where both attackers kill each other) till this script, even with higher pinged players. If the need arises we may put something in.

*Could we detect nut shoots* YES! - Why didn't we? Well we were going to then I made headshots work for crouched players instead. Maybe next version.

Download:
www.infinite-gaming.com/iG_BoOm_Headshot.zip

No comments:

Post a Comment