Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add - Iron dome for defending against projectiles #10038

Open
wants to merge 285 commits into
base: master
Choose a base branch
from

Conversation

TheCandianVendingMachine
Copy link
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
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
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
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
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.