Page 1 of 1

group recognition

Posted: Sat Sep 07, 2013 9:19 am
by BlubBlab
Did somebody ever made group recognition? ( I don't mean a party of bots or player)
I tried to target into group in the past put that wasn't very successful because I target the avg mop in a range behind my first target.

So I started calculate a square behind the mop to see how many in their and get the avg mop from out of the square, did somebody similar in the past?

Re: group recognition

Posted: Sat Sep 07, 2013 9:50 am
by rock5
Yes, I did this when I added aoe skills. It was very, very complex calculations.

The problem is uneven ground. It's impossible to know where to click if you don't know the height of the ground. When the bot sees that the mobs are on the same level then it uses the average but when it sees that the ground is uneven because the mobs are different heights then it clicks the mob directly. You can override this by using this in your profile

Code: Select all

<option name="FORCE_BETTER_AOE_TARGETING"            value="true" />
or you can change it for a particular waypoint file by adding this to the onload

Code: Select all

settings.profile.options.FORCE_BETTER_AOE_TARGETING == true
This will cause it to always use the best average location to click even if the ground is uneven but expect some strange behavior.

Re: group recognition

Posted: Sat Sep 07, 2013 12:19 pm
by BlubBlab
niece thx

Re: group recognition

Posted: Mon Sep 09, 2013 7:24 am
by BlubBlab
I saw you did the calculation only for thunderstorm, so I added a few thing to make it usable for all AOE's

Code: Select all

function CSkill:use()
	local target
	player:updateTargetPtr()
	if player.TargetPtr ~= 0 and player.TargetPtr ~= player.Address then
		target = CPawn.new(player.TargetPtr)
	end

	if( self.hotkey == nil ) then
		local str = sprintf("Bad skill hotkey name: %s", tostring(self.Name));
		error(str);
	end

	self.used = self.used + 1;	-- count use of skill per fight
--	self.LastCastTime = os.time() + self.CastTime;


	-- set LastCastTime, thats the current key press time plus the casting time (if there is some)
	-- self.CastTime is in sec, hence * 1000
	-- every 1 ms in self.LastCastTime.low ( from getTime() ) is about getTimerFrequency().low
	-- we calculate the value at bot start time
	--self.LastCastTime = getTime();
	--self.LastCastTime.low = self.LastCastTime.low + self.CastTime*1000 * bot.GetTimeFrequency;
	player.LastSkill = table.copy(self)
	-- wait for global cooldown gap (1000ms) between skill use
	-- there are different 'waits' in the bot:
	-- at CPlayer:cast(skill): for the casting flag gone
	-- at CPlayer:checkSkills(): for the casting flag gone
	-- and here to have a minimum delay between the keypresses
	-- 850/900 will work after skills without casting time, but will result in misses
	-- after skills that have a casting time
	--[[local prior = getSkillUsePrior();

	while( deltaTime(getTime(), bot.LastSkillKeypressTime) <
		settings.profile.options.SKILL_GLOBALCOOLDOWN - prior ) do
		yrest(10);
	end]]
	if self.AOECenter and self.AOECenter == SAOE_PLAYER and settings.profile.options.FORCE_BETTER_AOE_TARGETING == true then
		
			
		
		local distL =  distance(player.X, player.Z, player.Y,target.X,target.Z,target.Y);
		local mobcount, mX, mZ = target:findBestClickPoint(self.Range, settings.profile.options.MAX_TARGET_DIST, settings.profile.options.COUNT_AGGRO_ONLY)
		if distL < 150  then
			if( teleport ~= nil)then
				teleport(mX,mZ,target.Y, true);
			end
		end
		player:updateXYZ()
		if( teleport == nil or not (player.X == mX and player.Z == mZ and player.Y == target.Y))then
			success, reason = player:moveTo(CWaypoint(mX, mZ,target.Y ), true, false,0);
		end
	end
Now the bot runs to the point where it can hit the biggest numbers of targets, maybe you want add something similar to the bot because it is really nice ^^

Re: group recognition

Posted: Mon Sep 09, 2013 7:44 am
by rock5
We don't use teleport in the actual bot because it's a userfunction. And you can't really run to the proper spot because the mobs would move and you'd collect aggro along the way.

Re: group recognition

Posted: Mon Sep 09, 2013 7:56 am
by BlubBlab
I know because I said "similar"(mean dump it down) and getting agro is not a problem I "TRAVEL" to the point and if it fail its fail. I use the skill anyway

EDIT: The only problem is which debuff you get from the mobs and how strong they are because of this it is still able to turn on/off