SVN 2.0.7 AI bottleneck

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

cazanova000
Human
Human
Posts: 26
Joined: 29 Oct 2008, 22:18
Noob?: No

SVN 2.0.7 AI bottleneck

#1 Post by cazanova000 »

im getting a "bottleneck" with the latest SVN, a bottleneck of AI

the bot at the begins runs normally, doing all well
Jul 11 18:11:04 2009.32] [100/ 86] Monster Savage (1) attacks you - Dmg: Miss! (delay 96)
[Jul 11 18:11:04 2009.13] Exp gained: 516/244 (0.01%/0.00%)
[Jul 11 18:11:04 2009.13] Item Appeared: Mane (0) x 1 (167, 187)
[Jul 11 18:11:04 2009.14] Target died
[Jul 11 18:11:04 2009.34] Item added to inventory: Mane (5) x 1 - Non-usable
[Jul 11 18:11:08 2009.95] Attacking: Monster Alligator (0)
killing, attacking and looting items...but after a time (around 15 - 20 seconds) the bot get like a "bottleneck" of AI o.o
[Jul 11 18:11:19 2009.10] Item Exists: Sticky Mucus (0) x 1
[Jul 11 18:11:19 2009.17] Gathering: Sticky Mucus (0)
[Jul 11 18:11:19 2009.65] [dist=7.3] Monster Savage (0): *Whistling*
[Jul 11 18:11:22 2009.90] Player Mr. Vanity (0) uses Steal on monster Savage (0) : Lv 10
[Jul 11 18:11:23 2009.99] Item Appeared: Mane (0) x 1 (253, 169)
[Jul 11 18:11:26 2009.96] Item Appeared: Mane (1) x 1 (251, 166)
[Jul 11 18:11:34 2009.12] Player feng_e (3) uses Steal on monster Alligator (1) : Lv 10
[Jul 11 18:11:41 2009.84] ai_seq (auto) = move items_gather route attack route
note the diff in the time when the bot try to gather the "Sticky Mucus" at "18:11:19" and when i check what's happening at "18:11:41"...22 second, note too all AI auto seq in list. 5 AI

at this moment the bot is doing nothing, trying to gather the item without trying XD, the times passes and the "Sticky Mucus" eventually dissapear after a time, and the bot still stand there without doing nothing, just trying to gather that sticky mucus -.-
[Jul 11 18:11:46 2009.10] ------ AI Sequence ---------------------
[Jul 11 18:11:46 2009.10] 0: move {attackID=>'',time_move=>'1247353878.51038',ai_move_giveup=>{timeout=>'1'},move_to=>{y=>'160',x=>'246'}}

[Jul 11 18:11:46 2009.11] 1: items_gather {ID=>'ÂM..',pos=>{y=>'160',x=>'246'},ai_items_gather_giveup=>{timeout=>'2',time=>'1247353879'}}

[Jul 11 18:11:46 2009.11] 2: route

[Jul 11 18:11:46 2009.11] 3: attack {monsterPos=>{y=>'165',x=>'258'},ID=>'¼ç..',missedFromYou_last=>'',dmgFromYou_last=>'',move_start=>'1247353878.34874',pos_to=>{y=>'165',x=>'258'},unstuck=>{timeout=>'.7'},lastSkillTime=>'1247353825.34938',dmgToYou_last=>'',attackMethod=>{maxDistance=>'2.5',distance=>'1.5',type=>'weapon'},pos=>{y=>'165',x=>'258'},missedYou_last=>'',ai_attack_giveup=>{timeout=>'4',time=>'1247353878.34862'},attackMainTimeout=>'1247353878.34851'}

[Jul 11 18:11:46 2009.11] 4: route

