Skilled player (1410)
Joined: 5/31/2004
Posts: 1821
Lex wrote:
Hmm. The video is a 0-byte file. I realize it may be out of date. Can you please re-upload it somewhere? Maybe my browser took a dump.
No, it's gone. You want to see particularly that catchmode wip, right? Edit: Assuming that you do mean the wip in the post just above yours, here it is: http://www.megaupload.com/?d=QBTZ0TV5
Lex
Joined: 6/25/2007
Posts: 732
Location: Vancouver, British Columbia, Canada
Hmm, yeah, I remember this mode being ridiculously unfun on my actual DS due to the split screens both being used as a continuous screen. It was pretty hard to line things up at high speeds. This gameplay reminds me of Asteroids (or multi-ball Arkanoid) in a way, in that you have to prioritize your actions very well to get a high score. It seems like something a bot could do best, since humans prioritize actions incorrectly a lot of the time. It looks like you move your "character" down unnecessarily at some points, giving you less time to catch more blocks, and you even ended up missing one because of it. I might be wrong. OH, I just tried this mode on the real DS again, and I noticed the game ran a LOT faster (even on level 1) than in this WIP. Is the emulation extra slow or something?
Skilled player (1410)
Joined: 5/31/2004
Posts: 1821
Lex wrote:
Hmm, yeah, I remember this mode being ridiculously unfun on my actual DS due to the split screens both being used as a continuous screen. It was pretty hard to line things up at high speeds. This gameplay reminds me of Asteroids (or multi-ball Arkanoid) in a way, in that you have to prioritize your actions very well to get a high score. It seems like something a bot could do best, since humans prioritize actions incorrectly a lot of the time. It looks like you move your "character" down unnecessarily at some points, giving you less time to catch more blocks, and you even ended up missing one because of it. I might be wrong. OH, I just tried this mode on the real DS again, and I noticed the game ran a LOT faster (even on level 1) than in this WIP. Is the emulation extra slow or something?
I don't think I go down unnecessarily... but if you can point out a specific spot, I'll try to defend it (or conclude that you are right of course ;) Missing a block might look imperfect... but it's not as bad as you think. A black that is missed ends up at the top of the screen... so you don't lose that block actually. If I were to release the R button, all stones would drop slower, and since I do get that block eventually, I think letting it destroy itself in order to show up at the top is the best option. (I do think that pieces that are destroyed by rotating into them are destroyed permanently.) And you are indeed very right about this movie running too slow. There is lag frame every second frame... so the movie should run about twice as fast. This was due to it being made on an old version of the emulator, but the problem has been fixed now! I will have to try if the input file still works on the new version of the emulator (the beginning, where I do the mission time trials mostly) and if they do, then decide if I want to hexedit in this wip of catchmode or do it all over again (hexediting would be a long process also probably, since I would need to delete lines of input every 2 frames for several thousand frames).
Lex
Joined: 6/25/2007
Posts: 732
Location: Vancouver, British Columbia, Canada
At 00:10, why did you put the green block where you put it? Would it be better fitted into the 2-tall hole on the right side of your block, or were you trying to preserve it so it doesn't get blasted away? On that note, does blasting away blocks help or hurt the run? Maybe I just don't know the mechanics of the game.
Baxter wrote:
Missing a block might look imperfect... but it's not as bad as you think. A black that is missed ends up at the top of the screen... so you don't lose that block actually. If I were to release the R button, all stones would drop slower, and since I do get that block eventually, I think letting it destroy itself in order to show up at the top is the best option. (I do think that pieces that are destroyed by rotating into them are destroyed permanently.)
Hmm, now that you mention the blocks respawn if you miss them, I have to wonder: does the respawned block take the place of another block that would have spawned? I imagine so, because if not, you could miss all the blocks and have them all continuously respawn and multiply ridiculously, which you can't in this game. So, since you're technically still losing a block, missing a block is probably imperfect.
Baxter wrote:
(hexediting would be a long process also probably, since I would need to delete lines of input every 2 frames for several thousand frames).
That shouldn't take long if you know how to write scripts/macros. :)
Skilled player (1410)
Joined: 5/31/2004
Posts: 1821
Well... the particular goal of this WIP was to complete the mode as fast as possible (completing all levels allows you to pick a level at the start of the game, and you need to start from level 20 if you want to do a highscore TAS, so this also unlocks level 20). Either way, you get to the next level by blasting two times... which happens when get a 4x4 box. Normally, you get a certain amount of time to make the box bigger, but I explode it manually to move on. So my goals is to make 40 4x4 boxes as fast as possible. If I had placed the green block you mentioned at the start of your post at that spot it wouldn't have contributed at all to the 4x4 box that is gonna be formed with the horizontal I piece, and only block of the green block would remain after the explosion. Placing it here makes it possible to use that full green block for the next 4x4 block. I also didn't lose time there to place it where I did. The respawning block doesn't take the place of another block. If you just speed up the game, not catching any blocks, you will get a VERY filled playing field (I think this can even be done on a regular DS). You do die pretty fast though obviously... but you can still see there being LOTS of blocks (relative to how much there would be normally). And no, I don't know how to write scripts/macros :S
Lex
Joined: 6/25/2007
Posts: 732
Location: Vancouver, British Columbia, Canada
Baxter wrote:
The respawning block doesn't take the place of another block. If you just speed up the game, not catching any blocks, you will get a VERY filled playing field (I think this can even be done on a regular DS). You do die pretty fast though obviously... but you can still see there being LOTS of blocks (relative to how much there would be normally).
You're absolutely right. I just tested it.
Editor, Expert player (2080)
Joined: 6/15/2005
Posts: 3284
Here's a quick catch mode TAS from some TASer, for those who wonder what it looks like completed: http://www.youtube.com/watch?v=doZxE5C3_wg
mindnomad
He/Him
Former player
Joined: 11/2/2009
Posts: 100
I'll just leave this here: https://www.youtube.com/watch?v=DvRnr-ZklqU I'd also like to point out that veup has the .dsm in the description of the nicovideo version of this video, but I won't post it without here without permission.
morningpee
They/Them
Player (56)
Joined: 11/28/2013
Posts: 119
You know, veup has improved his run of Tetris DS Marathon drastically, by over 15 seconds. I wish he would submit it to TASVideos. I'm aware that his current record on this site wasn't submitted by him. Link to video
Projects: Tetris DS Genesis Toys: Let the Toy Wars Begin
morningpee
They/Them
Player (56)
Joined: 11/28/2013
Posts: 119
I'm working on a 200-line TAS of the Marathon mode, starting at level 1. I'm halfway done, having placed 252 of the necessary 500 pieces. Progress video: Link to video Comments or suggestions are welcome.
Projects: Tetris DS Genesis Toys: Let the Toy Wars Begin
morningpee
They/Them
Player (56)
Joined: 11/28/2013
Posts: 119
New WIP, 400 of 500 pieces placed so far (154 of 200 lines cleared). Link to video
Projects: Tetris DS Genesis Toys: Let the Toy Wars Begin
Player (138)
Joined: 9/18/2007
Posts: 389
If you only clear the top four lines, it wouldn't be necessary for the other pieces to drop down, so this should save quite a fair amount of time.
morningpee
They/Them
Player (56)
Joined: 11/28/2013
Posts: 119
partyboy1a wrote:
If you only clear the top four lines, it wouldn't be necessary for the other pieces to drop down, so this should save quite a fair amount of time.
This is true for NES Tetris and other Tetris games without hard drop, but clearing only the top four lines saves no time in Tetris DS. Am I understanding you correctly?
Projects: Tetris DS Genesis Toys: Let the Toy Wars Begin
Player (138)
Joined: 9/18/2007
Posts: 389
No, I'm not talking about that... There is a small animation each time after the lines get cleared. If you clear the bottom lines, all lines above must wander down. In the NES version, this is done instantly. In the DS version, there is a small animation which shows the progress how the field changes. The field won't be changed if the top four lines are cleared. This should make the animation unnecessary because the field is already in the right state. I think this could save about one third or one half of a second for each four lines cleared. I think there must not be even a single block above the cleared lines to get this to work.
morningpee
They/Them
Player (56)
Joined: 11/28/2013
Posts: 119
partyboy1a wrote:
No, I'm not talking about that... There is a small animation each time after the lines get cleared. If you clear the bottom lines, all lines above must wander down. In the NES version, this is done instantly. In the DS version, there is a small animation which shows the progress how the field changes. The field won't be changed if the top four lines are cleared. This should make the animation unnecessary because the field is already in the right state. I think this could save about one third or one half of a second for each four lines cleared. I think there must not be even a single block above the cleared lines to get this to work.
That's a good idea! I will test it tomorrow.
Projects: Tetris DS Genesis Toys: Let the Toy Wars Begin
morningpee
They/Them
Player (56)
Joined: 11/28/2013
Posts: 119
There's a roadblock keeping me from TASing this game.
5z98qTHveupDQ5kL/veup wrote:
Allmost all frames saved in 200 lines mode are due to "landing recovery cancel" by pressing down arrow just before landing in level 1-17.
I think this is why his latest run is faster than my WIP, but I can't get his DSM to sync, so my perspective is limited. Can anyone please help me get his run to sync? I want to TAS this game but have been held up by this for awhile now.
Projects: Tetris DS Genesis Toys: Let the Toy Wars Begin
AntyMew
It/Its
Encoder, Player (35)
Joined: 10/22/2014
Posts: 425
From what I can tell, the inputs line up once Advanced Bus-Level Timing (Emulation Settings) is turned off. The problem seems to be the RNG. So my two wild guesses are that the game has input-based RNG and that's what is desyncing, or we're using the wrong ROM version.
Just a Mew! 〜 It/She ΘΔ 〜
Skilled player (1743)
Joined: 9/17/2009
Posts: 4986
Location: ̶C̶a̶n̶a̶d̶a̶ "Kanatah"
How exactly does this game's RNG work? Time/input/frame?
mindnomad
He/Him
Former player
Joined: 11/2/2009
Posts: 100
Can anybody explain to me why veup's 99999999 TAS doesn't sync correctly on DeSmuME? I've tried all settings and a bunch of emulators and I still can't find out why it isn't working...
AntyMew
It/Its
Encoder, Player (35)
Joined: 10/22/2014
Posts: 425
mindnomad wrote:
Can anybody explain to me why veup's 99999999 TAS doesn't sync correctly on DeSmuME? I've tried all settings and a bunch of emulators and I still can't find out why it isn't working...
No idea. All I know is what I said 3 posts above.
Just a Mew! 〜 It/She ΘΔ 〜
morningpee
They/Them
Player (56)
Joined: 11/28/2013
Posts: 119
I posted in the DeSmuME forums, maybe this is a known bug in that emulator version. Barring that, I will try to find the RNG so we can brute-force a sync from the first frame of gameplay.
Projects: Tetris DS Genesis Toys: Let the Toy Wars Begin
Post subject: Veup run sync
morningpee
They/Them
Player (56)
Joined: 11/28/2013
Posts: 119
Okay, good news and bad news. The bad news is that the RNG is an 8-byte value (ranging from 0x0207F3E8 to 0x0207F3EF) and I have no intention of brute-forcing it. The good news is that I wrote a Lua script that injects the correct piece sequence in the memory so veup's 200-line run can sync. The script can be found here. If you use Desmume v0.9.8, you can use veup's original movie file. I have also uploaded a version of his movie optimized for 0.9.11.
Projects: Tetris DS Genesis Toys: Let the Toy Wars Begin
morningpee
They/Them
Player (56)
Joined: 11/28/2013
Posts: 119
jlun2 wrote:
How exactly does this game's RNG work? Time/input/frame?
The initial RNG value comes directly from the system time. The original algorithm that generates the first RNG value is too long to paste for how simple it is so I'll just say that the last word (at 0x207F3EC) is always 0x00000000, and the first word is the system time at frame 222, calculated from the replay file's rtcStartNew parameter as follows: 0x00000003 + 0x01000000 * year + 0x00100000 * month + 0x00008000 * day + 0x00000e10 * hour + 0x00000036 * minute + 0x00000001 * second. Year ranges from 0-99, month ranges from 1-12, day ranges from 1-31, hour ranges from 0-23, minute ranges from 0-59, and second ranges from 0-59. The offset 0x00000003 comes from the fact that frame 222 is about 3 seconds in. For example, May 25 2012 at 00:00:00 becomes 0x00000003 + 0x01000000 * 12 + 0x00100000 * 5 + 0x8000 * 25 + 0x00000e10 * 0 + 0x00000036 * 0 + 0x00000001 * 0 = 0x0c5c8003. The RNG cycles once at frame 222 (Desmume 0.9.11), 30 times for each bag sequence that is generated, and one extra time between the first and second bags of the game.
Language: asm

