Announcement: Be excellent to each other.


Caravel Forum : DROD Boards : Bugs : Walk over a Slayer (I heard spiders walk on people, but _whoh_.)
New Topic New Poll Post Reply
Poster Message
Monkey
Level: Master Delver
Avatar
Rank Points: 190
Registered: 03-21-2006
IP: Logged

File: Sit on the Slayer.hold (1.4 KB)
Downloaded 34 times.
License: Public Domain
icon Walk over a Slayer (+2)  
Slayers seem unstable in this game.

See attachment.
Take for example this bug. A quick-and-simple observation shows that the Slayer, expecting to kill Beethro, moves in for the kill. But since it is on oremites, the Slayer doesn't kill him. That's fine and dandy, until he moves back. He's second in movement order( only losing to Beethro), and the spiders think the Slayer's floor tile! They also act like he's floor tile. So they walk over him.

Not good. Not good at all. :?

____________________________
lurking

[Last edited by Monkey at 08-02-2007 01:12 AM]
08-02-2007 at 01:11 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
TFMurphy
Level: Smitemaster
Rank Points: 3117
Registered: 06-11-2007
IP: Logged
icon Re: Walk over a Slayer (+2)  
Huhm. Quite a spectacularly old bug. I suppose Oremites and the more tolerant editor in TCB makes it easier to find now, but still a tricky one to track down, so well done on finding it. (But yes, you can see the bug in JtRH as well if you try)

The conditions only require this:
* The Slayer must be one square away from his target.
* The Slayer must be unable to kill his target this turn via any method.

At this point, the boolean bMovingWisp is set to check whether he can step on his target. This naturally fails due to the 2nd condition we set up, but the boolean isn't turned off, so for the rest of the turn, the Slayer uses Wisp conditions on what squares he can step on. Which means he can now step on monsters, and cause Bad Things(tm) to happen. The only 'difficulty' in seeing the bug after that is to force the Slayer to make a defensive move into a monster, but that's not too difficult.

One line fix though, so not difficult to correct this either: it just needs an extra "this->bMovingWisp = false" in the Process subroutine of Slayer.cpp, in the following place:
	if (this->wDistToTarget == 1)
	{
		//Step on target.
		int dxFirst, dyFirst;
		this->bMovingWisp = true;	//need to set to step on target
		if (GetDirectMovement(this->wTX, this->wTY, dxFirst, dyFirst, dx, dy))
			if (this->wX + dx == this->wTX && this->wY + dy == this->wTY)
			//if this move can successfully be made
			{
				this->bMovingWisp = false;
				MakeStandardMove(CueEvents,dx,dy);
				this->wSwordMovement = nGetO(dx,dy);
				return;
			}
		this->bMovingWisp = false;
	}


That should do the trick.

[Last edited by TFMurphy at 08-02-2007 03:21 AM]
08-02-2007 at 03:20 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Briareos
Level: Smitemaster
Avatar
Rank Points: 3516
Registered: 08-07-2005
IP: Logged
icon Re: Walk over a Slayer (0)  
How about this?
	if (this->wDistToTarget == 1)
	{
		//Step on target.
		int dxFirst, dyFirst;
		this->bMovingWisp=!GetDirectMovement(this->wTX, this->wTY, dxFirst, dyFirst, dx, dy);
		
		if (!this->bMovingWisp && this->wX + dx == this->wTX && this->wY + dy == this->wTY)
		//if this move can successfully be made
		{
			MakeStandardMove(CueEvents,dx,dy);
			this->wSwordMovement = nGetO(dx,dy);
			return;
		}
		else
			this->bMovingWisp=false;
	}


____________________________
"I'm not anti-anything, I'm anti-everything, it fits better." - Sole
R.I.P. Robert Feldhoff (1962-2009) :(

[Last edited by Briareos at 08-02-2007 02:48 PM]
08-02-2007 at 08:10 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
Kevin_P86
Level: Smitemaster
Avatar
Rank Points: 535
Registered: 06-28-2005
IP: Logged
icon Re: Walk over a Slayer (0)  
Briareos wrote:
How about this?
	if (this->wDistToTarget == 1)
	{
		//Step on target.
		int dxFirst, dyFirst;
		this->bMovingWisp=!GetDirectMovement(this->wTX, this->wTY, dxFirst, dyFirst, dx, dy);
		
		if (!this->bMovingWisp && this->wX + dx == this->wTX && this->wY + dy == this->wTY)
		//if this move can successfully be made
		{
			MakeStandardMove(CueEvents,dx,dy);
			this->wSwordMovement = nGetO(dx,dy);
			return;
		}
	}
hmm... except the point at which TFMurphy added the this->bMovingWisp = false causes it to be executed in every case (whether GetDirectMovement() returns true or not).

____________________________
+++++[>+++++<-]>[>+++>++++>+++++<<<-]>.>+.>-------.<++++.+++++.

[Last edited by Kevin_P86 at 08-02-2007 08:26 AM]
08-02-2007 at 08:26 AM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
Briareos
Level: Smitemaster
Avatar
Rank Points: 3516
Registered: 08-07-2005
IP: Logged
icon Re: Walk over a Slayer (0)  
Kevin_P86 wrote:
hmm... except the point at which TFMurphy added the this->bMovingWisp = false causes it to be executed in every case (whether GetDirectMovement() returns true or not).
Uh, errrm... right. :blush

Better now? (see edit above)

____________________________
"I'm not anti-anything, I'm anti-everything, it fits better." - Sole
R.I.P. Robert Feldhoff (1962-2009) :(
08-02-2007 at 02:49 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
TFMurphy
Level: Smitemaster
Rank Points: 3117
Registered: 06-11-2007
IP: Logged
icon Re: Walk over a Slayer (+1)  
Sorry, Briareos, but the expected result of that change would be: Slayer no longer steps on monsters, but can no longer step on the player either.

bMovingWisp is a flag that needs to be set *before* we call any movement-related command that might check whether a move is possible or not. In this case, it needs to be set before GetDirectMovement. If we don't do that, the Slayer will consider Beethro to be an obstacle, instead of the squishy abovegrounder he is.

After we've called that, we need to turn bMovingWisp off. There really isn't any profit in trying to save lines of code text here, because the setting of bMovingWisp wherever we do it is going to be fast anyways (and we'd need to do it in both cases since there's a return inside the condition anyways). So the biggest difference here is actually how readable the code is, and I think it's more important for it to be readily apparent that bMovingWisp is most definitely on or off at the appropriate times than trying to condense things.

I suppose we could condense it like so though:
	if (this->wDistToTarget == 1)
	{
		//Step on target.
		int dxFirst, dyFirst;
		this->bMovingWisp = true;	//need to set to step on target
		const bool bFoundMove = GetDirectMovement(this->wTX, this->wTY, dxFirst, dyFirst, dx, dy);
		this->bMovingWisp = false;
		if (bFoundMove)
			if (this->wX + dx == this->wTX && this->wY + dy == this->wTY)
			//if this move can successfully be made
			{
				this->bMovingWisp = false;
				MakeStandardMove(CueEvents,dx,dy);
				this->wSwordMovement = nGetO(dx,dy);
				return;
			}
	}


That should do it as well, and still be quite readable.
08-02-2007 at 03:48 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Jason
Level: Smitemaster
Rank Points: 1076
Registered: 05-05-2006
IP: Logged
icon Re: Walk over a Slayer (0)  
What's the scripting supposed to do? Because this was made in 3.0.2.

____________________________
Play my holds?
08-02-2007 at 05:16 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Kwakstur
Level: Smiter
Avatar
Rank Points: 385
Registered: 05-05-2006
IP: Logged
icon Re: Walk over a Slayer (0)  
Hm, the hold doesn't seem to work for me. As I import it, look at it in the Change Location thing, and actually play it, I hear plenty of beeps through the whole process.
As I play it, I take two steps left, and then I try to switch clones, but it won't let me! Whether I press Tab or click on the clone, I stay as the same Beethro.

Looking at drod.err, it's pretty obvious what two things the beeps meant:
Click here to view the secret text


____________________________
Also known as ExpHP everywhere else.

[Last edited by Kwakstur at 08-02-2007 11:48 PM]
08-02-2007 at 11:47 PM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged
icon Re: Walk over a Slayer (+1)  
I've fixed this for both 2.0 and 3.0 using TFMurphy's patch. Thank you!

08-05-2007 at 07:02 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Bugs : Walk over a Slayer (I heard spiders walk on people, but _whoh_.)
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.