Posts for Sand
1 2
6 7
Sand
He/Him
Experienced Forum User, Published Author, Player (125)
Joined: 6/26/2018
Posts: 157
Dacicus wrote:
Was it faster to jump over the weapon tank after the second Dyna Man fight than to pick it up, or why did you do that?
Yes, it's faster to jump over (or at least equally fast). I discarded most of my notes, but for descents like that I tested 1-frame jumps at various offsets, 2-frame jumps, etc. The rule of thumb is you want to jump as high as possible, because that gives you more time to accelerate downward before reaching the drop; and jump as early as possible without clipping the corner. In some corridors with a low ceiling it's better to jump as high as possible and bounce off the ceiling. A good jump versus a not-so-good jump only translates into a difference of maybe 8 pixels or less of y position. As Mega Man's maximum falling speed is 15 pixels/frame, a better jump may not always result in him actually hitting the ground sooner. I only optimized for y position and velocity at some fixed frame number on the descent. I wrote a little Lua script to automate optimizing these jumps, but it caused a deadlock in JPC-RR due to an apparent race condition. (I didn't investigate it thoroughly.) I was able to work around it by commenting out a line in JPC-RR that restores the display after loading a savestate, but that becomes annoying when working interactively, and it was too cumbersome to switch back and forth between the two versions. So I just optimized all the jumps manually. Maybe in a future revision.
Sand
He/Him
Experienced Forum User, Published Author, Player (125)
Joined: 6/26/2018
Posts: 157
First draft of a TAS incorporating the skip in Volt Man's stage and other improvements: Link to video But you may prefer this version that has been slowed down to a watchable speed (more on this below): Link to video More info and JRSR file: https://archive.org/details/megamanpc-tas-1_49_352 The file is 7663 frames or 01:49.34, which is about 24% faster than [2247] DOS Mega Man by DarkKobold in 02:23.55. The biggest single time save is skipping Volt Man's stage. Further gains are from general clean movement: pre-jumping down pits and avoiding hugging walls. Other specific improvements are:
  • Putting C: on HDD rather than HDA and skipping all the startup options, as recommended at Wiki: EmulatorResources/JPC, makes the boot faster.
  • You need to delay slightly to avoid getting hit by the dog; there's enough time to kill one dog while still saving a few frames overall.
  • The second wall in Sonic Man's stage can't be harmed while the first wall is exploding. (This applies to all such explosions: only one can exist at a time, so anything that might explode is invulnerable until an existing explosion is gone.) While waiting for the explosion to finish, we lure the Batvire to the left to open up some headroom. Jumping and shooting the second wall near the top causes the explosion to spawn up high, so that Man Man can walk under it.
  • Holding up in the vertical fan shaft reaches maximum vertical speed slightly faster.
  • One damage boost is enough to get past the Sewer Rat—it requires slowing down so the wall blasters can hit you first.
  • It pays to be out of the water as much as possible. Under water, Mega Man moves at 6 pixels/frame; above it, 8 pixels/frame. Jumping from a lower to a higher platform incurs a slight delay for camera recentering. You can sometimes avoid the recentering delay by jumping immediately after landing.
  • Jumping from the top of a ladder mitigates the camera recentering that occurs in the dark Batvire cave and elsewhere.
  • Taking the right ladder, rather than the left, is a faster way to exit the Batvire cave.
  • The Volt Shield makes Mega Man immune to many of the hazards in Dyna Man's stage: Sentry Bee nails, lava bubbles, and acid drops. Keeping it equipped throughout the stage means we almost never have to slow down.
  • It's possible to touch the backwards conveyor belts for only one frame between jumps. You need to press the jump button before Mega Man is visually on the ground. If you do it right, Mega Man will stay in the jumping animation and not enter the running animation.
  • Damage boosting through the hazards in Dyna Man's assembly line is faster than waiting: even while stunned, Mega Man moves at 6 pixels/frame because of the conveyor belt, compared to 8 pixels/frame when running normally.
  • The pause/weapon menu is free if it only appears for one frame. To switch to the Sonic Wave, for example: press S, press Esc, frame advance; release S, release Esc, frame advance.
  • Earlier first shots in a damageless Wily fight.
