Project MeleeAI - A better AI for SSBM (UPDATE: NOW WORKS FOR CONSOLE)

Joined
Jan 10, 2016
Messages
19
#1

(artist: Acryte)​

Original Post: https://www.reddit.com/r/smashbros/comments/40883r/a_better_ai_for_melee_project_in_development/
Intro Video: https://www.youtube.com/watch?v=AACJrsBwW5k

Standalone ISO:


GitHub: https://github.com/luckycharms14/MeleeAI_Standalone

I think this project has a lot of potential for future Melee mods. As far as I know this is the largest mods for melee that was written in C. I would really like to clean up the development process so that people in the future will have an easier time writing their own mods for the game in C. I have made some progress in improving the development process but honestly its a pain in the ass. I hope that others can use the foundation of code I have here to make it easier on themselves.

Current functionality:


- Recovery (as seen in video, plus cleaner behavior near the stage)
- Teching (still a bit buggy, but it works decently well)
- DI (tries to mimic human behavior by DI'ing away more at lower percents and in more at higher percents)
- Acting out of hitstun (not really a focus right now, so currently it just jumps out of hitstun, will change soon)

Building the ISO:

xdelta patch:
http://www.mediafire.com/download/h8dwxxbrw3d1o3a/MeleeAI_patch.xdelta


The SD remix website has a great tutorial for creating the iso from a patch, I'll just link it here rather than explain it myself. Note that you need a v1.02 melee iso since the other versions of the game are not supported yet.

http://sdremix.com/installation/iso-hacking/from-a-patch-recommended/

Using MeleeAI Standalone:

Simply start up a game with P2 as a CPU and the AI will be running. Note that the AI will only work
on the tourney legal stages. MeleeAI does overwrite quite a bit of single player/debug code so its best if you
avoid those areas in order to not crash the game.

Dolphin dependent version:

This project runs as an external program to Dolphin and is not restricted by what code can be injected to the game. Eventually this project will surpass the standalone iso, but until then the standalone iso is much better for use. This is still primarily just in development.

GitHub: https://github.com/luckycharms14/MeleeAI

Current Goal: port neccesary Dolphin features to Windows
Completed Goals: get rid of dependency on special build of Dolphin (1/13/16)

Helping Out:

If you are interested in contributing to either project and you have some experience with programming in C, please send me an email at 14luckycharms14@gmail.com and I'll add you to our communication group.
 
Last edited:

SinsOfApathy

Smash Journeyman
Joined
Feb 24, 2015
Messages
470
NNID
Psion312
#5
The Gecko code is up on GitHub now, but the program now functions without the special build of Dolphin.

I will be posting a setup guide on GitHub sometime soon.
To be honest, I'm surprised that it works when you write to that input range. I've tried doing it with Dolphin using frame advance and never got results.
 
Joined
Sep 3, 2015
Messages
25
Location
Oviedo, Florida
#6
Hi everyone,

I'm carrying this over from the reddit post: https://www.reddit.com/r/smashbros/comments/40883r/a_better_ai_for_melee_project_in_development/

This will be used to communicate any progress that we're making on the project, as well as the current goals that we are working towards.

GitHub: https://github.com/luckycharms14/MeleeAI

Current Goal (1/13/16): clean up the code and release a library for I/O for melee on Linux version of Dolphin
Completed Goals: get rid of dependency on special build of Dolphin (1/13/16)

luckycharms14
Hi, I noticed that this project was designed for dolphin emulator, but could there be a chance of getting it working on the Wii with something like Nintendon't? I believe it does support cheat codes, and virtual memory cards.
 
Joined
Jan 10, 2016
Messages
19
#7
Hi, I noticed that this project was designed for dolphin emulator, but could there be a chance of getting it working on the Wii with something like Nintendon't? I believe it does support cheat codes, and virtual memory cards.
That is certainly a long term goal, but I think it will be difficult to get running on console, plus it would have to be a simpler AI, but it could be good enough to train against
 

Ed94

Smash Apprentice
Joined
Apr 2, 2015
Messages
164
Location
Pembroke Pines, Florida
#8
(Sorry I'm in my early years of programming, dunno everything off the bat, have only slight experience with python, c++, and c# with monogame framework.)

I noticed this is just source code only right now. Your build would work on windows so long as I compiled it correct? Would it be fine if I used MinGW?
 
Last edited:
Joined
Jan 10, 2016
Messages
19
#9
(Sorry I'm in my early years of programming, dunno everything off the bat, have only slight experience with python, c++, and c# with monogame framework.)

I noticed this is just source code only right now. Your build would work on windows so long as I compiled it correct? Would it be fine if I used MinGW?
The problem is the way in which the program and Dolphin communicate, which is currently Unix specific (works on Mac and Linux), we are working on porting this to Windows.
 

Acryte

Smash Ace
Joined
Mar 30, 2005
Messages
986
#16
So what are the emulator-based dependencies that you utilized which make it significantly harder to port to console?
 

luckycharms14

Smash Rookie
Joined
Jan 10, 2016
Messages
19
#17
So what are the emulator-based dependencies that you utilized which make it significantly harder to port to console?
The emulator-based dependencies mostly have to do with getting input/output between melee and our program, which is external to Dolphin. That part actually doesn't effect the port to console, but is making the port to windows a bit involved. The port to console is difficult simply because there is a lot of C code to inject into Melee, although I've been playing around with things and I am optimistic about the console port.
 

SinsOfApathy

Smash Journeyman
Joined
Feb 24, 2015
Messages
470
NNID
Psion312
#18
The emulator-based dependencies mostly have to do with getting input/output between melee and our program, which is external to Dolphin. That part actually doesn't effect the port to console, but is making the port to windows a bit involved. The port to console is difficult simply because there is a lot of C code to inject into Melee, although I've been playing around with things and I am optimistic about the console port.
If you want to make like easier, grab the no compression version of Dolphin here. I've got a copy of a decompressed save state file on my Github, which is https://www.github.com/psilupan, though I don't think you can load it without decompressed Dolphin.

From there, just write up your payload to copy into main memory, dcbi, sync, and you should be set.
 
Last edited:

luckycharms14

Smash Rookie
Joined
Jan 10, 2016
Messages
19
#21
That looks awesome!! Seriously great work.

Where should I add it? Just put it in the top post?

I guess its a good idea to re-format the whole thing to look nicer
 
Last edited:

ssknight7

Smash Apprentice
Joined
Oct 8, 2014
Messages
135
#22
Using the Memory Watch feature talked about in the reddit thread, and in the same line of thought as this project, would it be possible to set up a custom scenario, record it from memory and then replay it?

For instance you grab P2 controller, jump off ledge and you do a firefox sweetspot from below. While you're performing the action a module is scanning p2 input memory space every frame and recording it. Once you signal that you're finished recording your scenario, you can recall and loop the scenario over and over without having to actually write the action codes out?

This might be a much more intuitive way to write out AI input without having to write asm, inject etc.
 
Joined
Jan 10, 2016
Messages
19
#23
Using the Memory Watch feature talked about in the reddit thread, and in the same line of thought as this project, would it be possible to set up a custom scenario, record it from memory and then replay it?

For instance you grab P2 controller, jump off ledge and you do a firefox sweetspot from below. While you're performing the action a module is scanning p2 input memory space every frame and recording it. Once you signal that you're finished recording your scenario, you can recall and loop the scenario over and over without having to actually write the action codes out?

This might be a much more intuitive way to write out AI input without having to write asm, inject etc.
That type of feature would only be available on the computer version of the AI, in which case you never have to write ASM or inject anything. I think that could certainly be done, but I'm also hoping to have an easy to use way for users to make custom behavior that is more general than just repeating a set of actions.
 

VoidedSmash

Smash Rookie
Joined
Feb 17, 2016
Messages
23
#24
This looks very cool. Having experience with C and it's memory handling, I'll take a look at that and see if it would be possible to convert this into an attack program (since currently its defense oriented).
 

luckycharms14

Smash Rookie
Joined
Jan 10, 2016
Messages
19
#25
This looks very cool. Having experience with C and it's memory handling, I'll take a look at that and see if it would be possible to convert this into an attack program (since currently its defense oriented).
Would you like to be added to the communication group? Send me an email if you do.
 

worm_hd

Smash Cadet
Joined
Apr 27, 2015
Messages
48
#26
Is there a way to build the ISO on Mac without using a virtual machine or setting up a dual-boot? Wine doesn't seem to like Melee Code Manager or DRGN's DOL Manager (older version of the same thing).

Edit: I'm going to attempt manual hex replacement.

Edit 2: Super nevermind.
 
Last edited:

Kou

Smash Apprentice
Joined
Nov 22, 2011
Messages
198
Location
Japan
#29
Standalone ISO is so awesome!!!
Please it includes "Normal C-stick functionality in 1 Player Modes"...
I want to play with this AI in Trainig Mode.


P.S.
I could used that code!
 
Last edited:

Rank1Soon

Smash Rookie
Joined
Jan 22, 2016
Messages
6
#30
Uhm, the title says it works for console... So how do I get it to work?
Just patch the iso, and run on wii via nintendont?
 

Rank1Soon

Smash Rookie
Joined
Jan 22, 2016
Messages
6
#34
Wait, the bot doesn't DI at all? Try shining fox with falco at 0%, fox should DI hard away
NVM , I tested it and indeed Fox DI s hard away. However he doesnt DI the Up-Throws of Marth.

Another thing: I put Falco on Player 2 and he did recover properly too. Only thing is that he cant ledgedash to the stage. Little adjustments there and you'd have the second AI character :)
 

luckycharms14

Smash Rookie
Joined
Jan 10, 2016
Messages
19
#37
NVM , I tested it and indeed Fox DI s hard away. However he doesnt DI the Up-Throws of Marth.

Another thing: I put Falco on Player 2 and he did recover properly too. Only thing is that he cant ledgedash to the stage. Little adjustments there and you'd have the second AI character :)
Ok, ya it won't DI throws yet... that will be in the next release. And Falco would be really easy to program so that should be done shortly.
 

Chulip

Smash Rookie
Joined
Aug 23, 2015
Messages
21
#38
I tested out Falco on this earlier to see if he works the same since his special are the same as Fox's and it works pretty much amazing already.
Only problem with Falco is he always fails the ledge dash and SD's.
 

KyoTehCatt

Smash Cadet
Joined
Nov 29, 2009
Messages
67
Location
Pennsylvania, Scranton
#39
I see a tutorial for SD Remix. It doesn't help me download the current one you have.. Idk how I can use that tutorial for this? Do they both is xdelta.

Also I can't open the http://www.mediafire.com/download/h8dwxxbrw3d1o3a/MeleeAI_patch.xdelta file. It doesn't let me open it. I'm on a computer and trying to put this on my dolphin on pc. Is that capable? Or is this just for gamecube/wii? Anyways yea.
 
Last edited:

luckycharms14

Smash Rookie
Joined
Jan 10, 2016
Messages
19
#40
I see a tutorial for SD Remix. It doesn't help me download the current one you have.. Idk how I can use that tutorial for this? Do they both is xdelta.

Also I can't open the http://www.mediafire.com/download/h8dwxxbrw3d1o3a/MeleeAI_patch.xdelta file. It doesn't let me open it. I'm on a computer and trying to put this on my dolphin on pc. Is that capable? Or is this just for gamecube/wii? Anyways yea.
Download the patch from the link you have, then follow the tutorial on the SD remix site for how to patch an iso. We both use xdelta patches so the steps are the same, just apply MeleeAI_patch instead of the SD remix one.
 
Last edited:
Top