Posts for Alyosha


Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
^ That's bad. It shouldn't even be possible. Also it looks like there is a state error in mGBA. Start TAStudio, advance some frames, hit '<<', game won't load.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
Case by case basis seems fine to me. Maybe just change this:
Due to this, PAL versions of ROMs are generally not allowed, unless there are significant technical and/or entertainment merits to using this version.
to this:
Due to this, PAL versions of ROMs are generally not allowed, unless there are significant technical and/or entertainment merits to using this version, or there is strong audience support.
To keep things simple and consistent, just publish PAL seperately. I'd don't think any rule should be tied to the tier system.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
I have completed a new, more accurate in game time analysis here: http://tasvideos.org/forum/viewtopic.php?p=458702#458702 The new runs include time savings in 8-1 and 8-2, and use the vine in 4-2 to save in game time. They also remove all pole clips to save in game time. overall PAL is faster by 0.9 seconds or 0.4 seconds depending on how you count the pipe transitions in 1-1.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
I have completed the new in game time analysis. PAL is faster by a significant margin (in Super Mario Bros terms anyway.) NTSC: http://tasvideos.org/userfiles/info/41604061717252503 PAL: http://tasvideos.org/userfiles/info/41604073283198421 Spreadsheet can still be found here: https://docs.google.com/spreadsheets/d/149PjFfAayZw1i_jR3Kew3OA930r5P-v7rz5EI6r4XHw/edit?usp=sharing If anyone has any other ideas feel free to suggest them but I think this is pretty conclusive.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
^ About the same as the current one. (But I believe your new condition statement is incorrect, as state and state_c never have the same bits set.) So to summarize so far: - putting failing condition first is the biggest improvement - bool to int is also a noticable but smaller improvement - look up table has a negative effect - everything else has more or less no effect
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
I had actually tested the look up table earlier but it is slower by a LOT. I guess I could try with unsafe too but it's not worth it just for that. I also tried stringing together '?' operators but that had only marginall effect. I also tried just replacing the switch with ordinary logic elements but that wasn't much faster either. Overall it's currently ~30% faster then when I started, and I guess that's about as fast as it's going to get. It doesn't matter much for this case but I thought I could learn something more from it since it's so simple and obviously slow. Oh well though, too much other stuff to do to get hung up on it. EDIT: I tried your (Sour) other suggestions but they didn't result in improvements. Thanks for coming up with things to try though.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
Ok, I added a volume slider under NES->Sound Channels. Minimum setting (1) should match current NESHawk uadio. Maximum setting (10) should be 3x louder. Please try the dev build and let me know if it's enough.
Post subject: Re: NESHawks Audio
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
FadeToBacon16 wrote:
Hello BizHawk developers, I just wanted to ask if you guys can please turn up the overall volume on the NESHawk's Emulator Core. I love the Emulator, it is great. It is just that the overall Audio volume is low, I turn up the volume on my computer to the max for my head phones and it is still kinda low. Thank you for your time.
Hi, the sound seems normal to me. Check the following settings and make sure they aren't turned down: Config -> sound make sure volume is turned all the way up. Does QuickNES Sound soft as well or only NESHawk? How about other cores (i.e. SNES) ?
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
Andypro wrote:
I would posit that it's the sheer number of function calls to Bit() that eat away at performance. Can you run a disassembler to determine if the JIT compiler is inlining those calls? If it isn't, you could try the AggressiveInlining attribute that was mentioned in the NesHawk thread. I haven't done a huge amount of performance optimization in C#, but it's pretty fascinating.
Tried aggreisve inlining, no effect, probably the compiler already does it. Tried removing the Bit call altogether and just using explicit statements like (value & 0x200) > 0, no effect. Tried changing to integers and rewriting the logic. Small but positive effect, not sure it's worth the reduced clarity. But the most effective change was putting the condition most likely to be false first in the 'if' statement later on in that function. >___> I guess I need optimization 101. EDIT: Here's the complete thing if anyone sees anything obvious. According to performance profiler, this tiny block takes about 1/4 as long to run as the entire CPU function 0_0. So something about it must be super slow:
		public void tick_2()
		{
			divider_reg+=1;

			// pick a bit to test based on the current value of timer control
			switch (timer_control & 3)
			{
				case 0:
					state = divider_reg & 0x200;
					break;
				case 1:
					state = divider_reg & 0x8;
					break;
				case 2:
					state = divider_reg & 0x20;
					break;
				case 3:
					state = divider_reg & 0x80;
					break;
				default:
					break;
			}

			// And it with the state of the timer on/off bit
			state_c = timer_control & 0x4;

			// this procedure allows several glitchy timer ticks, since it only measures falling edge of the state
			// so things like turning the timer off and resetting the divider will tick the timer
			if ((state == 0 || state_c == 0) && (old_state > 0 && old_state_c > 0))
			{
				timer_old = timer;
				timer+=1;

				// if overflow, set the interrupt flag and reload the timer (4 clocks later)
				if (timer < timer_old)
				{
					pending_reload = 4;
					reload_block = false;
				}
			}

			old_state = state;
			old_state_c = state_c;

		}
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
8-2       | 10979  12475    1496  24.892

