Posts for endrift


1 2 3 4 5 6 7
Post subject: Re: Second live stream results, some notes
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
dwangoAC wrote:
From there I'll need to quickly transition to Sonic Advance, which could be a bit tricky as I won't have an opportunity to test the hardware board until I arrive on Thrusday night. I'll hammer out how to synchronize the realtime run and the camhack run - perhaps endrift has an idea on how we might trigger this, knowing that there are a different number of lag frames on the console variant (I won't be able to get it frame perfect, but I'm hoping to get somewhat close, so perhaps simply doing a 3-2-1-go countdown is fine).
The computer that's playing back input knows when a certain frame is being replayed. It could start the emulator at a certain time, but I'm not sure VBA-rr is scriptable enough to let us do this easily. I can try to ask someone who knows VBA-rr better? Also, I could probably pop up some weekend before SGDQ to try and help preparations. I have a few weekends left. E] Looks like I'm going to have to write some code to do the unpause, and beyond that writing a trigger module doesn't look too bad.
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
tom_mai78101 wrote:
endrift wrote:
Turns out the biggest problem was with VS 2015's macro support, but I should probably be using auto-generated code instead of the macro madness I am using.
That means VS2015 compatibility is possible? :)
I just landed a change that removes the macros that VS 2015 was choking on, and zeromus informs me it's possible to build with VS2015 now. Hurrah!
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
I just pushed some changes that drastically affect timing in mGBA, so I'm probably going to recommend not using 1.10.0's mGBA build for TASing, unless you want to stick to a really early build forever. General gameplay and testing is probably fine though.
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
Hopefully they'll sync with newer bugfix revisions of mGBA every so often. I've not talked to them too much about it, but they might be able to do 1.10.1 at some point in the next few months if there are a lot of bugs fixes in mGBA. I doubt there will be that many core bugs to fix, though. (Although obviously there's at least one here.)
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
I've been told that the sound restoration patch doesn't actually work properly on real hardware due to it using too much CPU. E] I just figured out what the graphical bug is and WOW I'm amazed I never fixed it before. It will be fixed in not the upcoming build, but the one after it.
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
hegyak wrote:
When possible, include what version of BizHawk or mGBA has your issue. So your bug reports can be handled more efficiently. mGBA has been put into Version 1.10.0 of BizHawk. I do have a bug report using the BizHawk version of the emulator. If you load Phantasy Star Collection, then run Phantasy Star, the game's intro cutscene does have a graphical issue. It appears to be rendering incorrectly. It is MUCH better then VBA-Next though. Note the 342. The first image, the 4 Is wrong. On the second, the 3 is wrong. Also you can't see it with these small images but the leafs and bushes are also rendered wrong. Tested against BizHawk SVN Build 9415
Everyone thinks this is a bug, but it's actually intended behavior. Every other frame, it swaps which NES scanline it's rendering in some of the GBA scanlines, so there is some light flickering. The intent is to make it look like there are more scanlines than there are. It's really hard to see on hardware, but I have verified that it happens on hardware, too.
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
I don't know who you are but I got a $1000 donation. Thank you so much!
Post subject: endrift's SGDQ 2015 costs (covered)
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
Hey all! Like dwangoAC, I've made arrangements to go to SGDQ this year, primarily to help present Sonic Advance by using the Game Boy Player Player that I made. Seeing as I got it to sync Sonic Advance on actual hardware, and Sonic Advance TAS was approved for SGDQ, I figured would be a good opportunity to show it off. I have purchased plane tickets and booked a hotel room, and am going to reg for SGDQ soon. Since my primary motivation for going is to show off TASing hardware, per dwangoAC's suggestion, I would appreciate if the community could help pay for my trip at least a bit. I should still be able to make it regardless, but every little bit helps. The costs are as follows:
  • SGDQ 2015 fee: $40
  • Airfare: $437.20
  • Accommodations: $676.10
  • Donations so far: -$1250
Total remaining: $-96.70 I am not asking to have my expenditure while at SGDQ covered. The reason my accommodations are more expensive than dwangoAC's is due to me staying for more days, as the TAS presentation is not my only reason for attending. As such, I have no expectation for all of my accommodation expenses to be covered. If you want to help, please use this PayPal link to donate, or donate to the BTC address 1Jrt1f7s3a4uEGUruFZpjhUGKLDvWYqpaR (PayPal preferred). 15% of all donations will be donated to Doctors Without Borders and 100% of any excess (if applicable) will be donated as well. Thank you list:
  • Anonymous donor (received beforehand): $250
  • I don't know who you are but thank you: $1000
