Posts for Luke

Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
Whoops, the 2-player input is just because my configuration is a bit messed up (probably from doing arkanoid actually). But it doesn't hurt anything so I won't redo it... Anyway here's a new WIP http://lukeg.50webs.com/ExcitebikeWIP-Luke-2.fcm this does tracks 0,1,2. I'm redoing track 2 because I found a way to get a bit more speed. Now that I know the tricks, I'm progressing pretty fast. I should have it done in a day or two I think.
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
Ooh, yeah you could do something pretty cool with that. Have all four videos side-by-side, and pause the faster videos when they get ahead. So you could see how much each segment was improved. It'd be a lot of work to make this, though, I guess.
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
Hi all--I've started working on a new version of the Excitebike TAS. I've figured out the programming, and in the process, discovered some nice tricks. Here's track 0 http://lukeg.50webs.com/ExcitebikeWIP-Luke.fcm I finish in 37.50, which is 1.42 ahead of the current movie. My interesting discovery is that input affecting your speed is only checked every 4 frames. First, that means that you only have to tap B every 4 frames, which will prevent the engine from overheating. Further, after going over a jump, you only have to press forward once every 4 frames to preserve your speed. While in the air, there is also a 4-frame timer for checking how your input affects the slant of the bike. If this timer is not in synch with the speed timer, you can actually tilt your bike backwards in the air while not losing speed!
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
DDR after even a couple drinks is a whole new experience )
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
Using frame advance can make it really hard to get a sense of your momentum/speed. For racing games sometimes playing at even 25-50% is easiest. Of course, for maximum optimization, you'd want to use frame advance, but then you have to be prepared for an exhorbitant amount of rerecords (like saturn's 13k just to do 1 race in FZero).
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
Damn, I was just so happy I got 1M tonight for 3rd place... Jeez you have quick fingers. I can't compete P
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
SprintGod I would just like to say this is the best online tetris I have played by far. The controls are great! But, how does the scoring work? I've gotten 4-point tetrises!
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
I've been working on some modifications to windows FCEU 98.15. Here's a version with some new features: http://lukeg.50webs.com/fceu.exe.heh (delete the .heh at the end after downloading--50webs doesn't allow executables :P) I can't upload source code just yet--I guess I have a 300kb file max, so I'll have to split it up. But I'll upload it eventually I didn't touch any internals, so movies, configs, etc are 100% compatible with 98.15. Here are the new features: Shared memory The game data can be read by external programs, in particular, Hoe's EmuRead. The downside is, you can only have 1 instance of this program running at once. But you can still run non-shared memory FCEU's simultaneously. So hang on to your old version if you like watching movies while you work on them. Note: All the shared-memory stuff can be removed with compiler instructions. Memory Watch Watch up to 24 RAM locations in a dialog box. Access the dialog through the NES menu. Simply type the address, and the value will update every frame. If you want to watch a 2-byte value, use a '!' before the address. You can save and load all the stuff as a text file, too. I'm not sure everything works 100% yet, but so far things seem to be fine. Later I hope to add options like view in hex, etc. but as it is, it's still very useful. Screenshot: http://lukeg.50webs.com/screen.html Next, I'm going to try and make FCEU able to accept input from outside programs. This would make it possible to author bots. I also am hoping to put some simple bots in the program itself, although this might be a while. Let me know if you have any problems or suggestions
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
Easiest way to check a memory value, I think, is to open up the cheats window. If you don't see numbers in the list on the left, press "Reset Search". Look for the last number on the line with 0055 at the beginning. I found the probabilities from looking at the code. The game increments 0045 when the CPU is otherwise idle, so basically 0045 is a random number. When you start a game, the code executes that takes 0045 mod 4, leaving a remainder of 0,1,2, or 3. It uses this to pick the technodrome location. 0 and 3 both give the technodrome in nthe slow location, while 1 and 2 give the other two locations. So 2/4 = 50% for that, and 1/4=25% for the other two.
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
0055 is the address that has the technodrome location 2=up-right (closest), 3=down-right, 4=down-left (farthest). As far as I can tell, it's invariant for the whole game the location is determined when you start a new game. I played through level 1, and did some other things, and the only spots that the game wrote to 0055 was after a continue, and after starting a new game. So, you should trying starting your game on different frames, until you get the value of 2 in 0055. Good luck with your run! If you're curious, when starting a new game, there's a 50% chance that it'll be in location 4, and a 25% chance for each of 2 and 3.
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
I put in the shared memory into 98.15nitsuja (although the version number is wrong in the program; I'll look how to fix that later). Let me know if you find any bugs. It wasn't much more than a bunch of cut and pasting. (I also used better programming practice, and #ifdef'd all the memory sharing code, so shared memory can be disabled when compiling.) http://lukeg.50webs.com/fceu-sm.exe.hah delete the "hah" at the end (50webs wouldn't let me upload an .exe lol) Ok now I have a question for you (or anyone who knows about this): Can you write to the shared memory? I'd assume yes, unless that privelege is reserved for FCEU? If you can write to the shared memory, that would be an easy way to send messages to FCEU, and then custom-made bots would be nice to make :) The code for allocating the memory is:
mapRAM = CreateFileMapping((HANDLE)0xFFFFFFFF, NULL, PAGE_READWRITE, 0, 0x800,"fceu.RAM");
RAM = (uint8 *)MapViewOfFile(mapRAM, FILE_MAP_WRITE, 0, 0, 0);
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
Cool, I'll look at the shared memory FCEU code, too. However I can't make any promises, since I've never done any inter-process stuff before.
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
Whew... I had a day off today, so I tried to get FCEU to compile. I was a tad annoyed to get MinGW etc. when I have Visual C++, but eventually I was able to get it working. I've been looking at the source, and it's really messy in a lot of places. The 6502 emulation core is disgusting... belongs in an obfuscated C contest, IMHO. But at least there are some simple functions for many things, so I think adding features like memory watch would not be so hard. So anyway, I'm excited, and I'll try some coding in my free time )
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
adelikat wrote:
From my experience the track/opponent/etc that has the most competition with console WR's is typically the EASIEST (hence more competition and closer to the theoretical limit) therefore the poorest choice for a TAS.
Yeah, I've seen all the WR videos, and MC1 is by far the most optimized, with the exception maybe of Death Wind 1. Beating the WR's will be much easier on other tracks than it was for MC1.
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
Thanks a bunch for all the work guys. That's a really tricky way to handle random numbers--seems like it'd also be very dependent on emulator timing. The good news is, it seems to be very manipulatable, so it shouldn't require too many frames to affect it. So that knowledge should save some work for future attempts. And yes, I would also love to see more sophisticated debugging tools (and maybe in the future, bot support) put into Nitsuja's version. I downloaded the source, but it's so large and uncommented that I had a hard time figuring it out.
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
I feel a little ambivalent about this movie. On the one hand, it's very good at what it does, and the technique to warp is very surprising. However, with the long wait in the beginning and all the warping, there is not much action. I think a full run is more interesting.
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
Wow, I am very impressed Baxter! With 12k rerecords no wonder you are posting such impressive times. I think with how much time you're gaining, the decision not to use lasers is OK. In my WIP I did not lose any balls, even when it lost time, because Genisto's run did this. However I personally don't care much either way. Feel free to use my WIP to help. Level 8 is not too hard to optimize. I also think level 10 should be close to optimal, since I tried many possibilities. Level 11 is extremely difficult to optimize since there are no powerups (I think I used over 1500 rerecords yet settled for just barely beating Genisto), so I'll wish you luck there ) Actually I was thinking, this game would probably be well-suited to having a bot, since there aren't many possibilities for input...
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
I was wondering if anyone was working on a new run of this game, to obsolete the Famtasia movie. Also I was wondering if there are any opinions about what a new run should aim for. I did a few levels and gained some time, without using lasers any more than the current movie. http://lukeg.50webs.com/Arkanoid%20(U).fcm
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
Hey--I've been doing a lot of "hacking" lately, refreshing my memory of 6502 assembly and stuff so I can see what the ROM is doing (it's fun lol). So maybe I could help... although I don't think I'd want to play through the game so much. If you have 2 save states where the boss in different places, could you post them and I could see what I could do? Edit I have a save state where the technodrome is in the south-west (slowest) sewer. Continuing several times didn't change its location. The current video desynchs in my FCEU, so I couldn't use that to get a save state. If anyone has a save state where the technodrome is in one of the other 2 sewers, I think I could figure it out pretty quickly.
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
Ok, I've been doing some research on this game in preparation for a run. I've only read really vague things about how to max your score in surfing, so I played around a bit to try and figure it out myself. What I found was that your internal score is stored in 00cf-00d0. The byte 00d0 is used to determine your final score. So basically, you divide your internal score by 256 (rounding down), then multiply by 0.2 to get your final total score. The game limits your final score to a maximum of 9.0. So with the memory window open, I could watch how the internal score accumulates:
    1 point per frame going 0 degrees = horizontal forwards 1 point per frame going 30 degrees 2 points per frame going 60 degrees 3 points per frame going 90 degrees 4 points per frame going 120 degrees 7 points per frame going 150 degrees 8 points per frame going 180 degrees = horizontal backwards 3 points per frame in the air Bonus for being near the surf, average 0.3-2 points/frame depending on how close you are
