Posts for FractalFusion

Post subject: why is my name even in this submission
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
Anyway, for those who are wondering why I'm included as an author in this submission at all, I'll try to give a brief explanation (Warning: this is going to be a long post regardless, and it involves a lot of math!): My involvement is limited only to solving the "Lucky Draw" level. I have no other expertise regarding this game. For that, you will have to ask Walgrey. The gimmick with Lucky Draw, and the sole reason I am involved at all, is because of how Lucky Draw works: It is a level whose success is determined only by RNG value, and nothing else (such as player input). It also has an extremely low probability of succcess: (63/64)^788 ~ 4.08x10^-6, or about 1 in 250000. (BTW, I have no clue what "800 triggers" means, but I do know there are exactly 788 checks for player death. Hence the (63/64)^788 probability of success.) So this got the math gears turning in my head, but to spare you all the details: I created a Game Resources page with the information on how Lucky Draw determines whether an attempt is successful. I have also uploaded a Lua script. Anyway, my involvement: Walgrey already had a TAS that completed everything except Lucky Draw, and was running a BK2 after end of input, with the hope that Lucky Draw would eventually succeed after hundreds of thousands of attempts (that would be an encoding challenge!). As far as I know, Walgrey only got to attempt 120000 or so. It turns out (after coding a few Lua and C++ scripts) that the RNG value Walgrey had was not ever going to succeed, instead entering an infinite loop that repeats every 9722 attempts starting at attempt 2033. In fact, I found out a couple interesting things: - There are exactly 1584919 values (out of 4294967295 possible) that allow for an eventual success. All successful values take no more than 228 attempts. Exactly 17726 of these values result in a success on the first attempt. - Unsuccessful attempts end up in one of six possible infinite loops. The vast majority of values enter an infinite loop of period 9722 (of which hexadecimal value 0x63AD9C9E is one of the values in the infinite loop). Other possible infinite loops are: Period 204 (0xEA0347AF), period 121 (0xC7BA5605), period 79 (0xB6C0AF7A), period 1 (0x3D95930E), and period 1 (0x3F4AEF39). The period 1 values look silly. If you are wondering how I came to that conclusion, here is a package containing all the Lua and C++ files I used: https://www.mediafire.com/file/7bcxk0lo9fqhkkl/famidash_alac_challengefix_LD_fastest_completion.zip/file In particular, in order to determine the 1584919 eventually-successful values, I had to make all kinds of optimizations to the C++ code, even using bit matrices for calculations. (For comparison, running a Lua script over all 2^32-1=4294967295 values would have taken thousands of years.) The key things I noted is that: 1) Whether an attempt is successful is only based on the RNG value at the start of the attempt, and on nothing else, 2) The RNG value upon death is the RNG value that is used for the next attempt, 3) Because of how the procedure works, the RNG value upon death is extremely likely to be one of 2^26-1=67108863 values, about 1/64th of all possible values. This means that it is only necessary to set up a tablebase on these 67108863 "bad" RNG values (much like how chess has endgame tablebases for positions involving a small number of pieces). I chose a size of 2 bits for each "bad" RNG value, resulting in a table requiring no more than 16MB of RAM. (The bits are used to classify each "bad" value, whether it is eventually-successful or enters an infinite loop.) From there, I simply simulated in C++ each of the 4294967295 values until it hit a "bad" value in the table (very likely after the first attempt), allowing me to find all eventually-successful values without having to run all attempts to exhaustion. The total runtime was around 3 hours and 15 minutes (it may be possible to optimize this further, but I decided this was OK) and the 1584919 values are dumped into a TXT file which I included in the package. So Walgrey's RNG value didn't work, but how can we find the smallest number of inputs needed to get to a value that does work? I made a Lua script (in the same package that I posted above) that solves for this value (using the TXT file with the 1584919 values). Note that this involves entering and quitting out of Lucky Draw first, in order to mix up the RNG with the "rand1" function. The resulting value I found is successful on attempt #64. Now, if you don't like that the actual completion of the level occurs 8 minutes after end of input, I did include a "fastest completion" BK2 file (in the same package again) that optimizes for fastest completion. I used the same Lua script but this time only with the 17726 values that succeed on the first attempt. The resulting BK2 only takes 36 frames longer until end of input. Is it improvable? Since the "rand1" function is used in at least one other level, it may be possible to change the timing of when you enter previous levels, and get a better RNG manipulation at the very end. However, I am not interested in going that far, and I doubt anyone else is either.
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
Sorry, eien86. The Arkanoid TAS raised the bar so high that 5 Lunar Pool TASes are boring in comparison.
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
Nice, you did a run showing off all the levels! I actually made a TAS of the very first Sonic ERaZor (not Sonic ERaZor 8 which is this version of the game) but it wasn't very good, so I didn't post it. I see that Sonic ERaZor 8 has a huge number of changes compared to Sonic ERaZor, some of which are better for speedrunning/TASing (Unreal Place is way faster in 8, for one), so I'm fine with the changes Sonic ERaZor 8 made.
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
This game benefits from having a camhack encode or something (if it were possible). The TAS is very difficult to follow even though I have played this game before.
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
McBobX wrote:
Well, the delay is in how the emulator responds to an input. For example, in Octoshock 2.8, if you press X to jump, it will only take 2 frames for the animation to appear on screen, while in later versions or Nymashock, it will take 3 frames.
I tested again as follows: Load "Mega Man X5.cue" (not bin). From Reboot Core, enable frame count and input display, go straight to the intro stage (starting game and clearing all dialogs to get player control), don't move until the emulator says on screen frame "4676". Press "X" and frame advance at the same time, so the display now says "4677 X". Hold "X" and press frame advance until the player first goes into the jumping animation. I tested both cores, both player characters X and Zero. In all cases, I found that the player goes into the jumping sprite when the emulator says "4680 X". That is, I found it takes 3 frames for the animation to appear in all cases I tested, being unable to find any difference between the cores or the characters. For reference, the emulator's About screen says that the version of BizHawk I am using is "Version 2.8 (x64) (GIT HEAD#e731e0f32)" and "Version 2.8 (x64) February 19, 2022". Not saying that emulator differences in input don't exist, just saying that I am unable to replicate them.
HappyLee wrote:
Unfortunately my issue in that topic hasn't been solved, so I have no choice but to do X5 TAS this way.
You may wish to consider the likelihood, that in fact BizHawk 2.10 is the emulator with correct emulation of input latency, and previous versions of BizHawk are inaccurate. General consensus is that later emulator versions means the emulator is more accurate, so if you are saying that BizHawk 2.10 is less accurate, you will need to convince the developers in that topic that BizHawk 2.10 is inaccurate. Otherwise they won't believe you.
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
HappyLee wrote:
FractalFusion wrote:
Regarding the topic https://tasvideos.org/Forum/Topics/26020 , you mentioned that there was a one-frame input delay of some kind. According to the submission notes, you used BizHawk 2.10. Did the one-frame input delay have any effect on the TAS?
I actually did this TAS with BizHawk 2.8 Octoshock (no delay), and then resynced it with 2.10.
Can you upload your BizHawk 2.8 Octoshock (no delay) TAS, for comparison purposes? I would like to understand what you mean by "no delay", because I tested Mega Man X5 on both cores in 2.8, and I was unable to find a difference so far.
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
Hi HappyLee. Regarding the topic https://tasvideos.org/Forum/Topics/26020 , you mentioned that there was a one-frame input delay of some kind. According to the submission notes, you used BizHawk 2.10. Did the one-frame input delay have any effect on the TAS?
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
HappyLee wrote:
FractalFusion wrote:
Since this TAS was made with BizHawk 2.8 and the previous TAS with PSXjin, I made a semi-comparison encode to show that the run is around 995 frames (16.5 seconds) faster:
I didn't check your comparison video stage by stage, but here's a part of things you're missing:
Oops. Oh well, I kind of tried. (But not hard enough, apparently.)
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
Not my encode, but AmaizumiUni posted this on nico (edit: the posted encode is apparently a previous version of the TAS in 38:19.78, not 38:08.53 like this submission) Link to video
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
Since this TAS was made with BizHawk 2.8 and the previous TAS with PSXjin, I made a semi-comparison encode to show that the run is around 995 frames (16.5 seconds) faster: Link to video The metric I used was: 1) Area that ends in fadeout (first area of most stages) * Timing begins on first frame of control after READY (except Jet Stingray stage where timing begins on fade-in). * Timing ends on fade-out. 2) Area that leads to a boss fight (second area of most stages) * Timing begins on first frame of control after READY (except Jet Stingray stage where timing begins on fade-in). * Timing ends on last frame of control before WARNING (or last frame when touching final boss door before WARNING). 3) A boss fight. * Timing begins when boss meter fills to full. * Timing ends on first movement frame (not a delay frame) after boss meter reaches zero. My metric is not necessarily more accurate than HappyLee's measurement of 1245 frames; I simply made this video in order to show that this is an improvement over the previous TAS. Note that BizHawk has far more lag frames on loading screens, boss explosions, and voiced lines by bosses, compared to PSXjin.
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
By the way, I noticed in the input that the TAS starts with the code Right-A-Down-B-Left-A-Up-B was used at the beginning of the TAS to speed up the ball by 50%. I guess in-game codes are allowed now? (Also, what does "warpless" even mean?) Interesting that this game has "Left" and "Right" choices for the levels. Also the powerups break the game, as you can see in this TAS. Similarly to before, I made a 1080p60 encode with paddle controller input display: Link to video
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
Finally there is a TAS of Pokemon Black/White submitted to this site. (If you recall, Kaphotics made a TAS of Pokemon White in about 3h19m, almost 13 years ago, but refused to submit the TAS to this site.) Thanks for the submission info. I like the tricks in this run. Also, the RNG having such a complicated seeding algorithm is weird, but we're talking Game Freak here. I resent the fact that the game just has to throw evil team grunts at you over and over, and that's even with 6 of their "mandatory" battles skipped using dust clouds.
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
By the way, if you're wondering how I made the input display part of the encode (the left sidebar with the line-art paddle controller graphic), I generated the input display with a Lua script in BizHawk:
local joystick_posy=550
local fire_posy=300

