Posts for micro500


1 2
5 6 7 8
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
I'm starting to think more about doing a TAS of this game. Since no one responded to the original poster (besides me) I'll ask again: Would any one else be interested in a TAS of this game? A little background for those that haven't played the game. You start with a set of basic cars, and two tracks to practice with. For each championship circuit completed you get another set of better cars, and another track. After completing the highest circuit you have "beaten" the game, and you get a police car, the best car in the game. So how would this TAS work? I could make a long run of the whole game, going through all the championships and eventually beating the game, but I feel like it would get boring quickly after seeing the first three levels so many times. I feel like a TAS would be better done using the police beetle, to allow me to show off glitches that require the speed and handling only that car can do, and to also beat the game as quickly as possible. Would it be acceptable for a run of this game to start from a savestate of after I've beaten the game and already have the police beetle, assuming (of course) I provide a verification video of that savestate? I then have two choices of how the do the rest of the game, either do a time attack (a type of race in the game where it just you racing for a single track) run of each level, or complete the most difficult championship circuit (it would go through all the levels, there are other cars in the race too, and I get a trophy/winning screen at the end). Most of the speedruns on youtube of this game use the police beetle in time attack mode. I heard the track times can differ a little between the two modes due to the other cars. If I did the run in time attack mode it would be easier to compare the track times. However I don't know how bad the difference is in track times, and I think the run would be smoother changing from track to track, feel more race like with other cars there, and have a better ending if I did the circuit instead. What do you guys think?
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
Console Verified! There were a bunch of parts where I said "that's not how that works!" Nice work! A yes vote from me. Edit: Added youtube link
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
NESBot: SMB2 <-- Now featuring a virtual controller!
Ferret Warlord wrote:
How feasible would it be to transfer this over to handheld systems? It would obviously require some invasive surgery, but it should be simple enough, correct?
I'm hoping to try a few super gameboy games when I get the SNES version of this working too. I don't know enough about how gameboys work yet to give you a definite answer, but I'm not crossing out the possibility of it working. I'll research it more, but of course I'll have to buy a gameboy to hack eventually if I do it. I am curious if it works though!
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
I have a PCB design that I've been working on. I've thought about trying to get it into the controller, but the board needs an external power supply (usb, batteries, etc). It may be possible to work on the NES power, but I haven't tested it, and it would require programming the chip directly (not using the Arduino bootloader) which creates more headaches, but is doable (you need another micro controller to program it in that case). There may also be problems try to get it to be the right size and shape to fit in the controller. I figured I would start with a simpler version before trying to figure out all those problems. My PCB has the FTDI chip needed to program the atmega chip using the bootloader, along with a USB port. I'd be glad to share the design when its all finished. I was planning on using that site you mentioned (BatchPCB) to get it printed. I do agree though that implementing this into a controller would be awesome, and I'm definitely going to work on that after I get this PCB all finished.
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
If I were going to try to play back videos on the console using a reset, I would play back the movie up until the the reset, then stop playback and manually reset the console, and let the bot continue from there. If the bot held no buttons while waiting for me to reset the console, and started playback fine after the reset, how many movies would this work for? I'm assuming this wouldn't work for games that use save corruption, since this is based on precisely timing the reset to "corrupt" the memory into a favorable state. But how many games would it work for?
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
Bisqwit wrote:
Why 14ms? That produces a framerate of approximately 71.43. It should be around 16ms plus some decimals that I am uncertain of.
My goal was to avoid having to do any precise timing, since it likely would not work (it is unlikely I could get any timing on my bot to exactly match the clock in the NES). With the way my code is, the timer only needs to be longer than the time it takes the console to do all of its input requests. When this timer runs out, the input is changed and the frame count in my bot is increased. Then the bot waits for a latch pulse and restarts the timer. Here's a timing diagram if that helps. It shows two frames of input, then a lag frame, and another frame of input. You can see that the "frames" my bot counts, and the frames the console draws don't line up.
MESHUGGAH wrote:
I'm also interested in your full code.
Enjoy. It's kind of a mess and some of the text comments may not actually be talking about the code they are near, but that's the code I'm working with right now. If you'd like a copy of the MMC library I can share that too, but it just setups the SD card, and reads and writes data from it.
Patashu wrote:
How many games does this make NESbot capable of playing back?
This new code should allow games that do multiple input requests in a video frame to work, assuming they are emulated well enough. I still have no idea how many games fit that description yet though. I hope I can get this bot out to more people with bigger collections so we can test even more games.
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
qubical wrote:
What did you need to do to make it work?
When you mentioned timer 0, timer1, and timer2 I ended up finding a code library for timer1 and tried to get that to work. After messing with it for a couple hours I had no luck. Then I remembered I've used a different timing library in the past, MsTimer2. I modified my code to fit it in, changed the delay, and it worked first try. The video is of the second time I tried running it. I should really get my new code online somewhere, but the basic idea is this:
preset first input
add interrupt for latch pulse (input request)
wait forever

