Level 11 CPU: The AI that beats you at Melee

AltF4

BRoomer
GRimer
Joined
Dec 13, 2005
Messages
5,045
Location
2.412 – 2.462 GHz
#1
Like a mad scientist, I have been cooking up something special in my lab that's almost ready to take over the world:
The Level 11 CPU!
(We skipped 10 and cranked it straight to 11)

For anyone that wants to play it, I'll be at Genesis III this weekend showing it off. I'm not completely sure where I'll be, but look for me in the friendlies section if there is one. I'll be the one with a laptop and laughing maniacally.

You can find the source code and instructions on how to get it running here.

Sample Features
(All taken from a live match)

Frame-Perfect Powershielding


Punishes Laggy Moves


Flowcharted Edgeguarding


Short-Hop Double Laser



Plus way more!



FAQ
  1. What character does the AI play?

    Fox, of course!

  2. Does the Level 11 CPU cheat?

    The short answer is: No.

    The long answer is that the CPU only interfaces with the game by pressing buttons on a virtual controller. There isn't anything it does that you couldn't do in principle. It just so happens, however, that a computer is much faster and more reliable than you, so it's able to do things that a human realistically can't.

  3. Are there any current limitations to the AI?

    Yes, right now the CPU is limited to playing against Marth only, and on Final Destination. Support for other characters and stages will be added soon.

  4. How is the AI designed?

    The level 11 CPU makes decisions on a 4 tiered hierarchy of objectives: Goals, Strategies, Tactics, and Chains. Each objective inspects the current game state and decides which lower level objective will be best to achieve it.

    Goals are the highest level objective, and inform the AI what the intended overall outcome should be. IE: Beating our opponent in a match, or navigating the menu to select our character.

    Strategies are the highest level means that the AI will use to accomplish the overall goal. For instance, the level 11 CPU will typically take the strategy of baiting the opponent into a poor move.

    Tactics are lowish level series of predictable circumstances that we can realistically flowchart our way through. For instance, if the enemy if off the stage we may choose to edge guard them to keep them from getting back on.

    Chains are the lowest level of objective that consists of a "chain" of button presses that Smashers will recognize, such as Wavedash, Jump-canceled Upsmash, etc...

  5. Can I play it on a regular Gamecube or hacked Wii?

    For right now, the level 11 CPU only runs on a PC as a normal computer program. (Meaning that Melee has to be in an emulator) But I do want to get it running on actual Gamecube/Wii hardware. If you'd like to help with this, let me know!
There's still a lot of work to do on the AI to improve the Marth matchup and then start on others. I'd love to have your help! Go ahead and run it and tell me what you think.

Code:
https://github.com/altf4/cpu-level-11
 

DRGN

Technowizard
Moderator
Premium
Joined
Aug 20, 2005
Messages
2,053
Location
Sacramento, CA
#3
Wow, this is awesome. I'm going to Genesis III, so I'll definitely need to find you and give this a try!

I'm also hoping to bring a project of my own, but I'm reluctant to mention details since I don't know if I'll finish in time.


SinsOfApathy SinsOfApathy
 

Kou

Smash Apprentice
Joined
Nov 22, 2011
Messages
198
Location
Japan
#4
Does anyone test on Windows?
I couldn't find "~/.local/share/dolphin-emu/MemoryWatcher/"...:(
 

AltF4

BRoomer
GRimer
Joined
Dec 13, 2005
Messages
5,045
Location
2.412 – 2.462 GHz
#5
Does anyone test on Windows?
I couldn't find "~/.local/share/dolphin-emu/MemoryWatcher/"...:(
If there are any code related questions or issues, using the github Issue tracker will be best. Or else I'm likely to miss your comment. (I don't come on smashboards often these days)

That said, the CPU runs only on Linux. So that's your problem. I'll add that to the FAQ, though.
 

Kou

Smash Apprentice
Joined
Nov 22, 2011
Messages
198
Location
Japan
#6
If there are any code related questions or issues, using the github Issue tracker will be best. Or else I'm likely to miss your comment. (I don't come on smashboards often these days)

That said, the CPU runs only on Linux. So that's your problem. I'll add that to the FAQ, though.
Thank you for your reply.
I see. I'll install Ubuntu on my PC.

Okay, I will use github next time!
 

SinsOfApathy

Smash Journeyman
Joined
Feb 24, 2015
Messages
470
NNID
Psion312
#9
Wow, this is awesome. I'm going to Genesis III, so I'll definitely need to find you and give this a try!

