Post subject: F-Zero: Grand Prix Legend
Editor, Skilled player (1171)
Joined: 9/27/2008
Posts: 1085
Here's a Story mission, Rick Wheeler #1, done in 16"87 to begin with. A script, which I ported readily enough from Maximum Velocity. I'm pretty sure the optimal controls would be to have Accelerate, Brakes, and Boost on separate buttons, and Side Attack for L+R, and not double-tap L or R. If there are real-time speedrunners wondering what I did on the rails, I don't think the variant I did is RTA viable. Not unless you can press left+right on the D-pad as well as L+R buttons at 20 to 30 Hz. Still, the basic idea is that the side attacks have an insane drifting speed, 1016 km/h on the first frame for the guy used in the first story mission. This decelerates at a rate of 64 km/h per frame, so the speed quickly diminishes. Taking damage on rails will cancel the side attack, so that the average speed remains very high. When I have time to rest and think about it, I can explain more. For now, here's a topic with a nice WIP.
Memory
She/Her
Site Admin, Skilled player (1522)
Joined: 3/20/2014
Posts: 1762
Location: Dumpster
Woah that's some insane stuff with that side attack trick. Good find. EDIT: Apparently how it works in Grand Prix mode is that whatever place you finish in on one track is where you start the next track... at least in Climax according to some RTA peeps and likely GPL. So there is the possibility for the vehicle to not be in position 0 but it's not necessarily likely to occur. Don't know if it affects the memory or not though. Let me know if you have any plans on porting the script over to Climax too, if not I could probably try to do it with the same assumption made in your current GPL script, if only to get people started with it. EDIT2: Also would you mind me uploading this to youtube if you have no plans of doing it yourself? I bet the FZC guys would appreciate it.
[16:36:31] <Mothrayas> I have to say this argument about robot drug usage is a lot more fun than whatever else we have been doing in the past two+ hours
[16:08:10] <BenLubar> a TAS is just the limit of a segmented speedrun as the segment length approaches zero
Editor, Skilled player (1171)
Joined: 9/27/2008
Posts: 1085
No plans for Climax. I just happened to have GPL available at the time. Go ahead, encode and upload to YouTube. I have no confidence in creating videos myself. I really need to remember to note this in my uploads. I did measure my average speed when I was heading north along that major straight. Somewhere around 1530 km/h true speed. The precise timing of the rail damage is based on the frame you were on the offending terrain, not the frame you got onto it. The Side Attack momentum still carries through on the frame it is lost on the rail. I was carefully watching my position to make sure that I am on the rail for exactly one frame, so that my motion would immediately get me back off because of the speed decay of the Side Attack, with some adjustment in steering as needed. I did not attempt brake tapping. Initiating a Side Attack depends on controls: If it's double-tap, you need at least a blank frame without drifting to have it happen. If it's any other control, you instead need to steer that direction. At the rate I was doing Side Attacks, the double tap controls would take too long to help. Between L+R or the other controls, on the frame you initiate a Side Attack, it immediately impacts your position. Side Attacks override drifting, so the fact you need L+R to initiate it doesn't really matter as you can't drift on that frame anyway, keeping a control free for braking. I suppose the disadvantage with L+R for Side Attack is that you need steering to initiate Side Attack. Between left or right, the game prioritizes right. This means you can press left+right to avoid steering that frame and get a side attack to the right. Right side rails have a clear optimal pattern I can do. Left side rails, unfortunately, has only one possible control for the frame to go left, as even if you held right for a few frames before L+R, it will still trigger as a right Side Attack. For comparison, drift speed of Dragon Bird (used in first story mission) is 220 km/h. Repeating the first three frames of the Side Attack like I did is "drifting" at an average of 952 km/h.
Memory
She/Her
Site Admin, Skilled player (1522)
Joined: 3/20/2014
Posts: 1762
Location: Dumpster
Uploaded I'll try looking into Climax myself for the moment. Thanks for the documentation anyways.
[16:36:31] <Mothrayas> I have to say this argument about robot drug usage is a lot more fun than whatever else we have been doing in the past two+ hours
[16:08:10] <BenLubar> a TAS is just the limit of a segmented speedrun as the segment length approaches zero
Editor, Skilled player (1171)
Joined: 9/27/2008
Posts: 1085
My advice for Climax: Search for your speed. Should be zero when holding still. Should be going up (by an unknown amount) when accelerating. It is almost certainly 2 bytes in size. If it's anything like the structures in the other two games, it will be in EWRAM. Use the Hex Editor and look in that area to see if there's a bunch of stats in that region that reasonably change based on your machine. If the positions are in the exact same spot in relation to the speed address, we probably have the same basic structure all over again, and can probably just copy the script with a single change in the PlAddr function. Oh, and probably a change in FetchInternalFrame as well. For calibrating the object size, just look at later stats in the Hex Editor. Find something that looks distinctly like position? The size is whatever difference in addresses of that position and yours. There are actually a few more changes from MV to GPL, as I forgot to use PlAddr in a few spots in the MV version. I recommend tinkering with the GPL script for convenience.
Memory
She/Her
Site Admin, Skilled player (1522)
Joined: 3/20/2014
Posts: 1762
Location: Dumpster
Climax script completed. There were a number of changes to the offsets of various stats of the previous two games but once I worked them out, it wasn't too hard porting it over.
[16:36:31] <Mothrayas> I have to say this argument about robot drug usage is a lot more fun than whatever else we have been doing in the past two+ hours
[16:08:10] <BenLubar> a TAS is just the limit of a segmented speedrun as the segment length approaches zero
Editor, Skilled player (1171)
Joined: 9/27/2008
Posts: 1085
I am curious about goal choice. Specifically a detail in Story mode. I'm not familiar with the game. After reading a guide or two, apparently Rick Wheeler and Captain Falcon each have chapters that only unlock when you have less than 1 billion cash upon clearing Chapter 4 (and some that unlock when you have that much or more). The requirement seems particularly annoying, as it seems we get a rather significant cash bonus for clearing some missions quickly. By "rather significant", I mean we're walking away on my 16"87 attempt with 860 million. If "all missions" or some type of 100% goal is in mind, things that require a low cash amount is going to seriously annoy us. I'm curious if there's any sort of workarounds, or what the plan will be. I'm all for 100% run of this game.
Memory
She/Her
Site Admin, Skilled player (1522)
Joined: 3/20/2014
Posts: 1762
Location: Dumpster
My plan is to not do a story mode TAS anytime soon, if at all. I'm just not particularly interested by it. It's really repetitive and the gimmicks just aren't that interesting. I've been playing through it to get an input file with all the unlocks just to create a table of numeric stats like you did with MV.
[16:36:31] <Mothrayas> I have to say this argument about robot drug usage is a lot more fun than whatever else we have been doing in the past two+ hours
[16:08:10] <BenLubar> a TAS is just the limit of a segmented speedrun as the segment length approaches zero
Editor, Skilled player (1171)
Joined: 9/27/2008
Posts: 1085
Some of the stats are placed into RAM, conveniently enough. I put the relevant addresses into the comments at the bottom of the FZGPL script. When in the race itself, I spotted machine stats at EWRAM:17720 During the tweaking screen, IWRAM:2EA0 holds stats for each gear. Some testing of the numbers would still be desired. Rather than unlock, I actually cheated in MV. I've taken a look in GPL for an address to cheat as well, and once at the track preview in Grand Prix mode, IWRAM:110A looks to be the one. No idea what, precisely, will happen if you modify that directly, but the Machine Setting screen that follows will show the new machine based on what you changed IWRAM:110A to. You might want to adjust the array at IWRAM:1270 if freaky stuff happens in the race, as that appears to be what machines have been selected for the Grand Prix. Or maybe I'm over-complicating things. Cheating is faster than unlocking.
Memory
She/Her
Site Admin, Skilled player (1522)
Joined: 3/20/2014
Posts: 1762
Location: Dumpster
I have an input file that unlocks all machines and all tracks. I'm now in the middle of compiling vehicle stats. I'm a little confused as to how to best figure out the maximum difference between facing and momentum before losing speed from turning too sharply. How did you find it for MV?
[16:36:31] <Mothrayas> I have to say this argument about robot drug usage is a lot more fun than whatever else we have been doing in the past two+ hours
[16:08:10] <BenLubar> a TAS is just the limit of a segmented speedrun as the segment length approaches zero
Editor, Skilled player (1171)
Joined: 9/27/2008
Posts: 1085
In Maximum Velocity, most of the machines had such a wide difference between how fast they turn and how slow their momentum actually shifted. It generally didn't take long to steer hard enough to hit the limits. Even J.B.Crystal wasn't that difficult. As for the detection process, I basically just steered until I saw a frame where I didn't steer further. It was also the time I lost speed from steering too much. As for the exact number, it looks so clean in hexadecimal. Viewing the MV numbers in hex, you'd see 2000, 3000, 3400, 3600, 3800, 3C00, 4000, and 5000. Most likely the exact number is some multiple of 256, or 0x100. Maybe 512, or 0x200. Considering the B Grip I've experienced on one of these machines, you might want to forget steering normally and cheat Momentum. Starting a course typically faces you straight north, which is 49152 (0xC000). After gaining some speed, try cheating your Momentum. Poke it to either 0 (0x0000) or 32768 (0x8000). If it's anything like MV, you'll be losing speed for a few frames before the difference shrinks back down low enough. Around the time you stop losing speed, that may be a good time to take a closer look.
Memory
She/Her
Site Admin, Skilled player (1522)
Joined: 3/20/2014
Posts: 1762
Location: Dumpster
I think this mechanic just plain doesn't exist in this game. I poked it to 0 and I didn't lose any speed. Obviously a degree greater than 90 made me lose speed but that would mean you're moving backwards.
[16:36:31] <Mothrayas> I have to say this argument about robot drug usage is a lot more fun than whatever else we have been doing in the past two+ hours
[16:08:10] <BenLubar> a TAS is just the limit of a segmented speedrun as the segment length approaches zero
Editor, Skilled player (1171)
Joined: 9/27/2008
Posts: 1085
I'm guessing you tried a rather large percentage of machines, at least 8 of them, preferably more. There's a few machines that didn't lose speed at 90 degrees in MV, but it's certainly possible the limit is set insanely high (180 degrees basically means no limit) or removed the limiting mechanic. It's also possible the poke causes the game to respond inappropriately, a quick test would be to check Jet Vermilion in MV and seeing if poking the Momentum like we did here causes any change in speed. If JV loses speed, then we can be pretty sure the poke test isn't messing any mechanics up. If there is no steering limit here, that should simplify your tables a little.
Memory
She/Her
Site Admin, Skilled player (1522)
Joined: 3/20/2014
Posts: 1762
Location: Dumpster
The poke test worked fine on JV in MV. I only tried 2 machines in GPL so far but just from watching time trials you can sorta tell that either it's not a mechanic, or it's so high that it's basically irrelevant.
[16:36:31] <Mothrayas> I have to say this argument about robot drug usage is a lot more fun than whatever else we have been doing in the past two+ hours
[16:08:10] <BenLubar> a TAS is just the limit of a segmented speedrun as the segment length approaches zero
Editor, Skilled player (1171)
Joined: 9/27/2008
Posts: 1085
As you continue to find more stats, just keep doing the poke test. Several seconds to find the spot, a few more to set it to zero each time, and then a few frame advances to see the change in speed. Don't bother checking machines you've already gotten the stats for, until you have one confirmation there is a limit less than 90 degrees. If you never get that confirmation, then it is very unlikely going back over the machines will show a limit you missed. Would be nice to know with greater certainty, since 3 of 10 MV machines wouldn't slow at 90 degrees, and only 2 of 34 was checked here.
Memory
She/Her
Site Admin, Skilled player (1522)
Joined: 3/20/2014
Posts: 1762
Location: Dumpster
Looks like it sort of is in the game after all, wild goose lost speed with the poke test. Still pretty high but still. How would I go about finding jump stats, that's basically the last thing I'm confused on.
[16:36:31] <Mothrayas> I have to say this argument about robot drug usage is a lot more fun than whatever else we have been doing in the past two+ hours
[16:08:10] <BenLubar> a TAS is just the limit of a segmented speedrun as the segment length approaches zero
Editor, Skilled player (1171)
Joined: 9/27/2008
Posts: 1085
Something tells me I might not have reported the right formula in the page. That will need some checking, and besides, there might be better numbers to report. Well, find a jump plate and drive over it at a high speed. Look for some addresses that weren't changing until you were suddenly airborne, and study those. That was what I did. Looking over my notes on MV...
Maximum Velocity
ROM:2C1CC0[size=0x30][count=25] - Machine core stats
  +00,1u[4] - Acceleration (for each gear)
  +04,2u[4] - Top speed for each gear
  +0C,1u    - Friction for being over speed limit of 4th gear (boost maintenance)
  +0D,1x    - Padding?
  +0E,2u    - Speed to drop to from over 4th gear limit (hysteresis)
  +10,1u    - Boost Acceleration
  +11,1x    - Padding?
  +12,2u    - Boost top speed
  +14,1u    - Friction for being over boost speed limit
  +15,1x    - Padding?
  +16,2u    - Speed to drop to from over boost limit (boost hysteresis)
  +18,2u    - Boost Time
  +1A,2u    - Jump
  +1C,2u    - ?
  +1E,1u    - Friction: Coasting (accelerator released)
  +1F,1u    - Friction: Braking
  +20,2u    - Steering rate
  +22,2u    - Momentum rate (balance)
  +24,2u    - Momentum rate (Blast Turn)
  +26,1u    - Facing-Momentum diff tolerance
  +27,1u    - ?
  +28,1u    - ?
  +29,1u    - Padding?
  +2A,2u    - LR drift speed
  +2C,1u    - ?
  +2D,1u    - ?
  +2E,1u    - Body
  +2F,1u    - ?