Note that being in the air is always 3 points per frame, regardless of your direction or where the surf is. So doing a jump while you're heading backwards is a waste of points--you'd get more just for surfing backwards. As far as I could tell, there's not a penalty for wiping out.
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
I realize Bisqwit was just throwing out numbers to prove a point (that brute-forcing a TAS is hard), but really the problem is much more feasible than he suggests. Instead of brute-forcing input, you'd want to brute-force the state of the game. In other words, look at the contents of memory, etc. You'd try each possible input, but only keep track of the unique states that are generated. That way, if there are lots of possible inputs that lead to the same state (an obvious example is, if your input is ignored by the program), not so much redundant computation is done. Perhaps you could even make the search easier by ignoring variables, such as score, that have no impact on whether you beat the game. However, I don't think even this would be feasible for more than ~60 frames in most situations ) Really you need a human to understand the programming of the game. I was wondering if Monopoly is a possible exception--with Acmlm figuring out the random number generator, and an optimal (?) game plan, the run should be provably optimal!
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
I think that this site, whether it wants to be or not, is expected to show the state-of-the-art in speedrunning. So I think the faster movie should be published, unless it somehow is obviously lacking in quality. That said, I think a short waiting period is OK--but only as long as it's short. I'm really excited to see a new run of SMB2 (even if it looks the same!), but I guess I'll have to download the ROM to watch this now--I'm not the only one, I'm sure, who'd like to see an avi of this as soon as possible.
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
Great to see computer programs being used for luck manipulation ) Takes away the most annoying part of making a TAS. Could this be the first speedrun known to be optimal?
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
Yeah, to maximize your score in BMX, you'd want to go through the race doing as many tricks as possible, and then stop at the end (with Select) and hop up & down until your time is up (10 minutes). So I don't think maximizing score would be a good idea for a TAS.
Use the force
Experienced Forum User, Published Author, Player (84)
Joined: 2/10/2006
Posts: 113
Location: US
Hmm, as far as I know, there is no time bonus in the NES version. Was there some trick you had to do to get bonus time in the genesis version? So maybe this would be a rare case where the NES version would be more suited for a run than the genesis version.
Use the force