Page 3 of 6

Re: DoD First Boss spam solo and party

Posted: Sun Sep 16, 2012 7:11 pm
by vo2male
I noticed that my follower just stand there on Okander area and do nothing. he's receiving damages and doesn't heal. he also does not attack and after the boss is dead he just also stand there and does not loot.. hmm is there a way that the follower also functions as a normal bot that attacks and loots.
another problem i encounter is that after the boss died and my Leader went back to the NPC area hes just going and bumping on walls.

Re: DoD First Boss spam solo and party

Posted: Sun Sep 16, 2012 8:19 pm
by Alkaiser
I have DoD full run waypoints here. The only problem I have with them is if there is a lag spike things get messy...bots get rubber-banded and then stuck in various hallways. I have included a function that checks ping to help minimize this problem. I also experience an occasional crash right after the 4th boss. I noticed that it will only crash there if I'm using rock5's model files.

The fly hack is used extensively to bypass most of the trash mobs and the two "traps", the roaches and the exploding rats/barrels puzzle.

UPDATE: You might want to remove "settings.profile.options.PARTY = true" as it seems weird things happen to casters (when party is in combat, they just keep walking forward forever) and looting (bot just hangs after boss death).

Re: DoD First Boss spam solo and party, full DoD now too

Posted: Tue Sep 18, 2012 4:09 pm
by kuripot
there is the way that the char will go to nearest point not the previous point?? example... my char going to waypoint 10 and because rubberband effect the char he teleport to waypoint 8 and he got stuck cos he trying to go to waypoint 10 how to get my char use waypoint 8?

Re: DoD First Boss spam solo and party, full DoD now too

Posted: Tue Sep 18, 2012 5:44 pm
by Alkaiser
kuripot wrote:there is the way that the char will go to nearest point not the previous point?? example... my char going to waypoint 10 and because rubberband effect the char he teleport to waypoint 8 and he got stuck cos he trying to go to waypoint 10 how to get my char use waypoint 8?
I also would like to have the option of finding the nearest waypoint on "distance break" instead of trying to continue on as usual. I believe that's what the bot means when the player is suddenly moved unexpectedly. It would probably help a lot in these circumstances.

Maybe here... I guess I should experiment. Starting at line 2460 in player.lua

Code: Select all

		-- We're still making progress
		if( dist < lastDist ) then
			self.LastDistImprove = os.time();
			lastDist = dist;
		elseif(  dist > lastDist + 40 ) then
			-- Make sure we didn't pass it up
			printf(language[29]);
			success = false;
			failreason = WF_DIST;
			break;
		end;
UPDATE: Wow... I think it was an easy fix. I only did a few minutes of testing, but here is what I did.

Code: Select all

		-- We're still making progress
		if( dist < lastDist ) then
			self.LastDistImprove = os.time();
			lastDist = dist;
		elseif(  dist > lastDist + 40 ) then
			-- Make sure we didn't pass it up
			printf(language[29]);
			success = false;
			failreason = WF_DIST;
			__WPL:setWaypointIndex(__WPL:getNearestWaypoint(self.X,self.Z,self.Y)); -- testing
			break;
		end;

Re: DoD First Boss spam solo and party, full DoD now too

Posted: Wed Sep 19, 2012 12:30 am
by rock5
We don't want to keep going to the nearest waypoint because if a waypoint file crisscrosses over the same area it might jump to another section of the file. So it's not a good long term solution. Probably what you want to do is check the distance to the last waypoint. Not sure how easy that will be. If we come up with a good solution I'll add it to the bot. The logic to knowing if you were pulled back or not is not that clear. I'll think about it.

Re: DoD First Boss spam solo and party, full DoD now too

Posted: Wed Sep 19, 2012 1:10 am
by rock5
Here's what I came up with.

What it does is teleport from wp1 to wp2 then moveto wp2. The moveto finds you are already there then moves to wp3. Then it pulls back to 1. Now if you are going from 2 to 3 then you should b closer to 3 than wp 2 is. But if you are pulled back wp2 will be closer to wp3 than you are. Or maybe I'll use the last position (lastpos). So if wp2 is closer to the lastpos than the player then the player has been pulled back to before wp2 so go to waypoint 2 again. Now just to decide where to put it.