0x02027240: 50 10 9f e5 ldr r1, [pc, #80] ; 0x2027298 0x02027244: 08 c0 91 e5 ldr r12, [r1, #8] 0x02027248: 00 30 91 e5 ldr r3, [r1] 0x0202724c: 04 20 91 e5 ldr r2, [r1, #4] 0x02027250: 9c 43 8e e0 umull r4, lr, r12, r3 0x02027254: 9c e2 2e e0 mla lr, r12, r2, lr 0x02027258: 0c 20 91 e5 ldr r2, [r1, #12] 0x0202725c: 10 c0 91 e5 ldr r12, [r1, #16] 0x02027260: 92 e3 2e e0 mla lr, r2, r3, lr 0x02027264: 04 30 9c e0 adds r3, r12, r4 0x02027268: 14 20 91 e5 ldr r2, [r1, #20] 0x0202726c: 00 30 81 e5 str r3, [r1] 0x02027270: 0e 40 a2 e0 adc r4, r2, lr 0x02027274: 00 00 50 e3 cmp r0, #0 0x02027278: 04 40 81 e5 str r4, [r1, #4]
Starting with the sequence {0, 1, 2, 3, 4, 5, 6}, each bag is generated by swapping bag elements a total of 15 times (once for every two RNG cycles). At 0x02028894, the first index is stored in r7 and the second is stored in r0.
Language: asm

0x02027280: 94 20 81 10 umullne r2, r1, r4, r0 ; where r0 = 7 and r4 is the first word of most recent calculation of the RNG ;... for the first RNG cycle, r1 -> r7 ;... for the first RNG cycle, r1 -> r0 0x02028894: 07 30 86 e0 add r3, r6, r7 ; r6 points to the next bag of pieces 0x02028898: 00 10 86 e0 add r1, r6, r0 0x0202889c: 01 50 85 e2 add r5, r5, #1 0x020288a0: 04 20 d3 e5 ldrb r2, [r3, #4] 0x020288a4: 04 00 d1 e5 ldrb r0, [r1, #4] 0x020288a8: 0f 00 55 e3 cmp r5, #15 0x020288ac: 04 00 c3 e5 strb r0, [r3, #4] 0x020288b0: 04 20 c1 e5 strb r2, [r1, #4]
After rewriting the RNG algorithm in C and brute-forcing all system times, I can say that changing the movie's "rtcStartNew" date to May 25, 2012 makes veup's movies sync in Desmume 0.9.8. That is the only startup system time that produces the correct RNG.
Projects: Tetris DS Genesis Toys: Let the Toy Wars Begin
Post subject: Tetris DS Visualizer
morningpee
They/Them
Player (56)
Joined: 11/28/2013
Posts: 119
A major frustration I have come across while TASing this game has been the 2-frame delay between inputs and display. I have made a set of scripts that removes this delay. Use them https://gitgud.io/scahfy/Tetris_DS_Visualizer/tree/0.1.1
Projects: Tetris DS Genesis Toys: Let the Toy Wars Begin