EDIT: Offset 26 looks like the turning tolerance. ... And the fact I saw what looked rather suspiciously like a similar looking stat block in EWRAM:17720 loaded based on whatever machine you have, we might want to look at +1A from that, at EWRAM:1773A, for some clue and seeing if they relate. The jump stat really needs another look in Maximum Velocity anyway. It's the least clear part of the table, and I will have no trouble redefining numbers that make more sense to you.
Memory
She/Her
Site Admin, Skilled player (1522)
Joined: 3/20/2014
Posts: 1762
Location: Dumpster
EWRAM:1773A is much higher for Deep Claw then any previous vehicles I paid close attention to. Deep Claw is known for having the best jump in the game so it is incredibly likely that it is indeed the jump stat. I went ahead and renamed a bunch of things that were either not labeled or incorrectly swapped around in your script. A bunch of accel addresses were marked as max/min speeds and vice versa:
During game play
EWRAM:14930[Size=0xD0][Count=5?] Machine data

EWRAM:17720,1u[4] - Acceleration (by gear)
EWRAM:17724,2u[4] - Top Speed (by gear)
EWRAM:1772C,2u    - Hysteresis friction (boost maintenance)
EWRAM:1772E,2u    - Hysteresis, speed to fall to when over limit
EWRAM:17730,2u    - (Boost acceleration?)
EWRAM:17732,2u    - (Boost top speed?)
EWRAM:17734,2u    - (Boost hysteresis friction?)
EWRAM:17736,2u    - (Boost hysteresis?)
EWRAM:17738,2u    - Boost timer
EWRAM:1773A,2u    - (Jump?)
EWRAM:1773C,1x    - (0)
EWRAM:1773D,1u    - (change in speed?)
EWRAM:1773E,1u    - (released acceleration friction?)
EWRAM:1773F,1u    - (braking friction?)
EWRAM:17740,2u    - (Turn)
EWRAM:17742,2u    - (Balance)
EWRAM:17744,2u    - (Blast Turn Balance)
EWRAM:17746,2u    - (rotation?)
EWRAM:17748,2u    - (rotation?)
EWRAM:1774A,2u    - (LR)
EWRAM:1774C,2u    - (rotation?)
EWRAM:1774E,2u    - (rotation?)
EDIT: Never mind saw something with a much higher 1773A than Deep Claw. Could be divided into multiple stats though or be more than one byte. EDIT2: Pretty sure it's 2 bytes so yeah that's it.
[16:36:31] <Mothrayas> I have to say this argument about robot drug usage is a lot more fun than whatever else we have been doing in the past two+ hours
[16:08:10] <BenLubar> a TAS is just the limit of a segmented speedrun as the segment length approaches zero
Editor, Skilled player (1171)
Joined: 9/27/2008
Posts: 1085
Not too surprised at inaccuracies in my listing for GPL. If some address in there is still not entirely clear, refer to my MV list and see if that helps you identify the stat. Byte counts for some stats might also be wrong in the GPL listing, particularly the last stats listed. Will be nice to see the table when it's ready.
Memory
She/Her
Site Admin, Skilled player (1522)
Joined: 3/20/2014
Posts: 1762
Location: Dumpster
15 out of 34 vehicles lose speed to the poke test. I'm compiling the information to a google doc for now: link I'll add the exact information on it when I get around to it. Not sure how I'll handle all the ones with turning allowances of 90 degrees or greater. I might not even bother but if I should lmk. EDIT: Is part of what you're unsure with about the jump calculations whether or not it should be fixed point like you have it displayed in the table on the resources page? If it shouldn't be, I'd like to know so I can make sure to not list it as such on my table as well.
[16:36:31] <Mothrayas> I have to say this argument about robot drug usage is a lot more fun than whatever else we have been doing in the past two+ hours
[16:08:10] <BenLubar> a TAS is just the limit of a segmented speedrun as the segment length approaches zero
Editor, Skilled player (1171)
Joined: 9/27/2008
Posts: 1085
There's plenty of other ways to list the jump stat. Probably the best one is the initial upward velocity you get if you hit the jump plate from above some speed threshold (basically, if you adjust your speed slightly and it changes your jump height, you're not going fast enough). An alternative is to just get the two bytes from the internal stats and use that. I don't recall what system, exactly, I used back then, and would advise to err on the side of whole numbers and basing a formula on that. If you prefer, when I am up to it, I can reformulate the jump stuff and try to be less confusing about it. I just don't like the system I used a while back.
Memory
She/Her
Site Admin, Skilled player (1522)
Joined: 3/20/2014
Posts: 1762
Location: Dumpster
I'll just use the two bytes from the internal stats and use that for now (unsigned). If you'd like to reformulate it using that, please do.
[16:36:31] <Mothrayas> I have to say this argument about robot drug usage is a lot more fun than whatever else we have been doing in the past two+ hours
[16:08:10] <BenLubar> a TAS is just the limit of a segmented speedrun as the segment length approaches zero
Editor, Skilled player (1171)
Joined: 9/27/2008
Posts: 1085
Rather hastily threw a script together, based on MV (EDIT: though of course I pick the addresses of GPL!). Hopefully it'll let you gather a touch faster. Unknowns are included, put aside below other data. Ran out of horizontal space for Boost Time and Jump, so those are displaced downward. EDIT2: Oh, dear. I overlapped the brakes and coast stats. I've adjusted that now. EDIT3: I've adjusted my script to show my guess on the turning tolerance. Download FZGPL_Stat.lua
Language: lua

