Page 1 of 1

Waypoint Radius

Posted: Wed Aug 11, 2010 7:01 pm
by Amihimarue
Hi, i have problem with rombot. My english is to poor, so i ilustrated my problem.

Bot works now that(chain mode - mob, mob, mob and most time bot never back to waypoint, because distance is too high and he blocked on some boxes/trees):
Image


So i need to do some waypoint radius, should bot never target and attack mobs outside allowed waypoint range.
Like this:
Image




My question is - can i do that ? if yes, please tell me where and how.


PS. on patch 3.0.3 im forced to download new version of bot, that version attacks all 360" character degree (old only attacks front of character, better for me. So can i back to old "only front attack"?)

Re: Stuck problems

Posted: Wed Aug 11, 2010 7:06 pm
by Valleyguy
Amihimarue wrote:Hi, i have problem with rombot. My english is to poor, so i ilustrated my problem.

Bot works now that(chain mode - mob, mob, mob and most time bot never back to waypoint, because distance is too high and he blocked on some boxes/trees):
Image


So i need to do some waypoint radius, should bot never target and attack mobs outside allowed waypoint range.
Like this:
Image




My question is - can i do that ? if yes, please tell me where and how.


PS. on patch 3.0.3 im forced to download new version of bot, that version attacks all 360" character degree (old only attacks front of character, better for me. So can i back to old "only front attack"?)

I think you will find the new one will keep your bot on path better with the 360 degree fighting mine never gets lost on the paths and if he gets jammed the new bot has a auto un-stick code to get him back to the way point... id try it man you might like the results. to avoid getting too deep in chain killing monsters away from your path reduce the ProfileOption("MAX_TARGET_DIST", 200); to 150 or 125...

Re: Waypoint Radius

Posted: Wed Aug 11, 2010 7:11 pm
by Amihimarue
Yea, but old bot works fine (only attack in front). Problem is 360" degree attack.
But better solution is control waypoint distance, if bot move too far (like 300-400 range), he need to back on track.
Im wondering if bot have thats mechanics or similiar?

EDIT

@Valleyguy
Thx dude :) You solve my problem. (Max_target_distance to reduce chainkilling)

Re: Waypoint Radius

Posted: Thu Aug 12, 2010 1:59 am
by rock5
Amihimarue wrote:But better solution is control waypoint distance, if bot move too far (like 300-400 range), he need to back on track.
Im wondering if bot have thats mechanics or similiar?
I think this is a good idea. Is there such a mechanic? There should be. It should only target mobs that aren't too far away from the 2 waypoint you are walking between.

Edit: Actually that approach wont work if 2 waypoints are very far away from each other. You'd still want to attack monsters along the way even if you are out of range of the waypoints. Instead you'd have to calculate the distance of the monster to the line from waypoint a to b, which can easily be done.

Actually this is something I can do, I'm going to start working on it. We will need a profile variable for the distance from the path to attack monsters and a default value. Maybe "MAX_TARGET_DIST_FROM_PATH"? I was never very good with variables. And a default of 250? How does that sound?

Re: Waypoint Radius

Posted: Thu Aug 12, 2010 2:30 am
by Amihimarue
Sounds good, 250 is perfect :) Cant wait for result.

Re: Waypoint Radius

Posted: Thu Aug 12, 2010 6:21 am
by Administrator
We could, potentially, calculate the closest point to the player on the segment between two waypoints, and use the radius from that. Isn't math fun?

Re: Waypoint Radius

Posted: Thu Aug 12, 2010 6:54 am
by Valleyguy
rock5 wrote:
Amihimarue wrote:But better solution is control waypoint distance, if bot move too far (like 300-400 range), he need to back on track.
Im wondering if bot have thats mechanics or similiar?
I think this is a good idea. Is there such a mechanic? There should be. It should only target mobs that aren't too far away from the 2 waypoint you are walking between.

Edit: Actually that approach wont work if 2 waypoints are very far away from each other. You'd still want to attack monsters along the way even if you are out of range of the waypoints. Instead you'd have to calculate the distance of the monster to the line from waypoint a to b, which can easily be done.

Actually this is something I can do, I'm going to start working on it. We will need a profile variable for the distance from the path to attack monsters and a default value. Maybe "MAX_TARGET_DIST_FROM_PATH"? I was never very good with variables. And a default of 250? How does that sound?

I love math thats why I am a Civil Engineer :) and not a programmer heh.... anyway you all ready have your var in the profile the Max Target Dist can and should = the Max Path Dist its already a radius number if i only want to target enemies at 150 (avoiding obstacles) then my distance away from my path i ever really want to be is either half that (75) or all of it (150) ...

cause you think of it i will run up to 150 already away from my path to attack something when i am done fighting i would have to check my path over 150? go back under look for another mob within 150 of me... etc...

Re: Waypoint Radius

Posted: Thu Aug 12, 2010 7:36 am
by rock5
Valleyguy wrote:love math thats why I am a Civil Engineer :) and not a programmer heh.... anyway you all ready have your var in the profile the Max Target Dist can and should = the Max Path Dist its already a radius number if i only want to target enemies at 150 (avoiding obstacles) then my distance away from my path i ever really want to be is either half that (75) or all of it (150) ...

cause you think of it i will run up to 150 already away from my path to attack something when i am done fighting i would have to check my path over 150? go back under look for another mob within 150 of me... etc...
Actually that's a good point. After all, the purpose of Max Target Distance is to keep you from going too far from the path. So what we should do instead is just change the way it checks Max Target Distance. Of course if the waypoint type is "wander" it will have to work as it does now.

Re: Waypoint Radius

Posted: Thu Aug 12, 2010 7:56 am
by Administrator
The math is fairly simple. Actually, far more simple than you might think. I've made up a small graphic to show you what's going on here.

X = player
A,B = waypoints
V = point between A and B that's closest to the player
seg_circle_collision.PNG
Once we find V, we do our distance checking from there.

This is, I assume, what you're asking for?

Re: Waypoint Radius

Posted: Thu Aug 12, 2010 10:29 am
by rock5
There are probably a few ways to calculate the distance. I saw a few ways of doing it online but I ended up calculating my own way. I've tested the math. It works. And I've done preliminary tests on the patch. Can someone who can reproduce the problem of getting pulled away from the path, please test it.