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

NPC running off fix #32164

Merged
merged 1 commit into from Jul 6, 2019
Merged

NPC running off fix #32164

merged 1 commit into from Jul 6, 2019

Conversation

ghost
Copy link

@ghost ghost commented Jul 5, 2019

Summary

SUMMARY: Bugfixes "NPC running off fix"

Purpose of change

sometimes your follower NPC just decided to randomly run away at max speed into the distance.
Fixes #31872

Split off from #31696

Describe the solution

There were two things happening as best I can tell :

When an activity was set to null, but the NPCs mission or attitude was still set to do an activity... when it came time for the NPC AI to choose an action, it didnt choose follow player, cos the NPCs attitude was not NPCATT_FOLLOW, and it didnt choose to do the activity, because the activitiy was null, so it reverte to what dynamic NPCs do and chose a long_term_goal to travel to.
I've fixed this by catching cases where the activitiy is null, but the MISSION/ATTITUDE needs to be reverted, and reverting them.

A seperate issue was that the NPCs path to destination to complte the activitiy, used player-centric code, which meant that if the player moved while the NPC was travelling to their activitiy, their path points got shifted, and that meant they were constantly travelling in one direction.
Ive fixed this by using an absolute co-ord to set their target point, to path to.

Describe alternatives you've considered

N/A

Additional context

N/A

@ZhilkinSerg ZhilkinSerg added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` NPC / Factions NPCs, AI, Speech, Factions, Ownership labels Jul 6, 2019
@ZhilkinSerg ZhilkinSerg merged commit 5101125 into CleverRaven:master Jul 6, 2019
@ghost ghost deleted the npc_running_off_fix branch September 11, 2019 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NPC ordered to construct blueprint can eventually switch to his/her long term goal and run away.
1 participant