What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

[Question] Raise Zombies -- In Combat Priority

judge001

Member
Joined
Mar 25, 2012
Messages
97
Reaction score
1
Greetings Exilebuddy community,

I have been monitoring the bot and note that it does not appear to summon zombies in combat, giving priority to the primary task instead. This can be an issue when an aoe spell destroys all zombies and I am left with a spell totem summoning skeletons or a weak attack skill. Can share with me how I would increase the priority of 'raise zombies' during combat? Basically, if zombies fall below x at any time, including in combat, I would like the bot to use the raise zombie skill if a corpse is in range. With CoDT Desecrate and mob death, there should regularly be a corpse within range. Thank you.
 
What you're describing is currently only coded for Summon Skeletons, so I'm not sure why you're having zombie issues.

The problem with zombies and other minions that can die, is that if the routine simple casts them as they die, you can get stuck in an infinite loop of recasting them over and over. To avoid that issue, ExampleRoutine throttles how often it casts them, and falls back to other skills to attempt to keep fighting.

However, that logic is only applied to skeletons, and not zombies or spectres, since it was just some example logic to show both cases.

I'll need a log where zombies aren't getting cast, to know what it's doing instead, as I can't think of any reason why zombies would not cast during combat, unless there's no bodies for it to raise, which is a possibility. Check the implementation of BestDeadTarget to understand how it looks for a body to raise:
Code:
private Monster BestDeadTarget
        {
            get
            {
                var myPos = LokiPoe.Me.Position;
                return LokiPoe.ObjectManager.GetObjectsByType<Monster>()
                    .Where(
                        m =>
                            m.Distance < 30 && m.IsActiveDead && m.Rarity != Rarity.Unique && m.CorpseUsable &&
                            ExilePather.PathDistance(myPos, m.Position) < 30)
                    .OrderBy(m => m.Distance).FirstOrDefault();
            }
        }

You could try increasing the range of 30 to something a little larger to see if it helps, but you might just need a custom routine that handles it better.
 
What you're describing is currently only coded for Summon Skeletons, so I'm not sure why you're having zombie issues.

The problem with zombies and other minions that can die, is that if the routine simple casts them as they die, you can get stuck in an infinite loop of recasting them over and over. To avoid that issue, ExampleRoutine throttles how often it casts them, and falls back to other skills to attempt to keep fighting.

However, that logic is only applied to skeletons, and not zombies or spectres, since it was just some example logic to show both cases.

I'll need a log where zombies aren't getting cast, to know what it's doing instead, as I can't think of any reason why zombies would not cast during combat, unless there's no bodies for it to raise, which is a possibility. Check the implementation of BestDeadTarget to understand how it looks for a body to raise:
Code:
private Monster BestDeadTarget
        {
            get
            {
                var myPos = LokiPoe.Me.Position;
                return LokiPoe.ObjectManager.GetObjectsByType<Monster>()
                    .Where(
                        m =>
                            m.Distance < 30 && m.IsActiveDead && m.Rarity != Rarity.Unique && m.CorpseUsable &&
                            ExilePather.PathDistance(myPos, m.Position) < 30)
                    .OrderBy(m => m.Distance).FirstOrDefault();
            }
        }

You could try increasing the range of 30 to something a little larger to see if it helps, but you might just need a custom routine that handles it better.

Thank you Pushedx. I have attached a log. Perhaps it will assist in showing that the bot appears to alternate between attacking and casting raise zombie rather than focusing on raise zombie until they are at the maximum again. I can provide more detailed logs if needed, logs that may show a few more examples during battles when most or all of the zombies are killed.

View attachment Raise Zombie in Combat.txt
 
Pushedx,

Please feel free to ignore this thread at this point. There must be something I am missing as I have observed some flawless fights and some with the questionable behavior. Clearly, it's trying to do what it is designed to do with regard to Raise Zombie in combat. I'll continue to test and see if I can come up with anything specific. Thanks.
 
well..

increase the range perhaps? Where you see 30 in the below code, change that to 50
Code:
 m.Distance < 30 && m.IsActiveDead && m.Rarity != Rarity.Unique && m.CorpseUsable &&
                            ExilePather.PathDistance(myPos, m.Position) < 30)

So...
Code:
 m.Distance < 50 && m.IsActiveDead && m.Rarity != Rarity.Unique && m.CorpseUsable &&
                            ExilePather.PathDistance(myPos, m.Position) < 50)

And while you are in the exampleroutine.cs, try the following code, UNTESTED, within the while loop
Code:
                // If we have Raise Zombie, we can look for dead bodies to use for our army as we move around.
                if (_raiseZombieSlot != -1)
                {
                    // See if we can use the skill.
                    var skill = LokiPoe.InGameState.SkillBarPanel.Slot(_raiseZombieSlot);
                    if (skill.CanUse())
                    {
                        var max = skill.GetStat(StatType.NumberOfZombiesAllowed);
                        while (skill.NumberDeployed < max)
                        {
                            // Check for a target near us.
                            var target = BestDeadTarget;
                            if (target != null)
                            {
                                await DisableAlwaysHiglight();

                                Log.InfoFormat("[Logic] Using {0} on {1}.", skill.Name, target.Name);

                                var uaerr = LokiPoe.InGameState.SkillBarPanel.UseAt(_raiseZombieSlot, false,
                                    target.Position);
                                if (uaerr == LokiPoe.InGameState.UseError.None)
                                {
                                    await Coroutines.FinishCurrentAction(false);
                                    await Coroutine.Sleep(Utility.LatencySafeValue(850)); //0.85 seconds before you can cast again unless you have faster casting..

                                } 
								else 
								{
									Log.ErrorFormat("[Logic] UseAt returned {0} for {1}.", uaerr, skill.Name);
									break;
								}
                            }
							else
							{
								break;
							}
                        }//while loop ends
                    }
                }

wimm
edit: stupid dump tabbing bullshit within the [codee]. And I pasted from Notepad++!
 
Last edited:
Thanks wimm! I haven't had a chance to test, but at the very least the 50 should help as that is well within range. I will test it out tonight.
 
Back
Top