endless loop if 2 mobs infront behind a barrier

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Message
Author
Micke
Posts: 46
Joined: Sun Aug 15, 2010 10:07 am
Location: Germany

endless loop if 2 mobs infront behind a barrier

#1 Post by Micke »

if this happens, my char is staying infront of the wall and is playing tennis :-) :

mob1: attacking, couldnt cast , cancel
oh found another mob
mob2: attacking, couldnt cast , cancel
oh found another mob
mob1 .....

message in the game: "there is a barrier between u and the target"
- any ideas to avoid this ;-) ?

to bad that we cant ask the client whether target is visible or not
Last edited by Micke on Sat Feb 02, 2013 8:58 am, edited 1 time in total.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: endless loop if 2 mobs infront behind a barrier

#2 Post by rock5 »

If they are behind a wall usually you would adjust the waypoints so they are not so close to the wall or temporarily adjust MAX_TARGET_DIST so it doesn't target mobs on the other side of the wall.

This should be fixed and a few ideas have been put forward, it just hasn't been fixed yet. The way I see it being fixed is, every time it fails to damage a mob it adds it to an ignore list. When it finally does damage a mob it clears the ignore list. I don't want to leave mobs on the ignore list longer because sometimes mobs move and become attackable so this way it will have the chance to try again if they are still in range.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
Micke
Posts: 46
Joined: Sun Aug 15, 2010 10:07 am
Location: Germany

Re: endless loop if 2 mobs infront behind a barrier

#3 Post by Micke »

better waypoints, of course ^^, but in my case the bot magically finds a way to this "bad" mob, through the chain of mobs ;-)

if u are looking for a betatester, give me a sign ^^

was my first thought too, to manage the ignorelist this way, maybe some modification - u could save the mob_id with the coordinates as combined key in this list. it wont harm the intension to recognize moving mobs, but it avoids useless tries to attack the mob at same bad Position.

but i dont know how much performance u have to pay for such a more complex search in lua

and iam not sure how to manage the case, if the mob can be attacked from other waypoint. by trend i would ignore the mob , cause if we loot at this "bad" Position, we will have again problems
Last edited by Micke on Sat Feb 02, 2013 8:57 am, edited 1 time in total.
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: endless loop if 2 mobs infront behind a barrier

#4 Post by lisa »

yep had many posts about this now, trouble is that it's not just when you have a wall between you and the mobs. You could have a small rock and the game will say there is an obstruction but if you move slightly or mob moves slightly you can then kill it.

So adding more and more mobs to an ignore list isn't really going to do what you think it will.

Better waypoint creation is the way to go.
There are many KS scripts that manage this, there is also the killzone if you have rooms or walls to deal with.
There are many ways to deal with situations where you regularly have issues of not being able to attack a mob.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: endless loop if 2 mobs infront behind a barrier

#5 Post by rock5 »

Still I think my idea is worth doing. It wouldn't be the most ideal solution but it would save you from getting permanently stuck and save you having to fiddle with your waypoint or muck around with killzones. Of course if waypoint speed is an issue you will want to "fiddle with your waypoint or muck around with killzones" but if speed is not an issue then my solution will handle it.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
Micke
Posts: 46
Joined: Sun Aug 15, 2010 10:07 am
Location: Germany

Re: endless loop if 2 mobs infront behind a barrier

#6 Post by Micke »

hi lisa,
the problem is similar to situation when bot cant reach the next waypoint, then he plays with some fallback strategies to solve this.
in worst case bot log off, but thats a solution.

with the 2 mobs behind a barrier we have only a endless Loop at non predictable cases, no way out
Jandrana
Posts: 187
Joined: Thu Jul 05, 2012 5:53 am

Re: endless loop if 2 mobs infront behind a barrier

#7 Post by Jandrana »

I know that with other scripts using the EventMonitor system it is possible to retrieve the messages printed on the screen. I'm asking myself, if it is not possible to get this information when fighting mobs. This would also speed up detecting the casting failures.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: endless loop if 2 mobs infront behind a barrier

#8 Post by rock5 »

The event monitor uses RoMScripts which are relatively slow, too slow for combat. If we could get the messages directly from memory, that would be another story, but I've never been able to.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: endless loop if 2 mobs infront behind a barrier

#9 Post by lisa »

System messages are pretty much the only way you would be able to do it.

I spent many many hours testing on this subject and I can say for a fact the out of range and obstruction things come from serverside.

I deliberately caused a lot of server lag to the point that another character would look like it was directly in front of me but a buff skill would post the message out of range. So there won't be any part of memory client side that we would be able to read in order to work out if we can actually hit a target or not.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: endless loop if 2 mobs infront behind a barrier

#10 Post by rock5 »

Which brings us back to the tried and true method of trying for a bit and then giving up if we don't do damage.

Which reminds me, I should do that ignore list now that I've committed my previous changes.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: endless loop if 2 mobs infront behind a barrier

#11 Post by rock5 »

Ok I did the ignore list code and tested it around the outside of the limo room. It works the way it's supposed to but it does take a long time to finally give up on each mob. It wont be much of an issue if there are only 2 or 3 mobs to ignore but it's still a long time.