Known deficiencies and potential improvements:
  • The intervals between the stages (when the game is loading resources from disk) are slightly slower than in [2247] DOS Mega Man by DarkKobold in 02:23.55. My best guess is that this has something to do with putting C: on HDD rather than HDA. If so, then it would be better to go back to HDA: the time saved between stages would more than make up for a slightly slower boot.
  • Didn't jump out of the first ladder in Sonic Man's stage.
  • It would be better to get up to speed before equipping the Volt Shield in Dyna Man's stage.
  • In the first Dyna Man fight, I tested both Volt Shield and the buster, and the buster was faster. But in the refight, I found a fast way to do it with the Volt Shield that may also work in the first fight. The circumstances are not exactly the same, because in the refight your goal is not only to defeat the robot master but also to get to the right side of the screen as fast as possible.
2247thisdiff
boot9159−32
configuration menu32−1
title screen127129+2
intro stage386382−4
stage select146154+8
Sonic Man stage20401928−112
Sonic Man111102−9
stage select352367+15
Volt Man stage2125186−1939
Volt Man109100−9
stage select305314+9
Dyna Man stage19881783−205
Dyna Man7757−20
Wily title cards363374+11
Wily stage17341686−48
Wily10440−64
total100617663−2398
About the game's speed It's unfortunate that the game's speed is CPU-limited up to the display refresh rate. It means that the video plays back at a speed that is too fast to appreciate what is going on. What can be done about this?
  • [2247] DOS Mega Man by DarkKobold in 02:23.55 links to a separate video that is slowed down to 30 fps. It's a lot nicer to watch—the only problem is that the sound effects are longer in duration and lower-pitched than they should be.
  • Cranking JPC-RR's CPU frequency divider up to its maximum value of 256 doesn't help. It's not slow enough to make a frame take more than a refresh, so the gameplay speed is unchanged, while loading stages, etc. is slower.
  • The F1 and F2 keys are in-game speed controls. F2 decreases the game speed by inserting busy-waits into every iteration of the main game loop. Using F2, you can make the game run 2×, 3×, 4×, 5×, ... slower. It complicates timing because one iteration of the game loop now takes more than one JPC-RR "frame." The slowdown only affects the gameplay loop, not things like loading stages.
