Jump to content
Sign in to follow this  
kremator

Heart of the action .... how could I visualise a battlefield to know the 'front'?

Recommended Posts

Dear scripters,

Once upon a time there was a game (can't remember it's name - possibly Planetside) where you could look at a map, and see where the action was. The action would be shown as a explosion graphic on the map and you knew to head there to support your friendly troops. There needed to be a certain minimum number of deaths (friendly or total) that showed a small graphic, with larger scale deaths shown as large explosion graphics. We could think of these graphics as SITREPS from our troops.

My question is this. Would such a script have a high CPU overhead (counting nearest units, or fired event handlers, or counting !alive units). Would there be a CPU-friendly way to write this, before I start?

Any help would be amazing, as I am NOT a scripter at all (unless you could AirTrafficControlRabbitTM!) - I'm more of an 'ideas man'.

Share this post


Link to post
Share on other sites

@Krem

Hi mate

COSLX (CO/OA) and A2SLX (for A2 only) puts red markers where your allies are wounded (immobile). Not compatible with DAPMAN, however - DAPMAN will stop working by design to avoid script clashes. I have no idea how Solus' implemented that but if you or a 3rd party could extract that code, it should give you quite a bit, maybe all of what you need.

Share this post


Link to post
Share on other sites

Well, I have two pieces of code, that do something similar, maybe this will be useful somehow. Still do not know, if these are heavy for CPU. It is possible, depends on the number of units engaged in combat. If so, the effect will be rather slow down work of this and other scripts active in the background, than the FPS drop...

Prepared some simple demos for them with 525 units engaged in firefights (just watch the map). Both scripts of course may be adjusted.

1. "Blood Drops"

Based on nearestObjects, looped conditional counter with marker visualisation. Tracks all unit's damage (including dead). If there is some alive unit (anyway, which side in this version) in specified in code range, then red drop will be generated on map. Its radius and intensity is proportional to sum of damage of all units in mentioned range. Its position is average of wounded units positions.

Blood Drops

2. "KIA Spark"

Based on "Killed" event handler "place of death visualizer". Generates temporary, orange dot on position of just killed unit. This "spark" will become more smaller and more transparent with time and finally disappears (after 20 seconds).

KIA Spark

Share this post


Link to post
Share on other sites

Cool Ryd ! This goes quite a bit towards the goal.

Been reminiscing about my Planetside days, being one of the earliest CR5 commanders .... ahh the good days of 600 people in a clan !

Share this post


Link to post
Share on other sites

Ryd, you never cease to amaze me :)

Nice scripts. I wonder what else you have lurking on your hard drive!

Share this post


Link to post
Share on other sites
I wonder what else you have lurking on your hard drive!

Better not to ask... :)

Edited by Rydygier

Share this post


Link to post
Share on other sites
Well, I have two pieces of code, that do something similar, maybe this will be useful somehow. Still do not know, if these are heavy for CPU. It is possible, depends on the number of units engaged in combat. If so, the effect will be rather slow down work of this and other scripts active in the background, than the FPS drop...

Prepared some simple demos for them with 525 units engaged in firefights (just watch the map). Both scripts of course may be adjusted.

1. "Blood Drops"

Based on nearestObjects, looped conditional counter with marker visualisation. Tracks all unit's damage (including dead). If there is some alive unit (anyway, which side in this version) in specified in code range, then red drop will be generated on map. Its radius and intensity is proportional to sum of damage of all units in mentioned range. Its position is average of wounded units positions.

Blood Drops

2. "KIA Spark"

Based on "Killed" event handler "place of death visualizer". Generates temporary, orange dot on position of just killed unit. This "spark" will become more smaller and more transparent with time and finally disappears (after 20 seconds).

KIA Spark

Hey Mr. Rydygier I think I love you lol seriously thank you. I was looking for a script to track all squad leaders on the map. I am working on a mission that I have control of multiple platoons and sqauds using the team switch/save function and I needed a way to know if and when each group had enemy contact so I could switch to that group to assist them or move in a different group to support them ect. The scripts are better then I hope for. Thanks Avibird

Share this post


Link to post
Share on other sites

Scripts are wonderful Ryd. Seriously mate, THANKS!

Have also downloaded your other 'surprise'.

Will let you know how I get on implementing the killedmon scripts.

Share this post


Link to post
Share on other sites
Scripts are wonderful Ryd. Seriously mate, THANKS!

Have also downloaded your other 'surprise'.

Will let you know how I get on implementing the killedmon scripts.