E] Guess that about covers it. $232.20 to charity once SGDQ starts!
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
Me too, tbh. Turns out it's not ALL that hard to get it to compile--if you preprocess the code with a different C preprocessor. Which doesn't exactly equate to running it through MSVS directly, unfortunately.
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
Which version of VBA are you using? Sonic Advance is known to desync between different versions.
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
I'm a bit paranoid about rooming with random strangers, especially when that involves flying out to a city I don't know for a gaming-related convention. Especially considering my brand, of, uh, uniqueness, sometimes doesn't play nice with people who aren't quite as progressive as my friends. I'd want to room with someone who I feel like I can trust, at least at some level, which is a hard thing to get from someone I've never talked to.
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
Looks like my potential rooming plans to try and reduce the cost of me going fell through :/ So unless I can dig up another roommate, or a few hundred extra dollars (D:) I don't think I'll be able to justify going.
Post subject: Re: TASBot block set for Saturday 8-1 @ 2:00 PM EST
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
dwangoAC wrote:
As noted, there will be no console verification planned for this GDQ and my focus remains on delivering well rehearsed commentary on each run. I'll be practicing by streaming on Twitch and I'll let people know when I have things to the point where it makes sense for me to try running through the block to ensure I can do everything on schedule.
That said, I do have an interest in bringing along my GBPP if I can make it to SGDQ, and having already verified Sonic Advance...that might make for an interesting accompaniment. I should be able to tell very soon if I can go.
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
Not in the short term, no. It'd be a lot of effort to fix it.
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
tom_mai78101 wrote:
Indeed. I was about to let you know of Visual Studio 2013 Community and Visual Studio 2015 CTP, with the latter being suggested because of this, by Stephan T. Lavavej - MSFT:
Regarding C99/C11 features: the compiler and library teams will consider them on a case-by-case basis, but our main priority is C++ conformance. For example, since C++11/14 incorporate the C99 Standard Library by reference, 2015 Preview fully supports the C99 Standard Library (with the only omissions being tgmath.h, which requires C compiler magic and is not relevant to C++ which has overloading, and CX_LIMITED_RANGE/FP_CONTRACT which also require compiler support).
I am not sure if mGBA uses tgmath.h, but if it does not, then VS 2015 CTP could be useful.
Turns out the biggest problem was with VS 2015's macro support, but I should probably be using auto-generated code instead of the macro madness I am using.
tom_mai78101 wrote:
I have been reading through the past posts, and have compiled my own feature requests that I feel it is useful for the TAS community. These are just feature requests that mGBA 0.3 or beyond might have, and not specifically be in 0.2.X. 1. Allow inputs be recorded through keyboard keys. It is the same scenario where when recording a movie and you hold down a button on a gamepad and then you frame advance, that held button input event will be recorded to that frame. (I am pretty sure that this may be backlogged in your feature suggestion list, but I can't seem to find it.) 2. Show a counter in this format (Again, not sure if it's backlogged already.): [Current frame] / [Total count of frames emulated/created] / [Dropped frames count due to lag] 3. Being able to set a new hotkey to bind the action of frame rewinding, 1 frame at a time, and not call it "Rewind", like other emulators would call it. (Just pedantic about the labeling.) That's all.
I'm not really sure what 1 is about, seeing as that seems to be pretty standard? If it's what I think it is, it's been implemented for a while. 2 is backlogged on when I can make a HUD. I've been having trouble with that for a while now. I added a "Step Back" function that steps back one rewind increment, but there are some syncing issues with it. Moreover, rewind is disabled with RR at the moment due to how it would work with savestates. It would leave a huge mess of files on the drive at the moment.
tom_mai78101 wrote:
Have you drafted and finalized the file format mGBA is going to be using? Or you are referencing other file formats, such as the BK2 format and implement to support them for the TAS features? The reason I asked is mainly due to a thought that just popped into my head. Would future TAS emulators supporting already working and existing movie file formats for compatibility among different emulators be viable in the long run?
I did not reference other formats in the process of designing the MGM format, and as a result it is VERY different. It is a tagged format, so each frame is delimited by tags with one or more inputs per frame, and various more tags can be added. Moreover, movies are separated out over multiple files while recording to allow a sort of git-like branching system. I haven't implemented any way to garbage collect or compile these though, so it's rather limited at the moment. I'm guessing almost no other emulators would be interested in a similar file format, given what I've since observed.
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
Hmm, I haven't had an original model DS in years. The Lite has a switch instead of a button so it doesn't work quite the same. It's probably a soft reset, then, as you said.
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
Adding another reset or delaying the reset would result in the exact same value, as the reset is what sets the value. It's impossible to reduce the number of frames between the reset and the RNG seeding without destroying sync :(
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
Warp wrote:
(The power button of the DS returns to the home screen, but it might just act as a soft reset button...)
It only does this on the 3DS. The original DS just shuts off, i.e. a hard reset. While the ARM processors in the DS do have protection modes, I'm under the impression that they aren't really used as they would be in an OS until the 3DS. The DS itself is still pretty bare-bones from the firmware side. Moreover, these registers are explicitly meant to be used from game code, so trapping on those registers A) wouldn't make sense to be a thing to be explicitly supported and B) would trap into the reset vector, which, if the DS is anything like the GBA, is in memory that can't be written. The most feasible approach, actually, would be to hook the input processing routine, but that would need to be determined per game, and injected into the ROM either via an Action Replay-like system or via a flash cart with a modified ROM. But doing any sort of processing, especially, say, buffering input off of a high-latency device such as an SD card in the flashcart, could dramatically alter timings, thus potentially changing if the TAS would actually sync. So even if it can be done, it would break timings. But the only real way to do it would be to patch the ROMs with per-game patches.
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
Warp wrote:
Would it be even possible? The game would run natively on the system, and the input would have to be somehow fed to it... I suppose that depending on how the DS's OS is designed, this could be achieved with some device driver or custom OS (but it would, of course, require for the OS to be hacked. Depending on how well the DS is designed this can range all the way from trivial to almost impossible.)
DS games don't run in a mode that really has an operating system to speak of. It's pretty close to bare metal. Input is read by talking to memory-mapped I/O registers directly. This isn't possible to change or hook without hardware modifications.
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
You pulled out the term NP optimization first :P Although yeah I suppose the problem isn't likely to be in NP, due to the fact that it's impossible to verify in polynomial time if it's optimal. I'd have to look up NP-hard first to even concretely say if it's that, I guess.
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
To be more specific, TAS optimization is reminiscent of the knapsack problem, and given the similarity I'd be inclined to say that TAS optimization in the general case is definitely NP-complete. There would certainly be games where the specific subset is in P, but most would be NP-hard. That said, approximating a solution and optimizing should be possible below O(2n) in general, but it won't be OPTIMAL most of the time. Incidentally, P vs. NP is one of the millennium prizes mentioned in the first post, so if P = NP, then it might not be as hard as we thought :P
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
It's [1665] GBA Sonic Advance by Mukki in 10:46.52. I tried with the Amy run, but it uses the reset already so I can't fiddle with the RNG.
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
So yes! I got full sync working on the GBPP, and the process involved was a bit more...complicated than I'd thought it would be. Several things were necessary: First, I had to insert a frame before "press start" as it was pressing start too soon. Second, I had to insert three frames at the end of every level. I eventually realized that this was due to the time taken writing to flash. This seemed to get every act synchronizing fine, up until Casino Paradise's boss. It was an RNG-heavy boss, and the seed was wrong. At that point, I basically gave up. Until Zeupar gave me some information (from FatRatKnight) on how the RNG works. It turns out it's a linear congruential generator, so if I could predict the seed and how many times it was incremented, it should always be the same. Right? Well, I modified mGBA to incorporate the "realistic" flash timings and discovered that the RNG state is identical right up until the boss. But that's when it does something nasty: it reseeds the RNG with the number of frames since the game restarted. And the emulators were running too fast, so the number of frames that had ACTUALLY gone by was too high; I couldn't just subtract frames to decrease that seed. Right? Wrong. Reseting the game by pressing A+B+Start+Select actually resets that counter, but skips the intro as well, causing it to have a frame counter of approximately 740 less at equivalent points into menuing. Turns out that approach also saves frames overall (as seen in the Amy run), but it was NOT done in the Mukki run, which let me abuse it. The problem was...I didn't know what the exact state that frame counter would be in when it was at equivalent states in the game. And that number had to MATCH when it reseeded the RNG for every next boss to sync (since it only reseeds once). These wait frames could easily be inserted during menuing to prevent any side effects, but they had to be done after the reset. Well, 740 states is a bit much to work through by hand, so I wrote a bot to try all of them. It took 5 minutes per attempt to get it to sync the Casino Paradise boss again, but it turns out that that wasn't enough to get later bosses to sync--it only needed two good values in a row, instead of all of them. So that was 83 frames of wait right there--already almost a second and a half. But then I needed to get the NEXT boss to sync, which meant all subsequent tries had to take more than six minutes. (I was using 386 seconds as my test length.) I only had to review a few seconds of each run, but I still had to play that much back on hardware. This would take upwards of three days. After about 300 tries, I decided to reverse the search to start from the end of the domain and work backwards. But at 629 additional wait frames (for a total of 712 wait frames, more than 11 seconds), the next boss synced. And after adding the three frames per stage, so did the next one. And the next one. And adding two frames for the final stage instead of three, the whole game synced. The run is overall quite a bit longer due to waiting during menuing, but the core TAS has not changed. Each stage still has the same timer at the end, except for the final boss, which is .12 seconds longer (and I don't know why). But here we have the first console-verified Game Boy Advance TAS, Sonic Advance by Mukki. And a big thanks to FatRatKnight and Zeupar for giving me enough insight into the RNG to bring this verification back from the dead. Without it, I wouldn't have known how to manage the RNG! P.S. There's a pretty good assortment of outtakes from the botting that I'll probably composite into a 5-second-per-clip sequence when I get a chance. Onwards to Sonic Advance 2, I suppose!
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
I'm just gonna leave this here. Link to video I'll post a full explanation of all the changes I had to make, and why, tomorrow. (I can try to take a video of it on a TV sometime soon, but I don't have a tripod or anything so it will be very shaky-cam.
endrift
Any
Emulator Coder, Experienced Forum User
Joined: 12/14/2014
Posts: 161
I updated the readme. mGBA is written in C99, which afaik is still not properly supported in Visual Studio, potentially even in 2015. I've been told that it may be able to be made to compile, but I don't plan to purchase a copy of Visual Studio just for this purpose, and trying to do it by proxy can be difficult. E] I did not realize there is a free version of Visual Studio. I may take a look at that when 2015 comes out proper.
1 2 3 4 5 6 7