Skip to content

Add - Iron dome for defending against projectiles#10038

Closed
TheCandianVendingMachine wants to merge 287 commits intomasterfrom
iron_dome
Closed

Add - Iron dome for defending against projectiles#10038
TheCandianVendingMachine wants to merge 287 commits intomasterfrom
iron_dome

Conversation

@TheCandianVendingMachine
Copy link
Copy Markdown
Contributor

When merged this pull request will:

  • Add Iron Dome API for missile guidance framework

Missiles will automatically track threats and kill them when they enter a "defend" radius. The missiles are managed by a "commander" state machine, and only one missile will be assigned to each threat.

The API is kinda shitty, and I would like feedback on how to improve.

I hate that I separated this PR after the recent political situation, but it is a cool system for ARMA missions

Merge Strategy

Follow #10019

IMPORTANT

  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.
  • Development Guidelines are read, understood and applied.
  • Title of this PR uses our standard template Component - Add|Fix|Improve|Change|Make|Remove {changes}.

@@ -0,0 +1,7 @@
#include "script_component.hpp"

if (isServer && { GVAR(enable) }) then {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A boolean check is too cheap for lazy eval.

I just tested that without lazy eval (isServer && true) it takes 0.0011ms - 0.0027ms, whereas with lazy eval (isServer && {true}) it always takes at least 0.0015ms (most of the time), sometimes up to 0.0045ms.

Suggested change
if (isServer && { GVAR(enable) }) then {
if (isServer && GVAR(enable)) then {


GVAR(interceptors) = [];
// Put these into hash table to avoid massive amounts of loops
GVAR(toBeShot) = call CBA_fnc_hashCreate;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HashMaps are in vanilla already, though.

@BaerMitUmlaut
Copy link
Copy Markdown
Member

Iron Dome fires two missiles per threat.

Why not a CBA state machine?

Base automatically changed from missile_guidance_rewrite to master August 23, 2024 14:21
@TheCandianVendingMachine
Copy link
Copy Markdown
Contributor Author

closing in favour of #10965

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.