Skip to content

fix: attribute Zeus remote-controlled shots to the controlled unit#110

Merged
fank merged 2 commits intomainfrom
fix/zeus-remote-control-fired-attribution
Mar 15, 2026
Merged

fix: attribute Zeus remote-controlled shots to the controlled unit#110
fank merged 2 commits intomainfrom
fix/zeus-remote-control-fired-attribution

Conversation

@fank
Copy link
Member

@fank fank commented Mar 15, 2026

Summary

  • When a Zeus curator remote-controls an AI manning a static weapon (e.g. .50cal HMG), all fired rounds were recorded as originating from the Zeus curator's body instead of the actual gunner
  • Root cause: Arma 3's FiredMan EH fires on the controller's body, not the controlled unit — so _firer was the Zeus unit
  • The old handler (eh_firedMan) used a distance-based heuristic (> 50m) that silently failed when Zeus was near the static gun; the proper fix was identified in commented-out code but never implemented
  • The new handler (eh_fired_client) checked BIS_fnc_moduleRemoteControl_owner on _firer, but that variable lives on the controlled unit, not the controller's body — so the lookup always missed
  • Both handlers now use bis_fnc_moduleRemoteControl_unit (missionNamespace, local to the controller's machine where FiredMan fires) to detect remote control, verified via BIS_fnc_moduleRemoteControl_owner on the controlled unit, then swap _firer and recalculate _vehicle

Test plan

  • Zeus remote-control an AI gunner on a static .50cal and fire — verify rounds are attributed to the gunner, not the Zeus body
  • Fire normally as a player (no remote control) — verify no regression
  • Have AI fire autonomously while Zeus is remote-controlling a different unit — verify AI shots are not misattributed
  • Check kill attribution (lastFired / shotParents) for kills made while remote-controlling

When a Zeus curator remote-controls an AI manning a static weapon,
FiredMan fires on the controller's body — not the controlled unit.
This caused all rounds to be recorded as originating from the Zeus
unit instead of the .50cal gunner.

Replace the old distance-based heuristic in eh_firedMan with a proper
check using bis_fnc_moduleRemoteControl_unit (missionNamespace, local
to the controller's machine) and BIS_fnc_moduleRemoteControl_owner
(broadcast on the controlled unit). Both fired handlers now swap
_firer and recalculate _vehicle from the controlled unit's state.
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves an issue where actions performed by AI units under Zeus remote control were misattributed to the Zeus curator. By enhancing the FiredMan event handlers, the system now correctly identifies the actual controlled unit as the source of fired rounds, ensuring accurate logging and gameplay mechanics. This change improves the fidelity of event tracking, particularly for remote-controlled static weapons.

Highlights

  • Corrected shot attribution for Zeus remote-controlled units: Previously, shots fired by an AI unit under Zeus remote control were incorrectly attributed to the Zeus curator's body instead of the actual firing unit.
  • Addressed root cause in FiredMan event handler: The Arma 3 FiredMan event handler inherently reports the controller's body as the firer, not the controlled unit, which was the core of the misattribution.
  • Replaced flawed attribution logic: An old distance-based heuristic that silently failed when Zeus was near the static gun was removed, and a more robust method for identifying the true firing entity was implemented.
  • Improved remote control detection: Both fnc_eh_firedMan and fnc_eh_fired_client now accurately identify the controlled unit using bis_fnc_moduleRemoteControl_unit from missionNamespace and verify the controller via BIS_fnc_moduleRemoteControl_owner on the controlled unit, then correctly swap the _firer and recalculate _vehicle.
Changelog
  • addons/recorder/fnc_eh_firedMan.sqf
    • Removed the previous distance-based heuristic for identifying the firing entity.
    • Introduced logic to detect if the _firer is a Zeus curator remote-controlling another unit.
    • If remote control is detected, _firer is updated to the actual controlled unit, and _vehicle is recalculated.
  • addons/recorder/fnc_eh_fired_client.sqf
    • Added new code to identify if the _firer is a Zeus curator remote-controlling another unit.
    • If remote control is active, the _firer and _vehicle variables are updated to reflect the controlled unit and its vehicle.
    • Included a TRACE_2 debug message for when the firer is swapped.
Activity
  • No human activity (comments, reviews, etc.) has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly fixes a bug where shots from a Zeus remote-controlled unit were attributed to the Zeus curator instead of the gunner. The solution uses the correct BIS functions to identify the remote-controlled unit and re-attribute the shot. The changes are applied to both fnc_eh_firedMan.sqf and fnc_eh_fired_client.sqf. My feedback includes a minor suggestion to improve code consistency between the two modified files.

Use local variable + if/then/else in eh_firedMan to match eh_fired_client.
@fank fank merged commit 7eca09e into main Mar 15, 2026
1 check passed
@fank fank deleted the fix/zeus-remote-control-fired-attribution branch March 15, 2026 11:23
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.

1 participant