[Jul 11 18:11:46 2009.12] ------ AI Sequences --------------------
[Jul 11 18:11:54 2009.43] {useSelf_skill_0_time=>'1247353824.96332',temp=>{ai_route_index=>'0',searchMonsters=>'0',ai_route_attackOnRoute=>'2',found=>''},AI_last_finished=>'1247353914.42592',cart_time=>'1247353823.38996',npc_talk=>{empty},autoConfChange_0_timeout=>'0',inventory_time=>'1247353823.38996'}
so i need to do by console command an "ai clear" for reset all and the bot finally continue botting normaly for the next 20-30 seconds to get again stuck with anything

NOTE: i checked and the bot get this bottleneck everytime when it try to gather/take a item. im completely sure is something in the src folder. i testest with a little old backup of that src folder and the bot work good, when i update that folder i begin to get this error.

playing on iRO valkyrie

srry for bad english =x
azndude988
Noob
Noob
Posts: 5
Joined: 08 Jul 2009, 21:39
Noob?: Yes

Re: SVN 2.0.7 AI bottleneck

#2 Post by azndude988 »

i think i have the same exact problem.... does it stop "stopping" when you make it not pick up any items? cuz that works for me... but it's kinda uselsss if you do that
Bibian
Perl Monk
Perl Monk
Posts: 416
Joined: 04 Apr 2008, 03:08

Re: SVN 2.0.7 AI bottleneck

#3 Post by Bibian »

are you attacking static monsters? (ones that dont move) or not?
i think The issue is that kore wants to move to a certain point to get the item, but its already there but doesn't realize this so it keeps trying to move...

i havent looked into it in detail, since i stopped playing RO a while ago :P
azndude988
Noob
Noob
Posts: 5
Joined: 08 Jul 2009, 21:39
Noob?: Yes

Re: SVN 2.0.7 AI bottleneck

#4 Post by azndude988 »

i am not attacking static, dont know the other guy though

i followed my bot with my character, and it tries to pick up a item that is like 4 cells away, and it just doesnt go get it... it say that it is gathering "the item" in the console but it just stands there 4 cells away and does nothing, and when agressive monsters attack me (i specified the bot to attack those) the bot just stands there and dies not using the potions, i can make it stop standing by making it sit then stand though... but that would lose the reason of having a bot (by staying at the computer's side watching what my bot does)

again this problem only exists when i make the bot pick up items

my config is here

http://forums.openkore.com/viewtopic.ph ... 8&start=50
cazanova000
Human
Human
Posts: 26
Joined: 29 Oct 2008, 22:18
Noob?: No

Re: SVN 2.0.7 AI bottleneck

#5 Post by cazanova000 »

azndude988 wrote:i am not attacking static, dont know the other guy though

i followed my bot with my character, and it tries to pick up a item that is like 4 cells away, and it just doesnt go get it... it say that it is gathering "the item" in the console but it just stands there 4 cells away and does nothing, and when agressive monsters attack me (i specified the bot to attack those) the bot just stands there and dies not using the potions, i can make it stop standing by making it sit then stand though... but that would lose the reason of having a bot (by staying at the computer's side watching what my bot does)

again this problem only exists when i make the bot pick up items

my config is here

http://forums.openkore.com/viewtopic.ph ... 8&start=50
exactly the same problem, doing sit/stand or ai clear, itemTakeAuto 0 or itemGatherAuto 0 solve the problem but that isnt a good solution <.<

all monsters are moving =x

the bot try to move near the item for gather/take but never reach the item, and the item dissapear, but the bot dont clear that AI so it keep trying to reach the item inclusive after dissapeared

running 20 bots, 7 of they in a very crowded map, and that 7 bots gets the bug very fast, when any of they begins their "gather AI" (in most cases) cuz other bots lets items in the floor

but sometimes for the other 13 bots, these bots are alone in their map and they get stuck when "take_auto" AI, in most cases take/gather AI everytime appear in the ai list

isnt a server problem or config problem, completely sure =x

the snapshot in SVN mirror 1 works well, but is a bit outdated...updating with tortoiseSVN to the latest build 6765 and begins the problems XD

SVN 6762 havent the bug =x

EDIT:
WOHO XD...we aren't the only with the problem =x
http://forums.openkore.com/viewtopic.ph ... 607#p25607
Fyske
Noob
Noob
Posts: 8
Joined: 24 Apr 2008, 15:08

Re: SVN 2.0.7 AI bottleneck

#6 Post by Fyske »

I can confirm I have the same exact same problem.
kali
OpenKore Monk
OpenKore Monk
Posts: 457
Joined: 04 Apr 2008, 10:10

Re: SVN 2.0.7 AI bottleneck

#7 Post by kali »

Set debug to 2 and see if that will help.
Got your topic trashed by a mod?

Trashing topics is one click, and moving a topic to its proper forum is a lot harder. You expend the least effort in deciding where to post, mods expend the least effort by trashing.

Have a nice day.
Fyske
Noob
Noob
Posts: 8
Joined: 24 Apr 2008, 15:08

Re: SVN 2.0.7 AI bottleneck

#8 Post by Fyske »

Result, debug 2.

Image
Image
Image

Always happen for me.
kali
OpenKore Monk
OpenKore Monk
Posts: 457
Joined: 04 Apr 2008, 10:10

Re: SVN 2.0.7 AI bottleneck

#9 Post by kali »

I'd ask you to patch in this and see if that resolves anything.

Code: Select all

Index: CoreLogic.pm
===================================================================
--- CoreLogic.pm	(revision 6765)
+++ CoreLogic.pm	(working copy)
@@ -87,7 +87,7 @@
 		}
 	});
 	processTake();
