Target selection algorithm menu

Shout-Out

User Tag List

Results 1 to 4 of 4
  1. #1
    abdula123's Avatar Sergeant
    Reputation
    14
    Join Date
    Feb 2010
    Posts
    46
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Target selection algorithm

    at this moment my bot can "see" mobs around, select nearest (in terms of path lenght), go to it (with navmesh pathfinding), cast spells, use abilities etc. to kill it, and when - loot it.

    but going from nearest target to nearest seems to be not optimal (in terms of xp/time) or even dangerous, if bot will approach to compact pack of mobs.

    so next what I want - is to optimize target selection algorithm.

    any ideas about?

    maybe clusterize targets list (by distance between targets) and prefer targets in clusters, that is not too dense (packs) and not too sparse (more running, than killing) ?
    for example, with Kohonen network.


    EDIT: range, in that server sends mobs data is not big, so maybe it will be not good idea at all

    Target selection algorithm
  2. #2
    mnbvc's Avatar Banned
    Reputation
    120
    Join Date
    Jul 2009
    Posts
    273
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    Robske's Avatar Contributor
    Reputation
    305
    Join Date
    May 2007
    Posts
    1,062
    Thanks G/R
    3/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Recognizing Strategic Dispositions: Engaging the Enemy - AI Game Programming Wisdom I

    Well worth the read and fits your problem description perfectly.
    "Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
    "I cried a little earlier when I had to poop" - Sku

  4. #4
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    It depends how far out you want to plan. Doing a traveling salesman problem sort of implementation would allow you to plan your next few targets. However, I find this to be not only overkill, but flawed in the sense that by the time you kill one or two targets you may want to re-evaluate. It makes sense to concern yourself only with finding the presently optimal target, and repeat that process after you kill said target.

    Hell, we re-evaluate every couple of frames, to allow for a scenario where we want to switch targets before the current one is dead (if, for example, it beings to flee and that fleeing is safe). What has worked okay for us is to do something like:

    Code:
    UpdateTargets()
    {
      if (Me.InCombat)
      {
        TargetsList = select target from nearby mobs where
                      target.TappedByMe and target.InLineOfSight and !target.IsFleeing
                      order by target.RemainingHealthPercent asc;
        if (!TargetList)
          TargetList = select target from nearby mobs where
                       target.TappedByMe and target.IsFleeing
                       order by target.Distance(Me) asc;
      }
      else
      {
        list<mob, score> priorityList;
    
        foreach (mob in nearby mobs)
        {
           // this will check if pulling this mob will do anything bad (like pull more guys that we can handle)
           if (!SafeToPull(mob))
             continue;
    
           int score = 0;
    
           score += mob.Health*weight;
           score += mob.RelativeLevel(Me) * weight;
           score += mob.distance * weight;
           // .... and so on, different weights for each to play with as you see fit
    
           priorityList.add(mob, score)
        }
    
        TargetList = priorityList.sortBy(score, sort::ascending);
      }
    }
    This leaves the case of being out of combat and not having any safe pulls unaddressed as it's beyond the scope of this example.

    Please forgive my somewhat haphazard pseudo-code. I've been working with c# and c++ at the same time lately.

Similar Threads

  1. selecting spell target area
    By NitroGlycerine in forum WoW Memory Editing
    Replies: 2
    Last Post: 10-11-2010, 04:57 PM
  2. Selecting target by GUID
    By NitroGlycerine in forum WoW Memory Editing
    Replies: 9
    Last Post: 09-28-2010, 04:38 PM
  3. [Trinity] [C++][Request] Make .gobject target work like .gob select in arcemu
    By myran2 in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 08-26-2010, 02:43 PM
  4. [Question] Select a Target With Memory Reading
    By fukmeimbroken in forum WoW Memory Editing
    Replies: 15
    Last Post: 03-31-2010, 04:56 AM
  5. 2 Questions Interact/Select Target C++
    By jockel in forum WoW Memory Editing
    Replies: 4
    Last Post: 06-04-2009, 08:31 AM
All times are GMT -5. The time now is 03:32 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search