I don't like the idea of changing the waypoint inside the moveTo function. After all you might not be moving to a waypoint but a user executed moveto. We can't do the check in the bot.lua file because we don't have the lastpos there. lastpos is in the moveto function. So what I might do is add another break reason in moveto where it will do the calculation. Then deal with it in bot.lua.

I'll see if I can come up with some code to test.

Re: DoD First Boss spam solo and party, full DoD now too

Posted: Wed Sep 19, 2012 1:58 am
by rock5
I can't simulate a pull back so I can't test these. Please try it out for me. These are assuming you are using the latest version of the bot. If you aren't, let me know.

Edit: Updated the files. The new ones are here.
http://www.solarstrike.net/phpBB3/viewt ... 883#p41883

Re: DoD First Boss spam solo and party, full DoD now too

Posted: Wed Sep 19, 2012 2:25 am
by lisa
rock5 wrote:I can't simulate a pull back so I can't test these.
Just set speedhack to 100, almost garaunteed to pull you back.

Re: DoD First Boss spam solo and party, full DoD now too

Posted: Wed Sep 19, 2012 2:41 am
by rock5
Maybe I'll give that a try instead of waiting for the user.

Re: DoD First Boss spam solo and party, full DoD now too

Posted: Wed Sep 19, 2012 2:55 am
by rock5
Didn't work. It noticed a few distance breaks and then I died. I added a print message to see when my new code fired. It didn't. It might be because I wasn't pulled back to before my last waypoint. Teleporting should always do this but going fast doesn't. Which brings up the point, being pulled back because you are going a bit too fast needs to be dealt with too. For that my code wouldn't work. I'll need to think some more on it. Maybe something to do with if the waypoint is in front of you or behind you.

Scratch that. If you don't get pulled to before your last waypoint, no action is needed. You still want to go to the current waypoint.

Re: DoD First Boss spam solo and party, full DoD now too

Posted: Wed Sep 19, 2012 4:39 am
by rock5
With a slower speed and more tightly spaced waypoints I was able to test it. Still didn't work. Did some more work on it and got it working.

Please try the following. If you get pulled to before the last waypoint it will go to the last waypoint and print a message. If it is pulled back more than 1 waypoint back it will still only go to the previous waypoint. Adding support for if you are pulled back multiple waypoints is too much work and would only happen if your waypoints are too close together.

Anyway let me know how it works.

Re: DoD First Boss spam solo and party, full DoD now too

Posted: Wed Sep 19, 2012 3:14 pm
by Alkaiser
I tried it and it does work, but it seems it can only set waypoint back by one right? What if you have 5 waypoints fairly close together which wrap around an obstacle and you almost get to waypoint 5, but then the server places you back near waypoint 1. The bot would then try to go for waypoint 4 which would still might be unreachable from waypoint 1's position. I haven't actually tested this scenario, so maybe I'm wrong about how it works. I used a speed hack with a line of waypoints and noticed that even though the server pulled me back several wayponts of distance, the bot would only fall back by one waypoint.

I didn't mention this in my previos posts, but I did add the ability to turn "find nearest waypoint on distance break" on and off with a profile setting like this:

Code: Select all

settings.profile.options.NEAREST_WP_BREAK = true
I would just turn it off in the waypoint file where it would cause trouble with crossing paths or wherever it wouldn't be needed.

Re: DoD First Boss spam solo and party, full DoD now too

Posted: Thu Sep 20, 2012 12:18 am
by rock5
Alkaiser wrote:I tried it and it does work, but it seems it can only set waypoint back by one right? What if you have 5 waypoints fairly close together which wrap around an obstacle and you almost get to waypoint 5, but then the server places you back near waypoint 1. The bot would then try to go for waypoint 4 which would still might be unreachable from waypoint 1's position. I haven't actually tested this scenario, so maybe I'm wrong about how it works.
That's exactly correct. But like I said, it's only a problem if the waypoints are very close together. And about your scenario, it's also possible that the closest waypoint might be on the other side of an obstacle. So going to the closest waypoint might not work.

Your gonna make me add multiple waypoint support, aren't you? I guess I could have it keep looking back until it finds the right waypoint. The problem is, if the waypoint isn't a straight line, you could always end up with unexpected results. I don't think we could ever handle every scenario. Even my way wont work in certain extreme situations.

Maybe I could write a function that works out if you are between 2 waypoints. then just go backwards until you find the pair of waypoints you are between then continue from there. Actually, that might work well.