8-2       | 10979  12363    1384  23.029
It seems myself and MrWint measured time slightly differently, but there is no disagreement that the time saved in 8-2 is 112 frames. The 2.379 seconds does seem to be in error, more likely 1.863. I really think at least this much should be corrected in the notes so as not to mis-inform people who might read it later. Even if it's not relevent to the judgement, it's still a statement by a judge attached to a player's submission, so it should be as accurate as possible.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
I didn't realize you only had just a couple of days to prepare for this DwangoAC, I never checked the date and just assumed it was at least a couple weeks away. Under the circumstances I think that went very well, nicely done. Sorry Battletoads gave you so much stress thuogh, I guess True has the magic touch for that game. Aside from that have you followed the recent Atari 2600 Dragster discussion at all? There's some real interest in having console verification of some A2600 runs. I'm not sure it's interesting enough for any kind of event, but it might raise the profile of TASBot a bit in some other circles. Just a thought since it's current.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
creaothceann wrote:
Is that line using bit masking and shifting? You could also store each emulated bit as its own boolean.
Yeah it does this:
public static bool Bit(this byte b, int index)
		{
			return (b & (1 << index)) != 0;
		}
It also seems like Bools are just slow altogether, not sure.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
Since I had some time today I decided to see if I could get the last graphics bit, windowing, working. As it turns out, I really should only try to do one thing at a time, because a large chunk of the time I spent on this was just trying to remember what the heck I was doing. In the end though it worked just fine. This scene from Mega Man 5 is actually pretty challenging to get right graphically, so it's a good sign that things are working well: A few more small timing things to clean up and it will be time to start audio. I also did some performance analysis, since this core runs much faster the NESHawk while not really having that much less to do, to see if I could learn anything from it. One thing I did learn is that statements like this:
state = divider_reg.Bit(9);
are really very expensive. Maybe knowing that can help me speed things up in other places.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
Nach wrote:
I picked a spot before the staircase a bit prior to where HL slows down, as an easy to notice spot. I then went through a bunch of previous movies for the game, looking for the one which did the staircase to flag fastest. Once I found the fastest, I added the time from that point to the time I calculated for HL till that point, and then subtracted that from HL's overall time. That's the thing, if you're aiming for fastest possible playable time don't do the glitch at all, as the glitch trades playable time for real time.
Which movie did you choose? I don't think I missed anything (I mean, I just had to run up the bricks) but I'd like to be totally positive. Good point. I went back did a test run and saved 46 frames in NTSC climbing the vine and 30 in PAL. It's surprising how little in game time this saves, but when Mario needs to jump in place it seems like it takes an eternity to do so. But, I also went back and saved the frames in 8-1 in PAL and turns out to be more then I expected at 12. This is net savings for NTSC of 46 (0.766s) and PAL of 42 (0.84s) so the net result is that NTSC is even further behind then before. (I'll post some movies maybe tomorrow when I have time to do things more carefully.)
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
SaxxonPike wrote:
It also occurred to me we lack a soft and hard reset. That's priority one. Followed by getting better disk and tape support. We still have quite a few games that aren't loading yet.
This reminded me Saxxon, that interrupts need a second look as well. I ran into trouble with the game MoonDust, which was doing some non-standard stuff with interrupts. The fix was simple but it took me a very long time to realize what the problem was. See this commit: https://github.com/TASVideos/BizHawk/commit/f99f9847b43d7ec51899ef65b91443e14e56b1a7 I didn't check for consistency in the other interrupt sources, so it's possible some issues are related to that. Also porting reSID would be good so my hackish FFT stuff can be removed.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
^ This isn't a proper analysis quite yet, I want to be a bit more precise first. To that end, I went back and did actual in game time runs of both NTSC and PAL (and by that I mean I removed the flagpole glitches and didn't slow down in 8-2.) Here are the runs: NTSC: http://tasvideos.org/userfiles/info/41492604435603477 PAL: http://tasvideos.org/userfiles/info/41492581593396446 I updated the spreadsheet with the new information, see the IGT tabs. Right now, NTSC has a long way to catch up. I didn't try to improve 4-2, so maybe a little time can be saved there, but it looks like roughly the same time is lost in bot NTSC and PAL so I doubt it will improve much. I also didn't change the obvious places in 8-1 PAL where HappyLee slowed down to hit some shells. If we count pipe transitions in 1-1 as non-playable, NTSC has an almost insurmountable 0.65 seconds to improve. Things are little closer if we don't include them, with only 0.24 seconds between them. If anyone understands the vine glitch in 4-2 better and can improve the runs there that would probably be the biggest place to improve the accuracy of this comparison.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
I still want to know which is faster in game time, PAL or NTSC version. So I started doing my own analysis. The first thing I checked was about how much time could be saved in 8-2 in both versions. NTSC: http://tasvideos.org/userfiles/info/41479089906232102 PAL: http://tasvideos.org/userfiles/info/41479114334607148 I'm not HappyLee, but I managed to save 112 frames in the NTSC version and 17 in PAL. Or 1.86s in NTSC and 0.34 PAL. Surprisingly that spring doesn't add up to much (or maybe I'm just bad.) I don't know where Nach's original estimate of 2.37 for NTSC comes from, so if I'm missing something someone please fill me in. Overall so far that adds up 1.54 seconds gained in NTSC. I'm in the process of making a table for the other level times and will edit this post when I'm done. EDIT: Here it is: https://docs.google.com/spreadsheets/d/149PjFfAayZw1i_jR3Kew3OA930r5P-v7rz5EI6r4XHw/edit?usp=sharing My times came in a bit under Nach's original estimates , but roughly by the same amount for both NTSC and PAL. An important note here is that these are only times where you can control Mario, the game accepts inputs (i.e. pause) for much longer then that. I also included the time you have to hit start at the beginning of the game. This is only a first order analysis, as I didn't try to find where HappyLee wasted a few frames here or there in PAL, but unless significantly more time can be saved in 8-2 in NTSC, it's unlikely to be faster. If anyone has anything to add please let me know.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
Inzult wrote:
I did, in fact. I got the same result. I don't know what I'm missing. At this point, my plan is to just fix the Fighting event and call it a TAS.
Ah, oh well. It looks like the first enemy in swimming in the nico video doesn't take any damage on the first hit (takes 2 kicks to kill him) are you able to reproduce that at all? Weird. (I tired briefly but couldn't do that either.)
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
Inzult wrote:
Alright. I don't understand how that other TAS gets such long combos in swimming. I'm probably missing something obvious, but I can't get the opponent to not get stunned as soon as he runs out of oxygen. Does anyone have any insight?
Any progress on this? It may sound obvious, but did you try the (J) version to get the swimming combos?
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
I just finished making NEShawk run in single PPU ticks. This should allow for future improvements such as debugger support. That won't be happening any time soon, but it needed to be done at some point so I wanted to get it done before going more in depth into optimization. The change only had a small negative impact on general game play performance, which I found surprising. What wasn't surprising though is the negative impact on TAStudio performance, since I had to increase the state size considerably. But I guess if you're running TAStudio you don't need to be running that fast anyway. I'll be stress testing the changes over the next couple days to make sure everything still funcitons correctly and see if any new optimizations are possible. All test ROMs still pass and my standard Battletoads run still syncs, so in terms of accuracy at least everything seems fine. Over time I want to make every in house core work this way, and this case was relatively painless so I might work on that sooner rather then later.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
Somehow I don't think I never noticed the original run. I laughed at the character falling when the bridge exploded, that's a silly re-use of existing animations. I also really liked the screen transitions this game has, I don't recall seeing that elsewhere. Voting yes, nice run (even without the pending improvement.)
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
Warp wrote:
On what basis it is determined that two consoles are the "same" console? On what basis it is determined that two games are the "same" game? Are the NTSC and PAL versions of the NES the "same" console? They are not identical, as there are differences in the hardware. Even the CPU's and PPU's aren't identical (as seen eg. here). They may be very similar, but not completely identical. Eg. their clockrates are different, among other things.
At least for NTSC vs PAL, there are some real differences. There are games (e.g. 'Huge Insect') that rely on glitches in the NTSC ppu that were fixed in the PAL ppu. Thus a direct port of the game only accounting for timing differences would not work in PAL. Beyond that, a large number of PAL demos would not work (or be heavily glitched) if directly ported to NTSC due to relying on behaviour that is different between the two regions. Aside from that as well, the infamous DMC glitch was fixed in the PAL NES. The somewhat large number of errata fixed between NTSC and PAL might be unique to the NES, I don't really know, but it does put it in an interesting situation to decide whether it's the 'same' or not.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
Nach wrote:
Good thing the timing analysis was under the section labeled NTSC vs. PAL in practice -> This game in particular and not under Judgment.
Not really, incomplete / innacurate analysis doesn't belong there, either. Having said that, I'm interested enough in the real answer here to try to work it out myself. I won't promise anything immediate, but I'll try to look at some initial stuff this weekend and post it in the game thread. Loose ends like this kind of bug me.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
Nach wrote:
I also raised questions that it's hard to estimate some of it due to a variety of factors.
You did? Where? I only see the part where you said you might be off by a frame either way. Given Hebrano and HappyLee's statements, the timing analysis seems incomplete and certainly not conclusive (and may even be incorrect.) If it doesn't factor into the judgement, I think it's better to remove it.
Alyosha
He/Him
Editor, Experienced Forum User, Published Author, Expert player (3536)
Joined: 11/30/2014
Posts: 2733
Location: US
Ok I see what you are saying now. We see this issue in very different ways. I don't think having in-game conversion comparison is much use without consistent cross obsoletion. The simple solution would be to just publish PAL seperately, which I think is a good option as well. EDIT: And I think not publishing PAL at all would be a bad choice.