local controller={}

gui.clearGraphics("emucore")
gui.clearGraphics("client")
gui.use_surface("client")

function circlebyradius(cx, cy, radius, col1, col2)
	gui.drawEllipse(cx-radius, cy-radius, 2*radius, 2*radius, col1, col2)
end

gui.drawBox(0,0,256,224,0xFF000000,0xFF000000,"emucore")

while true do
	console.clear()
	gui.drawBox(0,0,256,700, nil, 0xFF000040)
	gui.drawBox(20,220,256-20,700-20)
	gui.drawLine(123,220,123,0)
	gui.drawLine(133,220,133,0)
	circlebyradius(128,joystick_posy,80, nil, 0xFF000060)
	
	local prev_value=controller.Paddle
	local prev_fire=controller.Fire
	if not prev_value then
		prev_value=80
		prev_fire=nil
	end
	controller=joypad.getwithmovie(1)
	
	local pangle=(math.pi/180 * (180.5+(prev_value-80)*160/80))
	local angle=(math.pi/180 * (180.5+(controller.Paddle-80)*160/80))
	
	gui.drawLine(128,joystick_posy,128-80*math.sin(pangle),joystick_posy+80*math.cos(pangle), 0x40FFFFFF)
	gui.drawLine(128,joystick_posy,128-80*math.sin(angle),joystick_posy+80*math.cos(angle))
	gui.drawBox(127,joystick_posy+3,129,joystick_posy+77,0x8000FF00,0x8000FF00)	
	if controller.Fire then
		circlebyradius(128,fire_posy,30, 0xFFFF0000, 0xFFFF0000)
	elseif prev_fire then
		circlebyradius(128,fire_posy,30, 0xFFFF0000, 0x70FF0000)
	else
		circlebyradius(128,fire_posy,30, 0xFFFF0000, 0x20FF0000)
	end
	
	emu.frameadvance()
