Posts for Bisqwit


Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
> 1) In Iceman's level, you pause a few times while zipping. Are you taking damage somehow during that zip, or is there another reason for pausing? It's to eliminate lag. The lag is caused by the game's collision checks of Megaman vs the enemies. During the "teleportation", these checks are not done (enemies don't hurt), and thus Megaman gains lag-free movement at the expense of 2 frames (pause on+pause off). > 2) I noticed in Gustman's level that when moving down (and thus continually jumping over the top of the screen to do so), sometimes one beam is used and sometimes two are used. What causes this? Two beams is used when Megaman starts in-from a wall. One beam is used otherwise. The reason is that the beam needs to be on exactly the right height. If I do in the second screen what I did in the first one, in the third screen I can't put the beam on the right height. Therefore I had to enter a wall and place the beam more precisely by using a helper beam as support. > 3) What's the reason for using the Elecbeam a few times in Wily-1 after getting the large powerups for the magnet beam? Were there enemies we never saw? There were obstacles. More precisely, three of the blocks that can be picked up with Guts or electrocuted into pieces. > 4) If you could explain the screen glitches in Wily-2&3, that'd be cool :) it looks like you are somehow repeating the same screen multiple times in an attempt to get to the right spot. I'm going to check the maps and make sure this question isn't retarded. It is a complicated thing but I assure you all of it is explained in http://tasvideos.org/RockmanTricks.html. More specifically, the portions that apply are: - Grabbing the top of the ladder too high (press up+down) - Horizontal screen wrapping The thing that most confuses the viewers is the fact that Megaman is physically in the next room while he visually appears in the left edge of the current room. During scrolling, the "next room" is viewed briefly, but after the scrolling, the "current room" returns to the view. In Wily3, the "next room" was viewed for a longer period because Megaman managed to progress rightward in that room. The "current room" appeared back to the view when Megaman walked to the left, but physically he was still in the "next room".
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
adelikat wrote:
Could you post your code?
Huh? I did!
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Yes, the same method could be useful in other games. You just need to find the way to measure the results. In Rockman's case, the following aspects are measured: Q: Which reward was generated? (If any) A: It is the value of the Y register when-if location $BF25 is executed. Q: Did Rockman get damaged? A: If the ROM location $A231 has been executed, he did. Otherwise he didn't. Doesn't include instant deaths. Q: What kind of item did Rockman pick? (If any) A: It is the value of the A register when-if location $C833 is executed. And of course, you need to come up with an algorithm that generates realistic button presses. In Rockman's case, it is realistic to hold certain buttons down for certain times, and to shoot occassionally.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
nitsuja wrote:
confusion of controlling 2 players adds about as many rerecords due to screw-up as anything else
For my copy of FCEU, I created a "compose mode" where at every frame, I can toggle which buttons are held down, and if I press nothing, the same buttons will be down that were on previous frame. It makes the 2p-moviemaking significantly easier.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Okay, I decided to postpone the taking of the second refill until Wily2. With 1 refill, I found (BisqBot found) a method that leads to the spikeroom 121 frames faster than in the current WIP. The beams will still be enough for the rest of the level, and I believe that the beginning of Wily2 is much more fruitful for the two refills than that little room of Wily1 is. Ps: Did everyone lose their interest in this movie, or is it just that nobody understands what I'm talking about?
Post subject: WIP updated
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I have updated the WIP. Found at http://tasvideos.org/Bisqwit/RockmanMovie.html as always. It indeed contains now the Wily1, Wily2 and Wily3 stages, and the fixed Cutman battle. Three things that bother me most: - In Wily1, I collected two refills. It costed 4 seconds to do it. This is very ugly. Although, the level was still completed 65 frames faster than in v4, I want this faster. A lot faster. - In Wily2, there's a sloppy jump somewhere I know. - I want one more beam for the Wily4 stage. Things I'm proud of: - The way of fighting the clone robot (no pause trick!) - it's much less lag and faster. - The strategy of playing in Wily3.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
News: A lot happened today for this movie of mine. I was playing the DrWily 1 stage. It took hours to pass the first screen, but where I really was stuck was, again in the luck manipulation, This time I solved it by creating a program that randomly tries all kinds of sequences of playing in loop (in a fast loop), and stops when the right bonus has been generated. It rerecords in N frames or if an enemy yields the wrong bonus or if Rockman gets damaged. (Left) Running the bot looks approximately like this. (Below) Much to my surprise, the bot actually yielded results. I got the two refills I hoped for in that place. I got a third refill with the same method in Wily2. So I can say that part of this movie is played by BisqBot. Anyway, I've now completed Wily3, starting Wily4, but before playing Wily4, I'll keep a little break. I made an AVI of the progress so far for myself, and I'll analyze it. I don't want to rush the end like I did the last time. I'm not publishing a WIP either, for whatever reason. Because I haven't taken the timings carefully for the v4 movie in the Wily stages, I don't exactly know how much I've gained/lost in each period of the game, but overall at the beginning of Wily3 battle, I was 2931 frames (49 seconds) ahead the v4 movie. EDIT: Oh, and if someone is interested of the luckbot's source code... here's the most relevant part of it. Goes to drivers/pc/input.c. It won't do anything by itself. It requires some monitoring code in x6502.c and the bindings to keyboard commands. The monitoring code: The keyboard command code and the joypad update code:
Post subject: Re: Search for the correct frame to press a button?
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I usually use some kind of variation of binary search. For example, to find the first possible frame to shoot an enemy, the process could be the following: - Save. Shoot an enemy. <result:didn't work> - Reload. Advance 5 frames. Shoot. <result:didn't work> - Reload. Advance 5. Save. Advance 5. Shoot. <result:didn't work> - Reload. Advance 5. Save. Advance 5. Shoot. <result:worked> - Reload. Advance 3. Shoot. <result:worked> - Reload. Advance 2. Shoot. <result:didn't work> - Reload: Advance 3. Save. Shoot. Continue playing. Which gives me the correct position, "18 frames", in less retries than by a frame-by-frame method, with not less precision. The number of "advance" presses can of course be minimized by using more savestate slots.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
flagitious wrote:
Sorry Gorash to steal your 10-3 cheaply (I used my program to get the optimal solution)
:( I'll disqualify this result.
Post subject: News on bonus drop analysis
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I created code that tracks the last place of the ROM where the randomseed-permuting TempVar ($0D) is written into before each NMI. I found a couple of locations. "Called" here means that the location is the last $0D-writing instruction before NMI. B1E5 - Called once when switching weapons. Effectively preserves TempVar. A0E4 - Called once when the screen scrolls vertically. Sets TempVar to 0. D04C - Called when the screen scrolls vertically. Sets TempVar to 2. D69B - Called every time nametables are being written to (vertical or horizontal scrolling, weapon box appear/disappear). Sets TempVar to 3. D6AD - Related to D69B, happens rarer than D69B.. Sets TempVar to 1. D2A3 - Called every even frame, sets TempVar to <const>+(number of sprites)*4 D3E9 - Called every odd frame, sets TempVar to <const>+(number of sprites)*4 D252 - Called if there's lag (use elec beam). Unpredictable values. B1E5, A0E4 and D04C can be completely ignored: when I'm trying to manipulate luck, these functions will not be accessed. If I don't move horizontally, D04C, D69B, D6AD can be ignored. Otherwise they have to be taken to account. I don't intend to use elec beam, so D252 can be ruled out. Hopefully. D2A3 and D3E9 reside in the sprite updating function. Both of them seem to have the identical results on $0D. If horizontal scrolling is not used, only this has to be taken to account. The value returned in $0D is, straightforwardly, directly related to the number of 8x8 sprites on the screen. If Rockman jumps, his number of 8x8 sprites changes. If Rockman shoots, a new 8x8 sprite (or more) will be generated. When enemies change their shape, the number of sprites changes. If I find a way to track and predict the number of 8x8 sprites on the screen, the quest of weapon-refill manipulation is resolved for non-scrolling situations.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
daniayaw wrote:
a rerecords/seconds stats?!
Because there already are both the "movie length" and "rerecord count" on that page. Besides, a "rerecords/seconds" value doesn't really mean anything. The rerecords are unevenly distributed and the same frame might be rerecorded 100 times while another 10 seconds long section might be entirely played in real time.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
DeHackEd wrote:
Some days it walks right up to you.
Quite hilarious. The serious make-up combined with the stupid act :)
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
adelikat wrote:
wow, this should help you out alot
It will only be helpful when I learn how to create how-to instructions. So far it's only the equivalent of listing past week's lottery numbers. It doesn't help, it only reports what was already known (or what could have been). Even using savestates to go back to the past will not help, because even a single fired shot at different time will change the future, and will cause different, unpredicted powerup be created.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I implemented a feature to watch the randomness stats in FCEU. It goes just before the "b1=RdMem(_PC)" line in x6502.c. For every frame, it prints what bonus the game would give if an enemy spontaneously died at that frame. It works perfectly. Analyzing the output, I see that the "temp" variable changes less than I thought. If there are no other objects on screen and Rockman stands still, the "temp" variable keeps a steady 0x7C value. When Rockman climbs, it keeps a steady 0x03 value. However, when there is even one "flea" jumping around, the number changes once every few frames. It seems, for the most part, to always contain values that are evenly divisible by 4, but not really always. If the value didn't change, I could predict the bonus drops for hundreds of frames ahead, but when it changes, I can predict nothing because it works in a bit similar way as the CRC calculation works: tiny ripples change everything. But I keep trying to find ways to abuse it. Curiously, sometimes there are situations where you wouldn't get a big weapon drop no matter how many frames you waited. The RandomSeed can enter a short loop of unhelpful values. The loop can only be broken by influencing the TempVar.
Bag of Magic Food wrote:
I was thinking of looking for the energy drop algorithm when I was skimming a Metroid disassembly somebody linked me to
Yeah, that's where I got the inspiration too.
Post subject: Re: A friendly forum rant
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Thank you! :)
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Randil wrote:
First of all, how big is the chance that an enemy will drop an item? Do stronger enemies have a bigger chance to drop an item?
88% chance an item will be dropped. All enemies except bosses drop items. The type of the item does not depend on the type of enemy killed.
Randil wrote:
And how do you manipulate what item the enemy drops, is this framebased or are there more factors in this?
The frame counter affects the drops. So if you try 256 frames in a row, you could find what you wanted. (Actually 100 should be enough). It is also affected by the "temporary variable $0D", which carries the last result of a myriad of different calculations. What calculation was last performed depends on the situation on the game. Collision checks affect it - screen scrolling affects it - enemies' movement affects it. That all I know so far, but there are about hundred places where the variable is used in and I haven't analyzed them all. If you're unlucky, the temporary variable might change in ways that cancels out the changes in the frame counter, causing you to wait more than 256 frames without getting what you wanted. That's why it's important to try scrolling the screen, or to shoot or use different items, or to alter the enemies' behavior, so that the lucky combination of variables is created at the exact moment an enemy is killed.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Thereisnospoon wrote:
Incredible. . . How in the world did you figure this out?
Analyzing a disassembly. It took lots of time (there were many things I needed to understand first in order to make sense of other things), but that part is now clear. Ps: If someone wonders how I indended lines in phpBB without using the
 tag -- I used the Japanese double-width space character for indentation, unicode value U+3000.
