Joined: 3/17/2007
Posts: 97
Location: Berkeley, CA
Continuing discussion of SMB-bots written in Lua (around here): Wall-ejection to the left apparently kills the current "has Mario stopped?" logic. Warp zones would be worse. But for now, let's get the script past a castle: $35 is nonzero only when the sequence with Toad starts. It gets reset pretty quickly, but the script could watch $075F (world #) to figure out when it should resume playing.
IRC nick: UncombedCoconut
Joined: 4/2/2008
Posts: 70
Well, the "has mario stopped" logic in that script I did just checks for X velocity below a certain threshold, I originally had it set at 4 but it would get stuck in that one part in 1-2 because apparently Mario moves at 5 for certain frames when he's pushing into a wall. I added the toad flag and now the script gets to at least 2-3 (probably further but that's as far as I let it go). I added in some logic for whirlpools that turbo-fires A, but that could probably be adjusted to not be quite so frantic. See here This script still has massive trouble with that coin ledge in 1-2 but at least it can't get itself permanently stuck.
Joined: 3/17/2007
Posts: 97
Location: Berkeley, CA
Neat! :) I was just thinking that SNES Tetris Attack (vs. mode) could be a good target as well, especially since a bot could equally well control either player -- it'd be trivial to have a driver script set up a bot-vs.-bot contest. Playing (and menu navigation) could be tough, but all the information that's essential for gameplay is easily obtained: Display-script (It'd be nice to know the VScroll offset / time 'til next line arrives. Or what the next line is.) I'd better get back to work on FCEU/Mario. :-P Anyone want to see this taken farther after that?
IRC nick: UncombedCoconut
Joined: 4/2/2008
Posts: 70
Slightly updated script to be a little more robust about savestates, now it has a rolling buffer so it can rewind further if it keeps dying. There's a failsafe at the beginning of the level, but I have yet to see it get that far. It manages to get to 4-4 before getting permanently stuck for obvious reasons. Not sure how to easily solve that without some special-case coding. See here
Joined: 3/17/2007
Posts: 97
Location: Berkeley, CA
.98.27-compatible version of the SMB tile scanning script: here.
IRC nick: UncombedCoconut
Player (120)
Joined: 2/11/2007
Posts: 1522
Good stuff, good stuff, keep it up. Though technically these shouldn't be in the "heuristic" section as they abuse savestates thoroughly... :P (Maybe we need a Lua Playground section?) nits, the SMB tile scanning script seems like a good step towards a heuristic bot... is tracking enemies hard? I don't it will be for you. Now you just need to tie all that info together and start generating input based on it. I have a couple of heuristic bots I'll post soon.
I make a comic with no image files and you should read it. While there is a lower class, I am in it, and while there is a criminal element I am of it, and while there is a soul in prison, I am not free. -Eugene Debs
Joined: 4/2/2008
Posts: 70
Jump Prediction You may have to copy-paste. I can't get referring blocking working properly with this site. Doesn't actually make any decisions yet, but it's a step.
Joined: 3/17/2007
Posts: 97
Location: Berkeley, CA
Alden: The bots are progressively relying less on savestates and more on the heuristics. UraniumAnchor's doing some great work on synthesizing all this info and using it for game play! The scripts track enemy locations but currently don't have accurate hitboxes; I hope to fix that, but it's nearly irrelevant for decision making... uh, except with platforms. :)
IRC nick: UncombedCoconut
Player (120)
Joined: 2/11/2007
Posts: 1522
True true... Plus ultimately heuristics will only be useful for TASing when combined with a bit of savestates. I'm also thinking about adding a wiki page to centrally store all the various scripts for games. The downside is people would have to copy/paste scripts instead of just downloading, but I think it will be nice to not have to sort through forums to find stuff.
I make a comic with no image files and you should read it. While there is a lower class, I am in it, and while there is a criminal element I am of it, and while there is a soul in prison, I am not free. -Eugene Debs