Experienced player (608)
Joined: 10/23/2004
Posts: 706
Thank you! Now, if only there were a simple way to round in Lua (seems it takes several lines for some reason).
Current Project: - Mario Kart 64
Player (146)
Joined: 7/16/2009
Posts: 686
Language: lua

string.format("%g", Speed)
Experienced player (608)
Joined: 10/23/2004
Posts: 706
Scepheo, that's perfect, thank you! As I write to the screen with gui.text, is there any way to make the locations relative so that if I change the resolution of the emulator they stay put?
Current Project: - Mario Kart 64
adelikat
He/Him
Emulator Coder, Site Developer, Site Owner, Expert player (3574)
Joined: 11/3/2004
Posts: 4754
Location: Tennessee
use gui.drawText if you want to use "emulator space" instead of client space. In Emulator space it will scale along with the graphics.
It's hard to look this good. My TAS projects
Experienced player (608)
Joined: 10/23/2004
Posts: 706
Thanks, adelikat. That even gives me control over the font and such. Very nice!
Current Project: - Mario Kart 64
Experienced player (608)
Joined: 10/23/2004
Posts: 706
Just a quick announcement: I will be streaming at http://www.twitch.tv/weatherton today (Saturday) at 2pm EST to demonstrate some interesting findings and tools in the game, if you're interested. The topics I plan to discuss are: 00'00"00 Laps. How can you get them? Mario Kart 64 Item probabilities Course Ghost Behavior (after third lap) Ghost analysis (driving style / efficiency) Xenos slide. How does it work and is it TAS only? Mario Kart 64 Automatic Transmission / Dashboard PAL / NTSC Conversion Demo
Current Project: - Mario Kart 64
Experienced player (608)
Joined: 10/23/2004
Posts: 706
I discovered a faster shortcut on Banshee Boardwalk: Link to video I'm not sure how to capture at a higher resolution in BizHawk than what the movie was created in so, unfortunately this is only 320x240 :(
Current Project: - Mario Kart 64
Former player
Joined: 6/30/2010
Posts: 1107
Location: Zurich, Switzerland
That's incredible! Do you have an estimate what the time for the whole TAS will be?
Current project: Gex 3 any% Paused: Gex 64 any% There are no N64 emulators. Just SM64 emulators with hacky support for all the other games.
Experienced player (608)
Joined: 10/23/2004
Posts: 706
Thanks to Peter Greenwood (micro500) here at TASVideos, I was able to sync the input from two different Weathertenko TAS movie files on my actual N64 console. This is the first time the skip has ever been achieved on console and it verifies that it is technically possible. Now someone just needs to actually do it unassisted :) Link to video
Current Project: - Mario Kart 64
Post subject: weatherton
Joined: 3/18/2006
Posts: 971
Location: Great Britain
Weatherton, do you still need help with item-related mechanics? I was thinking of firing up a debugger and seeing if I could learn anything of interest.
Experienced player (608)
Joined: 10/23/2004
Posts: 706
antd, yes, Sully (who has posted some on the topic on other parts of these boards) has done some debugging of the game and some specifically related to items. However, I still have no way to predict the items I will get without trying every frame. Having an indicator of which item I would get would save me many many rerecords. If you are willing and able to help, I can dig up some of the details we know so far. P.S. A quick note, I'm just finishing up the second lap of Toad's Turnpike and making good progress on the run now :)
Current Project: - Mario Kart 64
Player (146)
Joined: 7/16/2009
Posts: 686
I've been trying to do the same thing, by the way. SeanSullivan86 (whom I assume to be the aforementioned Sully) has send me some helpful information. It pretty much comes down to predicting the outcome of the rng now, which he says is located at 802B7E34. That number [0, 99], together with your position, is used to pull the item you'll get from a table located at 0x1A7A90, which has eight sets (for each position) of 100 items (rng).
Experienced player (608)
Joined: 10/23/2004
Posts: 706
Scepheo, yes Sean Sullivan is the Sully I was referring to. When you say "together with your position" are you referring to X, Y an Z coordinates? Last night I had a strange discovering while trying to manipulate an item while towing another item (meaning I could not hit Z to choose the item). I couldn't change which item I received (it kept being a green shell when I wanted a mushroom) no matter how I changed my control stick input. However, when I changed the frame that I initiated a slide on (i.e. when I jumped) the outcome changed as well. Based on that (granted, it's a single sample) the item seed seemed to depend somewhat on jumping. Not sure what to make of that. I am familiar with the 100 byte lookup tables. I guess what I need is a Lua script that tells me which number I would receive if I hit Z on that frame. How close are you to being able to say that?
Current Project: - Mario Kart 64
Joined: 3/18/2006
Posts: 971
Location: Great Britain
I've only spent a short time looking though, so I can't say anything for certain. I can see the item lookup table and it is dependent on position, as in whether the player is in 1st, 2nd, 3rd, etc. The routine I'm looking at is like this:
item_table = 0x1a7a90
get_item = item_table + ((position * 100) + rnd)
And yes, Weatherton, I would like all of the information you have on this :D
Joined: 8/1/2006
Posts: 428
Weatherton wrote:
Based on that (granted, it's a single sample) the item seed seemed to depend somewhat on jumping. Not sure what to make of that.
If it works like other games, that means the rng draws from a fixed sequence of numbers, gets poked some number of times every frame, and gets poked some additional times when you slide, probably related to the dust puffs. So what you actually need is a count of how many rng numbers you are consuming during the item spin, the 'nearby' numbers in the sequence when the item pops, and a list of which actions consume how many numbers.
Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused telnet: Unable to connect to remote host
Joined: 10/20/2006
Posts: 1248
I could probably work something out, but I'd rather not given that somebody else has already spent a lot of time and effort on this.
Player (146)
Joined: 7/16/2009
Posts: 686
Weatherton wrote:
When you say "together with your position" are you referring to X, Y an Z coordinates?
No, I meant position in the race (1st place, 2nd place...).
Weatherton wrote:
I guess what I need is a Lua script that tells me which number I would receive if I hit Z on that frame. How close are you to being able to say that?
Yes, that's what I've been trying to do. Can't say I'm really close though, I haven't had much time and it appears the rng is unlike any I know.
JSmith wrote:
If it works like other games, that means the rng draws from a fixed sequence of numbers, gets poked some number of times every frame, and gets poked some additional times when you slide, probably related to the dust puffs.
I don't think it does. It appears to use "random" data left on the stack and in registers by previous function calls. That means that jumping (and sliding) affect the outcome, but only because they cause specific function calls.
JSmith wrote:
So what you actually need is a count of how many rng numbers you are consuming during the item spin [...]
None. The item spin just loops through all possible items in order. There appears to be very little in the game that depends on the rng, which is probably why the existing one is so odd: it'd probably be noticeable otherwise (same sequences of items).
Joined: 10/20/2006
Posts: 1248
JSmith wrote:
So what you actually need is a count of how many rng numbers you are consuming during the item spin [...]
Scepheo wrote:
None. The item spin just loops through all possible items in order. There appears to be very little in the game that depends on the rng, which is probably why the existing one is so odd: it'd probably be noticeable otherwise (same sequences of items).
I've only spent very little time so far, but this is definitely not correct. At least over a hundred numbers are generated every single frame in a race.
Player (146)
Joined: 7/16/2009
Posts: 686
Kuwaga wrote:
I've only spent very little time so far, but this is definitely not correct. At least over a hundred numbers are generated every single frame in a race.
Really, what for? I can't say my N64 ASM is all that good (too many registers to keep track of), and I'm having a hard time working with the available N64 debugging tools, so you're probably right. I'd love to help figure this stuff out, but I'm afraid I can't really be of any help at this point...
Joined: 10/20/2006
Posts: 1248
All kinds of graphical effects, like what you see behind your cart, enemy AI, and I don't know what else. I've spent very little time, like I've said. But it's a lot per frame, and that kind of makes it look to me like predicting an RNG roll several frames ahead might not be feasible. Drifiting and all that should influence the RNG because it'll pull a different amount of numbers for graphical effects.
Joined: 8/1/2006
Posts: 428
Kuwaga wrote:
Drifiting and all that should influence the RNG because it'll pull a different amount of numbers for graphical effects.
Huh... that means C^ might be useful for luck manipulation by changing the number of effects onscreen.
Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused telnet: Unable to connect to remote host
Experienced player (608)
Joined: 10/23/2004
Posts: 706
I was able to change the camera with c^ for the first five races with no desync (I originally played zoomed in but switched to zoomed out when I found out it produces less lag on the real console) . So I think not.
Current Project: - Mario Kart 64
TheKDX7
He/Him
Player (118)
Joined: 7/9/2011
Posts: 393
Location: Switzerland
Live of 2014-08-08 by Weatherton: http://www.twitch.tv/weatherton/b/556023142
Former player
Joined: 6/30/2010
Posts: 1107
Location: Zurich, Switzerland
TheKDX7 wrote:
Live of 2014-08-08 by Weatherton: http://www.twitch.tv/weatherton/b/556023142
Some parts are muted. This shows me that I made the right choice with my switch to Hitbox, because I run Mario Kart 64 very often.
Current project: Gex 3 any% Paused: Gex 64 any% There are no N64 emulators. Just SM64 emulators with hacky support for all the other games.
Experienced player (608)
Joined: 10/23/2004
Posts: 706
I'm guessing it was muted due to my playing music while I TAS. I may need to figure out a headphone solution. I'm not too pleased with the new Twitch policies muting sound and deleting past broadcasts after two weeks...
Current Project: - Mario Kart 64