idea for "forbidden zone" calculation

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
Starrider
Posts: 164
Joined: Sat May 01, 2010 7:04 am
Location: Germany

idea for "forbidden zone" calculation

#1 Post by Starrider » Thu Aug 26, 2010 2:16 pm

Maybe you can think about some code improvements that the bot doesn't run into barriers. The code was improved in case of calculating the best way between waypoints and that the bot not leave the route to far by the new attacking system. So if it would possibile to set an pointer in which radius around it the bot isn't allowed to cross, when it wants to reach a target or next mob.

On the pictue i discribe what i mean:

the bot runs normally from A->D and leave his direct way to the waypoint if an target is in his attack range. Now he leaves the waypoint to attack the mobs 1-> 4 after mob 4's death the bot calculate the shortest way to the next nearest waypoint.
What is if you think about an development on the waypoint system to add a "forbidden zone radius".

When you create your waypoint file you go to such barriers and mark them with a new waypoint function. This waypoint ist saved at the beginning of the waypoint file and is loaded at the beginning to be not entered when the bot calculate the route between all following waypoints and does automatically to forgo around them.
Attachments
Idea
Idea

User avatar
droppen
Posts: 179
Joined: Mon Aug 03, 2009 10:32 pm

Re: idea for "forbidden zone" calculation

#2 Post by droppen » Thu Aug 26, 2010 6:47 pm

hmm, do you mean like mark an area in witch to fight mobs, or make the bot not go too far from the points?

Starrider
Posts: 164
Joined: Sat May 01, 2010 7:04 am
Location: Germany

Re: idea for "forbidden zone" calculation

#3 Post by Starrider » Fri Aug 27, 2010 4:29 am

