A new theory to explain TGM wall kicks

Started by ryan_heise, April 06, 2011, 08:56:58 AM

Previous topic - Next topic

ryan_heise

On my wiki page, I have proposed a new theory to explain TGM's wall kicks.

I've not actually played TGM, either emulated or on real hardware, so perhaps someone can test whether the theory is true?

Kitaru

#1
I think you're reading something into the wiki's description that isn't there. It doesn't explicitly check the slides in the article; they're only there to serve as example. This exception is already known as the center column rule, and I could have sworn it was referred to as such on the wiki already. We can rewrite it to be more focused on the actual implementation side of things, but I think we should leave such examples so less technically-inclined players can see at a glance what does and does not work without executing the algorithm. I think we're just missing the slide for the kick you describe.

The exception is that if block index 0 causes the kick before the center-column blocks (indexes 1, 2, and 3) can cause it to fail, the kick goes through anyway. I tested the kick you described -- for J instead, but I digress -- and it does work.
<a href=http://backloggery.com/kitaru><img src="http://backloggery.com/kitaru/sig.gif" border='0' alt="My Backloggery" /></a>

ryan_heise

Quote from: KitaruThe exception is that if block index 0 causes the kick before the center-column blocks (indexes 1, 2, and 3) can cause it to fail, the kick goes through anyway. I tested the kick you described -- for J instead, but I digress -- and it does work.

Interesting. I had definitely not encountered this in the wiki before, but it would be interesting to see it written up. For example, the SRS wiki page has two sections on wall kicks; one that is easier to understand, and one that explains how it is really implemented. Not that the implementation is really that important, I think the important thing is that it be accurate. Are we sure there is only one case missing?

zaphod77

#3


The "is kicking allowed" test is very simple.

It goes from upper left to lower right on the bounding box, one row at a time. it stops when it finds the first overlap.

If the first overlap is center column, rotation is prevented.

Otherwise, try kicks.

The "L/J" exception shown on the wiki is a natural consequence of this scanning mechanism.

For a real counterexample, try this.
(pardon my lack of fumen)


.X.
JJJ
X.J


Your theory says this should kick. My testing says otherwise.

PS: the wiki's case and your test case are the only existing cases where it will kick with center occupied.  I uses different rules when it kicks at all, S and Z never change the status of the center column when rotating, and T can only block the top center one, never upper right and left. So the scanning routine i describes does the right thing (prevent kicks when center is occupied) for everything BUT those cases.  I'm not sure if that's a bug in TGM.

Kitaru

Quote from: zaphod77

.X.
JJJ
X.J


Your theory says this should kick. My testing says otherwise.
Err, I'd read his write-up again, because that's not what it says.

Quote from: zaphod77I'm not sure if that's a bug in TGM.
Well, if it wasn't intentional at first, they probably just let it slide since it's such an odd case. If they wanted to prevent it, they could just let the game test all four blocks and set the kick direction back to zero if a collision occurs in column x+1. Right now it just breaks from the loop as soon as a verdict is reached.
<a href=http://backloggery.com/kitaru><img src="http://backloggery.com/kitaru/sig.gif" border='0' alt="My Backloggery" /></a>

Zircean

Quote from: Kitaru
Err, I'd read his write-up again, because that's not what it says.

I disagree:


.X.       . .    .XJ
JJJ -CW-> . . -> ..J
X.J       B .    XJJ
          ^
          |
          this is occupied!
[div align=\\\"CENTER\\\"]Dev Blog | | Google Code[/div]

Kitaru

#6
Oh, haha, I thought he said CCW for some reason. It turns out he didn't specify any rotation direction. I mean, obviously CCW for this example doesn't make any sense, but that's what I was thinking.

EDIT: Anyway, I also tested the situation Zaphod mentioned and verified that it does not kick.
<a href=http://backloggery.com/kitaru><img src="http://backloggery.com/kitaru/sig.gif" border='0' alt="My Backloggery" /></a>