-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
Add FleeGoal #636
base: dev
Are you sure you want to change the base?
Add FleeGoal #636
Conversation
A goal which can be configured to run away to a possible safepoint if X mobs attack.
Gooday, thanks for the contribution i will look into this sometime soon tomorrow. On the other hand i want to try out how it feels and probably going to help eliminate the warnings. |
There's a way to get notified about upon a mob is died by the player. There's a decoupled messaging system setup where I will definitely going to improve the PR that way. |
Core/GOAP/GoapAgentState.cs
Outdated
@@ -9,4 +11,5 @@ public sealed class GoapAgentState | |||
public int ConsumableCorpseCount { get; set; } | |||
public int LastCombatKillCount { get; set; } | |||
public bool Gathering { get; set; } | |||
public LinkedList<Vector3> safeLocations = new LinkedList<Vector3>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my humble opinion, making safeLocations
as a LinkedList<Vector3>
seems like an overkill.
In my humble opinion, a safe spot would be a location what the player was already stepped on in the recent past.
While the player is outside of combat, periodically X
seconds or X
milliseconds, a location can be marked as safe.
Upon entering the FleeGoal
the goal execution would be really simple, from a Stack
collection just pops safe locations until leaves combat.
There should be some guard clause that the safeLocations
should contain about Y
seconds worth of time in order to make sure that do not run out of safeLocations
this can be checked in the CanRun()
.
Basically safeLocations.Count > 0
Essentially while the safeLocations
has content we do not need to reach for the Navigation Component
.
It should be a good idea to find out, after entering combat with a mob, how many seconds does it take till the enemy exit combat.
…r fit with the current project setup.
Hello, i've slightly refactored the code to be more simpler. It should give a better integration with the existing framework. The biggest benefit probably is to see the path while in the |
Currently when the However this can be dangerous 👀 |
Refactor: SafeSpotCollector: stores the spots. More todos
A goal which can be configured to run away to a possible safepoint if X mobs attack. Also, later I want to add checks based on HP/Mana which can be configured via the Json.