Post subject: Bonus drop algorithm dissected
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I have disassembled the mechanism the game (Rockman 1) uses to create the drops when an enemy is killed. Every frame, lagging or not, the game does this:     RandomSeed = ((TempVar13 XOR RandomSeed) + FrameCounter) SHR 1 TempVar13 is a variable that is used by various parts of the game code. It looks like it's practically impossible to predict where it's used. For example, it is the Y coordinate parameter to a sprite update function, as a Y coordinate in sprite-sprite collision check and as a VRAM pointer in a scrolling function. Joypad input has no direct effect in the random seed. Only indirect effects exist, by affecting those other functions. The random function of the game is: Random(n) = RandomSeed MOD n When an enemy is killed, the game generates a drop with the following algorithm:     n = Random(100)     Item = nothing     if(n >= 12) { Item = BonusPearl     if(n >= 65) { Item = SmallWeaponRefill     if(n >= 80) { Item = SmallEnergyRefill     if(n >= 95) { Item = BigWeaponRefill     if(n >= 97) { Item = BigEnergyRefill     if(n >= 99) { Item = ExtraLife } } } } } } Addresses:     $0D TempVar13     $46 RandomSeed     $23 FrameCounter     $1C5A0 RandomFunc     $1D574 RandomUpdater     $BF13 CreateRandomDrop So, likelihoods are:  12% nothing given (chance 3/25)  53% bonus pearl (chance 53/100)  15% small weapon refill (chance 3/20)  15% small energy refill (chance 3/20)  2% big weapon refill (chance 1/50)  2% big energy reflil (chance 1/50)  1% extra life (chance 1/100) I'll implement a debugging measure to monitor values of the critical variables and see if they could be predicted after all. Contrary to what I previously thought, the item 0x49 is not related to weapon drops at all. When an enemy is killed, it's replaced with the bonus item (or not). The item 0x49 is just coincidentally is an object that, if placed on a map with an editor, dies immediately and spawns a bonus item (or not).
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Bisqwit wrote:
> At the boss, could you switch weapons on the way down on the right side of the guts block? It looks like it takes a while before you can pick it up anyway, and it's only vertical motion. That's a good idea! I'll do that. (I recall this idea is not new, but somehow I had forgot it.)
Apparently, this idea is not useful. To kill Cutman with one brick, you need to walk closer to him. Otherwise it will only hit once even if you pause. (The brick has very strange collision detection.) If I use your suggestion, Megaman will be _standing_ when he comes off from pause, and there will be an acceleration delay. I can't cancel the acceleration delay with jumping, because then it just don't work (no two hits). I can't jump a higher jump either, because if I jump any earlier, Cutman will jump too and that's doesn't help at all. Of all the other improvement ideas so far, only the Fireman corridor was useful, but it was only 5 frames (and I lost 2 in the battle, resulting in 3 frame net gain) so I'll ignore this for now. EDIT: No, I actually got it. 4 frames shaved off the Cutman fight, thanks to Truncated.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Truncated wrote:
Perhaps you could hold the jump button for more upward speed, and kill it to 0 with grab-release on the ladder there to get a new jump sooner.
Sorry, but that particular jump is already maximum height. As it's now, grabbing the ladder and immediately releasing it doesn't save a frame (though it wouldn't lose one either).
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
> you should number the rooms in the maps or something I actually have numbered them in this map. http://bisqwit.iki.fi/kala/snap/cutman-numbered.png (Sorry, no numbered maps for other stages.) The numbering corresponds to the internal representation of the rooms in the game. Some numbers appear multiple times, but that's how the game works. Everything is compressed :) > About cutman: In one of the vertical screens, with the armoured cannons (you should number the rooms in the maps or something)... when you jump to the left of a platform and in to the right instead of going around it, it looks like you have to wait for a while to land on the ground. Could you grab-release the ladder to get faster above the floor to make your next jump? Unfortunately I couldn't understand what you are referring to. But I think I have tried grab-releasing in all applicable places and chosen the fastest way. > I don't understand why you did the rooms with the red blocks the way you did. In particular, in one of the laggy rooms you take damage and pause to go vertically trough one of them. Because it's faster. :P The first jump should be obvious (the apparent delay before jumping was because I had to move Rockman 1 pixel to the right), but why I paused in the second jump? It was to eliminate lag. The room lags a lot. Rockman's movement is purely vertical in that position, and pausing gives lag-free vertical movement at the cost of 2 frames. Edit: Actually, I think I should try to do it in room "3" too! Edit 2: I still probably should dare to try not using the magnet beam in the previous room. It could eliminate the lag in that next room. > At the boss, could you switch weapons on the way down on the right side of the guts block? It looks like it takes a while before you can pick it up anyway, and it's only vertical motion. That's a good idea! I'll do that. (I recall this idea is not new, but somehow I had forgot it.) > I loved how you scrolled to be placed just above the lethal spikes, and then went upwards to scroll the screen down. Yeah, it looks funny. But it was invented by Morimoto, not me. Thank you for the feedback!
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Maza wrote:
There definitely wasn't a single spot in the run which could be done faster, atleast to my knowledge.
Nevertheless, I'm going to see if I'm right about the Fireman's corridor. I think it could be played faster, based on my experience in the Gutsman's corridor.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Maza wrote:
If the battle was 3 frames slower than the previous one, shouldn't you correct that and make it atleast +-0? Or was this only an example (yes, I didn't bother to check my self :) ).
L-a-g. The Elecman weapon is a very laggy beam, and combined with a few extra objects (Iceman's sweat drops etc), it just happens to be so that FCEU lags where Famtasia didn't.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Truncated wrote:
One thing I've been wondering about, how do you make any sense out of the timing tables on your Rockman page? I can't understand how they're supposed to work.
I actually yesterday made them a little better to understand. Columns in order: 1. Frame number. 2. Event name for which this frame number is. - the meanings of events "begin", "door", "battle", "finished" are explained in the beginning of the "Timings" chapter. 3. The duration of the previous event (this frame number minus previous frame number). The number in parenthesis is difference to the previous movie. 4. Duration of the entire stage until that point. The number in parenthesis is difference to the previous movie. Example: | 15031 Iceman battle 757 (+16) | 15301 Iceman finished 270 (-3) 3734 (+505) Means: - Battle began at frame 15031. - The corridor (door->battle) took 757 frames, and was 16 frames faster than in v4. - Battle ended at frame 15301. - Battle took 270 frames. It was 3 frames slower than in v4. - The entire stage took 3734 frames. It was 505 frames faster than in v4.
Editor, Experienced Forum User, Published Author, Active player (296)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Spider-Waffle wrote:
was my guess of max length beams correct?
Your estimate was correct.