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

Rewrite map_trackers to use map markers #24

Open
freghar opened this issue Mar 10, 2021 · 1 comment
Open

Rewrite map_trackers to use map markers #24

freghar opened this issue Mar 10, 2021 · 1 comment

Comments

@freghar
Copy link
Owner

freghar commented Mar 10, 2021

The current solution uses manually drawn icons on the Displays used by various maps. This has some advantages, but every display needs to be hooked manually, so it doesn't work with many non-standard map displays (ACE microDAGR, cTab, Liberation Halo Deploy map, EG Spectator map, etc.).

So replace the back-end by creating Local map markers, associating them with groups/units, and just doing setMarkerPosLocal on each frame (or per configurable interval) to update them. Group-to-marker mapping would be oldschool "hashmap" with [[indices],[values]] and using find, to allow duplicated indices (grpNull).

The logic would probably use EachFrame mission EH (one for each type of tracking?) to do the following:

  1. Check update timer based on time (or frameNo or something)
    1. if expired, update marker positions
  2. Check if some list of to-be-processed groups is empty
    1. if so, fill it with allGroups (or something with similarly constant-time cost) and exit
    2. else
      1. pop one group from the list, filter it (ie. if not a player group and AI groups disabled, exit, etc.) and update its data in some global array of group data (marker icon, etc.)
      2. try to find one grpNull in the list of mapping indices
        1. if found, query the marker array for marker name, delete it and then delete the idx found from both group and marker arrays

This makes additions of new groups fairly slow on super busy missions, but keeps the load nicely balanced across frames, like the AI dynamic_skill logic.

Some notes:

  • Marker text color cannot be changed without changing the icon color; default color is in CfgMarkers
  • Marker text size cannot be changed
  • Custom CfgMarkers will be needed for unit tracking; unless I want to include custom paa images in the mod, the "ugly" soldier icons will have to be used and new config entries created for them
    • Shadow can be enabled in CfgMarkers, though
@freghar
Copy link
Owner Author

freghar commented Mar 10, 2021

Some nice-to-have features that could be added while rewriting it;

  • An "always show group" override (group variable), which would show an AI group even if the setting is disabled -- useful for showing one or two allied support elements (while hiding FOB guards), .. or for displaying one enemy AI group position (convoy lead, "GPS bug" on a HVT, etc.)
  • Per-group override for (not) showing group names -- same use case

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

No branches or pull requests

1 participant