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

Hostile ai tweak #2095

Merged
merged 5 commits into from
Dec 18, 2024
Merged

Conversation

Halonexus
Copy link
Collaborator

@Halonexus Halonexus commented Apr 27, 2024

About The Pull Request

Makes the mob ai more opportunistic about attacking other enemies while main target is out of reach.
Implements actual melee attack delay for ai (attack_cooldown in deciseconds), converts existing rapid_melee values.
AttackingTarget proc now actually uses the attacked_target parameter to allow attacking things other than the aggro holder.

2024-04-27.02-12-07.mp4

Optimised ListTargets.
Shortened patience loss time to 5 seconds, now mob has to lose target, lose patience or get enough aggro to overpower current target aggro + target_switch_resistance(about 15% maxhp worth of aggro) to switch targets instead of it being random upon taking damage.
Simple animals now properly add aggro upon attacking, which fixes mobs always prioritizing attacking other mobs instead of humans.
Hostiles now gain patience upon being attacked by the target in melee, this lets mobs without melee attacks such as Arbiter keep the same target so long as you keep attacking them.
Added AGGRO_DAMAGE damage type for adding aggro without dealing damage.
Shield type ego now deal aggro damage, that scales with the average of fortitude and prudence, in a 3 tile radius on block(regardless of any attacks getting blocked)

Why It's Good For The Game

Would make kiting strong enemies less effective.
Can customize mob attack cooldowns more precisely.

Changelog

🆑
tweak: Mob ai will attack anyone in range while main target is too far
code: AttackingTarget now uses the attacked_target parameter, mob melee attack speed is now using attack_cooldown instead of rapid_melee
/:cl:

@Kitsunemitsu Kitsunemitsu added the Tweak A small change/addition to already existing systems. label Apr 27, 2024
@Coxswain-Navigator Coxswain-Navigator added Code improvement Code is now easier to copy paste. Red Label High importance issue/pull request. labels May 1, 2024
@Halonexus Halonexus force-pushed the hostile-ai-stuff branch 2 times, most recently from 78e700f to 0e56539 Compare May 2, 2024 14:42
@InsightfulParasite
Copy link
Collaborator

I didnt consider having items themselves alter aggro value. Great job.

@InsightfulParasite InsightfulParasite added Test Merge Candidate Should be test merged to test its functionality. and removed Test Merge Candidate Should be test merged to test its functionality. labels Jun 20, 2024
@InsightfulParasite
Copy link
Collaborator

I forgot test merge candidate fucks up PR's but apparently dont merge doesnt???

Based on my experience with optimising effects timers are really bad for performance compared to sleeps.
Copy link
Collaborator

@InsightfulParasite InsightfulParasite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently was testmerged before. Looks good. Approved.

@Kitsunemitsu Kitsunemitsu dismissed LanceSmites328’s stale review December 18, 2024 00:02

Was fixed; this PR is good to go.

@InsightfulParasite InsightfulParasite merged commit 2f4e190 into vlggms:master Dec 18, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code improvement Code is now easier to copy paste. Red Label High importance issue/pull request. Tweak A small change/addition to already existing systems.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants