Announcement: Be excellent to each other.


Caravel Forum : DROD Boards : Bugs : Mimics, and mirrors on tokens
New Topic New Poll Post Reply
Poster Message
Remlin
Level: Master Delver
Rank Points: 181
Registered: 04-28-2005
IP: Logged
icon Mimics, and mirrors on tokens (+2)  
If a mimic steps onto a token that has a mirror on it (which of course means the mirror is either pushed off or destroyed), the token isn't activated. Tested in 3.1
10-03-2007 at 10:55 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
TFMurphy
Level: Smitemaster
Rank Points: 3117
Registered: 06-11-2007
IP: Logged
icon Re: Mimics, and mirrors on tokens (+2)  
Ah, yes, I see it.

Culprit's in Mimic.cpp; it does test whether the square has a Token or a Mirror on it... but doesn't retest the square if it can push the mirror.

I guess the solution to that would be to test for the Mirror first, then after that, test for the Token (since if the mirror moves, the token will be hit).

Testing brought up another interesting quirk though: Mimics can't smash mirrors by moving in their direction if their sword is already resting on them and the mirror cannot be pushed. This is because while a pushable mirror is not an obstacle, a mirror that cannot be pushed is. Not sure if this should be fixed though - the obstacle checking thing is what helps Mimics be able to slide against obstacles even if Beethro moves in a diagonal direction that happens to be blocked for them.

[Last edited by TFMurphy at 10-03-2007 11:31 AM]
10-03-2007 at 11:30 AM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
schep
Level: Smitemaster
Avatar
Rank Points: 864
Registered: 03-01-2005
IP: Logged
icon Re: Mimics, and mirrors on tokens (+1)  
TFMurphy wrote:
Testing brought up another interesting quirk though: Mimics can't smash mirrors by moving in their direction if their sword is already resting on them and the mirror cannot be pushed. This is because while a pushable mirror is not an obstacle, a mirror that cannot be pushed is. Not sure if this should be fixed though - the obstacle checking thing is what helps Mimics be able to slide against obstacles even if Beethro moves in a diagonal direction that happens to be blocked for them.
I'd say that's a bug too. But yeah, it's not obvious what should happen if for example a mimic with sword is facing NE, a mirror which cannot be pushed NE is under its sword, and Beethro steps NE. Mirror rules say the mirror should break. Mimic rules say the mimic should step N. We could have both happen, but that seems a little strange.
10-03-2007 at 02:25 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
Jacob
Level: Smitemaster
Rank Points: 3741
Registered: 10-01-2004
IP: Logged
icon Re: Mimics, and mirrors on tokens (0)  
Surely the mirror breaking would be more intuitive - you are forcing to move towards the mirror with its sword directly going into it. It would be mimicking what would happen if Beethro was in that position.

____________________________
New to DROD? You may want to read this.
My Holds and Levels:
Click here to view the secret text

10-03-2007 at 02:59 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Doom
Level: Smitemaster
Avatar
Rank Points: 3226
Registered: 07-05-2004
IP: Logged
icon Re: Mimics, and mirrors on tokens (+1)  
For what it's worth, the intented solution for this room in recently released Edge of the World relies on this mirror breaking trick. I never realised this behaviour existed but found an alternative solution while verifying the hold...

I was going to say pretty much exactly the same thing Jacob just managed to sneak through moments before my post :D The mirror should break for the reasons stated before.
10-03-2007 at 03:04 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
TFMurphy
Level: Smitemaster
Rank Points: 3117
Registered: 06-11-2007
IP: Logged
icon Re: Mimics, and mirrors on tokens (0)  
If it was a pure mimicking of moves, the Mimic wouldn't slide at all if you asked it to go diagonally and it couldn't (but could go vertically or horizontally). After all, if Beethro was there and went diagonally, he'd just bump the wall or obstacle.

And schep's example is *exactly* what I was thinking when I was considering the differences between sliding and mirror breaking. Hence the problem: you *could* have an exception just for mirrors (in that mimics never slide against them), but this is design consideration rather than necessarily a bug.

I would guess the possibilities would be:
1) Current behaviour: Mimics slide against immovable mirrors, but won't break a mirror in the 'sword on mirror and mirror is obstacle' special case.
2) Mimics slide against mirrors, unless they can break the mirror, in which case they break it and don't move.
3) Mimics never slide against mirrors, and 'bump' them with regards to sword movement instead (consistency in always breaking them).
4) Mimics always slide, but it's only if they can't and would still "bump" the mirror in their intended direction that they'll smash it.

Technically, we could also have both (Mimics can both slide and break in the same move), but that feels very strange indeed (the sword has ended up doing two directions: NE followed by N, for example).

[Last edited by TFMurphy at 10-03-2007 03:15 PM]
10-03-2007 at 03:12 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Jacob
Level: Smitemaster
Rank Points: 3741
Registered: 10-01-2004
IP: Logged
icon Re: Mimics, and mirrors on tokens (0)  
TFMurphy wrote:
After all, if Beethro was there and went diagonally, he'd just bump the wall or obstacle.

If Beethro was there and went diagonally he'd break the mirror. The important point here being that immoveable mirrors don't behave like other immovable objects (walls or obstacles) in that they have the additional feature of being broken if the the sword is directed at them while they are bumped. Thus, I'd consider behaviour 2 to be the most intuitive.
But clearly this is a debateable issue.


____________________________
New to DROD? You may want to read this.
My Holds and Levels:
Click here to view the secret text

10-03-2007 at 03:27 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
TFMurphy
Level: Smitemaster
Rank Points: 3117
Registered: 06-11-2007
IP: Logged
icon Re: Mimics, and mirrors on tokens (+2)  
So would you say that follows for other sword-affected objects that a Mimic could be standing next to with its sword resting on? (Orbs, Cracked/Broken Orbs, Broken Walls... though that last could only happen on a Turn 0 state)

The important thing is that while we can do an exception for mirrors, it also has to be somewhat intuitive and hopefully consistent with other special case scenarios of this nature.

Thinking about it, out of the three alternatives, I believe (4) would probably have the most consistent behaviour, since the sword movement only takes effect if the sword happens to still be on the mirror. (Current mirror behaviour has the mirror and the character move first, and *then* any smashing can take place - as an example of this, have Beethro put his sword on a mirror, and then push in its direction such that it moves onto a pressure plate: you'll activate the plate, but smash the mirror after the move. Another example is to put the mirror on oremites and do the same thing: the mirror won't smash because you don't have a sword at the end of the move.)

===

Oh, and Doom, I haven't gotten around to playing Edge of the World yet, but I'm thinking this is a different part of mirror breaking? Maybe I'm wrong, but you're talking about when Beethro bump-breaks a mirror, a Mimic won't? That's a different setup: if Beethro's position doesn't change, Mimics don't move at all, so they wouldn't even try to stab a mirror.

It's a nice little trick, and will likely stay as is for a number of reasons (unless Mimics were made to mimic Beethro 'bumping' obstacles while not moving, which could be a possibility). The bug being discussed is related, but definitely a different issue.

[Last edited by TFMurphy at 10-03-2007 04:10 PM]
10-03-2007 at 03:41 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Doom
Level: Smitemaster
Avatar
Rank Points: 3226
Registered: 07-05-2004
IP: Logged
icon Re: Mimics, and mirrors on tokens (0)  
TFMurphy wrote:
Oh, and Doom, I haven't gotten around to playing Edge of the World yet, but I'm thinking this is a different part of mirror breaking? Maybe I'm wrong, but you're talking about when Beethro bump-breaks a mirror, a Mimic won't? That's a different setup: if Beethro's position doesn't change, Mimics don't move at all, so they wouldn't even try to stab a mirror.

It's a nice little trick, and will likely stay as is for a number of reasons. The bug being discussed is related, but definitely a different issue.
I've not seen the author's demo and I don't have the hold installed currently... but I'm thinking it should (probably) be possible to set up both of these situations: Beethro moving or bumping while breaking the mirror. Although, to be honest, I also think the bump-break situation would also make more sense if the mimic broke the mirror.
####
#M.#
##*#
##.#
(#=wall,M=mirror, "."=floor
Not much new to add here, but I think this picture here makes it easier to see the problem. It's just ridiculous how this mirror can't be broken with a mimic, no matter how you dance around it. There's certainly at least something to be changed here. Yeah, it's a tricky question whether the mimic should a) break the mirror or not and b) move N or just bump, when moving NW while the mimic is on the asterisk. Can't quite decide what makes most sense myself...

[Last edited by Doom at 10-03-2007 05:01 PM]
10-03-2007 at 04:48 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
TFMurphy
Level: Smitemaster
Rank Points: 3117
Registered: 06-11-2007
IP: Logged
icon Re: Mimics, and mirrors on tokens (+3)  
I've been playing about with (4) for a little bit, since it's the easiest of the three to implement (and is still consistent with characters moving as they normally would *before* their sword smashes things). Looks to require the following code changes:

To allow Mimics to bump things if Beethro bumps something at the same time (which is what I assume the room that Doom referred to uses, since without this it'd allow Beethro to smash a mirror while a Mimic doesn't move at all), you'd add this near the start of the Mimic's Process subroutine:

	if (this->pCurrentGame->IsPlayerAt(this->pCurrentGame->swordsman.wPrevX,
			this->pCurrentGame->swordsman.wPrevY))
	{
		dx=dy=0;
		this->wPrevX = this->wX;
		this->wPrevY = this->wY;
		this->wSwordMovement = CSwordsman::GetSwordMovement(nLastCommand, this->wO);
		if (nLastCommand != CMD_C && nLastCommand != CMD_CC && this->wSwordMovement != this->wO)
			this->wSwordMovement = NO_ORIENTATION;
	} else {


In order to get Mimics to smash mirrors when a full move is made, you'd need this at the end of the Process subroutine (assuming the Mimic didn't move during this turn):

		} else {
			this->wPrevX = this->wX;
			this->wPrevY = this->wY;
			this->wSwordMovement = CSwordsman::GetSwordMovement(nLastCommand, this->wO);
			if (nLastCommand != CMD_C && nLastCommand != CMD_CC && this->wSwordMovement != this->wO)
				this->wSwordMovement = NO_ORIENTATION;
		}
	}
	//Light any fuse stood on.
	room.LightFuse(CueEvents, this->wX, this->wY, true);


I can look into the other possibilities as well, but they're a lot trickier to deal with given how the code's currently laid out.

===

By the way, with regards to Doom's example, here's how both fixes together listed in this post would affect it:

1) If the Mimic is on the asterisk with its sword facing NW, then if Beethro moves in any direction but NW, things will happen as they currently do now.
2) If Beethro moves NW but bumps something, the Mimic will 'mimic' the bump and smash the mirror as a result. If Beethro bumps a Master Wall, then of course the turn just won't happen.
3) If Beethro moves NW and successfully moves, the Mimic will move N and will thus not smash the mirror.
4) If the Mimic is just east of the mirror instead with its sword facing W, then the mirror will be smashed if Beethro moves W, no matter whether it was via a bump or a successful move.

This should be consistent with how both Mimics already naturally move and how swords interact with mirrors during a move. (2) is the natural consequence of the first fix listed (based around the mechanic Doom mentioned), and (3) is the consequence of the second fix listed. How does that sound?

===

EDIT: Recently realised something. First, Mimics don't always have to have swords to bump things. So if Mimics are being allowed to bump things when they have their swords, they should probably turn to face the direction they bumped if they don't have a sword.

The code to do this should be:
	const UINT wMovementO = nGetO(dx, dy);

	if (this->bFrozen) //frozen by aumtlich gaze?
		dx = dy = 0;

	CDbRoom& room = *(this->pCurrentGame->pRoom);

	// Did the nLastCommand successfully move the swordsman.
	// If not, then set dx/dy to zero so mimics don't move
	if (this->pCurrentGame->IsPlayerAt(this->pCurrentGame->swordsman.wPrevX,
			this->pCurrentGame->swordsman.wPrevY))
	{
		dx=dy=0;
		this->wPrevX = this->wX;
		this->wPrevY = this->wY;
		this->wSwordMovement = CSwordsman::GetSwordMovement(nLastCommand, this->wO);
		if (nLastCommand != CMD_C && nLastCommand != CMD_CC && this->wSwordMovement != this->wO)
			this->wSwordMovement = NO_ORIENTATION;
		if (!HasSword() && wMovementO != NO_ORIENTATION)
			this->wO = wMovementO;
	} else {


And then we can use the same HasSword and wMovementO check at the end for testing when Beethro *does* move but the Mimic can't.

===

While I'm thinking about it, it seems strange that you can bump things whilst being frozen by an Aumtlich's gaze. I mean, turning is one thing, but bumping shouldn't be possible. I mean, you can't even trigger the "Player Bumps Obstacle" event when frozen by an Aumtlich. Could be worth looking into. EDIT: Actually, given you can break mirrors through Force Arrows using this, it's possibly not so bad. So Aumtlich would be consistent with Force Arrow use.

[Last edited by TFMurphy at 10-25-2007 02:35 PM]
10-03-2007 at 05:00 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Mimics, and mirrors on tokens (0)  
TFMurphy wrote:
I've been playing about with (4) for a little bit, since it's the easiest of the three to implement (and is still consistent with characters moving as they normally would *before* their sword smashes things). Looks to require the following code changes:
I like solution 4 the best also, so I'd like to go with this. Thanks for the code to implement this change.

I'll look into fixing the mirror+token bumping bug, but you're welcome to provide a fix any time the bug or arrow icon is on this thread (meaning I haven't started working on it yet in my code).

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 10-03-2007 05:35 PM]
10-03-2007 at 05:35 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
TFMurphy
Level: Smitemaster
Rank Points: 3117
Registered: 06-11-2007
IP: Logged
icon Re: Mimics, and mirrors on tokens (+3)  
mrimer wrote:
I'll look into fixing the mirror+token bumping bug, but you're welcome to provide a fix any time the bug or arrow icon is on this thread (meaning I haven't started working on it yet in my code).

Oh, sorry, I didn't make that fix explicit.

It should again be in the process subroutine, but instead of a switch statement, we use a series of if statements instead:

			//Check for movement onto a checkpoint.
			this->pCurrentGame->QueryCheckpoint(CueEvents, this->wX, this->wY);

			if (room.GetTSquare(this->wX, this->wY)==T_MIRROR)
				room.PushObject(this->wX, this->wY, this->wX + dx, this->wY + dy, CueEvents);
			if (room.GetTSquare(this->wX, this->wY)==T_TOKEN)
				room.ActivateToken(CueEvents, this->wX, this->wY);


Once PushObject is done, GetTSquare should find the Token underneath - it's the same principle that ProcessPlayer uses in CurrentGame.cpp with NewTSquare: it has to deal with things like mirrors before it can check for tokens later on in the subroutine.

10-03-2007 at 06:07 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
Jatopian
Level: Smitemaster
Rank Points: 1842
Registered: 07-31-2005
IP: Logged
icon Re: Mimics, and mirrors on tokens (0)  
$.02: Mirror should break, mimic shouldn't move.

____________________________
DROD has some really great music.
Make your pressure plates 3.0 style!
DROD architecture idea generator
10-03-2007 at 10:45 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
BoyBlue
Level: Smitemaster
Rank Points: 547
Registered: 03-25-2006
IP: Logged
icon Re: Mimics, and mirrors on tokens (0)  
My perception of how a mimic moves is this:

1) When Beethro turns, the mimic turns.

2) When Beethro moves to a new square, the mimic moves to a new square, if an appropriate one is available. If not, the mimic does nothing. (Notably, the mimic does not "bump into" the object it's being blocked by.)

All other actions by Beethro are not mimicked. Bumping into a wall, bumping into a mirror, bumping into an orb after using a power token, drinking a potion, sheathing a sword, speaking, exiting the room, transferring consciousness to a different clone, answering a dialog question... -- all these things are ignored by mimics.

[In some versions of DROD, mimics also mimic the Z's that appear when Beethro falls asleep. In my opinion that's inconsistent, but it's too silly to argue about.]

Given this, the only new issue introduced by mirrors is whether a square occupied by a mirror is considered by the mimic to be "available". As currently implemented, such a square is "available" if and only if the square beyond the mirror is open, such that the mirror could be pushed onto it.

I don't see anything at all wrong with the current behavior. It's simple and consistent. In Doom's example, I don't think it should be possible to break the mirror.
10-04-2007 at 12:54 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
Syntax
Level: Smitemaster
Rank Points: 1218
Registered: 05-12-2005
IP: Logged
icon Re: Mimics, and mirrors on tokens (0)  
I did a little test in the editor...

B     M
 \     *

B = Beethro
M = Mimic
* = Sword on crumbly wall


Move SE. Mimic slides down, and the wall survives.

I think this is intuitive and how mirrors should be treated when blocked.


10-04-2007 at 09:54 AM
View Profile Send Private Message to User Show all user's posts Quote Reply
Doom
Level: Smitemaster
Avatar
Rank Points: 3226
Registered: 07-05-2004
IP: Logged
icon Re: Mimics, and mirrors on tokens (0)  
Isn't Syntax's test completely different?

You can only get a mimic's sword on an intact crumby wall on turn 0. If you move SE in that test the mimic moves first, sliding normally, and only then checks if it can kill anything.

Try replacing the crumby wall with a brain. It doesn't die either. So this shouldn't be used as a guideline for the mirror behaviour.
10-04-2007 at 01:47 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
TFMurphy
Level: Smitemaster
Rank Points: 3117
Registered: 06-11-2007
IP: Logged
icon Re: Mimics, and mirrors on tokens (0)  
Right, which is why I mentioned Orbs as well in one of my previous posts ^_^ While crumbly walls and brains are definite Turn 0 cases (or other particularly unique situations), both Normal Orbs and Broken Orbs (start with a Cracked Orb then hit it) can have a Mimic's sword resting on them in normal play.

[Last edited by TFMurphy at 10-04-2007 01:52 PM]
10-04-2007 at 01:52 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Mimics, and mirrors on tokens (0)  
I've implemented TFMurphy's fixes in build 55.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
11-01-2007 at 10:04 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Bugs : Mimics, and mirrors on tokens
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.