PDA

View Full Version : [Extension] - 5E - AGGRO: Smart Targeting System for NPCs



Alanrockid
December 30th, 2024, 03:07
Forge Link: https://forge.fantasygrounds.com/shop/items/2021/view

Introducing Aggro – Smart Targeting for NPCs in Fantasy Grounds

Are your players constantly shouting, "Why is he attacking me instead of the barbarian?"
Are you a DM who wants to enjoy impartial targeting while battling it out in an arena with your players?
Or are you simply looking for a way to streamline combat decisions without overthinking?

Well… this is for you!


https://i.imgur.com/k3u34bL.jpeg

Aggro is a new extension designed to bring intelligent, automated targeting to your games. By using customizable variables with adjustable weights, it calculates targeting priorities for NPCs. At the start of an NPC's turn, Aggro determines targets based on probability—higher Aggro values mean a greater chance of being selected.


Key Features

Two Targeting Systems


Logical Chance: Target selection remains random, but higher threat levels significantly increase the chances of being targeted. This maintains a balance of consistency and unpredictability.
Pure Logical: The actor with the highest threat level is always selected as the target.


Choose between Auto Target or Target Advisor
Auto Target will do the calculations and auto select the target for you.
Target Advisor will calculate the aggro values, but will not select target, instead, it will advise you of the best option (better with "Pure Logical")

You can also choose whether to display full threat calculations in the chat or only the final target selection message.

https://i.imgur.com/J5kxjB5.jpeg

https://i.imgur.com/pkjLLAp.jpeg


Customizable Threat Variables

Aggro's targeting system is powered by the following variables, all adjustable via the Options menu:


Base Value: A default Aggro value assigned to all actors at the start of a turn. Think of it as a "random motive" factor.
Proximity Threat: Closer targets receive higher Aggro values. The nearest target gets 100%, the second-closest gets 50%, the third 25%, and so on.
Damage Threat: Targets that deal the most damage to the NPC are prioritized. The top-ranked actor receives 100% of the damage Aggro, with subsequent ranks halving the previous value.
Persistence Threat: Actors already targeted in previous turns gain this Aggro value, ensuring consistent NPC behavior.
Critical Hit Threat: Actors who land a critical hit on the NPC gain increased Threat until the NPC's next turn.
Miss Penalty: Each time an NPC misses a target, that target's Aggro decreases. This penalty is cumulative and resets upon a successful hit, making difficult-to-hit targets less attractive.
Out of Reach Penalty: Targets outside the NPC’s base movement range (or effective attack range) have their Aggro reduced by 100%. Targets beyond dashing range (or maximum range) receive triple this penalty, making faraway targets less appealing.
Injured Opponent Penalty: Bloodied actors (50% HP or less) have their Aggro reduced by 100%, while wounded actors (more than 50% HP but not full) receive half the penalty.
Minimum Target Value: Prevents an actor’s Aggro from dropping to 0 or below, ensuring they remain a potential target.
NPC Cruelty: Determines if dying actors (0 HP) are valid targets. When turned off, NPCs will ignore actors with 0 HP.


Don’t like a variable? Set its value to 0, and it will no longer affect targeting.

https://i.imgur.com/g0KEmgU.jpeg


New Effects: AGGRO, INDEPENDENT, NOTHREAT, CRUEL

Usage: AGGRO: [n]
Where [n] is a number (positive or negative) that adjusts the target’s Aggro value.
Examples:


Taunt: AGGRO: 300 – Increase a target's Aggro by 300.

Innocent Face: AGGRO: -200 – Decrease a target's Aggro by 200.

INDEPENDENT: Skip threat calculation and auto targeting. Use it for manual targeting.

NOTHREAT: Excludes the actor from the valid targets list.

CRUEL: Bypass the check for "NPCs Cruelty: off" for this particular NPC.


Important Notes


Always drag tokens from the Combat Tracker to the map. Dragging tokens directly from a PC sheet or NPC list will prevent the extension from functioning properly.
This extension is not compatible with language translations, as it depends on capturing certain messages from the ruleset to work properly.


Changelog

1.5.0
New Feature
Users can now configure which factions are eligible to roll for AGGRO.

UI Refinements

Threat values now have their own configuration window to avoid cluttering the Fantasy Grounds Options menu.
The AGGRO token widget can now be set to always on, always off, or shown only when hovering over a token.
The widget position and size can be chosen by the user.


Bug Fixes
Discreet mode for the host was behaving like Verbose mode. FIXED.

1.4.1
Changes/Bug Fixes:
Fixed certain features, such as spellcasting, critical hits, and damage threat, not being accounted for in client rolls.
Fixed system messages notifying clients about the initial threat value options.
Changed the extension settings so they are visible only to the host, preventing clients from seeing threat values.

