Skip to content

feat: track vanilla mine placement with markers#74

Open
fank wants to merge 10 commits intomainfrom
refactor/eliminate-database-addon
Open

feat: track vanilla mine placement with markers#74
fank wants to merge 10 commits intomainfrom
refactor/eliminate-database-addon

Conversation

@fank
Copy link
Member

@fank fank commented Feb 19, 2026

Summary

  • Detect vanilla mine placement (weapon == "put") in the fired handler and create a Minefield triangle marker at the placement position
  • Remove the placement marker on detonation via the Explode event handler
  • Mirrors the existing ACE explosive tracking pattern (fnc_aceExplosives.sqf), reusing the handleMarker event infrastructure
  • Mines that never detonate remain visible throughout the entire recording

Test plan

  • hemtt build succeeds
  • Place mines in-game via vanilla inventory → Minefield triangle markers appear in OCAP playback
  • Detonate a mine → triangle marker disappears
  • Mines that never detonate → triangle persists through entire recording

fank added 6 commits February 18, 2026 21:42
The database addon was a legacy name from the Postgres era. The extension
now supports generic storage, so "database" was misleading. Splits its
two concerns:

- Extension session management (init, callbacks, world/mission context)
  moved to extension/ as initSession + newMission
- Event-based data capture (chat, ACE, TFAR radio) moved to recorder/
  as addEventIntegrations + handleChatMessage + radioEvent + getStaticObjects

Renames dbValid → sessionReady, extensionVersion → dllVersion, and fixes
the EGVAR(database,version) bug in mission context (was never set).
The functions eh_fired_client and eh_fired_clientBullet are already
available on all machines via CBA PREP (Extended_PreInit_EventHandlers).
The runtime aliasing via missionNamespace setVariable and remoteExec
of function bodies to clients was redundant. Use FUNC() directly.

Fixes HEMTT L-S29 warnings for undefined ocap_fnc_handlefiredman and
ocap_fnc_addbulleteh.
The FUNCMAIN aliases that caused false-positive L-S29 warnings were
removed in the previous commit, so the grep filter is no longer needed.
OCAP is a server-side addon — clients don't have the PBO installed, so
CBA PREP doesn't run on them and FUNC(eh_fired_client) /
FUNC(eh_fired_clientBullet) are nil. This broke all player-fired
projectile tracking (including mine placement) while AI tracking
(server-local) worked fine.

Restore the remoteExec JIP pattern to send compiled functions to clients,
now using FUNC/QFUNC macros instead of the old FUNCMAIN aliases.
Mirrors ACE explosive tracking for vanilla mines. When a player places
a mine via inventory (weapon == "put"), a Minefield triangle marker is
created at the placement position. On detonation, the marker is removed.
Mines that never detonate remain visible throughout the recording.
@gemini-code-assist
Copy link

Summary of Changes

Hello @fank, 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 introduces a new feature to track vanilla mine placements within the game, enhancing the recording and playback capabilities by visually representing mine locations. It establishes a system to create temporary map markers when mines are deployed and subsequently removes these markers upon detonation, ensuring that the recorded data accurately reflects the battlefield state. The changes also include a significant refactoring of the extension's initialization logic, streamlining how the recording session is set up and managed.

Highlights

  • Vanilla Mine Tracking: Implemented tracking for vanilla mine placements by detecting the 'put' weapon action in the fired event handler.
  • Minefield Markers: Created temporary 'Minefield' triangle markers on the map at the exact position where vanilla mines are placed.
  • Dynamic Marker Removal: Ensured that mine placement markers are automatically removed from the map upon the mine's detonation, leveraging the 'Explode' event handler.
  • Event Infrastructure Alignment: Reused the existing 'handleMarker' event infrastructure, mirroring the pattern established for ACE explosive tracking, for consistent marker management.
  • Persistent Markers for Undetonated Mines: Designed the system such that mine markers persist throughout the entire recording if the mine never detonates, providing a complete picture of unexploded ordnance.
  • Extension Initialization Refactor: Refactored the extension initialization process, renaming 'initDB' to 'initSession' and centralizing one-time setup calls to improve clarity and flow.