end
Then (separately from a normal encode of the TAS) record AVI with the options "Capture OSD" and "Capture Lua" enabled and do some editing with something like AviSynth. I didn't explore all the Lua gui options so there might be a better way to set this up.
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
Submission Text wrote:
todo
no need, the video explains itself
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
I like how the Arkanoid paddle controller actually improves the TAS. 1080p60 encode, with input display: Link to video I recommend viewing at 720p60 or above, since the "entertainment" effects don't show up on 30-fps settings.
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
Hm, I've never tried buster-only before. Just note that if you have trouble with the RNG, you can use this Lua script: https://tasvideos.org/UserFiles/Info/638585240848962683 (change "local game=7" to "local game=1"). Other notes: * In general, wall dragging can be used for RNG manipulation. * If you need to manipulate Storm Eagle, you can wall drag along the right side of the platform. * Bospider: I found a file I made 10 years ago, if it helps: https://www.mediafire.com/file/r74xxonx492n4uc/bospider2.txt/file . Note that 0-crossing RNG values are rare. (Bospider is awful but you'll have to deal with it.)
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
Thornstrom wrote:
Yes, one can edit it in post. But then it has to be re-encoded which means some quality loss, so it would be better to be able to remove it when it's generated.
As a regular AviSynth user, I generally only use lossless codecs prior to the final encoding run, so that there is no quality loss during editing. This is just a side note.
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
OmnipotentEntity wrote:
For this second one, find all solutions in the Reals, prove you have all of them.
Nice that this is a Diophantine problem in disguise. Since |cos(anything)|≤1 and |1/sin(anything)|≥1, the equality can only possibly be true if cos(88*pi2/x) = ±1 and sin(3x) = ±1. sin(3x) = ±1 when 3x = pi/2 + pi*n, or in other words, x = (1+2n)*pi/6. Note that sin(3x) = +1 when n is even, and -1 when n is odd. cos(88*pi2/x) = ±1 when 88*pi2/x = pi*m, or in other words, x = 88*pi/m. Note that cos(88*pi2/x) = +1 when m is even, and -1 when m is odd. So x is a solution if and only if x is both of the form 88*pi/m and of the form (1+2n)*pi/6, where m and n are either both even or both odd. So we have: 88*pi/m = (1+2n)*pi/6 88*6 = m*(1+2n) m*(1+2n) = 11*3*24 Since 1+2n is always odd, it follows that m is a multiple of 24, and so m and n are both even. Then 1+2n must be a divisor of 33 (positive or negative) that is 1 mod 4, and now we can list the possibilities for 1+2n: 1+2n = 33: n=16 and m=16, x=11*pi/2 1+2n = 11: no, not 1 mod 4 1+2n = 3: no, not 1 mod 4 1+2n = 1: n=0 and m=88*6, x=pi/6 1+2n = -1: no, not 1 mod 4 1+2n = -3: n=-2 and m=-88*2, x=-pi/2 1+2n = -11: n=-6 and m=-48, x=-11*pi/6 1+2n = -33: no, not 1 mod 4 So there are exactly four solutions for x: x=11*pi/2, x=pi/6, x=-pi/2, x=-11*pi/6.
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
OmnipotentEntity wrote:
Instead of solving explicitly for x, it's easier to square x + 1/x to get x^2 + 1/x^2 + 2 = 293. Notice that the goal formula reduces to x - 1/x, and if you square that you get x^2 + 1/x^2 - 2, which is 293 - 4 = 289 from our above formula. Then just take the square root of 289 = 17.
I did eventually get to answer=17 through some algebraic manipulation of my own, but this method works as well. Although I was thinking of why OmnipotentEntity had the multiple choice in the first place. I mean, I was very tempted to go with the following "solution": With some algebraic manipulation similar to before, logba + logab = sqrt(293) and the goal is to find logba - logab. But a>b>1, so logab is clearly between 0 and 1. That means the answer is between sqrt(293)-2 and sqrt(293), and the only number in the multiple choice list that fits is 17. Therefore the answer is 17.
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
Comparison encode (1080p60) with previous publication: Link to video
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
Link to video Sorry for the low-effort encode. I also threw in video of the previous version just for comparison purposes.
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
Are there any plans to make a glitched version? That might be interesting.
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
MUGG wrote:
I noticed the lua console said "Message Cap reached, suppressing output" because of a long string that was outputted.
From my experience, that can definitely happen if you do too many console.write operations without emu.frameadvance(). The Lua console is not a good way of holding output long-term. Try output to file, something like:
local f = io.open("results.txt","a")
    f:write( ... )