-	# processMove();
+	processMove();
 	Benchmark::end("AI (part 1.3)") if DEBUG;
 
 	Benchmark::begin("AI (part 1.4)") if DEBUG;
@@ -816,6 +816,39 @@
 	}
 }
 
+##### MOVE #####
+sub processMove {
+	if (AI::action eq "move") {
+		AI::args->{ai_move_giveup}{time} = time unless AI::args->{ai_move_giveup}{time};
+
+		# Wait until we've stand up, if we're sitting
+		if ($char->{sitting}) {
+			AI::args->{ai_move_giveup}{time} = 0;
+			stand();
+
+		# Stop if the map changed
+		} elsif (AI::args->{mapChanged}) {
+			debug "Move - map change detected\n", "ai_move";
+			AI::dequeue;
+
+		# Stop if we've moved
+		} elsif (AI::args->{time_move} != $char->{time_move}) {
+			debug "Move - moving\n", "ai_move";
+			AI::dequeue;
+
+		# Stop if we've timed out
+		} elsif (timeOut(AI::args->{ai_move_giveup})) {
+			debug "Move - timeout\n", "ai_move";
+			AI::dequeue;
+
+		} elsif (timeOut($AI::Timeouts::move_retry, 0.5)) {
+			# No update yet, send move request again.
+			# We do this every 0.5 secs
+			$AI::Timeouts::move_retry = time;
+			$messageSender->sendMove(AI::args->{move_to}{x}, AI::args->{move_to}{y});
+		}
+	}
+}
 sub processEquip {
 	if (AI::action eq "equip") {
 		# Just wait until everything is equipped or timedOut
P.S. Thank God for intelligent testers! :P (it's been a looooong time we got good testers)
Got your topic trashed by a mod?

Trashing topics is one click, and moving a topic to its proper forum is a lot harder. You expend the least effort in deciding where to post, mods expend the least effort by trashing.

Have a nice day.
EternalHarvest
Developers
Developers
Posts: 1798
Joined: 05 Dec 2008, 05:42
Noob?: Yes

Re: SVN 2.0.7 AI bottleneck

#10 Post by EternalHarvest »

kali wrote:I'd ask you to patch in this and see if that resolves anything.
Also need to uncomment the single processMove call in sub iterate, and it seems to work.
Committed.