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

Fix dancing AI (#551) #570

Merged
merged 1 commit into from
Jan 4, 2017
Merged

Fix dancing AI (#551) #570

merged 1 commit into from
Jan 4, 2017

Conversation

kymckay
Copy link
Contributor

@kymckay kymckay commented Dec 23, 2016

Some sort of conflict between disableAI "PATH" and setUnitPos "UP"
A bug in setUnitPos "UP" causes AI to dance when engaged (repeatedly trying to lower their profile but can't I assume)

@commy2
Copy link
Contributor

commy2 commented Dec 24, 2016

Honestly, I liked doStop more. It didn't have permanent effects, so the AI could be given other waypoints / orders after they garrisoned a building.
No setUnitPos "UP" is a huge loss too. Prone AI tends to fire through the floor/ceiling and even walls.

@kymckay
Copy link
Contributor Author

kymckay commented Dec 24, 2016

I was under the impression doStop did have permanent effects unless you executed specific script commands on the AI afterwards? (just like disableAI "PATH" but much more hacky).

Also, in my testing after removing this line, the AI actually only seemed to go prone if exposed at an outdoor building position or similar (which I kinda like - if we do add it back, would be nice to only apply it to units inside buildings).

@kymckay
Copy link
Contributor Author

kymckay commented Dec 24, 2016

Decided to look into doStop for you, it actually causes the same dancing bug when used with setUnitPos 😢 However I'm with you now, it seems better because AI will move to react to combat.

On further analysis, I think this might actually just be a bug with setUnitPos "UP", I've got units moving around showing the same behaviour now.

@commy2
Copy link
Contributor

commy2 commented Dec 24, 2016

Hmm. Only alternative is https://community.bistudio.com/wiki/setUnitPosWeak, but that will be overruled by the AI FSM, so there is not much point in using it.

@kymckay
Copy link
Contributor Author

kymckay commented Dec 24, 2016

It could work because they'd be detached from their formation with doStop, however if it did work I have a feeling it would cause the same problem

A bug with `setUnitPos "UP"` causes AI to dance when engaged.
Changed `disableAI` to `doStop` so that AI can move in reaction to combat
if desired.
@Killswitch00 Killswitch00 merged commit 658f416 into CBATeam:master Jan 4, 2017
@kymckay kymckay deleted the areWeHuman branch January 5, 2017 15:53
@commy2 commy2 added the Bug Fix label Jan 7, 2017
@commy2 commy2 added this to the 3.2 milestone Jan 7, 2017
@ShizCalev
Copy link

ShizCalev commented Feb 18, 2017

With this change, when issuing the ACE defend area command to units, once the patrolling units hit their cycle waypoint, all the units whom were in buildings abandon their posts and rejoin formation to take up patrol.

This issue was not experienced prior to this commit.

You can work around this by deleting the patrol's cycle waypoints, so it appears that doStop doesn't have permanent effect, and is just being overridden by the cycle.

@commy2
Copy link
Contributor

commy2 commented Feb 18, 2017

I think that is the expected behavior though. If a waypoint is finished, the whole group should begin with the next waypoint.

@ShizCalev
Copy link

ShizCalev commented Feb 18, 2017

Previous behavior was that issuing Defend Area would have units garrison buildings in the area, with a 7% chance of a unit going onto a patrol around the area. Once the patrol group finished through all waypoints and hit the cycle, they would repeat the same patrol with the same select units, and the rest would stay garrisoned (since pathing was disabled on the ones in the buildings.)

Now the behavior is that units garrison buildings, 7% chance at patrolling, however once the patrol group reaches the final waypoint and hit the cycle, all units leave their buildings and start patrolling the area in a formation.

AI shouldn't be dropping out of buildings under defend area, as that would make the command redundant with Patrol Area.

@commy2
Copy link
Contributor

commy2 commented Feb 19, 2017

That wasn't the case before @SilentSpike changed the taskDefend module / waypoint in the first place.
We cannot use disableAI "PATH" as it's broken.
I think placing waypoints after any of these taskX waypoints is undefined behavior.

@ShizCalev
Copy link

ShizCalev commented Feb 19, 2017

May I ask how disableAI "PATH" is broken? I know setUnitPos "UP" is, however this is the only I've heard about disableAI (and there are a couple other mods that I use that that information would be relevant for.)

I tired out replacing doStop _unit; with the current version with disableAI "PATH" and the AI seem to stay in the buildings as intended, and shoot freely as desired (and present no dancing issue, as was the reason for this PR)

@commy2
Copy link
Contributor

commy2 commented Feb 19, 2017

Yeah, my bad. setUnitPos is broken. However, units being stuck after a taskDefend waypoint is not intentional either.

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

Successfully merging this pull request may close these issues.

None yet

4 participants