Jump to content
  • [Repost]Range Calculater for WoW Vanilla is off


    eniac86
    • Version: All Product: WRobot General Type: Bug Status: Duplicate

    It seems that the 'range' calculator for Vanilla is off by a few yards.

    If i tell the bot to walk away from mobs if they are less than 8 yards range from me (to be able to use ranged abilities as hunter), the bot does not walk far enough away (it walks less then 8 yards away).
    If i set it to 12 yards instead of 8, then it will walk far enough away for the mob to be more then 8 yards range from me)

    This works totally fine in TBC, but not in Vanilla.

     

    Quote

    I even tried telling it to walk away if !_AutoShoot.IsDistanceGood , same problem (_AutoShot is Spell "Auto Shot")

    Like

    Hello, try to disable option "auto calcul range..." in advanced general settings

    Like
      On 5.1.2018 at 12:56 PM, Droidz said:

    Hello, try to disable option "auto calcul range..." in advanced general settings

    I don't see that anywhere in my settings, but i tried turning off Calculate interact/combat distance by target size.
    Did not help anything. :(

    Edit: It looks like the target size calculator is what is not working.

    Edited January 5 by Ordush
    Like

    @Droidz
    It should be very easy to reproduce, because i am using the code you supplied in another thread. :)

    Like

    Please @Droidz read this, and see my screenshot.

    5a539c7848fa9_buggedrange.png.31a4574c148ba3e8acd0e719b0f42cf7.png

    The code to print ObjectManager.Target.GetDistance i use is here:
     

    
    public static void wrPrint(float message)
    	{
    		{
    			Lua.LuaDoString("DEFAULT_CHAT_FRAME:AddMessage('" + message.ToString() + "')");
    		}
    	}

    Then you can just put wrPrint(ObjectManager.Target.GetDistance);
    Into a while loop or into wManager.Events.FightEvents.OnFightLoop += (unit, cancelable) => { }; if you only wanna spam your chat when actually shooting a mob or dummy.

    I need to be 13.3 yards away from the target, for it to be in range with a 8 yard spell (any ranged hunter attack). So when i am actually 8 yards away from the target, ObjectManager.Target.GetDistance thinks i'm 13.3 yards away. This is both with and without Calculate interact/combat distance by target size in general advanced settings.

    wrPrint("DistanceGood:" + _AutoShot.IsDistanceGood); This prints false under what ObjectManager.Target.GetDistance claims is 5 yards, above 5 yards it prints true.
    But in vanilla Auto Shot distance is not 5 Yards, it's 8 Yards.

    If you want to compare you IsDistanceGood with in-game "Is Distance Good" checker then you can do

    
    /run DEFAULT_CHAT_FRAME:AddMessage(IsActionInRange(1))

    then put whatever spell you wanna check against on action bar slot 1.
    Like Auto Shot

    Edited January 8 by Ordush
    Like
      On 2.1.2018 at 4:50 AM, Ordush said:

    I even tried telling it to walk away if !_AutoShoot.IsDistanceGood , same problem (_AutoShot is Spell "Auto Shot")

    Are you walking away by doing the "button press" logic that move during combat plugin does? I had problems with that and the refresh rate of the calculation of target distance before.

    Like
    
    wManager.Events.FightEvents.OnFightLoop += (unit, cancelable) => {
    			var unitsAffectingMyCombat = ObjectManager.GetUnitAttackPlayer();
    			var unitsAttackMe = unitsAffectingMyCombat.Where(u => u != null && u.IsValid && u.IsTargetingMe).ToList();
    			LuaUtils.wrPrint("GetDistance:" +ObjectManager.Target.GetDistance);
    			LuaUtils.wrPrint("DistanceGood:" + _AutoShot.IsDistanceGood);
    			if (ObjectManager.Target.IsAttackable && unit.IsValid && !ObjectManager.Me.IsCast && ObjectManager.Target.GetDistance < 8 && !ObjectManager.Target.IsTargetingMe && !ObjectManager.Target.GetMove && unitsAttackMe.Count <= 0)
    			{
    				Move.Backward(Move.MoveAction.PressKey, 3000);
    			}
    		};

    However, it's not so much the refresh rate of the distance calculation, because as you can see in my screenshot, i am standing completely still at 7yard range from the mob, and WRobot thinks i'm 9 yards away.

    Edit: When a mob is melee hitting me WRobot thinks it's 3 yards away.

    Edited January 9 by Ordush
    Like
      On 9.1.2018 at 2:37 PM, Ordush said:
    
    wManager.Events.FightEvents.OnFightLoop += (unit, cancelable) => {
    			var unitsAffectingMyCombat = ObjectManager.GetUnitAttackPlayer();
    			var unitsAttackMe = unitsAffectingMyCombat.Where(u => u != null && u.IsValid && u.IsTargetingMe).ToList();
    			LuaUtils.wrPrint("GetDistance:" +ObjectManager.Target.GetDistance);
    			LuaUtils.wrPrint("DistanceGood:" + _AutoShot.IsDistanceGood);
    			if (ObjectManager.Target.IsAttackable && unit.IsValid && !ObjectManager.Me.IsCast && ObjectManager.Target.GetDistance < 8 && !ObjectManager.Target.IsTargetingMe && !ObjectManager.Target.GetMove && unitsAttackMe.Count <= 0)
    			{
    				Move.Backward(Move.MoveAction.PressKey, 3000);
    			}
    		};

    However, it's not so much the refresh rate of the distance calculation, because as you can see in my screenshot, i am standing completely still at 7yard range from the mob, and WRobot thinks i'm 9 yards away.

    Edit: When a mob is melee hitting me WRobot thinks it's 3 yards away.

    I tried this code out, while useful, it seems to only "tap" the back button, I did reproduce the range calculation being off though...

    Like

    It works fine in the way that i am using it.
    In my TBC profile, this works perfectly, no bugs etc.
    The issue here is the range being off, which is what i started saying. :)
    I think i've produced enough evidence. :)
    Also, the range needed for ranged attacks is set to 5 yards. in vanilla it's not 5 yards it's 8 yards. :)

    Like

    @Droidz
    Pretty please look into this <3

    Like

    Still no word? @Droidz

    Like
      On 8.1.2018 at 5:33 PM, Ordush said:

    Please @Droidz read this, and see my screenshot.

    5a539c7848fa9_buggedrange.png.31a4574c148ba3e8acd0e719b0f42cf7.png

    The code to print ObjectManager.Target.GetDistance i use is here:
     

    
    public static void wrPrint(float message)
    	{
    		{
    			Lua.LuaDoString("DEFAULT_CHAT_FRAME:AddMessage('" + message.ToString() + "')");
    		}
    	}

    Then you can just put wrPrint(ObjectManager.Target.GetDistance);
    Into a while loop or into wManager.Events.FightEvents.OnFightLoop += (unit, cancelable) => { }; if you only wanna spam your chat when actually shooting a mob or dummy.

    I need to be 13.3 yards away from the target, for it to be in range with a 8 yard spell (any ranged hunter attack). So when i am actually 8 yards away from the target, ObjectManager.Target.GetDistance thinks i'm 13.3 yards away. This is both with and without Calculate interact/combat distance by target size in general advanced settings.

    wrPrint("DistanceGood:" + _AutoShot.IsDistanceGood); This prints false under what ObjectManager.Target.GetDistance claims is 5 yards, above 5 yards it prints true.
    But in vanilla Auto Shot distance is not 5 Yards, it's 8 Yards.

    If you want to compare you IsDistanceGood with in-game "Is Distance Good" checker then you can do

    
    /run DEFAULT_CHAT_FRAME:AddMessage(IsActionInRange(1))

    then put whatever spell you wanna check against on action bar slot 1.
    Like Auto Shot

    Try

    
     var dist = ObjectManager.Target.GetDistance - ObjectManager.Target.CombatReach;

     

    Like
      On 18.1.2018 at 3:43 PM, Droidz said:

    Try

    
     var dist = ObjectManager.Target.GetDistance - ObjectManager.Target.CombatReach;

     

    @Droidz  Sorry bout the late answer, i was hospitalized.
    This prints 11,3342 as range, when it's 8 yard range. So not better. =/

    Like

    @Droidz Can you please look into this? I've started coding on hunter class aswell and have the same problem. :(

     

    @Droidz as far as i can tell this bug only affect like 20-30% of npcs-types, for some it works just fine.
    Seems to be a problem with the npcs bounding box size calculation.

     
      On 16.2.2018 at 12:46 PM, Droidz said:

    This does not fix anything?
    The first one just tells if a auto-shot is in range, the other one checks attack.

    It's nice that we can check if a spell is in range. However, this does not give the range.
    We need the number (Range as a number).
    The methods listed above will make a shit ton of noise if you play with sound, and it uses lua which will slow down the fightclass.
    Also try and look at what i wrote above.. I wrote EXACTLY that code.

      Quote
    
    /run DEFAULT_CHAT_FRAME:AddMessage(IsActionInRange(1))

    To me it's clear that what is not working is the mob size calculator.

    Edited February 19 by Ordush
    Like

    Hey, as mangos emu is the only vanilla server software around these day i fuge most likely all of the private servers run on it (more or less modified).
    So here is the table containing the npc hitbox-radii and combat-reaches from the default mangos database. of cause they may have been modified on some servers.
    ttps://github.com/mangoszero/database/blob/master/World/Setup/FullDB/creature_model_info.sql

    But as it is now the hitbox data Wrobot reads from the wow client ist absolutely unreliable.
    Is the hitbox size even sent to the wow client? or is it just handled server-wise? 

    I tried to dig into mangos server code a little to find out if it sends the info to the client, so that it could be read with the right opcode.
    But i'm to lazy to trac the networklogic down to that point, this might be the funktion that sets it internally, no idea if that is then send or not:
    https://github.com/mangoszero/server/blob/52454825c7e1435ff53f32f9edf9fe7dca10ec08/src/game/Object/Unit.cpp#L8836

     



    User Feedback

    Recommended Comments

    There are no comments to display.



    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...