Hey Kremator I tryed to get both of the scripts to work together in a mission no luck only one will show up and if you add the Military Symbols" module it will override the scripts. Let me know what you come up with. Avibird.

Share this post


Link to post
Share on other sites
Better not to ask... :)

ROTFLMAOASTCA!

Jeez, I haven't laughed so much in weeks :D

Some really cool special effects there (but on a serious note, you might want consider adding an alert re epilepsy).

Thanks, Ryd.

Share this post


Link to post
Share on other sites

Good point, Orcinus. Added some warning readme to a file. This is of course one of those things, that I did not plan to publish. :)

Share this post


Link to post
Share on other sites
Good point, Orcinus. Added some warning readme to a file. This is of course one of those things, that I did not plan to publish. :)

Why not? - I think it's brilliant.

Now, about those 3m long 400 kg attack bunnies with rabies....

Share this post


Link to post
Share on other sites

Well KillMon is working perfectly in my mashup mission!

Many thanks for this mate.

Share this post


Link to post
Share on other sites
Well KillMon is working perfectly in my mashup mission!

Many thanks for this mate.

Hey Kremator did you get both to work together blood and kia. I am trying to get them both to work with DAPMAN and DAC scripts. Avibird.

Share this post


Link to post
Share on other sites

No - I really wanted one (KilledMon is fine for me)

Of course it picks up Man units very well (love seeing the dots appearing then disappearing :) ) but how would I extend this to dead vehicles ? I thought AllUnits would pick that up, but no.

Edited by Kremator

Share this post


Link to post
Share on other sites

Do not have time to tests now, but if "Killed" EH handles also vehicles, then simply in AddKMark.sqf AllUnits should be replaced by (AllUnits + Vehicles). But if "Killed" EH, as I suppose, isn't proper for vehicles, then for them must be replaced by "Dammaged" (or, with some changes, "HandleDamage") EH. Result:

1. Init.sqf:

DMark = compile preProcessFile "DMark.sqf";
KilledMark = compile preProcessFile "KilledMark.sqf";

[] execVM "AddKMark.sqf";

2. AddKMark.sqf:

{
_KilledEH = _x addEventHandler ["Killed", {nul = _this spawn KilledMark}];
}
foreach AllUnits;

{
_DEH = _x addEventHandler ["Dammaged", {nul = _this spawn DMark}];
}
foreach Vehicles;

3. DMark.sqf

_veh = _this select 0;
_pos = getPosASL _veh;

if ((damage _veh) >= 0.9) then
{
[_pos,_veh] spawn
	{
	_pos = _this select 0;
	_veh = _this select 1;

	_veh removeEventHandler ["Dammaged", 0];

	_i = "markHD" + (str _veh);

	_i = createMarker [_i,_pos];
	_i setMarkerColor "ColorOrange";
	_i setMarkerShape "ICON";
	_i setMarkerType "DOT";
	_i setMarkerSize [1,1];
	_alpha = 1;
	_size = 1;
	while {(_alpha > 0)} do
		{
		sleep 0.2;
		_i setmarkerAlpha _alpha;
		_i setMarkerSize [_size,_size];
		_size = _size - 0.008;
		_alpha = _alpha - 0.01;
		};

	deleteMarker _i;
	}
}

I hope it works...

Edited by Rydygier

Share this post


Link to post
Share on other sites

Cheers mate .... will play around with it tomorrow. Just running an overnight test to see how my mashup performs :)

Had such a laugh with jumper :)

Share this post


Link to post
Share on other sites

Just tested this. There is a problem. Looks, like "Dammaged" EH is triggered only for non-killing damage. So with this method I can to mark moment of damaging as long, as after this vehicle is still "alive".

On AVIBIRD1's request prepared package with some demos. Scripts are improved and simplified. "BloodDrop1" contains Blood Drop code only for BLUFOR wounded version 1, "BloodDrop2 - same, version 2. Both are working fine. In this demos there are two groups of wounded units - west and east. May be noticed, that drop appears only for west units. "KIASparks" contains simplified code (removed redundant "spawns"), also only for BLUFOR deaths. "Blood&KIA" combines both plus KIA code for vehicles based on "Dammaged" EH. Using of "HandleDamage" considered as too complicated, because it replaces default damaging system with manually written one and triggers for each selection, that was hit. Without getHit command this makes all this coding too heavy (must be some setVariable used for each selection and so on). HandleDamage also will corrupt every other based on this EH script, like Tank Damage System. So there is needed some non-EH based workaround for vehicles' KIA monitor. For now this package:

http://www46.zippyshare.com/v/3207624/file.html

Edited by Rydygier