Changelog
  • .gitignore
    • Added '.hemttprivatekey' to the ignore list.
    • Added '*.biprivatekey' to the ignore list.
  • addons/extension/XEH_prep.sqf
    • Added PREP calls for 'initSession' and 'newMission'.
  • addons/extension/fnc_initSession.sqf
    • Renamed from 'fnc_initDB.sqf'.
    • Refactored initialization logic to use 'sessionReady' instead of 'dbValid'.
    • Updated variable names for extension version from 'EGVAR(database,extensionVersion)' to 'GVAR(dllVersion)'.
    • Changed 'EFUNC(extension,sendData)' to 'FUNC(sendData)'.
    • Removed one-time setup calls (getStaticObjects, addEventHandlers, eh_fired_server, telemetryLoop) as they are now handled in 'fnc_init.sqf'.
  • addons/extension/fnc_newMission.sqf
    • Updated internal function name and comments to reflect 'initSession' and 'sessionReady'.
    • Changed 'EFUNC(extension,sendData)' to 'FUNC(sendData)'.
  • addons/recorder/XEH_prep.sqf
    • Added PREP calls for 'addEventIntegrations', 'getStaticObjects', 'handleChatMessage', and 'radioEvent'.
  • addons/recorder/fnc_addEventIntegrations.sqf
    • Removed the 'GVAR(enabled)' check.
    • Updated event data to use 'GVAR(captureFrameNo)' directly.
    • Switched database validity check to 'EGVAR(extension,sessionReady)' and added 'SHOULDSAVEEVENTS'.
  • addons/recorder/fnc_captureLoop.sqf
    • Updated database validity checks to 'EGVAR(extension,sessionReady)' for new soldier and vehicle data.
  • addons/recorder/fnc_eh_fired_client.sqf
    • Implemented tracking for vanilla mine placement, creating a unique marker name and sending a server event.
    • Updated function call for bullet event handlers from 'FUNCMAIN(addBulletEH)' to 'FUNC(eh_fired_clientBullet)'.
  • addons/recorder/fnc_eh_fired_clientBullet.sqf
    • Added logic to send a server event for mine detonation, triggering marker removal.
  • addons/recorder/fnc_eh_fired_server.sqf
    • Streamlined client-side function distribution for fired event handlers, removing 'FUNCMAIN' aliases.
    • Updated calls to client-side fired event handlers from 'FUNCMAIN(handleFiredMan)' to 'FUNC(eh_fired_client)'.
    • Introduced new CBA event handlers for 'minePlaced' and 'mineDetonated' to manage map markers.
  • addons/recorder/fnc_exportData.sqf
    • Updated session validity flag from 'EGVAR(database,dbValid)' to 'EGVAR(extension,sessionReady)'.
  • addons/recorder/fnc_getStaticObjects.sqf
    • Updated internal function name and description in comments.
  • addons/recorder/fnc_handleChatMessage.sqf
    • Updated event data to use 'GVAR(captureFrameNo)' directly instead of 'EGVAR(recorder,captureFrameNo)'.
  • addons/recorder/fnc_init.sqf
    • Relocated event handler and object initialization calls from 'fnc_initSession'.
    • Updated extension initialization to use 'initSession' and 'sessionReady' instead of 'initDB' and 'dbValid'.
  • addons/recorder/fnc_radioEvent.sqf
    • Updated event data to use 'GVAR(captureFrameNo)' directly instead of 'EGVAR(recorder,captureFrameNo)'.
  • addons/recorder/fnc_startRecording.sqf
    • Updated session validity checks and new mission registration calls to use 'sessionReady' and 'EFUNC(extension,newMission)'.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/build.yml
Activity
  • No specific activity (comments, reviews, or progress updates) has been recorded for 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 introduces a new feature to track vanilla mine placements with markers, mirroring the existing pattern for ACE explosives. It also includes a significant and valuable refactoring of the codebase. The database component is now integrated into a more generic extension component, and recorder-specific logic has been moved to the recorder component, which improves modularity and separation of concerns. The new feature is well-implemented. I have one minor suggestion to improve performance and readability in the new mine tracking logic. Overall, this is a great contribution.

fank added 4 commits February 19, 2026 23:10
Remove minePlaced/mineDetonated wrapper events and server-side handlers.
Send handleMarker CREATED/DELETED directly from the client instead.
Send mine projectile data to server immediately on placement so it is
recorded even if the mine never detonates. Removes all marker-based
mine tracking — mines are projectiles, handle them as such.
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

Comments