Jump to content

Inimical Gestalts never update their tracked player (separate from combat target)


hoxi
  • Pending

It's only set once when spawning through the brightmarespawner component, but then is never updated unless the player dies or despawns.

local function SetTrackingTarget(inst, target, behaviour_level)
	local prev_target = inst.tracking_target
	inst.tracking_target = target
	inst.behaviour_level = behaviour_level -- behavior level should also probably not be handled by this function
	if prev_target ~= inst.tracking_target then
		if inst.OnTrackingTargetRemoved ~= nil then
			inst:RemoveEventCallback("onremove", inst.OnTrackingTargetRemoved, prev_target)
			inst:RemoveEventCallback("death", inst.OnTrackingTargetRemoved, prev_target)
			inst.OnTrackingTargetRemoved = nil
		end
		if inst.tracking_target ~= nil then
			inst.OnTrackingTargetRemoved = function(_) inst.tracking_target = nil end
			inst:ListenForEvent("onremove", inst.OnTrackingTargetRemoved, inst.tracking_target)
			inst:ListenForEvent("death", inst.OnTrackingTargetRemoved, inst.tracking_target)
		end
	end
end

This effectively makes them tunnel vision onto one specific player for their targeting logic, without trying to find any other valid combat targets (they will only set a combat target on being attacked or sharing aggro by another one being attacked).

 

On top of that, this tunnel vision logic doesn't even check if the tracked player is enlightened (compared to GetLevelForTarget or KeepTarget, though the latter doesn't check for gestalt protection or low enlightenment), they have to be asleep, not close, or have gestalt protection, so they can constantly aggro again.

local function Retarget(inst)
	if inst.tracking_target then
		if inst.components.combat:InCooldown()
				or not inst:IsNear(inst.tracking_target, TUNING.GESTALTGUARD_AGGRESSIVE_RANGE)
				or inst.tracking_target.sg:HasAnyStateTag(SLEEPING_TAGS) then
			return nil
		end

		-- If our potential target has a gestalt item, don't target them.
		local target_inventory = inst.tracking_target.components.inventory
		if target_inventory ~= nil and target_inventory:EquipHasTag("gestaltprotection") then
            return nil
		end

		return inst.tracking_target
	else
		-- standard logic here
	end
end
local function KeepTarget(inst, target)
    if target.components.sanity == nil then
        --not player; could be bernie or other creature
        return true
    elseif target.components.sanity:IsEnlightened() then -- no gestalt protection or low enlightenment check
        inst._deaggrotime = nil
        return true
    end

    -- rest of the function
end

Unlike Gestalts, they don't even have logic in their brain file to allow relocating if they don't have a tracked player or if they're too far from players, their relocation logic also doesn't make use of the tracked player, and they also don't have constant updating of which's the best player to track. The tracked player effectively just affects their targeting logic and nothing else.

 

If the tracked player dies or despawns, then they'll stop tunnel-visioning, but there's more issues. They're not able to put out Nightlight fires, unlike Greater Gestalts. They're capable of targeting them and starting the attack, but can't hit them, and will mostly target them but not attack them (I'm unsure why this last bit happens).

 

They also don't seem to have cleanup logic to despawn if far away, not even if unloaded, although to be fair normal Gestalts have this issue too.. should probably be addressed for both, since long range teleportation exists (and even leaving a shard would be enough). It's clearly not intended given that this fully prevents normal Gestalts from despawning even with their methods, and can cause the old issue shadow creatures had, where unloading them prevents further spawns for both (and in the case of Inimical ones, just them existing is enough as they'll stick to one place and never despawn, but also won't persist on saving and loading, so.. yeah, weird).

 

They just seem to have a lot of issues from being a mix of Gestalts and Greater Gestalts (in terms of code, although in gameplay that's the case too), but without full coherence. The targeting, tracking and relocating systems are all disjointed.

 

Given that a lot of code for them does suggest that the intention is for them to stick to their spawn point, only chasing valid targets or following players with an upgraded Enlightened Crown, the logic specific from Gestalts could probably just be removed, especially the player tracking bit. Some sort of cleanup logic should be added, especially for when unloading them, and their targeting needs to be revised so that things match better (please check the last report below to resolve some issues with targeting and transparency across all Gestalts).

 

On top of all these issues, there's also these other issues I reported:


Steps to Reproduce

For the target tunnel vision issue:

  • Have two enlightened players near each other with Inimical Gestalt spawns enabled.
  • Once one spawns, figure out which player is being tracked. This will be player A, the other B.
  • Have player A equip the Enlightened Crown or a Brightshade Helmet. The Inimical Gestalt should deaggro shortly if not attacked.
  • Have player B get close and hang around the Gestalt while having above 33% enlightenment or while having shadow gear equipped, and without the gear in the step above.
  • Notice how the Gestalt will ignore player B.
  • Now have player A be killed.
  • Notice how the Gestalt will now properly aggro to player B, and even shadow and nightmare creatures (although they won't be able to put out Night Light fires).
  • Revive player A.
  • Notice how the Gestalt is now able to target either player, as well as other entities.

For the lack of cleanup logic issue:

  • Have Inimical Gestalts spawn (with or without the upgraded crown).
  • Run away far enough for them to unload.
  • They should eventually stop spawning entirely.
  • Even if they don't unload, they won't relocate to the player and will block further spawns.
  • Like 11



User Feedback


So with the updates done to the code in 675312, it's clear they intend to keep the player tracking bit on them, even if they won't specifically chase or follow their tracked player (outside of targeting). And I think there's ways to keep that while still letting them target other things more properly.

 

I made a draft with modifications to some of the functions, attached to this comment rather than posting here or editing the report as it'd be too big.

The main thing behind it besides making targeting logic consistent across different functions (whereas that's not the case currently), is that this keeps in mind allowing them to target other things while having a tracked player, rather than ignoring everything else until that player dies/despawns (which is really unintuitive and weird).

Whether you'd want them to fully focus tracked players even if attacked by other things (or other players), or not, is also easily tweakable in Retarget.

 

Ideally, these issues should be looked at as well:

 

@V2C

I apologize for the ping but I feel like looking into all this should be quite high priority given all the negative feedback with this enemy. Fixing targeting issues so that tracked players don't always need gestalt protection (so if enlightenment is disabled, or if at low enlightenment, they won't aggro) would be a massive improvement.

 

gestalt_guard_evolved_fixes_draft.lua

Edited by hoxi
Corrected typo in attached file
  • Thanks 1

Share this comment


Link to comment
Share on other sites

I agree this should be fixed as soon as possible. I host a server and players keep dying constantly by these gestalts. To the point that if a player is alone on the server, they get even attacked during a reviving animation and will die instantly again. 

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...