1.4.0
New Features:
LoS-Aware Aggro: Characters will not be listed as potential targets if they do not have line of sight to the current actor (don't forget to activate this in the options windows and turn LoS on in the image).
Opportunity Attack-Aware Aggro: Intelligent actors will avoid targeting characters when doing so would trigger opportunity attacks. Optimized for 5E.
New Threat Modifier: Legacy: Carries over a percentage of the previous threat value to the next turn if the new value is lower.
Target Priority Widget: Displays a skull icon above the tokens of the top three targets to help the GM choose between them. This is especially useful when automatic targeting is disabled.
Expanded support for spells in Pathfinder 1 and 2.
Added Starfinder to the ruleset compatibility list. Although it is not officially supported, most, if not all, features should work due to its similarities to Pathfinder. Try at your own risk.
Also, multiple bug fixes.

1.3.0

New Features:
Spellcasting Aggro! Caster receive the base spell threat value + additional level bonus (both customizable).
Healing Aggro: also receive additional aggro based on healing level.
Intelligence based aggro: Define the minimum intelligence to be considered 'intelligent' and 'rational'. Intelligent actors will calculate all variables plus spell and healing aggro. Rational actors will calculate everything but those two and irrational actor will only consider basic aggro modifiers.
Neglected target aggro: Actors that are not being targeted by anyone will receive this bonus to threat.

1.2.1

New Features:
3 New Effects: INDEPENDENT, NOTHREAT and CRUEL.
New feature to decide if attacked neutral NPCs engage in battle.
New target advisor mode to show aggro calculations without actually targeting.

Fixes an Small Changes:
Fixed effective and max range calculations for melee combatants.
Renamed options.

1.1.2

Fixes:
Fixed a bug related to tied actors with the same threat modifiers resulting in a console error and no target selected when in "Pure Logical" mode.

1.1.1

New Features:
NPCs now have the option to target any actor in Combat Tracker. (Select between "PC Only", "Any Friendly" or "All But Hostile").
Added a option to choose the target message's display mode for players.
Included a message feedback in Verbose mode to show the current NPC effective and maximum range. (If the NPC has no ranged attack, effective range is NPC speed + reach. Maximum range is NPC speed x 2 + reach. For ranged attacks, it takes the effective and maximum range from the weapon or ranged spell attack. If there is only a single value for range, maximum range = effective range.)

Fixes:
Fixed "Injured" threat bonus displayed as a penalty.
Fixed console error when NPC ranged attack have only one range value.

1.0
Initial Release

Coming Next
Exciting future updates include:


Status Effects Threat: Assign custom threat values to statuses like Invisible, Dash, Prone, Paralyzed, etc.
Improved Range Calculation: Incorporate save-based spells and powers, like dragon's breath, into the "Out of Reach" penalty.
NPCs Quirks: A chance to randomly assign an effect to a NPC representing some personal beef or soft spot, like: "HATES: Dwarves" (Dwarves get threat +200 against him), "LOVES: TINY" (Tiny sized actors receive -200 threat against him).

I'm constantly checking this post to see the feedback and suggestions to update this list.

Have Suggestions or Found a Bug?

I’d love to hear your feedback! Reply to this post with your thoughts or report any issues you encounter.

Want to be a beta tester for future versions? Send me a message!

BushViper
December 30th, 2024, 08:00
This has a lot of potential.

MrDDT
December 30th, 2024, 09:15
This is super cool.

Zacchaeus
December 30th, 2024, 12:38
Interesting concept. Nice work.

rocketvaultgames
December 30th, 2024, 21:08
Very cool!

I really won't be able to use it until it can target NPCs, unfortunately, as my groups are always running around with extras (who should often be juicy targets).

Does "11-Injured Opponent Penalty" make it so the monster is less likely to try to finish off a bloodied opponent? If so it's really the only one that stands out as counterintuitive at a glance...

I would love to see another option for 'Message Visibility' to be able to have either discreet or verbose but optionally not broadcast to players.

Alanrockid
December 30th, 2024, 22:16
I really won't be able to use it until it can target NPCs, unfortunately, as my groups are always running around with extras (who should often be juicy targets).

I'm working on expand the effect to all actors in scene right now. I may update this extension sooner than i thought.


Does "11-Injured Opponent Penalty" make it so the monster is less likely to try to finish off a bloodied opponent? If so it's really the only one that stands out as counterintuitive at a glance...

It's the opposite. Wounded and bloodied targets are more likely to be targeted because they are viewed as weak. I don't know why i called it a penalty, its really a bonus to threat levels. It will be fixed in next version.


I would love to see another option for 'Message Visibility' to be able to have either discreet or verbose but optionally not broadcast to players.

That makes sense. Should be easy to implement.

rocketvaultgames
December 30th, 2024, 22:19
I'm working on expand the effect to all actors in scene right now. I may update this extension sooner than i thought.



It's the opposite. Wounded and bloodied targets are more likely to be targeted because they are viewed as weak. I don't know why i called it a penalty, its really a bonus to threat levels. It will be fixed in next version.



That makes sense. Should be easy to implement.

That all sounds fantastic. I'm definitely excited about the future possibilities for this extension!

rocketvaultgames
December 30th, 2024, 22:22
Regarding Message Visibility: I'm not sure it's worth the complexity, but I could see a situation where some users would prefer Discreet for Players and Verbose for GM, so having separate options for Player and GM with all 3 options each might be best:

Players - Muted / Discreet / Verbose
GM - Muted / Discreet / Verbose

Griogre
December 30th, 2024, 23:01
Very interesting concept. Of course, the end game for something like this would be for the extension to actually set the targeting for the active NPC creature with the most aggro so all you have to do is roll.

Alanrockid
December 30th, 2024, 23:14
Very interesting concept. Of course, the end game for something like this would be for the extension to actually set the targeting for the active NPC creature with the most aggro so all you have to do is roll.

You mean the extension selecting the target for player characters as well?

Griogre
December 31st, 2024, 01:11
I was just thinking monsters selecting party members with FGU's targeting rather than just a chat message. I prefer players to have more agency.

Alanrockid
December 31st, 2024, 01:25
I was just thinking monsters selecting party members with FGU's targeting rather than just a chat message. I prefer players to have more agency.

It's not just a message, the NPC should actually target the characters, the text is just for clarification of the chances and motives. Or isn't working like that for you?

Dax Doomslayer
December 31st, 2024, 02:28
I'm looking forward to it. I bought this as soon as I saw it and will now finally get to use it, tonight. A thought (and one you probably already had from the sounds of it), if a wizard is dropping fireballs and scorching everyone, that should draw some attention. Also, I'm not sure if this would be attainable but most intelligent creatures would definitely look to take out spellcasters ASAP so I'm not sure if that could be factored in, too.

Alanrockid
December 31st, 2024, 02:55
I'm looking forward to it. I bought this as soon as I saw it and will now finally get to use it, tonight. A thought (and one you probably already had from the sounds of it), if a wizard is dropping fireballs and scorching everyone, that should draw some attention. Also, I'm not sure if this would be attainable but most intelligent creatures would definitely look to take out spellcasters ASAP so I'm not sure if that could be factored in, too.

Yes, NPC intelligence affecting how it perceives threats is in my plans for a future update, just not the priority right now, as there are some other features that i would like to implement first.

Spells are a little bit trickier because the current system searches for specific patterns in the NPC actions that are not really homogeneous for spells. Also, i need to implement some way to distinguish if a saving throw spell is actually threatening (casting zone of truth in the middle of combat is not exactly menacing). Ranged spell attacks are working fine, though.

Some cool features i would like to implement in future versions besides the ones I've listed on the original post are:

- Spell Level Threat: The higher the level of the spell cast, the bigger the threat.
- NPCs Quirks: A chance to randomly assign an effect to a NPC representing some personal beef, like: "HATES: Dwarves" (Dwarves get threat +200 against him), "LOVES: TINY" (Tiny sized actors receive -200 threat against him).
- Healer Threat: "Yeah...we need to take out this bastard that keep bringing the Barbarian back to combat."

rocketvaultgames
December 31st, 2024, 03:15
Yes, NPC intelligence affecting how it perceives threats is in my plans for a future update, just not the priority right now, as there are some other features that i would like to implement first.

Spells are a little bit trickier because the current system searches for specific patterns in the NPC actions that are not really homogeneous for spells. Also, i need to implement some way to distinguish if a saving throw spell is actually threatening (casting zone of truth in the middle of combat is not exactly menacing). Ranged spell attacks are working fine, though.

Some cool features i would like to implement in future versions besides the ones I've listed on the original post are:

- Spell Level Threat: The higher the level of the spell cast, the bigger the threat.
- NPCs Quirks: A chance to randomly assign an effect to a NPC representing some personal beef, like: "HATES: Dwarves" (Dwarves get threat +200 against him), "LOVES: TINY" (Tiny sized actors receive -200 threat against him).
- Healer Threat: "Yeah...we need to take out this bastard that keep bringing the Barbarian back to combat."

This all seems great. I would suggest an option to turn off the auto targeting but keep the rest of the messaging.

I envision this being best acting essentially as the computer in an MMO and tracking 'threat'.... the beauty of the TTRPG is that the human can override what the computer spits out.

But it is fantastic to have that target suggestion served up to you every turn... maybe even an option to single click accept the suggested target(s) would be good...


I have not had time to test compatibility with other extensions at all, but running with AGGRO on but muted for tonight's session, it did spit an error to the GM on NPC turns (with 100 other extensions running):

63104

And I was seeing (GM side only) some graphical issues that may or may not be related to AGGRO (but wasn't happening yesterday before AGGRO) where the health bars and targeting arrows would be offset from tokens... moving the tokens snapped them back. Not sure of the rhyme or reason at this point.

63105

Alanrockid
December 31st, 2024, 03:41
This all seems great. I would suggest an option to turn off the auto targeting but keep the rest of the messaging.

I envision this being best acting essentially as the computer in an MMO and tracking 'threat'.... the beauty of the TTRPG is that the human can override what the computer spits out.

But it is fantastic to have that target suggestion served up to you every turn... maybe even an option to single click accept the suggested target(s) would be good...


I have not had time to test compatibility with other extensions at all, but running with AGGRO on but muted for tonight's session, it did spit an error to the GM on NPC turns (with 100 other extensions running):

63104

And I was seeing (GM side only) some graphical issues that may or may not be related to AGGRO (but wasn't happening yesterday before AGGRO) where the health bars and targeting arrows would be offset from tokens... moving the tokens snapped them back. Not sure of the rhyme or reason at this point.

63105

Line 328 is calculating distance, reach and max range. A nil value in one of them could mean the original distance methods were modified by some extension, the token was moved to the map from anywhere else but the CT or, my main guess: The function did find a ranged attack in the NPCs actions, but it failed to capture the desired pattern.

To set the effective and maximum range for ranged attacks, the script searches for any action in that NPCs sheet that has "range, "ranged" or [R] on its description. Then, it captures the numbers inside the patterns "range [range]/[max range] ft" or "ranged [range]/[ranged] ft".

So if your NPC has a ranged attack written in some other format, it could cause that variable to be nil.

Can you confirm if that is the case?

(about the graphic glitch, i see no reason why this extension could cause it...maybe its a coincidence? :confused:)

rocketvaultgames
December 31st, 2024, 04:11
Line 308 is calculating distance, reach and max range. A nil value in one of them could mean the original distance methods were modified by some extension, the token was moved to the map from anywhere else but the CT or, my mains guess: The function did find a ranged attack in the NPCs actions, but it failed to capture the desired pattern.

To set the effective and maximum range for ranged attacks, the script searches for any action in that NPCs sheet that has "range, "ranged" or [R] on its description. Then, it captures the numbers inside the patterns "range [range]/[max range] ft" or "ranged [range]/[ranged] ft".

So if your NPC has a ranged attack written in some other format, it could cause that variable to be nil.

Can you confirm if that is the case?

(about the graphic glitch, i see no reason why this extension could cause it...maybe its a coincidence? :confused:)

The token was definitely moved to the map from the CT.

Here's an NPC that is throwing the error:

63106

It is definitely possible that it is another extension's compatibility. I won't have time to look in depth until later this week at the earliest. I just wanted to mention it in case it was an obvious fix on your end.

I'll have to do some checking on the graphical glitch as well.

Alanrockid
December 31st, 2024, 04:19
The token was definitely moved to the map from the CT.

Here's an NPC that is throwing the error:

63106

It is definitely possible that it is another extension's compatibility. I won't have time to look in depth until later this week at the earliest. I just wanted to mention it in case it was an obvious fix on your end.

I'll have to do some checking on the graphical glitch as well.

Yeah, it's exactly what I've imagined. The ranged attack of the NPC "Hurl Flame" has only one range: "range 150 ft.". The extension was expecting 2 values in the format [range]/[max_range].

I'll have to add some logic to just repeat the first value in case of the second value is nil. For now you can just edit the NPC action to be "range 150/150 ft." and you should be good.

Alanrockid
December 31st, 2024, 06:41
Version updated:

Changelog
1.1.1
New Features:
NPCs now have the option to target any actor in Combat Tracker. (Select between "PC Only", "Any Friendly" or "All But Hostile").
Added a option to choose the target message's display mode for players.


Fixed:
Fixed "Injured" threat bonus displayed as a penalty.
Fixed console error when NPC ranged attack have only one range value.

charros
January 1st, 2025, 01:19
Amazing extension! I am loving testing this out as the fighter goliath has a item I gave him to become pretty much the tank, a ring of the challenger, which I can create a custom aggro threat and then he can pretty much absorb the damage!

I have read the threads here and hope to see this extend to NPCs as well! I use a lot of NPCs and the adventuring party are all playable monster races, so the NPCs are not cut and dry that if a human is being attacked by a goblin then you will help the human. You have a goblin in your party and make moral decisions. So seeing how the aggro meter will look on each of them would be amazing!

Arnagus
January 1st, 2025, 14:03
Hello Alan,

I can only repeat what other already wrote: I see huge potentials in the Extension. The (biased) calculation is a significant help in large battles - having (as GM) the option to accept or not accept the choice would be nice, but since you can mute the output to the players now (with version 1.1.1) while getting the whole (verbose) calculation as GM, changing the target afterwards is no issue ;)

As Rocketvault already pointed out: there are some "early adopter's bugs":


The extension also sets targets for Player NPCs (conjured monsters, familiars, pack animals, etc.). As these NPCs are fully player controlled, they should not be part of the automation. Perhaps a similar option like for selection of targets would be possible (Select target for: "All NPCs", "Any Hostile", or "All But Friendly").
I have the following error in a specific situation with ONLY this extension loaded:

s'Saving aggro data...'
s'Aggro data save complete'
[ERROR] Script execution error: [string "Aggro:scripts/manager_aggro.lua":717: bad argument #1 to 'ipairs' (table expected, got nil)
Situation on map: hostile where the error is generated when turn starts is adjacent to a player character and a player NPC (conjured "pet"). No target is selected for the hostile on turn start. Both adjacent tokens calculate the same threat value (200 - 100 from base, 100 from proximity). Issue is repeatable (moved turn counter back to last PC, advance turn - produces the same error) but vanishes if one token is selected as target before the turn.
Error also occurs when one token is lifted 5' into the air which results into the same calculation, but vanishes when the token is lifted 10' (which changes its calculation to 150 - 100 base, 50 proximity). I therefore assume that the same calculation result causes the issue. Option for Target Selection is set to "Pure Logical". When set to "Logical Chance", surprisingly, none of the two is chosen as target but one of the next closer ones (150 - 100 from base, 50 from proximity).

Hope this helps in further debugging/development!

Alanrockid
January 1st, 2025, 16:24
I can only repeat what other already wrote: I see huge potentials in the Extension. The (biased) calculation is a significant help in large battles - having (as GM) the option to accept or not accept the choice would be nice, but since you can mute the output to the players now (with version 1.1.1) while getting the whole (verbose) calculation as GM, changing the target afterwards is no issue

As suggested, I'm implementing an option to switch between auto target or leave the aggro just as advice.


1. The extension also sets targets for Player NPCs (conjured monsters, familiars, pack animals, etc.). As these NPCs are fully player controlled, they should not be part of the automation. Perhaps a similar option like for selection of targets would be possible (Select target for: "All NPCs", "Any Hostile", or "All But Friendly").

I'm working on an INDEPENDENT effect to make a NPC ignore the aggro calculations. That would be an easy fix for pets or allies controlled by players.


[ERROR] Script execution error: [string "Aggro:scripts/manager_aggro.lua":717: bad argument #1 to 'ipairs' (table expected, got nil)

The line 717 and your description points to an error in the tiebreaker function for pure logical. I have a hunch about what is causing it and i'll fix it ASAP.

About "Logic Chance" selecting a third target other than that two, might be just pure chance. A higher aggro means higher chance of being targeted, but does not nullify the chance of a low aggro being selected if jinxed enough (and to be honest, a 50 threat difference is a very low value). :p Try to "force" an aggro to one of the two closer tokens with an AGGRO: 99999 effect to see if that was just a coincidence.

Dax Doomslayer
January 1st, 2025, 16:37
This may be a bit much for the extension, but is there any thought about negative weighing aggro for creatures that would suffer an Opportunity Attack if they were to go after a creature? Or having spellcasters generating more aggro for intelligent creatures? Just some thoughts. This is a pretty cool little extension!

Alanrockid
January 1st, 2025, 16:51
This may be a bit much for the extension, but is there any thought about negative weighing aggro for creatures that would suffer an Opportunity Attack if they were to go after a creature? Or having spellcasters generating more aggro for intelligent creatures? Just some thoughts. This is a pretty cool little extension!

Spellcasting threat and intelligence based aggro are already on my todo list for future updates (spellcaster threat is probably coming first).

Checking for adjacent targets reaction (to prevent opportunity attacks) is something that i intended to do on the original release, but got delayed because of the level of complexity (mostly because it would require the intelligence based aggro). So, until the intelligence update is released, this feature is postponed... :p

Dax Doomslayer
January 1st, 2025, 17:57
Wow - that's terrific. This is definitely a neat little extension already!!

Alanrockid
January 2nd, 2025, 01:20
Hello Alan,

I can only repeat what other already wrote: I see huge potentials in the Extension. The (biased) calculation is a significant help in large battles - having (as GM) the option to accept or not accept the choice would be nice, but since you can mute the output to the players now (with version 1.1.1) while getting the whole (verbose) calculation as GM, changing the target afterwards is no issue ;)

As Rocketvault already pointed out: there are some "early adopter's bugs":


The extension also sets targets for Player NPCs (conjured monsters, familiars, pack animals, etc.). As these NPCs are fully player controlled, they should not be part of the automation. Perhaps a similar option like for selection of targets would be possible (Select target for: "All NPCs", "Any Hostile", or "All But Friendly").
I have the following error in a specific situation with ONLY this extension loaded:

s'Saving aggro data...'
s'Aggro data save complete'
[ERROR] Script execution error: [string "Aggro:scripts/manager_aggro.lua":717: bad argument #1 to 'ipairs' (table expected, got nil)
Situation on map: hostile where the error is generated when turn starts is adjacent to a player character and a player NPC (conjured "pet"). No target is selected for the hostile on turn start. Both adjacent tokens calculate the same threat value (200 - 100 from base, 100 from proximity). Issue is repeatable (moved turn counter back to last PC, advance turn - produces the same error) but vanishes if one token is selected as target before the turn.
Error also occurs when one token is lifted 5' into the air which results into the same calculation, but vanishes when the token is lifted 10' (which changes its calculation to 150 - 100 base, 50 proximity). I therefore assume that the same calculation result causes the issue. Option for Target Selection is set to "Pure Logical". When set to "Logical Chance", surprisingly, none of the two is chosen as target but one of the next closer ones (150 - 100 from base, 50 from proximity).

Hope this helps in further debugging/development!

The console error should be fixed with the new updated version. Thank you for your feedback!

Arnagus
January 2nd, 2025, 12:10
The console error should be fixed with the new updated version. Thank you for your feedback!

Thanks a lot! Confirmed that the issue is gone.

As for the AGGRO - any change away from the calculated 200 caused a target to be selected and the error to be gone. I can reproduce a random selection or targets with lower AGGRO than adjacent tokens, so the choice of the third token seem to have been pure chance. Nevertheless I was not able to reproduce a chance selection of any of the two adjacent tokens when both had the same AGGRO result. I tried 10 times, several different tokens were selected (from AGGRO 150 to 125) but not those two. With the update, any token (including the two adjacent) might be selected randomly, so issue is gone as well.

Arnagus
January 2nd, 2025, 12:19
I'm working on an INDEPENDENT effect to make a NPC ignore the aggro calculations. That would be an easy fix for pets or allies controlled by players.

That would do the trick indeed (although I need to find a way to apply the effect automatically to summoned monsters/conjured animals - perhaps cloning the NPCs specifically for those spells and adding an additional trait/ability "Summoned" for using EE to apply the effect).
Looking forward to have it. :)

Alanrockid
January 2nd, 2025, 14:00
That would do the trick indeed (although I need to find a way to apply the effect automatically to summoned monsters/conjured animals - perhaps cloning the NPCs specifically for those spells and adding an additional trait/ability "Summoned" for using EE to apply the effect).
Looking forward to have it. :)

You can already achieve what you want using the excellent (and free) extension "Advanced Effects". This extension allows you to add fixed effects that are already active whenever the actor is added to Combat Tracker. It works with both PCs and NPCs. Just add a "INDEPENDENT" (next update...it won't be long) effect to the summoned NPC sheet and it will do the trick.

https://www.fantasygrounds.com/forums/showthread.php?40833-5E-Advanced-Effects-(items-npcs-characters)Advanced Effects' Forge Page (https://www.fantasygrounds.com/forums/showthread.php?40833-5E-Advanced-Effects-(items-npcs-characters))

This extension was originally created by Celestian and is current maintained by Rhagelstrom

charros
January 2nd, 2025, 19:02
I am looking into the extension and is there a way to stack the bonus aggro?

Example:

Rogue/ranger multiclass:

Sneak attack: DMG: 1d6: AGGRO: 100

Dread Strike: DMG: 1d8: AGGRO: 150

I would like to see the bonus aggro be 250 but it only calculates one of them.

Thank you

Alanrockid
January 2nd, 2025, 19:55
I am looking into the extension and is there a way to stack the bonus aggro?

Example:

Rogue/ranger multiclass:

Sneak attack: DMG: 1d6: AGGRO: 100

Dread Strike: DMG: 1d8: AGGRO: 150

I would like to see the bonus aggro be 250 but it only calculates one of them.

Thank you

It should be calculating all aggro effects. Can you share a print of your AGGRO effects?

Are you using more than one 'AGGRO: value' in the same effect? Each instance of AGGRO must be in a different effect, so:

https://i.imgur.com/f4ozvcF.png
this would work because it's two different instances of AGGRO in different effects.

https://i.imgur.com/ORVVvvw.png
This would only return the first instance of AGGRO in the same effect.

(Nevermind the Allosaurus attacking itself on screenshots...i'm testing a new feature :P)

Darth Decisive
January 3rd, 2025, 03:54
Very cool extension! Excited to see what all it can do.

Weirdly enough, I seem to be unable to get it to flag damage, critical hit, or miss threat. Everything else seems to be working fine.

I did have a lot of other extensions active, but I'm not sure which one might be causing the discrepancy.

Darth Decisive
January 3rd, 2025, 04:05
Upon further testing, I turned off all of the other extensions and it still wasn't applying the threat from damage. I didn't tweak any of the default settings, so I'm not sure if something went wrong with a recent update or what.

Either way, looking forward to seeing where this extension grow!

Alanrockid
January 3rd, 2025, 04:17
Upon further testing, I turned off all of the other extensions and it still wasn't applying the threat from damage. I didn't tweak any of the default settings, so I'm not sure if something went wrong with a recent update or what.

Either way, looking forward to seeing where this extension grow!

Please check if you are adding the character to the Combat tracker first and only then dragging them to the map. When you drag a token directly from the sheet to the map, things may seem ok (it even creates the CT entry for that char), but some features won't work properly. The behavior your describe fits exactly the behavior of a token dragged from outside the Combat Tracker. Can you confirm if the problem persists if you delete the token from map and CT and put it back on, but from the combat tracker?

Arnagus
January 3rd, 2025, 09:50
You can already achieve what you want using the excellent (and free) extension "Advanced Effects". This extension allows you to add fixed effects that are already active whenever the actor is added to Combat Tracker. It works with both PCs and NPCs. Just add a "INDEPENDENT" (next update...it won't be long) effect to the summoned NPC sheet and it will do the trick.

That would work as well but in both cases, I need to have a summoned version of the NPC which applies the effect, either as trait (EE) or as „per creature“ effect (AE).

This reminds me to review all PC actions/traits for „perceived threat“ (what would a hostile observer consider threatening) and to add an AGGRO ;) like others are already exploring in this thread.

Fingersome
January 3rd, 2025, 16:33
[ERROR] Script execution error: [string "Aggro:scripts/manager_aggro.lua"]:367: attempt to concatenate local 'nMaxRange' (a nil value)

Any idea what might cause this error? It only procs on a homebrewed monster; it seems to work fine on the duergar and other monsters in the intiative while testing...
I added them to the initiative first, before adding them to the map, to avoid errors as you suggest, but still doesn't seem to want to generate aggro for them.

Alanrockid
January 3rd, 2025, 16:50
Any idea what might cause this error? It only procs on a homebrewed monster; it seems to work fine on the duergar and other monsters in the intiative while testing...
I added them to the initiative first, before adding them to the map, to avoid errors as you suggest, but still doesn't seem to want to generate aggro for them.

Yes, I've already noticed that bug and it's fixed in the next update that should be up tonight with some new features and fixes.

Fingersome
January 3rd, 2025, 19:12
Yes, I've already noticed that bug and it's fixed in the next update that should be up tonight with some new features and fixes.

Fabulous news! :D

Alanrockid
January 3rd, 2025, 19:54
Fabulous news! :D

Wait, did you update the extension already? Because come to think, nMax range error was already fixed in 1.1.1
The bug that still remains in 1.1.1 (and its fixed in the coming version 1.2.1) is that the formula to calculate effective and max range for melee actors was using bad parameters, so it is always calling the default number "30" to avoid a nil error.

Darth Decisive
January 3rd, 2025, 20:35
Please check if you are adding the character to the Combat tracker first and only then dragging them to the map. When you drag a token directly from the sheet to the map, things may seem ok (it even creates the CT entry for that char), but some features won't work properly. The behavior your describe fits exactly the behavior of a token dragged from outside the Combat Tracker. Can you confirm if the problem persists if you delete the token from map and CT and put it back on, but from the combat tracker?

I removed the PC from the combat tracker completely, then re-added them, and drug them from there to the map. I then put a new NPC on the combat tracker and pulled them to the map from there. For whatever reason, it still seems to be unable to track any of the damage aggro values, even if I dump a few hundred points of damage from the PC to the NPC.

Attached a couple images showing the chat log if it helps. Gilveradin Windrunner was the attacker, and Arackokra was the NPC.

Fingersome
January 4th, 2025, 05:34
Wait, did you update the extension already? Because come to think, nMax range error was already fixed in 1.1.1
The bug that still remains in 1.1.1 (and its fixed in the coming version 1.2.1) is that the formula to calculate effective and max range for melee actors was using bad parameters, so it is always calling the default number "30" to avoid a nil error.

I always check for updates before I run FGU so it *should* be using whatever the latest version you’ve pushed is… right?

Alanrockid
January 4th, 2025, 20:52
I removed the PC from the combat tracker completely, then re-added them, and drug them from there to the map. I then put a new NPC on the combat tracker and pulled them to the map from there. For whatever reason, it still seems to be unable to track any of the damage aggro values, even if I dump a few hundred points of damage from the PC to the NPC.

Attached a couple images showing the chat log if it helps. Gilveradin Windrunner was the attacker, and Arackokra was the NPC.

It's probably conflict with another mod. I've tested it with Aure effects, BCE, Advanced effects, Combat Automation and Turbo, but any mod the changes anything related to combat tracker could be causing the conflict. Can you test it without other extensions first, so we can be sure?

damned
January 4th, 2025, 22:07
I used last night in a dungeon with lots of corridors. Aggro with default settings would consistently target enemies that it had no line of sight on were often (not always) the furthest or 2nd furthest target away from the attacker. I dont know if there is an ability for Aggro to use line of sight or to check whether it has ranged attacks before selecting a target 40' away.

Alanrockid
January 5th, 2025, 00:25
I used last night in a dungeon with lots of corridors. Aggro with default settings would consistently target enemies that it had no line of sight on were often (not always) the furthest or 2nd furthest target away from the attacker. I dont know if there is an ability for Aggro to use line of sight or to check whether it has ranged attacks before selecting a target 40' away.

There's no feature for line of sight yet, as i believe this is more complex than the other features to implement (i want to implement it tough, along with an actor detection for ranged attacks vectors to track possible cover, i just don't even know where to start yet, so i'm focusing on easier to implement features...).

If a NPC has a ranged attack, its effective and maximum range for selecting valid target is the effective and maximum range of the attack (otherwise, the effective reach = speed + reach and maximum range = speed*2 + reach). So if a NPC has a longbow, for example, most probably all npcs on map will be valid targets (unless is a gargantuan map). If you think distant creatures are getting too much aggro, you can increase the threat weight for proximity, so closer targets will have better chances.

damned
January 5th, 2025, 00:53
This is just for your info - we had a lot of scenes where some or even most party members were in a corridor so there was limited movement possibilities (moving through enemy occupied squares) so the target choices were often not optimal due to that.

The targeted PC was the most wounded which is what swayed it. I tested now removing the Wights Longbow and he still preferred to attack the wounded character over all other options :bandit:

https://www.fantasygrounds.com/forums/attachment.php?attachmentid=63134

63134

Fingersome
January 5th, 2025, 01:48
It's probably conflict with another mod. I've tested it with Aure effects, BCE, Advanced effects, Combat Automation and Turbo, but any mod the changes anything related to combat tracker could be causing the conflict. Can you test it without other extensions first, so we can be sure?

Righto, I'll give it a go and see if I can narrow down which extension might be causing the issue.

EDIT: I removed all other extensions aside from Aggro, and it still happens, so it must be related to this extension.

Tooting Dog
January 5th, 2025, 04:47
I really like this extension, but I am guessing that it’s impossible to account for every unique situation. A good compromise might be a ranking system on each PC’s token—like a health bar or threat level indicator—so the DM can quickly identify threats. The DM could skip the top-ranked target if, for example, the target is behind a wall and move to the next highest-ranked viable target. But I don't know if that is possible.

Fingersome
January 5th, 2025, 06:38
I really like this extension, but I am guessing that it’s impossible to account for every unique situation. A good compromise might be a ranking system on each PC’s token—like a health bar or threat level indicator—so the DM can quickly identify threats. The DM could skip the top-ranked target if, for example, the target is behind a wall and move to the next highest-ranked viable target. But I don't know if that is possible.

That's a good shout; some way to know the next preferred target or a list of the threat posed by each target in initiative would be a good way to avoid edge cases.

Arnagus
January 5th, 2025, 09:37
That's a good shout; some way to know the next preferred target or a list of the threat posed by each target in initiative would be a good way to avoid edge cases.

This is partially already in the verbose chat output for the GM. I am currently muting the player output and check through the calculations (pure logic option) who gets how many AGGRO points. I find myself quite often changing target due to LoS, but having a choice of 3-4 targets instead of.... many is very helpful, especially if this annoying fireballing wizard in the last row is usually overlooked although in perfect range of a crossbow.

Adding AGGRO to spell casting effects is very helpful :D - for longer casting times, my players are already used to add an effect to their chars. They will now need to do it for more spells - which in turn also adds nice graphics from GAL, so a win-win.

However - having the full calculation results printed (in a nice table?) and sorted by AGGRO (highest last to minimize scrolling) would be really helpful.

Arnagus
January 5th, 2025, 10:42
I am not sure how you plan to implement AGGRO for spells, but i would like to share some thoughts (and rules) for your consideration - and include a feature request ;)

As of XGE p85, to identify a spell, a character must observe the casting or effect (or both) and spend an action or reaction to make a successful Arcana(INT) check against DC 15 + <spell level>. The check is made with advantage if the caster casts the spell in the same class as the character has.

Using this for AGGRO sounds pretty cumbersome and will kill a lot of reactions (or actions).

However, using the check itself (perhaps "passive" = 10 + <skill bonus>) might help to determine if a NPC perceives a spellcaster as a threat. House rule might adjust visible effect to DC 10 + <spell level> vs. somatic/verbal component observation remaining on DC 15 + <spell level>.
I can see this resulting in wizards exchanging fireballs from backrow to backrow as the other NPCs do not perceive the whimsy guys in the backrows as threat :D

That means a table for all spells with visible effect and a predefined (level based?) AGGRO would be required.
I am currently using an additional effect (for the spells I consider visible) which wears off after the spell caster's next turn, simple AGGRO: 50 * <spell level>. I have not solved the skill check yet but I suspect it would require something like an AURA effect and/or a new reverse AGGROT effect applied to the NPCs succeeding the check with the caster as target.

Long story short: perhaps you could add this targeted AGGROT (or rather THREAT as it is reversed: NPC feels threatened by the target) to your "future implementation" feature list.
Many thanks!

Alanrockid
January 5th, 2025, 15:18
So... new update incoming. New features include:

3 New Effects

INDEPENDENT: NPCs with INDEPENDENT effect will skip threat calculation an auto targeting. Use it for manual targeting.
NOTHREAT: NPCs with this effect will be ignored as valid targets.
CRUEL: The NPC with this effect will bypass NPC Cruelty: Off (NPC will continue to see dying actors as valid targets until they're dead). Good to evil bosses or final battles.

A New targeting mode: Target Advisor

Instead of Auto selecting targets, Target advisor will just advise the GM on who are the biggest threats of the battlefield, leaving the final target choice to GM/Player.

New Option: NPC Engagement

NPCs normally don't engage in combat. But this option can change that behavior. These are the new options:

Off: Neutral NPCs never engage combat, even if attacked.
Auto Defense: Neutral NPCs will join the opposing faction of any actor that attack them first. If after switching factions a former neutral is attacked by a member of the faction they've just joined, the NPCs will turn hostile to all, instead.
Hostile to All: If a neutral NPC is attacked by anyone, it will turn hostile to all actors on combat tracker that were not neutral before.
Random Choice: Randomly chooses between auto defense or hostile to all.

Bug Fixes and minor changes:

Fixed effective and max range calculations for melee actors.
Renamed menu options.

Known Issues:
Foes will never see a former neutral turned foe as a valid target. The only way to trigger the "betrayal" behavior for neutrals that are now foes is to manually target it with another foe.

I've tried my best to test all possible scenarios, but as the number of features grow, it's becoming very difficult to test, so if you would like to test future releases in advance, let me know!

Alanrockid
January 5th, 2025, 16:13
I always check for updates before I run FGU so it *should* be using whatever the latest version you’ve pushed is… right?

Maybe not. I've switched AGGRO from Data to Vault on Forge, in earlier versions. if you happen to have a older version in .ext format in you extensions folder, FG will grant priority for the .ext over the vault file. Remove any old aggro files from your extension folder and give it a new try.

check the extension announcement message when you launch the game, if it says Aggro 1.2.1 you're good. If it says something like "Aggro - [Prioritized Source: File; Other Sources: Vault]" it's because FG is loading the old version instead.

Fingersome
January 5th, 2025, 18:16
Maybe not. I've switched AGGRO from Data to Vault on Forge, in earlier versions. if you happen to have a older version in .ext format in you extensions folder, FG will grant priority for the .ext over the vault file. Remove any old aggro files from your extension folder and give it a new try.

check the extension announcement message when you launch the game, if it says Aggro 1.2.1 you're good. If it says something like "Aggro - [Prioritized Source: File; Other Sources: Vault]" it's because FG is loading the old version instead.

63142

Welp, it's still giving that error, and it's definitely the latest version :confused:

Alanrockid
January 5th, 2025, 19:00
63142

Welp, it's still giving that error, and it's definitely the latest version :confused:

Can you share a screenshot of the NPC sheet that is triggering this error? I need to see the text for the ranged attack and the npc speed and reach.

Fingersome
January 5th, 2025, 19:25
Can you share a screenshot of the NPC sheet that is triggering this error? I need to see the text for the ranged attack and the npc speed and reach.

Aha! Found the issue; the creature's ranged attack was missing the "ft." part of the range increment on its ranged attack roll. It's now working as intended. Apologies for mucking you about!

Alanrockid
January 5th, 2025, 20:17
Aha! Found the issue; the creature's ranged attack was missing the "ft." part of the range increment on its ranged attack roll. It's now working as intended. Apologies for mucking you about!

Good to know! The function that checks for range in npc actors search for specific patterns: 'range x/y ft'., 'ranged x/y ft.', 'range x ft'. or 'ranged x ft', that why it wasn't working for you.

Tooting Dog
January 5th, 2025, 22:05
This is partially already in the verbose chat output for the GM. I am currently muting the player output and check through the calculations (pure logic option) who gets how many AGGRO points. I find myself quite often changing target due to LoS, but having a choice of 3-4 targets instead of.... many is very helpful, especiaöly if this annoying fireballing wizard in the last row is usually overlooked although in perfecr range of a crossbow...

Some of us process information better visually. Personally, I find it quicker to look at a map with ranked targets than to scan the chat output and match it to the tokens' positions. For example, I could glance at the map and immediately see that the token marked '1' is behind a wall and invalid, '2' is behind cover and would impose a -2 penalty on my ranging orc’s shot, while '3' is in a perfect position. Both methods work, but visual cues are much easier for me in these situations, and maybe for a few others.

Alanrockid
January 8th, 2025, 21:29
Some of us process information better visually. Personally, I find it quicker to look at a map with ranked targets than to scan the chat output and match it to the tokens' positions. For example, I could glance at the map and immediately see that the token marked '1' is behind a wall and invalid, '2' is behind cover and would impose a -2 penalty on my ranging orc’s shot, while '3' is in a perfect position. Both methods work, but visual cues are much easier for me in these situations, and maybe for a few others.

That's something worth considering for sure. Right now i'm focused on implementing Spellcast/Healing aggro, but i'll add this to my todo list.

BushViper
January 9th, 2025, 05:54
How much system performance load does this extension carry?

I use a ton of extensions (90+) and have to be selective about which ones that have a lot of overhead.

I love the concept of your work, but if it's constantly doing data comparison the performance cost may be too high (for me).

It's not apples to apples, but I had to stop using Auras for awhile because it made combat exceptionally laggy. However, that was fixed and it runs extremely well now.

Alanrockid
January 9th, 2025, 13:19
How much system performance load does this extension carry?

I use a ton of extensions (90+) and have to be selective about which ones that have a lot of overhead.

I love the concept of your work, but if it's constantly doing data comparison the performance cost may be too high (for me).

It's not apples to apples, but I had to stop using Auras for awhile because it made combat exceptionally laggy. However, that was fixed and it runs extremely well now.

It does compare data, but not continuously. It doesn't run nonstop checks or loops in the background; instead, it performs checks once for each system message in the chat (such as criticals, damage, misses, or spells) and once at the start of an actor's turn in the combat tracker. I’ve also implemented a garbage collection system to avoid memory clutter. The processing is done on local tables rather than database nodes, except when saving data.

HeWhoKnows
January 10th, 2025, 04:43
Please check if you are adding the character to the Combat tracker first and only then dragging them to the map. When you drag a token directly from the sheet to the map, things may seem ok (it even creates the CT entry for that char), but some features won't work properly. The behavior your describe fits exactly the behavior of a token dragged from outside the Combat Tracker. Can you confirm if the problem persists if you delete the token from map and CT and put it back on, but from the combat tracker?

I am very interested in getting this extension, but I have a question about what you said above. What about pre-built modules? Like if I have Decent into Averus, where the author may have dragged the map directly from the encounter, would I have to add each encounter to the combat tracker then drag each monster onto the map?

Alanrockid
January 10th, 2025, 19:40
I am very interested in getting this extension, but I have a question about what you said above. What about pre-built modules? Like if I have Decent into Averus, where the author may have dragged the map directly from the encounter, would I have to add each encounter to the combat tracker then drag each monster onto the map?

I"ve tested with Tomb of Annihilation and i had no problems with the pre-made encounters. You should be fine with other modules as well. Also, I've made some changes to damage, misses and critical functions and it seems to have fixed the issues with those factors not being calculated when the actor's token were dragged directly from the character sheet into the map, instead of combat tracker.

Alanrockid
February 1st, 2025, 02:22
Big Update

1.3.0

New Features:
Spellcasting Aggro! Caster receive the base spell threat value + additional level bonus (both customizable).
Healing Aggro: also receive additional aggro based on healing level.
Intelligence based aggro: Define the minimum intelligence to be considered 'intelligent' and 'rational'. Intelligent actors will calculate all variables plus spell and healing aggro. Rational actors will calculate everything but those two and irrational actor will only consider basic aggro modifiers.
Neglected target aggro: Actors that are not being targeted by anyone will receive this bonus to threat.

Let me know if you find any bugs! Also, leave your suggestions! I always read them and try to implement everything i can.

Alanrockid
February 1st, 2025, 23:14
Some of us process information better visually. Personally, I find it quicker to look at a map with ranked targets than to scan the chat output and match it to the tokens' positions. For example, I could glance at the map and immediately see that the token marked '1' is behind a wall and invalid, '2' is behind cover and would impose a -2 penalty on my ranging orc’s shot, while '3' is in a perfect position. Both methods work, but visual cues are much easier for me in these situations, and maybe for a few others.

Next update will feature visual aid for the first 3 aggro choices. I'm already testing it and it seems to be working fine...

https://i.imgur.com/n8BsWAU.png

Arnagus
February 2nd, 2025, 09:31
Next update will feature visual aid for the first 3 aggro choices. I'm already testing it and it seems to be working fine..

This looks really great, but be careful here: the icons in the top left might clash with the Indicators (https://forge.fantasygrounds.com/shop/items/1603/view) (or similar) extension which are quite widely used.

Alanrockid
February 2nd, 2025, 11:25
This looks really great, but be careful here: the icons in the top left might clash with the Indicators (https://forge.fantasygrounds.com/shop/items/1603/view) (or similar) extension which are quite widely used.

Position and size are customizable as well.

Arnagus
February 2nd, 2025, 11:31
Position and size are customizable as well.

Excellent, thanks for considering - let's hope the overlays are not interfering.

Evolivolution
March 8th, 2025, 16:09
Hey, I've been playing around a bit with this and I really like it.
One thing, I'd like to note. In PF2RPG the differentiation between 'irrational', 'rational', and 'intelligent' doesn't seem to work. I assume this is because in PF2 Ability Scores are Modifiers only and I guess the extension checks for the score. I can set the values to 0 to make them work, which supports this. Maybe you can look into this?

Arnagus
March 15th, 2025, 12:29
FYI (I have not seen any impact): the following warning is showing up in the console logs pretty much at the top:

[3/15/2025 12:23:18 PM] [WARNING] Could not load script file (AGGRO) (P:aggroVision) (scripts/manager_vision_aggro.lua)

Veliant
April 24th, 2025, 21:55
Hey there, I bought the extension and it works great for the basics. One issue i'm having is that it's only adding aggro values for any spellcasts/damage/misses while GM is the one doing the spellcast or attack from the character sheet, it does not calculate when PC players use actions. Is there any possible fix for this? Thanks.

MrDDT
May 21st, 2025, 01:26
Hey there, I bought the extension and it works great for the basics. One issue i'm having is that it's only adding aggro values for any spellcasts/damage/misses while GM is the one doing the spell cast or attack from the character sheet, it does not calculate when PC players use actions. Is there any possible fix for this? Thanks.

I'm having this same issue. If the GM does it, it will track the spell casting.
Same for healing.

I'm not seeing the threat for "Damage Threat" nor "Critical Hit Threat" nor "Miss Penalty"
Also some healing is working but others are not.

Testing with no other exts.


Feature Request: Can you add a new option to carry over some or all of the last round's threat? Much like "Previous Target" a way to pull the total AGGRO as part or the whole amount carrying it forward would be nice.
This would allow for someone's high threat the round before to carry over more than just a "previous target" modifier because someone could have got a LOT of AGGRO in a round lets say 850 now they are the target. All it would take is someone to do slightly more (an amount over the Prev Target setting) AGGRO for 1 round and they (the creature) would change to a new target.
This prevents some ping ponging also.

MrDDT
June 1st, 2025, 16:25
Getting this error when using a Spectator NPC. (Legacy MM)

[ERROR] Handler error: [string "AGGRO:scripts/manager_aggro.lua"]:787: attempt to concatenate local 'nMaxRange' (a nil value)

MrDDT
June 4th, 2025, 18:16
When the players connect it displayed these messages to them. Which they can see if they look at the options but still likely better not to display it each time they load.


Target selection weight updated - RANDDISTW: 150
Target selection weight updated - RANDDMG: 555
Target selection weight updated - RANDMIN: 50


Also is it possible to hide the settings from the players? I would like it if they didn't know the weights of these things at all or any of these settings.

The Judge
August 5th, 2025, 01:18
Anything to be concerned about here?

Pathfinder 1st edition,
[WARNING] Could not load script file (AGGRO) (P:aggroVision) (scripts/manager_vision_aggro.lua)

bwatford
March 2nd, 2026, 22:07
Is this module no longer being maintained? Get all sorts of errors when using it?

arkanis
March 3rd, 2026, 13:40
It seems so.
A pity, it was an interesting concept, but sure It was very short lived.

Alanrockid
June 1st, 2026, 07:13
Sorry guys... I've been away since my child was born, but now I'm back and ready to catch up with my extensions.

I'll be conducting a series of tests this week to see what is broken and what is still working in the latest versions of the supported rulesets.

A lot of people have asked me to add support for specific rulesets, so I'll probably allow this extension to load in any CoreRPG-based ruleset. Support is not guaranteed, though, and I won't be advertising the additional rulesets for that reason. This is mostly for testing purposes, so you guys can see what works and what doesn't.

MrDDT
June 1st, 2026, 07:25
Sorry guys... I've been away since my child was born, but now I'm back and ready to catch up with my extensions.

I'll be conducting a series of tests this week to see what is broken and what is still working in the latest versions of the supported rulesets.

A lot of people have asked me to add support for specific rulesets, so I'll probably allow this extension to load in any CoreRPG-based ruleset. Support is not guaranteed, though, and I won't be advertising the additional rulesets for that reason. This is mostly for testing purposes, so you guys can see what works and what doesn't.


Welcome back and congrats!!

Alanrockid
June 21st, 2026, 21:33
Changelog

1.4.0
New Features:
LoS-Aware Aggro: Characters will not be listed as potential targets if they do not have line of sight to the current actor (don't forget to activate this in the options windows and turn LoS on in the image).
Opportunity Attack-Aware Aggro: Intelligent actors will avoid targeting characters when doing so would trigger opportunity attacks. Optimized for 5E.
New Threat Modifier: Legacy: Carries over a percentage of the previous threat value to the next turn if the new value is lower.
Target Priority Widget: Displays a skull icon above the tokens of the top three targets to help the GM choose between them. This is especially useful when automatic targeting is disabled.
Expanded support for spells in Pathfinder 1 and 2.
Added Starfinder to the ruleset compatibility list. Although it is not officially supported, most, if not all, features should work due to its similarities to Pathfinder. Try at your own risk.
Also, multiple bug fixes.

If you're experiencing bugs, make sure to test it without other extensions and please specify the ruleset used.

MrDDT
June 21st, 2026, 21:42
This ext is not working because it's too deep into the folder structure. Need to move it up one.

Alanrockid
June 21st, 2026, 21:57
Yup...just noticed that...fixed!

MrDDT
June 21st, 2026, 23:04
I'm having a conflict with this an another ext I use, Generic Actions (Generic Actions Layers).

Not sure if you have that one or not.

Alanrockid
June 21st, 2026, 23:08
Changelog

1.4.1
Changes/Bug Fixes:
Fixed certain features, such as spellcasting, critical hits, and damage threat, not being accounted for in client rolls.
Fixed system messages notifying clients about the initial threat value options.
Changed the extension settings so they are visible only to the host, preventing clients from seeing threat values.

If you still are not seeing spellcasting threat, make sure the affected NPCs are considered Intelligent. The minimum Intelligence scores required for an NPC to be considered Rational or Intelligent can be configured in the extension options. For spellcasting, healing, and opportunity attacks to be taken into account, an NPC must be Intelligent.

Alanrockid
June 21st, 2026, 23:09
I'm having a conflict with this an another ext I use, Generic Actions (Generic Actions Layers).

Not sure if you have that one or not.

I don't... can you give me more details? Any console errors?

MrDDT
June 22nd, 2026, 01:18
I don't... can you give me more details? Any console errors?


Handler error: [string] "GenericActionsLayer:..ric_actions_layer.lua"]:366: stack overflow

Here is the related function in GAL

function onActionPostResolve(rSource, rTarget, rRoll)
if _fnOrigActionOnPostResolve then
_fnOrigActionOnPostResolve(rSource, rTarget, rRoll);
end


-- Add scaled asset in layer at desired map position
if rRoll.sType == "attack" then
addGenericActionLayer(rSource, rTarget, rRoll.sDesc);
elseif rRoll.sType == "damage" then
addGenericActionLayer(rSource, rTarget, rRoll.sDesc, "DefaultDamage");
elseif rRoll.sType == "heal" then
addGenericActionLayer(rSource, rTarget, rRoll.sDesc, "DefaultHeal");
end
end



_fnOrigActionOnPostResolve = GameManager.getMultiKeyFunction("onActionPostResolve", "");

MrDDT
June 22nd, 2026, 02:49
Threat Legacy, I'm not sure what % it's doing but doesn't seem to be working correctly as a % of anything I can tell.
Personally, what I would like it to do is keep a % of the last threat carried over to the new threat amount.

Spell Casting Threat is not working at all.

Healing Threat doesn't seem like its working correctly. I can see it sometimes but other times I don't see it working correctly.

In the options, there is 2 options for the same thing (Verbose) (Both Messages: GM and Messages: Player)
In the options, (Discreet) is not correctly giving the summary, its acting like Verbose. (think its related to the other options issue)
In the options, "Logical Chance" has 2 options for the same thing, likely causing some issues.

This stems from the options manger where you are defining too many label res.

Example below, you don't need to define "option_val_vis_alldice_default" in labelsres it can detect it from it being the baselabelres. Same with "values", you already set the baseval with "default" so no need to add it to the values list.
Don't ask me why FG changes to doing this.


OptionsManager.registerOptionData({
sKey = "vis_alldice",
sGroupRes = "option_header_DroppedOrder",
tCustom = {
labelsres = "option_val_vis_alldice_on|option_val_vis_alldice_v isual|option_val_vis_alldice_off",
values = "on|visual|off",
baselabelres = "option_val_vis_alldice_default",
baseval = "default",
default = "default",


I love the new widget icon things, but can I suggest maybe using another icon for =< #2 because it's very hard to see the number in that white skull, so if maybe you can use like color dots around it instead or something on the skull. Those graphics look awesome but saying for ease of use it's hard to see.


Can we have an option for FACTION = NONE to not display any info and not target anything? The main reason is a lot of the times things that are faction none are likely objects that don't need to target anything.

MrDDT
June 22nd, 2026, 02:58
Check all your options because I'm seeing more that have doubles in them.

Alanrockid
June 22nd, 2026, 03:21
It seems that Aggro was registering the GameManager action wrapper during both onInit and onTabletopInit, which could recapture another extension's wrapper as the "original" handler and create a circular call chain. I've changed it to register those wrappers only once and added a re-entry guard, so it should no longer contribute to a stack overflow loop.

See if it works now, as I don't have GAL to test it myself.

MrDDT
June 22nd, 2026, 03:41
It seems that Aggro was registering the GameManager action wrapper during both onInit and onTabletopInit, which could recapture another extension's wrapper as the "original" handler and create a circular call chain. I've changed it to register those wrappers only once and added a re-entry guard, so it should no longer contribute to a stack overflow loop.

See if it works now, as I don't have GAL to test it myself.


Everything with GAL is working great thank you!!!

I noticed the options are working correctly now as far as no doubles.

Spell Casting threat, and healing are not working correctly. I can get healing to trigger sometimes but it's very weird how it's being detected.

Still not understanding "threat legacy" and what % it is and where it's coming from. Also why it's only applied to some targets sometimes.

MrDDT
June 22nd, 2026, 03:44
Also the option for "Discreet" is acting just like verbose.

Alanrockid
June 22nd, 2026, 03:45
Threat Legacy, I'm not sure what % it's doing but doesn't seem to be working correctly as a % of anything I can tell.
Personally, what I would like it to do is keep a % of the last threat carried over to the new threat amount.

What Threat Legacy does is carry over a percentage of the difference between the previous threat value and the current one, but only if the previous value was higher. For example, if your threat was 1,000 on the previous turn, Threat Legacy is set to 25%, and your threat this turn is 500, you will receive a Legacy bonus of 125. That is 25% of 500, which is the difference between the previous and current threat values.


Spell Casting Threat is not working at all.

I tested it here and encountered no issues. Can you confirm that your NPCs meet the minimum Intelligence requirement configured in the extension options (there are options for you to define the minimum Intelligence value to be considered 'rational' and another one to be considered 'intelligent')? Also, which ruleset are you using? Only intelligent character will consider spellcasting, healing or Opportunity attacks as threats, I made it like that so that irrational beasts or really dumb characters could be a little more "realistic" with their choices.


Healing Threat doesn't seem like its working correctly. I can see it sometimes but other times I don't see it working correctly.

This is probably caused by the same issue mentioned above. Can you confirm whether your NPCs meet the minimum Intelligence requirement?


In the options, there is 2 options for the same thing (Verbose) (Both Messages: GM and Messages: Player)
In the options, (Discreet) is not correctly giving the summary, its acting like Verbose. (think its related to the other options issue)
In the options, "Logical Chance" has 2 options for the same thing, likely causing some issues.

I fixed the duplicated states in the option buttons.


I love the new widget icon things, but can I suggest maybe using another icon for =< #2 because it's very hard to see the number in that white skull, so if maybe you can use like color dots around it instead or something on the skull. Those graphics look awesome but saying for ease of use it's hard to see.

In future releases, I plan to add options to show or hide the widget and adjust its position and size. I will also consider using alternative graphics.


Can we have an option for FACTION = NONE to not display any info and not target anything? The main reason is a lot of the times things that are faction none are likely objects that don't need to target anything.

FG already has a NEUTRAL faction. Wouldn't that be enough to solve this issue? AGGRO also has the "Valid Target: Any Friendly" option, which prevents neutral actors from being selected as targets. Finally, you can assign the "NOTHREAT" effect to an actor, and it will be ignored as a potential target.

MrDDT
June 22nd, 2026, 04:00
Ok this makes a lot of sense and I will do more testing with that info in mind.

I can just apply a "NOTHREAT" effect on creatures, thank you, but that wasn't what I was saying. FACTION: NONE is triggering threat messages when it's their turn.

There are 4 factions in FG. Foe, Friend, Neutral, and None.

I feel like none and neutral shouldn't process threat messages, or give us the option to not process them with them.

MrDDT
June 22nd, 2026, 04:04
I wouldn't worry about the Faction NONE thing, I can simply use an effect, "independent; Nothreat"

Alanrockid
June 22nd, 2026, 04:32
I understand now. I thought you were saying that actors with the Neutral or None faction were being considered valid targets. That should be easy to implement, so I’ll work on it next week.

Feel free to report any other issues you encounter by then, so I can include them all in a single update.

bwatford
June 22nd, 2026, 06:55
I also would be interested to hear what GM settings worked for you in your game that felt like it worked well.

Alanrockid
June 28th, 2026, 16:05
AGGRO v1.5.0

This release introduces a new feature and refinements to the UI.

New Feature


Users can now configure which factions are eligible to roll for AGGRO.


UI Refinements


Threat values now have their own configuration window to avoid cluttering the Fantasy Grounds Options menu.
The AGGRO token widget can now be set to always on, always off, or shown only when hovering over a token.
The widget position and size can be chosen by the user.


Bug Fixes
Discreet mode for the host was behaving like Verbose mode. FIXED.

https://i.imgur.com/YnxCesR.png

https://i.imgur.com/HQun1BA.png

MrDDT
June 29th, 2026, 08:11
Amazing work, thank you.

MrDDT
July 13th, 2026, 00:09
I noticed a small bug that this EXT is doing and I'm not sure why.

It's changing the faction of "Faction: None" to "Hostile Neutral".
It's also adding a faction icon of "Hostile Neutral" in the CT at the bottom.

I think if you want to add the faction icon for none, it should be labeled correctly as "Faction: None", to correctly track the faction right.

There are 4 factions:
None
Friend
Foe
Neutral


When using a faction check "FACTION(none)" using this ext it will cause this to not see faction none because they are now a new faction called something else (I'm not sure but displayed it's Hostile Neutral).
Which poses a problem with anyone using FACTION(none) checks in coding effects.

Alanrockid
July 13th, 2026, 22:56
I noticed a small bug that this EXT is doing and I'm not sure why.

It's changing the faction of "Faction: None" to "Hostile Neutral".
It's also adding a faction icon of "Hostile Neutral" in the CT at the bottom.

I think if you want to add the faction icon for none, it should be labeled correctly as "Faction: None", to correctly track the faction right.

There are 4 factions:
None
Friend
Foe
Neutral


When using a faction check "FACTION(none)" using this ext it will cause this to not see faction none because they are now a new faction called something else (I'm not sure but displayed it's Hostile Neutral).
Which poses a problem with anyone using FACTION(none) checks in coding effects.

Can you describe the circumstances under which this change happens? There is indeed a new "Hostile Neutral" faction, but it exists alongside Faction: None, not as a replacement for it. Faction: None is still there. I just checked.

If you have the option "NPC Flavors: Engaging Neutrals" set to anything other than "Off", a Neutral or Faction: None target may change faction when attacked.

If the option is set to "Auto Defense", a Neutral or Faction: None actor will turn Friendly if targeted by a hostile actor, Hostile if targeted by a friendly actor, and Hostile Neutral if the option is set to "Hostile to All". This allows the extension to distinguish it from other hostile actors, since it can target both hostile and friendly actors.

That said, I will upload a small fix to exclude Faction: None from this rule, so traps, objects, and non-combatant actors do not roll for targets in a fight, even when attacked.

Alanrockid
July 13th, 2026, 23:19
AGGRO v1.5.1


Actor with Faction: NONE are not treated as Neutral NPCs anymore when they are attacked and the option NPC Flavors: Engaging Neutrals is on.

MrDDT
July 13th, 2026, 23:56
Can you describe the circumstances under which this change happens? There is indeed a new "Hostile Neutral" faction, but it exists alongside Faction: None, not as a replacement for it. Faction: None is still there. I just checked.

If you have the option "NPC Flavors: Engaging Neutrals" set to anything other than "Off", a Neutral or Faction: None target may change faction when attacked.

If the option is set to "Auto Defense", a Neutral or Faction: None actor will turn Friendly if targeted by a hostile actor, Hostile if targeted by a friendly actor, and Hostile Neutral if the option is set to "Hostile to All". This allows the extension to distinguish it from other hostile actors, since it can target both hostile and friendly actors.

That said, I will upload a small fix to exclude Faction: None from this rule, so traps, objects, and non-combatant actors do not roll for targets in a fight, even when attacked.


I understand your logic for doing this and sounds cool idea. However, I do think there will be some issues with effect coding because there is no faction currently called "Hostile Neutral", so any effect that would target neutral or foe, or enemy etc. Will not work on this new faction "Hostile Neutral".

Example say if I have a ranged attack that says if I try to make a ranged attack near an enemy, it will give me disadv on that attack.
The coding will return "no enemies near" even though a "Hostile Neutral" is next to the ranged attacker.
You can do this with things like pact tactics.

Because it made it's new faction but not checking correctly for the faction types it will cause some issues.

Example,
IFT: FACTION(neutral); ATK: 10
Will not work on "Hostile Neutrals"

Alanrockid
July 14th, 2026, 01:00
I understand now. Indeed I created hostile neutrals thinking in terms of AGGRO only, not other effects. I'm uploading a fix to this right now.

AGGRO v1.5.2


Consolidates the Neutral Hostile as a valid faction for other effects. Use 'hostile_neutral' to identify the faction in effects. Ex.: IFT: FACTION(hostile_neutral); ATK: 10.