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

Rework position commands #341

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

Conversation

rekterakathom
Copy link
Contributor

@rekterakathom rekterakathom commented Mar 3, 2023

When merged this pull request will:

Replace all instances of getPos with the appropriate position command, usually ASLtoAGL getPosASL. This is because getPos is not a suitable command for getting an objects 3D position due to inconsistent behaviour and slow execution.
In my tests, the new macro is almost always faster than getPos. On open terrain execution time stays the same, but indoors the new method is 3 to 4 times faster.

Edit: Also added a macro alternative to setPos. This will set objects to AGL positions which is much more consistent.

  1. Describe what this pull request will do
  • Add a new macro for getting 3D positions in positionAGL format and utilize it to replace all instances of getPos
  • Add a new macro for setting an objects 3D position in positionAGL and utilize it to replace all instances of setPos
  1. Each change in a separate line
  • New macro POSITIONAGL(object)
  • Removed getPos in favour of the new macro
  • New macro SETPOSITIONAGL(object,position)
  • Removed setPos in favour of the new macro

Added new macro that gets positionAGL for an object
Replaces getPos with the new POSITIONAGL macro, which is faster and more accurate
@nk3nny nk3nny added this to the 2.7.0 milestone Apr 16, 2023
@rekterakathom rekterakathom changed the title Rework position commands Rework position getters Apr 26, 2023
Added new macro to set object to AGL position
Replaces setPos with the new SETPOSITIONAGL macro, which should be more accurate
@rekterakathom rekterakathom changed the title Rework position getters Rework position commands Apr 29, 2023
@nk3nny
Copy link
Owner

nk3nny commented Feb 18, 2024

Nice PR.

@diwako
For more discussion.

@nk3nny
Copy link
Owner

nk3nny commented Feb 19, 2024

I like this solution. It seems to run significantly faster in most situations, with the odd exceptions of terrain objects gathered from nearestTerrainObjects, which is used in some hiding and fleeing functions.

https://community.bistudio.com/wiki/nearestTerrainObjects

nk3nny added a commit that referenced this pull request Mar 4, 2024
The function failed to pack weapons in some cases. Now it always packs.

Relies on #341
@nk3nny nk3nny mentioned this pull request Mar 4, 2024
nk3nny added a commit that referenced this pull request Mar 4, 2024
Improves cover selection accuracy.  Enhances many instances where the AI would pick wide open places to find cover.

Relies on #341
nk3nny added a commit that referenced this pull request Mar 4, 2024
Adds Vehicle smoke usage when dropping off troops, or Jinking/dodging danger
Adds road checks to Assault, Flank and VehicleJink (to improve manoeuvrability)
Adds pseudo-fire team based bounds to infantry flanking together with Vehicles.

Relies on #341
@nk3nny
Copy link
Owner

nk3nny commented May 5, 2024

@diwako
Let's have a discussion once you are back about this one. :)

nk3nny added a commit that referenced this pull request May 5, 2024
* Fixes doGroupStaticPack

The function failed to pack weapons in some cases. Now it always packs.

Relies on #341

* Update fnc_doGroupStaticPack.sqf

Reverted macro change
nk3nny added a commit that referenced this pull request May 5, 2024
* Update fnc_tacticsFlank.sqf

Improves cover selection accuracy.  Enhances many instances where the AI would pick wide open places to find cover.

Relies on #341

* Update fnc_tacticsFlank.sqf

Revert macro change
nk3nny added a commit that referenced this pull request May 5, 2024
* Improve vehicle maneuverability and defenses

Adds Vehicle smoke usage when dropping off troops, or Jinking/dodging danger
Adds road checks to Assault, Flank and VehicleJink (to improve manoeuvrability)
Adds pseudo-fire team based bounds to infantry flanking together with Vehicles.

Relies on #341

* Update fnc_tacticsAssault.sqf

Reverted Macro changes

* Removed macro references

* Stop linter shouting - all hail HEMTT overlords
@nk3nny
Copy link
Owner

nk3nny commented Jul 7, 2024

Allright. Review completed. Only to half a year.

We like the concept and appreciate the thought that has gone into it. However we are suspect about the maintainability (see review time) and would like instead to implement non-macroed version in key positions. :)

@rekterakathom
Copy link
Contributor Author

Allright. Review completed. Only to half a year.

We like the concept and appreciate the thought that has gone into it. However we are suspect about the maintainability (see review time) and would like instead to implement non-macroed version in key positions. :)

The way I see it, partially implementing this PR w/o macros is the less maintainable version. That way you'll end up with various position commands across the codebase, whereas with this PR you get universal getters / setters for the most common position format with singular definitions.

@rautamiekka
Copy link
Contributor

The way I see it, partially implementing this PR w/o macros is the less maintainable version. That way you'll end up with various position commands across the codebase, whereas with this PR you get universal getters / setters for the most common position format with singular definitions.

Yeah, hard to argue against the complexity that those macros are simplifying.

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

Successfully merging this pull request may close these issues.

5 participants