I'm also hoping to bring a project of my own, but I'm reluctant to mention details since I don't know if I'll finish in time.


SinsOfApathy SinsOfApathy
Saw this on Github before. Pretty cool. Main issue I have with it is that it uses Memory Watcher and Pipes, because hardware is my goal.

Throughput on inputs through the USB Gecko for inputs + game state bothered me due to the transfer rate of the device having a possible impact on processing time which ai have less than 16ms to spare if I want frame perfect reads. (I say 16ms, since I'm unaware of the actual input buffer and ~16ms is a frame).

So, that's why I made the jump to the rPi, but I still need to buy a M->F cable set on top of upgrading to a rPi 2 (otherwise I may have to network the system adding ~2ms RTT latency.) I really, really want to add network debugging to Nintendont, so that my memory access won't have to be through the Gecko.

Also, need to do a Lua interpreter for my friend's project that used to stream on Twitch, since I really want to do a subtle Twitch troll by having the bot run on the Gameboy Player replacement over on the Gamecube homebrew forums. But I don't have a real Gameboy Player and want to try making it run through a Memory Card payload with a packed ROM. https://github.com/kylecoburn/PokeBot

So this is an ambitious year for me on top of finishing my CSE degree (which includes emulating a CPU in my Computer Architecture class, apparently.)
 
Last edited:

AltF4

BRoomer
GRimer
Joined
Dec 13, 2005
Messages
5,045
Location
2.412 – 2.462 GHz
#10
Ahh, so you're trying to run the game like normal on a Wii, use Gecko to give you game state info, and then use a Raspberry Pi to send controller input? That's pretty neat. Might even be something easier to support than running code natively inside the GameCube. (Which is a long term goal for the lvl 11 CPU) I'll give that some thought.

As for latency, it's not a problem. 16ms is an ETERNITY to a computer. Especially since there's no database operations involved, it's all CPU bound. The CPU has all day to process a frame.
 

DRGN

Technowizard
Moderator
Premium
Joined
Aug 20, 2005
Messages
2,053
Location
Sacramento, CA
#13
I wanted to bump this and mention that I got to try it out, and it was awesome. It was a lot of fun watching people come up and freak out as they got beat by it.

And it was doing that even though it's still only a WIP, with many facets of gamplay that haven't been programmed in yet. As more aspects of it's game are added, it'll improve exponentially, which I think is pretty cool. I could see it eventually beating really, really good players.

AltF4 AltF4 , I think the areas that would impact its gameplay the most atm (or at least from a week ago when I played against it) would be DIing/shining out of chaingrabs and dash-dancing. More intelligent recovery would help a lot of course, but I think the former two aspects would improve it even more. For dash dancing, it's of course possible he could be doing some super high-speed dash-dances, but I think it would be more effective if he didn't. One reason being control/precision: With longer waits before turning around he can cover more ground, and by varying the wait he can control whether the overall movement is in or out; so he could be just adjust-ably foxtrotting around occasionally. But probably more importantly, dash dancing with longer strides, more like a human, will appear and feel a lot more natural, which is great because 1) people would probably like playing against it more, and 2) it can help train people on how to properly deal with real (human) dash dancing. But I think it would still be cool to every once in a while throw in some brief inhuman/super-rapid dash dancing too. Just to throw people off even more, and kinda remind them just what they're up against, lol.
 
Last edited:

AltF4

BRoomer
GRimer
Joined
Dec 13, 2005
Messages
5,045
Location
2.412 – 2.462 GHz
#15
Yup, this is definitely an active project. Progress will be seen on the project's github page (in the first post). For any feature requests or bug reports, make an Issue on the github page as that will be the best way for me to track them. I only rarely check the smashboards, and this is not an optimal forum for managing that sort of thing anyway.
 

Sudoi

Smash Journeyman
Joined
Mar 21, 2015
Messages
255
Location
North Myrtle Beach
NNID
Blargbla
#16
Yup, this is definitely an active project. Progress will be seen on the project's github page (in the first post). For any feature requests or bug reports, make an Issue on the github page as that will be the best way for me to track them. I only rarely check the smashboards, and this is not an optimal forum for managing that sort of thing anyway.
I heard it only works on Linux, is this true? Also, can you upload a video or two of this AI?
 

SinsOfApathy

Smash Journeyman
Joined
Feb 24, 2015
Messages
470
NNID
Psion312
#17
I heard it only works on Linux, is this true? Also, can you upload a video or two of this AI?
Yes. Dolphin Emu's piped inputs don't support Windows API yet. I believe the MemoryWatcher shares the same fate.
 
Top