So I reconsidered the eventmonitor idea. If we use it cleverly then it shouldn't impact performance. I was thinking start the event monitor at the start of the fight then only check it if it fails to cast. It checks the last message only and if it's the "There is an obstacle between you and you target" then it immediately quits the fight and adds the mob to the ignore list. How does that sound?

Edit: I just had an idea. I should add a distance check to when it clears the ignore list. So if it hasn't moved far when it finally kills a mob then it wont clear the list until it moves further away.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: endless loop if 2 mobs infront behind a barrier

#12 Post by rock5 »

Try these 2 files out.
  • -- Includes an ignore list that clears when you kill a mob if more than 50 away from the last ignore.
    -- Includes monitor for "There is an obstacle between you and you target" so it disengages after the first failed cast. I don't know if we will need to add support for other messages or not.
Attachments
player.lua
(126.08 KiB) Downloaded 184 times
pawn.lua
(28.31 KiB) Downloaded 176 times
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: endless loop if 2 mobs infront behind a barrier

#13 Post by rock5 »

I still want to hear how these files worked but I'm thinking they still need more work. Firstly it should also check the system message if it can't damage the target during battle (after aggroing the target) so it steps back more quickly. Also there are other reasons for not being able to target a mob eg. "Must face target". So I'm thinking a general function that is called whenever it fails to cast and checks for different messages and act accordingly.

I had a lie down to think about this some more and it occurred to me that maybe we should have an eventmonitor running all the time for warning and alert messages. It could be used for anything. If you just did an action and want to see if it cause a warning, then just check.

As the eventmonitor is written now, it will accumulate messages in it's log if not cleared. I think what we need is specific code in the ingamefunctions addon that always keeps just the last warning and alert message. It would always be running so you wouldn't have to start it, and at anytime, in your code, you could do something like

Code: Select all

Do some action or command
msg= GetWarningMessage(5) -- 5 means ignore message if older than 5s
if msg and msg == "what you are expecting" then
    react to message
end
Now I'm thinking, "do we want to automatically clear the message when it's checked?". I'm thinking what if the bot gets the chance to check the messages before you can? Then the message you were expecting would be gone. I'm thinking the addon should always hold the last message, only overwriting it with new messages. So how do we avoid acting on the same message twice? We could have it return the time along with the message. That way if it has a different time then it's a different message.

How does that sound?
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: endless loop if 2 mobs infront behind a barrier

#14 Post by lisa »

Looks like I am the only one to d/l those files so far, I haven't done any fighting yet though, just been working on my buff thingy.

Sounds like it is going to get complicated though.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: endless loop if 2 mobs infront behind a barrier

#15 Post by rock5 »

But what do you think of the idea of being able to check for system warning/alert messages any time, simply? I'm quite excited by it. :D And once I implement that, it will actually make the check for the obstacle message easier.
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
Jandrana
Posts: 187
Joined: Thu Jul 05, 2012 5:53 am

Re: endless loop if 2 mobs infront behind a barrier

#16 Post by Jandrana »

But what do you think of the idea of being able to check for system warning/alert messages any time, simply? I'm quite excited by it. And once I implement that, it will actually make the check for the obstacle message easier.
Looks good in my opinion. Perhaps we can group events message in different categories:

fighting category: -> obstacle, must face target, out of range, out of ammo, being stunned/rooted, skill cooldown..
inventory: -> backpack full (when looting, completing quests)
quest: -> quest completed
general: -> phirius shell limit reached, public event started,...

So if we the bot will provide handlers for certain categories this would allow a complete different style how to write scripts which would allow to create scripts that look less bottish.
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: endless loop if 2 mobs infront behind a barrier

#17 Post by rock5 »

It's a good idea except, like I said before, checking the event monitor is relatively slow so should only be used where no other solution is possible. Most of what you mentioned is already handled by the bot by reading values directly from memory which is the fastest way to do it.

rooted/stunned sounds interesting. Do you get a rooted/stunned message if you try to use a skill when rooted/stunned?
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
Jandrana
Posts: 187
Joined: Thu Jul 05, 2012 5:53 am

Re: endless loop if 2 mobs infront behind a barrier

#18 Post by Jandrana »

Do you get a rooted/stunned message if you try to use a skill when rooted/stunned?
There is a red message, when you try to use a skill while being stunned. But I can't remember what it is. Maybe something simple like: "You cannot do that" or similar.
User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: endless loop if 2 mobs infront behind a barrier

#19 Post by lisa »

rock5 wrote:Try these 2 files out.
  • -- Includes an ignore list that clears when you kill a mob if more than 50 away from the last ignore.
    -- Includes monitor for "There is an obstacle between you and you target" so it disengages after the first failed cast. I don't know if we will need to add support for other messages or not.
I accidently commited these to rev 749, hope they work ;)
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: endless loop if 2 mobs infront behind a barrier

#20 Post by rock5 »

As is, they work and shouldn't cause any problems but they still needed more work to be optimal. And of course I have plans to make it a lot better with other messages monitored and using the general purpose warning/alert message system.

How do you accidentally commit files while at the same time add a comment saying you accidentally added them? Do you know a way to edit a comment after committing the files?
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan
Post Reply