local R4u , R4s= memory.read_u32_le , memory.read_s32_le local R2u , R2s= memory.read_u16_le , memory.read_s16_le local R1u , R1s= memory.read_u8 , memory.read_s8 local a= 0x17720 local s= string.format while true do gui.pixelText( 0, 8,s("%4d",R1u(a+0x00,"EWRAM")),0xFFFFFFFF) --Acc1 gui.pixelText( 20, 8,s("%4d",R1u(a+0x01,"EWRAM")),0xFFFFFFFF) --Acc2 gui.pixelText( 40, 8,s("%4d",R1u(a+0x02,"EWRAM")),0xFFFFFFFF) --Acc3 gui.pixelText( 60, 8,s("%4d",R1u(a+0x03,"EWRAM")),0xFFFFFFFF) --Acc4 gui.pixelText( 0, 0,s("%4d",R2u(a+0x04,"EWRAM")),0xFFFFFFFF) --Spd1 gui.pixelText( 20, 0,s("%4d",R2u(a+0x06,"EWRAM")),0xFFFFFFFF) --Spd2 gui.pixelText( 40, 0,s("%4d",R2u(a+0x08,"EWRAM")),0xFFFFFFFF) --Spd3 gui.pixelText( 60, 0,s("%4d",R2u(a+0x0A,"EWRAM")),0xFFFFFFFF) --Spd4 gui.pixelText(140, 0,s("%4d",R1u(a+0x0C,"EWRAM")),0xFFFFFFFF) --Over max friction gui.pixelText( 0, 16,s("%4d",R1u(a+0x0D,"EWRAM")),0xFF808080) --Padding? gui.pixelText(100, 0,s("%4d",R2u(a+0x0E,"EWRAM")),0xFFFFFFFF) --Hysteresis gui.pixelText( 80, 8,s("%4d",R1u(a+0x10,"EWRAM")),0xFFFFFFFF) --AccB gui.pixelText( 20, 16,s("%4d",R1u(a+0x11,"EWRAM")),0xFF808080) --Padding? gui.pixelText( 80, 0,s("%4d",R2u(a+0x12,"EWRAM")),0xFFFFFFFF) --SpdB gui.pixelText(140, 8,s("%4d",R1u(a+0x14,"EWRAM")),0xFFFFFFFF) --Over boost friction gui.pixelText( 40, 16,s("%4d",R1u(a+0x15,"EWRAM")),0xFF808080) --Padding? gui.pixelText(100, 8,s("%4d",R2u(a+0x16,"EWRAM")),0xFFFFFFFF) --Hysteresis (boost) gui.pixelText(222, 8,s("%4d",R2u(a+0x18,"EWRAM")),0xFFFFFFFF) --Boost Time gui.pixelText(224, 16,s("%4d",R2u(a+0x1A,"EWRAM")),0xFFFFFFFF) --Jump gui.pixelText( 0, 24,s("%4d",R2u(a+0x1C,"EWRAM")),0xFFFF80FF) --? Unknown gui.pixelText(170, 0,s("%2d",R1u(a+0x1E,"EWRAM")),0xFFFFFFFF) --Friction: Coast gui.pixelText(160, 0,s("%2d",R1u(a+0x1F,"EWRAM")),0xFFFFFFFF) --Friction: Brake gui.pixelText(180, 0,s("%4d",R2u(a+0x20,"EWRAM")),0xFFFFFFFF) --Steering gui.pixelText(200, 0,s("%4d",R2u(a+0x22,"EWRAM")),0xFFFFFFFF) --Momentum, balance gui.pixelText(200, 8,s("%4d",R2u(a+0x24,"EWRAM")),0xFFFFFFFF) --Momentum, Blast Turn gui.pixelText(176, 8,s("%5d",R1u(a+0x26,"EWRAM")*256),0xFFFFFFFF) --Turning tolerance gui.pixelText( 20, 24,s("%4d",R1u(a+0x27,"EWRAM")),0xFFFF80FF) --? Unknown gui.pixelText( 40, 24,s("%4d",R2u(a+0x28,"EWRAM")),0xFFFF80FF) --? Unknown gui.pixelText(120, 0,s("%4d",R2u(a+0x2A,"EWRAM")),0xFFFFFFFF) --LR drift speed gui.pixelText( 60, 24,s("%4d",R1u(a+0x2C,"EWRAM")),0xFFFF80FF) --? Unknown gui.pixelText( 80, 24,s("%4d",R1u(a+0x2D,"EWRAM")),0xFFFF80FF) --? Unknown gui.pixelText(218, 0,s("%5d",R1u(a+0x2E,"EWRAM")*64),0xFFFFFFFF) --Body gui.pixelText(100, 24,s("%4d",R1u(a+0x2F,"EWRAM")),0xFFFF80FF) --? Unknown emu.frameadvance() end
Memory
She/Her
Site Admin, Skilled player (1522)
Joined: 3/20/2014
Posts: 1762
Location: Dumpster
Thanks. I'll still need to manually find out maximum turning stuff and how much power it takes to boost but this might speed things up.
[16:36:31] <Mothrayas> I have to say this argument about robot drug usage is a lot more fun than whatever else we have been doing in the past two+ hours
[16:08:10] <BenLubar> a TAS is just the limit of a segmented speedrun as the segment length approaches zero
Memory
She/Her
Site Admin, Skilled player (1522)
Joined: 3/20/2014
Posts: 1762
Location: Dumpster
Decided to not bother with adding variations of stats based on the slider to the table but instead wrote a script to display them on the tweaks screen: script
[16:36:31] <Mothrayas> I have to say this argument about robot drug usage is a lot more fun than whatever else we have been doing in the past two+ hours
[16:08:10] <BenLubar> a TAS is just the limit of a segmented speedrun as the segment length approaches zero