You can seperate it, one marker is Elite/boss area, one marker is barriers, but isn't really necessary.
Maybe devide in small (for fences or points on the map the bot can't walk up)/middle (larger objects like houses) large (mountains). So you can set different values.

I am no math expert, but if you create an area for example a circle around the marked point, you need a formula where the bot calculate the circle/ elipse around it, then the bot decides the shortest way around this point on the circle line. That could he do by comparing the lenght the bot has to walk on the circle. Then you need dynamic new waypoints until the next static waypoint is reached.
that the bot doesnt enter the cricle is garuanteed by that the bot takes the total length of the way on the circle, devides it by the max distace between two waypoints f.e. lenght is 500 max distance between two dynamic waypoints is 100 the bot has to calculate 5 waypoints on the circle.

Its only a suggestion, i think rock5 is the formula and math expert XD maybe he has an idea if this is realizable
Attachments
example2
example2

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: idea for "forbidden zone" calculation

#4 Post by rock5 » Fri Aug 27, 2010 5:33 am

Starrider wrote:You can seperate it, one marker is Elite/boss area, one marker is barriers, but isn't really necessary.
Maybe devide in small (for fences or points on the map the bot can't walk up)/middle (larger objects like houses) large (mountains). So you can set different values.

I am no math expert, but if you create an area for example a circle around the marked point, you need a formula where the bot calculate the circle/ elipse around it, then the bot decides the shortest way around this point on the circle line. That could he do by comparing the lenght the bot has to walk on the circle. Then you need dynamic new waypoints until the next static waypoint is reached.
that the bot doesnt enter the cricle is garuanteed by that the bot takes the total length of the way on the circle, devides it by the max distace between two waypoints f.e. lenght is 500 max distance between two dynamic waypoints is 100 the bot has to calculate 5 waypoints on the circle.

Its only a suggestion, i think rock5 is the formula and math expert XD maybe he has an idea if this is realizable
It would be a lot of work but it could be done if it was only 1 point but what if there are overlapping circles? Then it becomes too much math for me.:) And really, it's not necessary. With a little bit of planning and care, when making your waypoint file, you should be able to avoid obstacles.
  • 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

Starrider
Posts: 164
Joined: Sat May 01, 2010 7:04 am
Location: Germany

Re: idea for "forbidden zone" calculation

#5 Post by Starrider » Fri Aug 27, 2010 6:58 am

yes i tried but on several maps this problem occures because the bot found the next mob across such a point and get stucked into it where only the report helps to get free.

If you have overlapping points calculate the intersections of them and add the next cricle to the length calucaltion, by checking if there are other cirles before the route is created. Then the best route around is the one where less intersections are. Then start calculating the route around these crcles. The the bot should run along the circles to the next one until all where passed.
One point would be enough for the first time :-P

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: idea for "forbidden zone" calculation

#6 Post by rock5 » Fri Aug 27, 2010 7:33 am

Starrider wrote:yes i tried but on several maps this problem occures because the bot found the next mob across such a point and get stucked into it where only the report helps to get free.
What you can do is reduce the COMBAT_DISTANCE at those waypoints so it doesn't see those unreachable mobs.
Example:

Code: Select all

changeProfileOption("COMBAT_DISTANCE", 60)
  • 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

Starrider
Posts: 164
Joined: Sat May 01, 2010 7:04 am
Location: Germany

Re: idea for "forbidden zone" calculation

#7 Post by Starrider » Fri Aug 27, 2010 3:15 pm

the problem in this case is that if I reduce this, i have 50% less mobs I can attack, because the radius of their movement is so large that it happens that they are so far away form my waypoints and the bot runs only to the next waypoint. In some bad cases the bot runs 5-6 waypoints without attacking because I had the luck that at this time the mobs have been far away from that. If I increase it i got also the problem that 3 mobs around the "forbidden area" and whith an value of 60 also doesnt really help because the mobs are not far away from each other...

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: idea for "forbidden zone" calculation

#8 Post by Administrator » Fri Aug 27, 2010 4:03 pm

The math is simple. The hard part is marking all of the zones you don't want to go in to and doing so in a simple, easy-to-use way, then writing a pathfinding algorithm to navigate it. And then you have to worry about things like cliffs still.

I've considered it before, but it's such a huge project that it's just not worth the time.

Oh, and also, you can use the above code to change it per waypoint.

Starrider
Posts: 164
Joined: Sat May 01, 2010 7:04 am
Location: Germany

Re: idea for "forbidden zone" calculation

#9 Post by Starrider » Fri Aug 27, 2010 6:01 pm

a ok, dont now that this is a waypoint based value XD

User avatar
Administrator
Site Admin
Posts: 5307
Joined: Sat Jan 05, 2008 4:21 pm

Re: idea for "forbidden zone" calculation

#10 Post by Administrator » Fri Aug 27, 2010 9:08 pm

It's not. You need to change it back and forth. Lets say waypoint 3 in the below example contains a lot of stuff you want to avoid, but waypoints 1, 2, and 4 can have a wide target range. You would do this:

Code: Select all

<!-- 1 --><waypoint x="0" z="0"></waypoint>
<!-- 2 --><waypoint x="0" z="0">changeProfileOption("COMBAT_DISTANCE", 60)</waypoint>
<!-- 3 --><waypoint x="0" z="0"></waypoint>
<!-- 4 --><waypoint x="0" z="0">changeProfileOption("COMBAT_DISTANCE", 210)</waypoint>
Now, waypoint 1 will use the default, and move to waypoint 2. Once you hit waypoint 2, you'll change the combat distance to 60. This will be used between 2 and 3. It stays at 60 for betwen 3 and 4, where it will finally be changed to 210 again.

What I'm getting at here with the example is that you should leave a small gap in the waypoints where you will use the reduced combat distance; don't just set it low for one waypoint.

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: idea for "forbidden zone" calculation

#11 Post by rock5 » Fri Aug 27, 2010 11:55 pm

By the way 60 was just an example. It might be too low a value. You can use 'rom/getid.lua' to get an idea of how far objects are and set a more appropriate value.
  • 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

Starrider
Posts: 164
Joined: Sat May 01, 2010 7:04 am
Location: Germany

Re: idea for "forbidden zone" calculation

#12 Post by Starrider » Sat Aug 28, 2010 1:29 pm

how does the getid.lua work, run it like the bot lua and it shows me the ids of alle objects around the bot?

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: idea for "forbidden zone" calculation

#13 Post by rock5 » Sat Aug 28, 2010 8:19 pm

Starrider wrote:how does the getid.lua work, run it like the bot lua and it shows me the ids of alle objects around the bot?
It shows you the id of objects you point at as well as their distance.
  • 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

Who is online

Users browsing this forum: Ahrefs [Bot] and 6 guests