Post subject: Barnstorming [A2600]
Player (37)
Joined: 2/16/2012
Posts: 282
Just wanted to post a thread for this game, in case anybody is working on it. I know Alyosha has put in some time with it, but as far as I know hasn't published a WIP or otherwise. This game is interesting in that it has another early-gaming era "legendary time," but also has existing footage of humans beating the currently-published TAS. We should probably fix that. I spent a little bit of time experimenting with the game last night to get a feel for the mechanics, and also started a disassembly of the binary. The basics I think are pretty well understood: you lose some horizontal speed by moving vertically, so minimal movement is optimal. But the actual coordinate system it uses is tricky to track; I found the addresses related to horizontal and vertical pixels per frame, but couldn't find a sensible combination of addresses that could precisely describe the plane's current horizontal position. It's in there, I just haven't nailed it down yet. From the disassembly, though, I noted several other things that will affect optimality: -Frame rules. There are numerous odd/even frame rules spread throughout the code, but also a number of checks that only occur every 8 frames. -Sub-frame inputs. Unfortunately, the game checks the button state at 3 separate logic blocks in the code, which I'm pretty sure are not mutually exclusive. -Birds spawn based on button use. If you start up a race and never press the accelerator again, no birds will spawn. If this is one of the three input checks, then you can absolutely get an optimal pattern (no birds) by precisely toggling sub-frame inputs. -It is possible to go through windmills. I found this entirely by accident my first time going through, but some precise combination of position and v/h speed will cause the plane to bounce "upwards" instead of backwards. It is unlikely that this is faster than simply going around the windmill. Currently unknown, though, is whether you can bounce backwards after passing through a barn in order to pass through it again. Just wanted to document these things in case anybody plans to put more work into this game.
Site Admin, Skilled player (1255)
Joined: 4/17/2010
Posts: 11492
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Thanks! I still feel uneasy about my judgment. But sub-frame input isn't going to happen in bizhawk, I already tried asking.
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.
Player (37)
Joined: 2/16/2012
Posts: 282
To clarify, I don't think sub-frame is necessary for improving the current TAS, but may be necessary for true optimality later on. I believe Alyosha mentioned he could produce a 32.61, so that's at least an improvement. Sub-frame would be nice, but I understand the difficulty in making that happen from an emulator development perspective. At least, a better understanding of the system would make it possible to reason a theoretical limit, assuming sub-frame inputs were possible.
Site Admin, Skilled player (1255)
Joined: 4/17/2010
Posts: 11492
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
You can input sub-frame with lua for the PoC purposes. Don't remember the event name.
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.
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3826)
Joined: 11/30/2014
Posts: 2834
Location: US
Omnigamer wrote:
To clarify, I don't think sub-frame is necessary for improving the current TAS, but may be necessary for true optimality later on. I believe Alyosha mentioned he could produce a 32.61, so that's at least an improvement. Sub-frame would be nice, but I understand the difficulty in making that happen from an emulator development perspective. At least, a better understanding of the system would make it possible to reason a theoretical limit, assuming sub-frame inputs were possible.
I did? 0_0 I forget about 90% of everything I do, but I don't recall doing that. I can however at least reproduce a 32.74 on the latest Dev Build of BizHawk that always changes inputs on video frames, so maybe that's a start.
Player (37)
Joined: 2/16/2012
Posts: 282
My mistake! You were discussing Grand Prix on TG, and I just swapped the games/times in my head. As far as input polling goes, I set up a basic script to change out inputs on different polls, but there are a couple things I'm not sure of. What is the "start" of a frame for Atari, as far as BizHawk is concerned? I assume it starts in VBlank but the oninputpoll() behavior is kind of strange. That, or the emulator doesn't seem to register input changes until the start of the next frame. It might not be possible to change them mid-frame like that.
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3826)
Joined: 11/30/2014
Posts: 2834
Location: US
Oh Yeah, I was working on Grand Prix as that time seems by far impossible, but TG people seem to think it can even be beaten, but won't say how. Anyway, the current release build of BizHawk runs constant length frames for A2600. In other words, all frames are 262 scanlines long. This causes some adverse side effects for some A2600 games because start up times can vary and put frame boundaries in the middle of video frames. Also some frames in games are 263 scanlines long, so this causes a cycling effect. By pure coincidence, I was working on another bug and realized that it could be solved by only changing frames on video frames, so this is the current implementation in the dev build. So, in that build, frames change at the falling edge of VSYNC. Side Note: A2600 core originally changed frames on video frames and at some point was changed to constant length frames. And now I changed it back, we aren't very consistent! EDIT: http://tasvideos.org/userfiles/info/41923259965218113 Here is a movie that gives a 32.74 in the Dev Build. I'm not sure a 32.74 is possible in the release build.
Player (37)
Joined: 2/16/2012
Posts: 282
One further question - for the purposes of the oninputpoll event, what counts as an Atari input? Is it just controller inputs, or also system inputs (reset, difficulty select, etc)? Going through the code I see far more direct calls to just the button and the system inputs than there are polls occuring per frame.
Site Admin, Skilled player (1255)
Joined: 4/17/2010
Posts: 11492
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
BTW, while not possible with a bizhawk movie, such poll-based movie will be possible to console verify, just like the 2 second long SMB3 TAS.
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.
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3826)
Joined: 11/30/2014
Posts: 2834
Location: US
Omnigamer wrote:
One further question - for the purposes of the oninputpoll event, what counts as an Atari input? Is it just controller inputs, or also system inputs (reset, difficulty select, etc)? Going through the code I see far more direct calls to just the button and the system inputs than there are polls occuring per frame.
Currently only joysticks count for input polling. If it's needed console switches could easily be added just by putting the call in "ReadConsoleSwitches" in Atari2600.core.cs. Is this something you want? joystick one, joystick two, and console switches are each their own event in this sense, so you have to be a bit careful when looking at / counting polls.
Player (37)
Joined: 2/16/2012
Posts: 282
The console switches aren't something that I would particularly need for testing, but in the long run they function just the same as controller inputs as far as the Atari is concerned. Other games might certainly benefit from toggling console switches on certain polls, but until the input state can be changed mid-frame I don't think it will be useful.
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3826)
Joined: 11/30/2014
Posts: 2834
Location: US
I just tested my movie on the release build of BizHawk and it synced with only minor start up correction. So, I guess 32.74 was possible all along D:
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3826)
Joined: 11/30/2014
Posts: 2834
Location: US
http://tasvideos.org/userfiles/info/42010515158802928 I managed a 32.72, which I believe is the first confirmed evidence a time below 32.74 is possible. EDIT: With some refinement I think a 32.70 might be within the realm of possibility, I think the 32.72 is probably human achievable with a lot of luck in timing maneuvers right. EDIT2: http://tasvideos.org/userfiles/info/42024964093355238 Yup, 32.70 is possible. Probably not human viable though, as this seems to be almost frame perfect. And we are also a very long way from 32.69.
Player (37)
Joined: 2/16/2012
Posts: 282
Good job! Are you doing anything in particular to track horizontal position or speed?
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3826)
Joined: 11/30/2014
Posts: 2834
Location: US
Omnigamer wrote:
Good job! Are you doing anything in particular to track horizontal position or speed?
Nope, just minimizing up / down presses by hand
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3826)
Joined: 11/30/2014
Posts: 2834
Location: US
I've worked a bit on Game 2, and I am stuck at 49.98. The current record is on video at 49.97. The thing is that the RTA run is much less optimized then my current run but still beats it. In trying to figure out why, I noticed that the time at which you go up / down is also important, not just just how long you hold the button for. I seem to be able to gain several pixels just by moving at the correct location. I don't know the details, but this seems like an important mechanic to figure out to get an optimal run.
Player (146)
Joined: 7/16/2009
Posts: 686
Dunno if a file is already available, but here's the relevant addresses I've found so far: User movie #42114537143735492
Player (37)
Joined: 2/16/2012
Posts: 282
I can never find the user file uploads location! Managed to work it back from Scepheo's link, but I have no idea how to arrive there through normal browsing. In any case, my watch set: http://tasvideos.org/userfiles/info/42118433998608228 Of particular note are a number of addresses that are related to X position, which I just called the sub-positions. They are related to the speed at $56. The X and Y px velocities are useful for finding out where you are losing speed, but the actual "position" is still a mystery. It's between one of two addresses, but has a lot more to do with the subpixels as well. Like I said, I have disassembled the game. If there are any particular addresses that seem especially interesting, I can try to track down interactions with those.
Site Admin, Skilled player (1255)
Joined: 4/17/2010
Posts: 11492
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Omnigamer wrote:
I can never find the user file uploads location! Managed to work it back from Scepheo's link, but I have no idea how to arrive there through normal browsing.
Bottom of http://tasvideos.org/
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.
Alyosha
He/Him
Editor, Emulator Coder, Expert player (3826)
Joined: 11/30/2014
Posts: 2834
Location: US
I just recently went back to try to match the RTA world record for game 2. I was able to beat it just slightly with a 49.95. I don't know the programming details of what I changed, I just compared against my old run until I found some improvement. http://tasvideos.org/userfiles/info/42764456087635749