Share this post


Link to post
Share on other sites

Hey rydygier you are the man! Thank for you time and help sir. This will help me almost complete my RTS domination mashup mission as Kremator likes to say. Will check them out after work and when babies are in bed tonite lol. Avibird.

Share this post


Link to post
Share on other sites

And here is demo with no-EH workaround for vehicles. In this version only BLUFOR vehicle's deaths are marked.

KIASparksVeh

NOTE: all this will not work with vehicles spawned later (this refers also to units KIA markers and units counted by "Blood Drop"). For such purpose, for "KIA Sparks", all spawned on the fly vehicles should arrive with execution of such code: Ryd_AllVeh = Ryd_AllVeh + [JustSpawnedVehicle]; and spawned during gameplay units with: nul = JustSpawnedUnit addEventHandler ["Killed", {nul = _this spawn KilledMark}]; or something like that. For "Blood Drop" situation is similar: variable _AllOfThem must be everywhere in "ShowMeBlood.sqf" file changed to global (eg Ryd_AllOfThem) and for all spawned units must be executed: Ryd_AllOfThem = Ryd_AllOfThem + [JustSpawnedUnit]; (not tested however).

Share this post


Link to post
Share on other sites

Any idea how to get these scripts to work serversided but to be shown client side (show all west damage/deaths)?

Share this post


Link to post
Share on other sites

More improvements:

http://www8.zippyshare.com/v/92714120/file.html

- spawned during mission units/vehicles are (should be) considered;

- "Blood Drops" is side sensitive, set for "west" currently;

- resolved problem with side of destroyed vehicles (is always civilian, so implemented some setVariable for each vehicle containing its initial side), so "KIA Sparks" also can be in this version side-sensitive, and is;

- easy way to set for given side(s) - see init.sqf for each demo to know, how to initialize for chosen side or sides. This is achieved by adding a letter in quotes to array before execVM. These letters are: "W" for west, "E" for east "R" for resistance and "C" for civilian. Any combination of counted sides may be achieved this way. Order is not important, but it is (I suppose) case-sensitive. Example of init.sqf of both scripts:

["E","W"] execVM "BDStart.sqf";
["W","E","R"] execVM "KIAStart.sqf";

and init by in-editor init field of unit/object/trigger/whatever:

nul = ["W","E"] execVM "BDStart.sqf";nul = ["W","E","R"] execVM "KIAStart.sqf";

- both are slightly heavier for CPU now.

Not tested with any "spawner" script, but I hope, these work fine.

EDIT: And some more "real combat" Chernaruss demo, that combinig both scripts. First markers should be on map after a minute or so, when fight gets more intense.

BD-KIASdemo

Known issue: sometimes some blood drop may be duplicated and stay on map even, if should disappear (rare). Not sure, why, but hey, it is hard to wash off blood, is not it?

Edited by Rydygier

Share this post


Link to post
Share on other sites
More improvements:

http://www8.zippyshare.com/v/92714120/file.html

- spawned during mission units/vehicles are (should be) considered;

- "Blood Drops" is side sensitive, set for "west" currently;

- resolved problem with side of destroyed vehicles (is always civilian, so implemented some setVariable for each vehicle containing its initial side), so "KIA Sparks" also can be in this version side-sensitive, and is;

- easy way to set for given side(s) - see init.sqf for each demo to know, how to initialize for chosen side or sides. This is achieved by adding a letter in quotes to array before execVM. These letters are: "W" for west, "E" for east "R" for resistance and "C" for civilian. Any combination of counted sides may be achieved this way. Order is not important, but it is (I suppose) case-sensitive. Example of init.sqf of both scripts:

["E","W"] execVM "BDStart.sqf";
["W","E","R"] execVM "KIAStart.sqf";

and init by in-editor init field of unit/object/trigger/whatever:

nul = ["W","E"] execVM "BDStart.sqf";nul = ["W","E","R"] execVM "KIAStart.sqf";

- both are slightly heavier for CPU now.

Not tested with any "spawner" script, but I hope, these work fine.

EDIT: And some more "real combat" Chernaruss demo, that combinig both scripts. First markers should be on map after a minute or so, when fight gets more intense.

BD-KIASdemo

Known issue: sometimes some blood drop may be duplicated and stay on map even, if should disappear (rare). Not sure, why, but hey, it is hard to wash off blood, is not it?

Hey mate you are the bomb! It's 7:18 AM here, late for work lol. Will check them out when I get home tonite if my babies let me lol. I really appreciate your time and effort. I know Kremator will aslo! Avibird.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×