Above, I tried a compromise, which is a separate slowed-down "soundhack" video, named after the camhacks in e.g. [3584] Genesis Sonic the Hedgehog 2 by Zurggriff & Aglar in 17:40.08. The sound effects in Mega Man use the PC speaker and the programmable interval timer, which is clocked independently of the main CPU. The soundhack is a small modification to the game executable that increases the pitch and decreases the duration of all sound effects, so that they sound mostly correct when the video is slowed down. It's not perfect, because some of the high frequencies are lost, but it's much better than just slowing down all the audio. I chose to slow down the video by a factor of 5, to about 14.02 fps. I chose this speed, even though it feels a little too slow to me, because it's close to the speed you get when running in DOSBox with cycles=500, which is what speedrun.com RTA runs use. I measured the speed by counting blinks. Mega Man's blink cycle is 64 frames. I timed 10 blink cycles in DOSBox to take approximately 45.65 seconds, or 14.02 fps, which conveniently is almost exactly 1/5 of the natural framerate of a JPC-RR dump.
Post subject: Re: Stifling Sentry Bees
Sand
He/Him
Experienced Forum User, Published Author, Player (125)
Joined: 6/26/2018
Posts: 157
Sand wrote:
The Sentry Bee will fly overhead without dropping its nails—and no more Sentry Bees will spawn for the remainder of the opening section.
I figured out why this happens. Imagine that the stage is divided into vertical zones, each 8 tiles wide (128 pixels wide). The bee drops its bundle of nails as soon as it enters the zone that Mega Man is currently in. (Which means that the drop can be right on top of Mega Man's head, or up to 8 tiles away, or anywhere in between, depending on Mega Man's position in the zone.) If Mega Man, moving right, crosses from zone A to zone B in the same frame as the bee, moving left, crosses from zone B to zone A, then there is no frame in which they are both in the same zone, and nails never drop. The relevant code is at offset 0x1947 in dyna.bin:
0000:1947  268b07      mov ax, word es:[bx]     ; bx points to Mega Man's x position
0000:194a  2580ff      and ax, 0xff80           ; round down to a multiple of 128
0000:194d  8b1c        mov bx, word [si]        ; si points to the bundle's x position
0000:194f  83e380      and bx, 0xff80           ; round down to a multiple of 128
0000:1952  3bc3        cmp ax, bx               ; same zone?
0000:1954  7508        jne 0x195e               ; branch if not same zone
0000:1956  ff441a      inc word [si + 0x1a]       ; set bundle's y velocity to 1 (indicates it's now falling)
0000:1959  c744180000  mov word [si + 0x18], 0    ; set bundle's x velocity to 0
0000:195e
Or in pseudocode:
if (megaman.x / 128 == bundle.x / 128) {
        bundle.y_vel++;
        bundle.x_vel = 0;
}
Knowing this, I was able to prevent the drop in the second section where bees appear, too. The way respawning works is, there's really only one bee: there are five sprite slots for the bee, bundle, and four nails. (The bundle and one of the nails share a slot.) The next bee can spawn only when all five slots become empty (despawn). The bee itself despawns when it goes far enough offscreen, but the bundle only despawns when it hits the ground. Because the bundle never drops, it never hits the ground, and the next bee can never spawn. (Actually, if you wait long enough—several minutes—the bundle's x position will wrap around 16 bits, arrive once more in Mega Man's zone, finally drop, and restart the spawning cycle. I only noticed this because it happened in the background while I was writing this post.)
Post subject: Stifling Sentry Bees
Sand
He/Him
Experienced Forum User, Published Author, Player (125)
Joined: 6/26/2018
Posts: 157
A small glitch, noting for completeness: In Dyna Man's stage, at the beginning, wait for 16 frames, then run right at full speed. The Sentry Bee will fly overhead without dropping its nails—and no more Sentry Bees will spawn for the remainder of the opening section. I'm not sure if this helps or not. To be worth it, the 16 frames spent waiting would have to be less than then number of frames spent evading bees later in the section. And by this point you would have the Volt Shield, which protects you from the nails, so the only concern would be contact with the bees themselves. I don't know what causes the glitch. I tried for a little while, but wasn't able to reproduce it in later sections that have Sentry Bees. The trick isn't very hard in real time, either. Hold down the J key before the level starts to buffer a full-height jump. Start running to the right as soon as you land.
Sand
He/Him
Experienced Forum User, Published Author, Player (125)
Joined: 6/26/2018
Posts: 157
Dacicus wrote:
Have you tested if farming E-tanks in Sonic is faster or slower than getting the one in Volt for the Dyna skip?
I did a test and I don't think the Dyna Man skip is worth it. I was able to farm a single E Tank in Sonic Man's stage (including dying three times with Esc-F10-P) in about 659 frames. The skip in Dyna Man's stage saves only about 425 frames (or less, depending on how long it takes to line up the Sentry Bee in order to take damage). In an earlier comment I said that you can use an E Tank from Volt Man's stage to do the Dyna Man skip, but obviously you won't have that E Tank if you skip Volt Man's entire stage. Volt Man's E Tank is deep in the stage. I didn't test it, but I'm sure it's slower to get that one. I don't know of any E Tanks other than the one in Sonic Man's stage and the one in Volt Man's stage. My estimate for getting an E Tank in Sonic Man's stage includes a minor time save relative to the current TAS: in the first room, if your last shot on the second destructible wall hits near the top of the wall, the explosion will be high enough to walk under.
Post subject: Re: Volt Man skip
Sand
He/Him
Experienced Forum User, Published Author, Player (125)
Joined: 6/26/2018
Posts: 157
It turns out that the skip in Volt Man's stage needs only one E Tank, not four. If you take damage such that you stagger backwards against the solid wall, the death barrier only damages once. No E Tank farming is required in Sonic Man's stage—the single E Tank in that stage requires only a slight detour. Incidentally, from the top of this pole, you can walk to the left and get out of bounds. The same trick is possible in Dyna Man's stage. Here, it skips a comparatively short portion of the stage. It also avoids the trigger that initiates lava eruptions and acid droppers in the following section. The necessary E Tank can be acquired in Volt Man's stage, from behind a destructible wall.
Post subject: Volt Man skip
Sand
He/Him
Experienced Forum User, Published Author, Player (125)
Joined: 6/26/2018
Posts: 157
A major skip is possible in Volt Man's stage. There is a row of death tiles immediately below the start position. Contact with a death tile sets Mega Man's health to zero, but the game doesn't actually notice he's dead until the next frame; during that frame you can pause and use an E Tank to restore Mega Man's health. Four E Tanks suffice to pass completely through the barrier. This skips almost the whole stage: after landing, the boss chamber is just a short walk to the right. According to my rough estimate based on DarkKobold's TAS and LiteralGrill's RTA WR, farming four E Tanks in Sonic Man's stage—even though you need to die three times and continue for each one—is faster than playing through Volt Man's stage once.
1 2
6 7