Editor, Reviewer, Experienced player (978)
Joined: 4/17/2004
Posts: 3109
Location: Sweden
Many thanks for this, feos! The position pixel and subpixel values are very helpful. Since I'm conservative I updated it to be more like the script I already had :) If anyone's interested, it's available here: http://pastebin.com/2cyVePEh
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11469
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Do you need a map on any certain level? I can make it in the first place, as now I got my script set up and ripping randomly. EDIT: The maps are ready. Want some? Also how about fighting Phalanx-Magneto? It's kinda easter egg and would be nice to see in a TAS. EDIT 2: Just tested. You can unlock Magneto after finishing all but TWO clones, not all but one.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Editor, Reviewer, Experienced player (978)
Joined: 4/17/2004
Posts: 3109
Location: Sweden
Maps for the three last levels might be helpful. That's where we are at the moment. (Well, actually at the elevator, but no map is needed there.) So blue base, green base, and last level. I think we will submit a movie which aims to finish the game as quickly as possible, but it's possible to make different version of the last level, sure.
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11469
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
http://www.vgmaps.com/Atlas/Genesis/index.htm#XMen2CloneWars While non-P-Magneto version is marginally faster, the one with him shall definitely be more interesting (including different route). That's not the thing that must be followed through the whole movie, so I see no need in 2 categories, even the ending doesn't deffer. FTW!
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Joined: 2/26/2007
Posts: 1365
Location: Minnesota
Gambit looks a pimp in this game. Just sayin'. I am excited to see your work on this TAS, Truncated and Sonikkustar. Even if it is an any% ;)
adelikat wrote:
I very much agree with this post.
Bobmario511 wrote:
Forget party hats, Christmas tree hats all the way man.
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11469
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Just saying, the WIP is of awesome quality and is done til the last level. Total Saved: 04:21.80 frames. http://tas-sonikkustar.googlecode.com/svn/trunk/X-Men%202/
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Editor, Reviewer, Experienced player (978)
Joined: 4/17/2004
Posts: 3109
Location: Sweden
In case anyone missed it, the movie is done and has been submitted. The submission topic is here: http://tasvideos.org/forum/viewtopic.php?t=12600
marzojr
He/Him
Experienced player (760)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
So, after some talk on IRC, I started disassembling the game to see exactly is the cause of the randomness in the character selection. feos prompted me to put my findings here. First off, this game seems to have been written in C++ and compiled to the 68k; and let me say, I did not know how much compilers have improved in these ~20 years... Anyway: each level has its own separate function that initializes the level data; the function responsible for setting up Siberia is at offset 0xFD6A8. Among other functions, this function calls the function at offset 0xFD614; this function is responsible for selecting which player you get. If player 1 has not yet been initialized (specifically, it tests if the long at 0xffeaa8 is zero or not), then the following code gets run:
                jsr     j_DisableInterrupts-MainVTable(a5)

loc_FD62C:
                moveq   #0,d7
                move.b  (VDP_HV_counter).l,d7
                moveq   #0,d0
                move.b  (VDP_HV_counter).l,d0
                cmp.w   d7,d0
                bne.s   loc_FD62C
                jsr     j_EnableInterrupts-MainVTable(a5)
                ext.l   d7
                move.w  FrameCount_mod4-MainVTable(a5),d0
                ext.l   d0
                add.l   d7,d0
                move.l  d0,-(sp)
                jsr     j_InitRNG-MainVTable(a5)
                jsr     j_GetRandomP1-MainVTable(a5)
Ah, yes, the compiler has made pretty much all calls use a master VTable stored at register a5, and most of these calls point to trampoline functions (that is, a function that is nothing more than a jump to the real function). FrameCount_mod4 is a RAM location: 0xffc670, to be accurate; for Siberia, it is never updated from its initial value of zero, so it is utterly irrelevant. Now for some info: VDP_HV_counter is a symbolic constant for 0xC00008; it is a memory-mapped port from the Genesis graphics chip, the VDP. You can read it as a byte or as a word; if reading as a word, the low byte is the same as you would get from reading port 0xC00009. Port 0xC00008 is the Horizontal/Vertical counter, or H/V counter. The byte read in the code above is the vertical counter -- it is the line in which the electron beam is in the TV (or would be, in the case of modern TVs and emulators). The other byte would be the horizontal counter, and shows which column the electron beam is in -- it is counted in pairs of pixels because it is a single byte (not that it matters, as the VDP is a lot faster than the 68k anyway...). The game reads it twice, compares and loops just to make sure that the beam is not too close to changing a line. With these considerations out of the way, we can write the above as the following pseudo-c code:
	word scanline = VDP_Get_Active_Line();
	InitRNG(scanline + *(word *)FrameCount_mod4);
	GetRandomP1();