f:close()
(replace "..." with whatever string you want to output) Edit: The error happens if you use console.write 100 or more times in a row. You can make your output string first (use ".." (two dots) to concatenate the strings all together), then at the end use console.write on that string. Of course, if you are storing output that you want to view long-term, better to output to file as shown above.
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
Samsara (from News feed) wrote:
It took until last month, two and a half years after Playground was drafted, for us to show those runs on game pages. We completely dropped the ball on it. Part of that I think was due to lack of interest across... Everyone on the site, really.
Considering that the news post this quote is from is the first and so far only news post to mention "Playground" at all... I wasn't even sure whether "Playground" was supposed to be taken seriously. It just came across as no one having any idea of what it was ultimately supposed to be.
Editor, Experienced Forum User, Published Author, Expert player (2127)
Joined: 6/15/2005
Posts: 3299
McBobX wrote:
I think FractalFusion wasn't talking from a judgement perspective, it is just something I noticed as well, because yeah I do agree with the fact that MMX4-6 games don't have that long "Now Loading" for it to be accelerated. That said, I appreciated HappyLee's care about viewer pleasure, it is very nice!
Just to confirm, I wasn't talking from a judging perspective. I don't talk from judging perspectives anymore. It's fine, I have used speed edits in my encodes before. Just pointing out that most games don't really need speed edits; when watching TASes, viewers can normally skip over video as they so choose. I have done speed edits in my own encodes, but only very rarely (it does take a lot of work which I usually don't see as necessary) and only for one of two reasons: * The upload site has a restriction on video length (doesn't apply anymore), or * The TAS is exceptionally boring. (Fortunately, the vast majority of TASes don't fall in this category.) Also personally, if it's just a matter of loading screens, I'd prefer removing them all together over speeding them up.