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

[SUGGESTION] CQC Module #283

Open
Sargers opened this issue Aug 19, 2020 · 5 comments
Open

[SUGGESTION] CQC Module #283

Sargers opened this issue Aug 19, 2020 · 5 comments

Comments

@Sargers
Copy link
Contributor

Sargers commented Aug 19, 2020

Is your feature related to a problem? Please describe.
Current CQC is a bit naff in that the hallways are always stationary and the enemy units don't have any initiative. This is useful in situations to ensure the enemy doesn't fuck off out of defensive positions but doesn't allow the enemy to participate at all besides shooting.

Describe the solution you'd like
The module would work exactly like stationary units until we get into CQC. The module would then detect players within a random small radius (1-5m) around units (in buildings or bunkers) and allow movement of the ai unit. This would hopefully cause them to move into hallways and try engage the friendlies as we are clearing buildings. Hopefully would add some dynamics to the enemy when clearing instead of stationary units.

Could also add some code that forces the ai to point towards the nearest friendly unit or talking unit (I know we have an implementation of this but it's not exactly consistent) as we constantly open doors only to shoot AI in the back.

Describe alternatives you've considered
This is definitely already partially possible with triggers and the allow movement modules but that takes a bit more finicky playing with triggers and modules and doesn't allow for individual units to move as they detect players near their individual position.

Have the stationary units module have an option to enable CQC mode but having different modules makes the mission editing a bit clearer.

Additional context
CBA_Defend hold chance does a similar thing but units run out of position the instant they hear gunfire which leaves the city empty after a massive firefight at the edge of town.

@Bosenator
Copy link
Contributor

It's a huge overhead to distance check on each unit. Don't think it's really feasible if you want to keep things performant.

@McJazza
Copy link
Contributor

McJazza commented Aug 19, 2020

From a lay persons perspective,
If checking each unit of resource intensive, why not do it on a larger scale by triggering all or a selected group of defenders of a building/small fortification with one area trigger local to one or the centre of the group?

@Bosenator
Copy link
Contributor

You can get away with per group checks reasonably well. For example, if you had 10 groups and 40 players, that's 400 calculations every X seconds you check. Far better than 10 groups of units checking, which would result in like 3,200 calculations every X seconds (assuming 8 per group).

Just unfortunately that didn't mesh with:

This is definitely already partially possible with triggers and the allow movement modules but that takes a bit more finicky playing with triggers and modules and doesn't allow for individual units to move as they detect players near their individual position.

@Hobbnob
Copy link
Contributor

Hobbnob commented Oct 10, 2020

firednear might help with this too, combine it with an isplayer check on the firing unit and you have the inherent distance checking of the firednear with the player proximity checking built in. It's more like about 50m in terms of distance, but if you really want to then you can check the distance against that one unit, which is still less performance heavy than checking every player.

@Neciota
Copy link
Contributor

Neciota commented Dec 19, 2020

In a near™ Arma update the behaviour change eventHandler will be added, which will provide an efficient manner to do this.

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

5 participants