So: the current scanline is being used to seed the random number generator, which is then used to select P1. And there is the pickle: Gens-rr is deterministic, so the H/V counter is set to a known value; in real hardware, and in some other emulators, it would be an essentially random value. Changing controller settings works for changing the initial character because the code to read from a 6-button controller is slightly slower than the code for reading from a 3-button controller; this is enough to change one scanline, but only because the game was apparently close to it already. As far as I can tell, there is no way to gain the 488 clock cycles needed to gain another scanline. So until there is a setting to change the initial value of the H/V counter, the best that can be done is using Wolverine in that level.
Marzo Junior
Editor, Reviewer, Experienced player (978)
Joined: 4/17/2004
Posts: 3109
Location: Sweden
Big thanks, Marzo! So essentially, the TV is used as a source of randomness? Very interesting. I have a vague memory of this being used in some NES game, maybe Blades of Steel? In any case, I guess this means that whatever Genesis emulator core adelikat was using in his tests in Bizhawk emulates the TV electron beam to start up on a random value. The 6-button thing being slower to read, throwing off the startup somehow, is pretty much what I expected. >So until there is a setting to change the initial value of the H/V counter, the best that can be done is using Wolverine in that level. Actually, our TAS manages to manipulate the starting character to be Nightcrawler, so there is something which is not accounted for in your analysis. We do this by pressing up+down on frames 7-39. Pressing it for longer/shorter gives other characters. (Sonikkustar discovered this by accident.) I tested, and this does not affect ffc670 (FrameCount_mod4), so if your info is correct, it must affect the TV electron beam position somehow. Probably indirectly by taking up calculation cycles somehow, like having a 6 button controller? The startup does not take longer, and game action starts on the same frame (character appears at frame 174), at least.
marzojr
He/Him
Experienced player (760)
Joined: 9/29/2008
Posts: 964
Location: 🇫🇷 France
Oh, I didn't notice you guys managed to manipulate Nightcrawler. Yes, pressing up+down (or left+right, for that matter) changes timing slightly because the game has routines to "fix" the input that are ever so slightly slower when it has to fix it than otherwise. I just assumed that the difference would be too slight, but it seems I was wrong... Now to watch that TAS...
Marzo Junior
Patashu
He/Him
Joined: 10/2/2005
Posts: 4042
So this is the first time in TASing history that not having a bug in u+d / l+r input has lead to a faster TAS? ;)
My Chiptune music, made in Famitracker: http://soundcloud.com/patashu My twitch. I stream mostly shmups & rhythm games http://twitch.tv/patashu My youtube, again shmups and rhythm games and misc stuff: http://youtube.com/user/patashu
Editor, Reviewer, Experienced player (978)
Joined: 4/17/2004
Posts: 3109
Location: Sweden
marzojr>Yes, pressing up+down (or left+right, for that matter) changes timing slightly because the game has routines to "fix" the input that are ever so slightly slower when it has to fix it than otherwise.' So THAT is why! It was a bit of a mystery to us why up+down worked when no other button seemed to have any effect. Patashu>So this is the first time in TASing history that not having a bug in u+d / l+r input has lead to a faster TAS? ;) Heh, I guess you could say that! :) The previous inability to get the right character for the first level is really just an emulator artifact though, on a real console speedrunners just reset until they get Nightcrawler. With better emulation, say the ability to set the TV electron beam position and saving that in the movie file, this problem would be gone.
Editor, Reviewer, Experienced player (978)
Joined: 4/17/2004
Posts: 3109
Location: Sweden
As we said about the Pyramid level in our submission:
There was a user in the thread of a previous submission, who suggested that it is possible to skip floors with the teleport. He was unable to figure out how he did it, and we have not had any luck either. Until we see some indication otherwise, we are skeptical that this is possible.
Now, I have stopped being skeptical. User Orkan contacted me a while back saying this was possible, and managed to record a movie of it. In his movie he jumps as high as possible, then teleports upwards, hits a rock and gets bumped a tiny bit upwards to reach the next floor. I tried replicating it to see what makes it work. Normally, the final little bump needed to reach the next floor does not occur. It happens, as it turns out, because of a bug. First, you need to do a diagonal kick (I suspect that a downwards stomp would work too), and get damaged by a rock before landing. When you hit something during a diagonal kick/stomp, you bounce off it, and this state (next hit causes bounce) is not reset properly. This state is kept until you do another diagonal kick/stomp or hit something. After this, you can jump, teleport up and hit a rock (perhaps other damageable objects work too), and get bumped to the next floor. The timing is not even that strict. Here's the BK2 movie where where I managed to replicate it: User movie #26095853500551368 It should save some time. Even with the limitation that it takes some time to set up, and you need to keep yellow health (or else the boss takes twice as long), the first few floors are very long. Orkan also found that the trick to fall through thin floors could be used in the Sentinel levels too. I haven't looked into this yet.
EZGames69
He/They
Publisher, Reviewer, Expert player (4431)
Joined: 5/29/2017
Posts: 2761
I got bored and wanted to see if I could resync the current publication to bizhawk. I got past the stage with the spikey pillers before I gave up with the boss directly after that. http://tasvideos.org/userfiles/info/62899378081657479 I had to edit some of the inputs near the end to get past some things, and I discovered a clip through the last breakable wall at the stage, it happens around frame: 29100 was this already known that you can skip past that wall without blowing it up?
[14:15] <feos> WinDOES what DOSn't 12:33:44 PM <Mothrayas> "I got an oof with my game!" Mothrayas Today at 12:22: <Colin> thank you for supporting noble causes such as my feet MemoryTAS Today at 11:55 AM: you wouldn't know beauty if it slapped you in the face with a giant fish [Today at 4:51 PM] Mothrayas: although if you like your own tweets that's the online equivalent of sniffing your own farts and probably tells a lot about you as a person MemoryTAS Today at 7:01 PM: But I exert big staff energy honestly lol Samsara Today at 1:20 PM: wouldn't ACE in a real life TAS just stand for Actually Cease Existing
Editor, Reviewer, Experienced player (978)
Joined: 4/17/2004
Posts: 3109
Location: Sweden
EZGames69 wrote:
I got bored and wanted to see if I could resync the current publication to bizhawk. I got past the stage with the spikey pillers before I gave up with the boss directly after that. http://tasvideos.org/userfiles/info/62899378081657479 I had to edit some of the inputs near the end to get past some things, and I discovered a clip through the last breakable wall at the stage, it happens around frame: 29100 was this already known that you can skip past that wall without blowing it up?
There is a wall earlier that we skip, at 7:50 in the encode. So the trick itself was known. How well it was tested at that particular wall, I can't remember. I'm fairly certain it was Sonikku who did this level, because I did the ones before and after. However, watching our movie, the spike pillar is in a very unfavorable position to do any skip, and we can't take damage here, or we'll only do quarter damage to the boss. Since you take damage there in your version, that is one reason that the boss desyncs for you. You also miss a health pickup at 28240, which is needed for the same reason.
EZGames69
He/They
Publisher, Reviewer, Expert player (4431)
Joined: 5/29/2017
Posts: 2761
Yeah the spike pillers seem to be on a different pattern in BizHawk, which seems like it loses time to that. I’d definitely would like to see a new version of this movie someday on Bizhawk, I at the very least was able to find an input pattern that gives you the right character at the start, so hopefully if someone goes back to this game, that will help them.
[14:15] <feos> WinDOES what DOSn't 12:33:44 PM <Mothrayas> "I got an oof with my game!" Mothrayas Today at 12:22: <Colin> thank you for supporting noble causes such as my feet MemoryTAS Today at 11:55 AM: you wouldn't know beauty if it slapped you in the face with a giant fish [Today at 4:51 PM] Mothrayas: although if you like your own tweets that's the online equivalent of sniffing your own farts and probably tells a lot about you as a person MemoryTAS Today at 7:01 PM: But I exert big staff energy honestly lol Samsara Today at 1:20 PM: wouldn't ACE in a real life TAS just stand for Actually Cease Existing
Joined: 10/18/2020
Posts: 5
Hey all, I've come across a way to skip floors on the pyramid level that I haven't seen discussed yet. https://www.youtube.com/watch?v=pZZlGiVg-zw&feature=youtu.be&t=12 I wasn't able to play the video linked by Truncated above that shows the method found by Orkan. I thought I needed the Rad Video Tools player, but that didn't seem to work. Anyone have advice on that? I would like to skip floors in the speedrun and it may be that the method in that video is faster or easier to perform than what I linked above.
Samsara
She/They
Senior Judge, Site Admin, Expert player (2098)
Joined: 11/13/2006
Posts: 2821
Location: Northern California
A-Frame wrote:
I wasn't able to play the video linked by Truncated above that shows the method found by Orkan. I thought I needed the Rad Video Tools player, but that didn't seem to work. Anyone have advice on that?
That's an input file for BizHawk, not an actual video.
TASvideos Admin and acting Senior Judge 💙 Currently unable to dedicate a lot of time to the site, taking care of family. Now infrequently posting on Bluesky
warmCabin wrote:
You shouldn't need a degree in computer science to get into this hobby.
Joined: 10/18/2020
Posts: 5
Samsara wrote:
A-Frame wrote:
I wasn't able to play the video linked by Truncated above that shows the method found by Orkan. I thought I needed the Rad Video Tools player, but that didn't seem to work. Anyone have advice on that?
That's an input file for BizHawk, not an actual video.
Thanks - I was able to play it with the matching version of BizHawk. Here's a video version of it in case others want to view it without setting up BizHawk and/or acquiring an X-Men 2 rom. https://youtu.be/HYHs0Da-tbg A few interesting notes: - This can be performed with Beast as well. - You can also store the pogo by taking damage from a projectile. https://youtu.be/L6YFHHrpnAE
Editor, Reviewer, Experienced player (978)
Joined: 4/17/2004
Posts: 3109
Location: Sweden
Hey, since this thread is active again, here is the thin floor skip in the Sentinel factory that Orkan found and I mentioned in passing earlier. Link to video I think the new method of skipping pyramid floors that A-Frame posted should be highlighted more by the way. It's no longer necessary to first take damage, and then wait for another boulder to fall. All you need is one boulder, which is a lot faster. Link to video
Joined: 10/18/2020
Posts: 5
Not sure if this will be useful, but is kind of neat. Store a pogo by getting hit out of a pogo attack, stick to a wall, then punch something while upside-down. Properties are not fully understood yet. Note the big shift in character position when hit at 0:41. Link to video
Joined: 10/18/2020
Posts: 5
Bacon and I ended up finding some uses for it. May be more on the way. Link to video Link to video
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11469
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Now that's awesome!
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
EZGames69
He/They
Publisher, Reviewer, Expert player (4431)
Joined: 5/29/2017
Posts: 2761
A-Frame wrote:
Bacon and I ended up finding some uses for it. May be more on the way. Link to video
This exact level was where I stopped doing my resync attempts to bizhawk for the current publication. Meaning if someone wanted to pick this game back up to improve it using these new tricks, they can use use my bk2 file I provided here that ends at this exact level: http://tasvideos.org/forum/viewtopic.php?p=494467#494467
[14:15] <feos> WinDOES what DOSn't 12:33:44 PM <Mothrayas> "I got an oof with my game!" Mothrayas Today at 12:22: <Colin> thank you for supporting noble causes such as my feet MemoryTAS Today at 11:55 AM: you wouldn't know beauty if it slapped you in the face with a giant fish [Today at 4:51 PM] Mothrayas: although if you like your own tweets that's the online equivalent of sniffing your own farts and probably tells a lot about you as a person MemoryTAS Today at 7:01 PM: But I exert big staff energy honestly lol Samsara Today at 1:20 PM: wouldn't ACE in a real life TAS just stand for Actually Cease Existing
Joined: 2/26/2007
Posts: 1365
Location: Minnesota
It's always fun to come back from a sabbatical to see updates to a favorite TAS. Good find EZ. Hopefully someone will pick up where you left off.
adelikat wrote:
I very much agree with this post.
Bobmario511 wrote:
Forget party hats, Christmas tree hats all the way man.