InputRequestInterruptRoutine() {
 restart 14ms timer, run update_buttons when done
}

update_buttons() {
 stop timer
 change buttons
 update frame number
}
On every latch pulse the timer is restarted, that way the buttons are only changed after the last input request in that frame, and each input request gets the same input no matter how many times the console polls the controller. I next tried SMB2, and it worked too! My camera died immediately after shooting the SMB3 video so I don't have a video for SMB2 yet. I'll try to shoot one and get that up tomorrow. The code (as expected) still works with SMB1, but now Adventures of Lolo doesn't work. It seems like the start button is pressed too early and the game never gets into the levels. I tried adding an extra blank input before the start button, which caused the game to sync to a little past where it stopped working before. The character now walks far enough down to pass the block, shoots, walks up a bit, then playback desyncs and he walks aimlessly around the area. I'll try and get a video of that too.
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
Here are 4 more videos to enjoy. The walkathon video completes the game, but the rest show how that particular game desyncs. SMB1 Walkathon Adventures of Lolo SMB2 SMB3 (more details below) And by request, here is a playlist of all videos I've made with this bot so far. I'll keep this up to date as I upload more videos.
qubical wrote:
Try using the hardware timers (Timer0, Timer1, Timer2) that are part of the microcontroller; I'd be stunned if they stop on an interrupt. Once you've set one up, it should increment itself automatically (at an interval you choose) no matter what's going on elsewhere in the processor, and you can check and change its value whenever you like.
Thanks for the idea! I started using one of the hardware timers, but it was very picky about the length I chose for the timer. It might be the way I designed my code, or me not completely understanding the timer library I'm using. I'm going to mess with it some more and hopefully get it fully working. With some tinkering I did manage to get SMB3 to play through the first level, after which it desynced. The hammer bro on the overworld didn't move in the same way as in the emulator version, causing the button timing to desync and mario never correctly starts the second level.
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
FODA wrote:
I don't see where I can vote... Yes, I am logged in, but it's a new account.
Thanks for trying! I forgot voting closed last night (I thought it went on until the 19th). It's not a big deal though, I'm a finalist in the competition! So thanks to anyone who did get a vote in! I'm uploading my video of SMB1 warpless on the console. I'll add a link here when it's finished. Edit: NESBot: SMB1 Warpless
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
NESBot: Gradius I also forgot to mention that voting is now open! The link to the article is here. You may need an instructables account to vote.
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
Bisqwit wrote:
"A lag frame" is simply when an NMI occurs before the actual game program has finished doing whatever it planned doing before the next NMI, such as run AI, spawn/delete actors, mogrify actors, set up instructions for the NMI routine to execute while the PPU is having a lunchbreak, etc.
Thanks for the clarification Bisqwit. I'll stick to my new method of getting input data, since it seems to generally work better.
Kirkq wrote:
Also with your current boards, they could theoretically support SMB3 if software agreements could be sorted out, right? (Does the circuit need to be modified to open up possibilities of games like SMB3 to work, or just the software?)
Yes, the board is basically an arduino microcontroller connected to the shift register, with a few buttons and LEDs for input from the user and status. It also has a microSD slot to store the data. If the software can be worked out, SMB3 should work fine.
DarkKobold wrote:
I think he meant me.
I did mean you, my apologizes! My new code based off your sample is working much better.
qubical wrote:
Would it help at all if the Arduino program had an idea of time, instead of blindly presenting the next input on the card whenever the NES asked for it?
That's the idea I've had in mind that I'm going to try next. It gets a little more complicated because timing (delays, etc) doesn't work in an interrupt routine, but I'll try some other methods and see if I can get it to work. As I mentioned before, I got Marble Madness to work. I shot a video of it today: http://www.youtube.com/watch?v=VjB6-2iH1oY. Sorry for it being low quality, I don't have access to the tv I used last time. I also tried turning down the brightness of this TV in an attempt to get the colors to not run together, with not much luck. I hope its reasonably watchable. If not, I'll re-shoot it in a couple days. I also got Gradius in the mail yesterday. The TAS for it also worked perfectly on the console. I have a video of it too, but that'll take a while to upload.
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
Derakon wrote:
Amusing, but we should probably hold off until there's more than one game that would get the mark.
Well, we can now add Marble Madness to that list. I got it to work last night. I'll get a video up of it as soon as I can. I ran into an issue though getting it to run. The movie started fine, but around 3 seconds into the first course the ball started spinning too early and ran itself off. I tried my new code based off Derakon's example, and I noticed even when the emulator said the frame was not a lag frame, sometimes the game wasn't actually looking for buttons. With the new code the resulting file was a few frames shorter, and ran perfectly. Is that a bug with FCEUX, or do I not understand it's definition of a lag frame? As for my other games: I tried SMB2, it desynced when toad entered the alternate world for the first time. SMB3 gave me the same random failures I talked about before. Adventures of Lolo desynced in the second puzzle room after pushing the block towards the other creature. He didn't walk far enough south to get around the block. Zelda 1 stopped working soon after starting the game. It may have been a problem with my bot, since it seems the game polls multiple times in a frame and my bot doesn't handle that well yet (it's too fast for it). Link would randomly stop and start walking. Also if I'm not mistaken that movie uses the second controller to restart the game, which I have no way of dealing with right now. Maybe in the future. Zelda 2: both videos are .fcm files, do those work in recent emulators? I haven't tried it yet. I'll need to run my lua script along side it, so if it runs in an emulator with that support there may be a chance. I'm waiting on Tetris, Excitebike, and Gradius to come in the mail. I'll start messing with them once they arrive. I also bought more components to build an SNES bot and maybe another one of these. Also, if I started selling these for around $100-150, would anyone be interested? That price includes design, parts (a board and the components) and construction (I'll put it together for you and make sure it works).
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
evknucklehead wrote:
So, what are the chances of extending this to the SNES? For that matter, what SNES games would be most likely to work with such a project?
It should be pretty easy to expand this to the SNES, I just need another shift register and a little time. Unfortunately I don't have another shift register handy, but I will make it a point to buy one soon and get to work on that. And that's a good question, what games would work well on the SNES? I only currently own LoZ ALttP, but I'd be willing to expand my collection to try them out. Mentioning games, heres the list of NES games I own. Let me know which are more likely to work with this robot. Super Mario Bros (obviously), Super Mario Bros 2, Super Mario Bros 3, Super Mario Bros/Duck Hunt/World Class Track Meet 3-in-one cartridge, Home Alone 2, Treasure Master, LoZ, LoZ II, Star Trek, Marble Madness, and Adventures of Lolo. Derakon, you said Adventures of Lolo might work. I'll give that a shot. I also bought a copy of Gradius to try it out by popular demand. Tetris and Excitebike also sound promising, so I may buy copies of those soon too.
TheAxeMan wrote:
My game suggestions: Any of the Ninja Gaiden games - They have no lag Final Fantasy - But all of my runs use power cycle for luck manipulation so you'd have to segment.
I can also try giving those a shot. I am of course not made of money though, but donations for games are welcome! :P
Acmlm wrote:
The NES has a little known bug with PCM that causes random Right button presses, so any game that uses PCM (like SMB3) needs to poll input multiple times (usually 2, but sometimes more) until the values match, to make sure it's getting the right input. Only Nestopia 1.40 and Nintendulator (0.975, but not 0.965) emulate this bug at all if even properly, and FCEUX 2.1.5 doesn't, so any game that uses PCM isn't likely to sync.
That matches up with what I saw on my scope when I was testing out my project. Sometimes it would poll 2-3 times, sometimes only once. I adjusted for it by holding the input for 2 polls, which worked for a while, until I'm guessing it polled 3 times, screwing up my timing completely. I'll take another look into it and see if I can have any more luck with it. I would absolutely love to get the original SMB3 video to run on the actual console, if thats at all possible, just to see this hobby go full circle. DarkKobold: Thanks for that code sample! My lua code is a mess, and your method makes more sense anyway. I'll probably do a re-write of it, especially if I'm going to try and get games working that poll more than once a frame. Another project idea I have is to be able to record button presses that the user inputs on the actual controller, and play them back at least on the console, but maybe in an emulator too. That's still in the beginning planning stages right now, but I'll keep you guys posted. And thanks for all the support! I'm really glad you all like the project! I'm wondering if I managed to get this board cleaned up a bit, would anyone be interested in buying a copy? It would still be fairly DIY to get it working, but you would have all that you need to make it work.
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
Derakon wrote:
You'd need to do something like a full walkabout of the TV + console + device to make it clear that there are no other video inputs to the TV than the console. Even then you could be running a custom computer installed inside the NES itself (I've seen an NES case used as a small-form-factor computer case before) or just doing some post-processing trickery to make the game show up on the TV screen with appropriate visual effects. In short, haters gonna hate.
I could try doing something like that next time I shoot a video. But you're right, haters are gonna hate.
andymac wrote:
Did you try the warpless SMB1? I've always wonderd whether a longer run would synch on real hardware.
I did, and it works equally as well. I've also tried the walkathon and the 500 score run, all of which worked fine. Should I get videos of those too?
BadPotato wrote:
I don't think there any NES game accuracy list. But I guess, you can still post your game list libary, so we can try to determine which other game would be a suitable candidate.
Good idea. I'll get a list of my games together soon. Also, I've been featured on Hack a Day! http://hackaday.com/2011/02/11/nesbot-video-game-automation/ I've also made it to the homepage of Instructable today, under technology!
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
Thanks for all the kind words everyone!
Warp wrote:
I already hear the trolls crying that it's fake. "Clearly the video is coming from a PC running an emulator. The NES box there is just for show."
Yeah, I was worried about that. Is there any way I can make it more obvious in the video that it's not?
adelikat wrote:
Mind if I link that video in one of our pages that explain TASing?
Not at all! That would be awesome! That video isn't the best quality, it was getting late and I wanted to get this posted ASAP. I can do more videos if you'd like, let me know what you want done.
Ferret Warlord wrote:
What are the chances of trying this out on other games?
Well, I did try Super Mario Bros 3. I discovered the console polls the controller twice a frame in that game, so I first had to adjust for that. I still had bad luck trying to get it to run. Sometimes it wouldn't even make it into the first level, sometimes it would make it halfway through the first level, and sometimes it failed somewhere in between. I'm not entirely sure what the problem is, I may give it a try again soon. I tried a few other games like Marble Madness, and didn't have too much luck with them either. Are there other games that are as well emulated or lacking a RNG like Super Mario Bros that I might have better luck with? I only went with SMB because people were talking about it being the most likely candidate for this to work.
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
I finally got my project online! I present to you, NESBot. It is hosted on Instructables as a part of a microcontroller contest. The contest ends on Sunday, and I'm hoping I could get some votes for me to win from the people who made it possible. Maybe? :) (Note, I have no idea how voting works yet, I just submitted my entry, but if you guys figure it out it would be greatly appreciated. Maybe by rating the guide it counts as a vote?) The guide describes how to build it, but not so much how it works. If you guys would like I could get a more detailed description on that up.
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
Not recently unfortunately. I got caught up with the dream team contest, and then school made me busy. I'm currently working on another TAS related project, which I'm hoping to get a post up about tonight, and then hopefully I can get back to work on this.
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
I came across this yesterday, and it made me think of this thread: Michael Larson (the middle guy) studied the "random" pattern of the board, and learned where it was going to land and how he could manipulate it. He went on to win over $100,000. Check out wikipedia for more.
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
I just wish the menus were more convenient to use. Options - Input - Auto Hold - [button] is getting very old. Can we move all the important items, like controller buttons and savestates, to their own dedicated menu, for quicker access? We also thought of trying to involve the keyboard a bit. Maybe typing "frameadvance" could do the same thing as navigating the menu and clicking it every time?
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
After some discussion, we have decided to post one of our previous WIPs. We figured since it is so close to the end of the competition it wouldn't hurt. We also found this really interesting emulator option. I was having a little trouble with VBA, so I started browsing the menus, and I found this thing called "Frame Advance". HOLY CRAP that thing is useful! Seriously guys, try it out. We started completely over when we found that. "Frame Advance" is going to save us a good 3000-4000 frames! Just wait until we finish our new video!
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
I guess I have no options than respond.
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
"Finished" world 3. I completed the world, but I'm feeling like I can save more time, so I'm going to back through and try some stuff. I also really rushed at the end, so I'm going to go back through that. I tried using death again at the first screws. I found I lost 185 frames from respawning, and 5 from death warping (I was moved back a little). After that, I used the invincibility from respawning to avoid the first screw, and took a hit on the second, saving ~100 frames. On the way back the timing of the screws let me completely avoid the left screw, and I took a hit on the right screw. I ended up ~12 frames behind if I had just avoided the screws, but I still had one hit point. I used that last one on a screw near the end, which would have taken 47 frames to avoid, meaning I saved ~35 frames. Looks like death was a good choice. I end the level with one hit point, but I'm thinking of dying again on the screws near the bottom to give me more hit points for the next levels (most likely world 5), I just need to really make sure I can make up for the respawn time. Other interesting things, I found kicking changes my hit box, letting me grab items sooner than if I didn't kick. I saved 11 frames grabbing the third machine part using a kick. I would have saved another 11 getting the first, but it threw off the timing of the screws. I did end up using it though to save a few frames and get me out of that area faster. It makes me wonder if I could have kicked in level one to grab the bomb. No way I'm going back now to fix it, but I'll definitely try it on world 5. Also, not having the gun (or the ID card) made a noticeable decrease in the time. You can really see it when I use the machine parts, it only takes 4 menu accesses compared to the 8 it took in my previous attempt. It also took 2 less to get the boots out at the beginning of the level. Each access is 77 frames, so I saved 462 frames, ~8 seconds just from that. And apparently they REALLY want you to have the gun in this game, since on one of the screens I don't visit there is another gun waiting to be taken. And the WIP I posted a few days ago was 33333 frames, this one is 43333 frames. Epic.
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
Url tags don't seem to close in the search results. http://tasvideos.org/forum/search.php?search_author=micro500 Anything after a link in my posts is also linked in the results.
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
Finished world 2. I was thinking the same thing mklip, so I went back and tried a bunch of different things to end up not getting shot. The annoying part was trying to make it entertaining too. I found if I just walked the top route and got to the waiting area as quickly as possible I didn't get shot, but it was very boring. (I also lost a frame from having to fall off the platform I land on below that alien. He shot again, and if I jumped I would die). Messing around, I found if I wait for a certain amount of time in the middle of that area, then wait more near the platforms I didn't get shot or lose a frame. I hope my waiting was somewhat entertaining, or at least not overly boring! Also by some awesome twist of luck, the alien before the radio beacon was timed perfectly to allow me to avoid it without having to stop and wait. Onward to world 3!
Emulator Coder, Experienced Forum User, Published Author, Player (68)
Joined: 10/4/2005
Posts: 197
Updated WIP. It ends when I die after the appearing platforms. I got that part looking great, and then I got shot at the end. I'll find a way around that next time. And hopefully next update will be a completed world 2! Thanks for the kind words Brushy! As for those platforms, I stayed on any one that was moving left for as long as I could. I went over that whole area, and couldn't find any place for improvement (thankfully, I didn't want to have to back track). There were a few cases that looked even to me like they were moving left and I just jumped, but watching frame by frame I found they are beginning to move right at that time. Thanks though, it didn't even occur to me to check that area!
1 2
5 6 7 8