Re: DoD First Boss spam solo and party, full DoD now too

Posted: Thu Sep 20, 2012 10:28 am
by rock5
Ok, now there are 3 files. I decided to make the function that finds which waypoints you are between, a waypointlist function. So that's been edited too.

Things to know;
- It limits how far back in the waypoint list too look based on distance. After 1000 it stops and returns the best result.
- Tested it on a zig zag path and even though there were closer wps it still correctly placed me between the correct 2 waypoints.
- I'm wondering whether I should add a second or 2 pause after pull back to avoid death. Still thinking about it.

Let me know how you like it.

Re: DoD First Boss spam solo and party, full DoD now too

Posted: Thu Sep 20, 2012 8:07 pm
by Alkaiser
Your gonna make me add multiple waypoint support, aren't you?
Haha! I had a feeling you wouldn't be able to resist!

I'll give it a try tomorrow and let you know how it goes.

UPDATE: Well, I ran it through some tests and it seems to work perfectly. I'll do a more thorough test overnight.

UPDATE 2: I ran it for about 10 hours with 6 bots... no problems that I could see.

Re: DoD First Boss spam solo and party, full DoD now too

Posted: Sun Sep 23, 2012 4:24 am
by minhtien86
My characters sometimes die and then my leader always wait for members, I would like to have one set while waiting for one member for so long time, automatically destroy the group and the bots are started from outside at revived. Can anyone help me? Thank you!

Re: DoD First Boss spam solo and party, full DoD now too

Posted: Sun Sep 23, 2012 8:42 am
by Ego95
minhtien86 wrote:My characters sometimes die and then my leader always wait for members, I would like to have one set while waiting for one member for so long time, automatically destroy the group and the bots are started from outside at revived. Can anyone help me? Thank you!
I noticed that, too. My party member waits outside the instance for my leader, and my leader waits at one of the bosses.

Code: Select all

	function waitForParty(_checkdist)
		local warncount = 0
		repeat
			local we_ready = true
			cprintf(cli.lightred,"\nWaiting for:\t")
			for i = 1, #DOD_PARTY_MEMBERS do
				local _partymember = player:findNearestNameOrId(DOD_PARTY_MEMBERS[i])
				if _checkdist then
					if not _partymember or (_partymember and distance(player.X,player.Z,player.Y,_partymember.X,_partymember.Z,_partymember.Y) > _checkdist) then
						we_ready = false
						cprintf(cli.lightred,DOD_PARTY_MEMBERS[i].."\t")
					end
				else
					if not _partymember then
						we_ready = false
						cprintf(cli.lightred,DOD_PARTY_MEMBERS[i].."\t")
					end				
				end
			end
			printf("\n")
			yrest(2000)
			player:update()
			warncount = warncount + 1
			if warncount > 10 and not we_ready then
				printf("\a")
			end
		until we_ready
		cprintf(cli.lightgreen,"Party is ready!\n")
	end
If you look at this code I think you only have to set

Code: Select all

if warncount > 10 and not we_ready then
to a smaller warncount. I don't know if I've understand it right, but now he checks 10 times if your party member is there. You only have to set it to

Code: Select all

if warncount > 3 and not we_ready then
or something like that and add a

Code: Select all

RoMScript("LeaveParty()")
under it.

Code: Select all

			if warncount > 3 and not we_ready then
				RoMScript("LeaveParty()")
			end
Try it, I really don't know if it works. Maybe it gets stuck after that because it is outside the instance after leaving.
Good luck

Re: DoD First Boss spam solo and party, full DoD now too

Posted: Sun Sep 23, 2012 2:38 pm
by minhtien86
Thanks for your idea, I have not tried it but have a problem after leaving the group, the bot continue operations without restart.Is there a code that can help for this?

Re: DoD First Boss spam solo and party, full DoD now too

Posted: Mon Sep 24, 2012 1:19 am
by harbifm
i tried the dodleadertele and I got this error, how I can resolve it!!?

Re: DoD First Boss spam solo and party, full DoD now too

Posted: Mon Sep 24, 2012 2:13 am
by lisa
harbifm wrote:i tried the dodleadertele and I got this error, how I can resolve it!!?
http://www.solarstrike.net/phpBB3/viewt ... =27&t=2924