• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

FifthCPU's Custom AI Discussion/Workshop

nimigoha

Smash Ace
Joined
Jan 31, 2014
Messages
877
Are those random techs? And is it random DI or certain combo DI/survival DI?
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
Are those random techs? And is it random DI or certain combo DI/survival DI?
From the code KC just posted, random techs, and a combination code that swaps between combo/survival DI. Its sweet.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
Awesome!

I'm planning on digging more into SCDBottom in between recoveries (next is Lucas, I guess, or maybe Tink or Snake because bomb/C4 juggling), since the way my wavelanding code is set up it should work, but its kind of just failing horribly. I'll probably just use a routine to test what situations count as what for OSCDBottom and go from there.
 

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
And Done
LvL 1 - Does nothing but Recover's when knocked off stage, DI, and Tech
LvL 2 - Shields Attacks, and Counters out of Shield and Recover's when knocked off stage, DI, and Tech
LvL 3 - Dodges, and Avoid Attacks and Recover's when knocked off stage, DI, and Tech
LvL 4 - Melee LvL 9 Cpu's + Wave Dashing, Teching, and L-Cancels


Just have to fix a wavedashing error and the first 4 levels are complete.
FifthCPU FifthCPU
This is what i created for l-canceling. Worked like a charm.
Code:
if CurrAction >= 51 &&CurrAction <= 51 &&FramesSinceShield > 1
Button R
endif
This spams the R Buttom while aerial attacks are going, I've only tested it on short hop aerials but it should work perfectly fine.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
?__?
what do you mean between recoveries?
My bad, completely screwed up with my grammar. I'm alternating between improving recoveries and working on wavelanding.
could throw one together for you if you want.
That's all right, mine by all rights should work (and worked amazingly well in the past, except for not using certain platforms on certain stages), I just made some sort of typo somewhere or misused SCDBottom so it isn't working.
 

nimigoha

Smash Ace
Joined
Jan 31, 2014
Messages
877
For the counter out of shield level 2 bots, does every character do the same thing like grab or roll, or do they do their character specific fastest OOS option, or a different pick of a group of OOS options each time its shield gets attacked?
 

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
There are only two options right now. Are you in front or behind the cpu?
I haven't matched these options to each and every character, only just fox.
As this is more of a proof of concept until i finished at least one character.
Afterwards i will be asking for suggestions on individual characters.
The reason why i'm building it like this is so that its systematic.
Making it easy for me to copy paste the complete system to another character and just make the corrections, or changes needed.
 

nimigoha

Smash Ace
Joined
Jan 31, 2014
Messages
877
There are only two options right now. Are you in front or behind the cpu?
I haven't matched these options to each and every character, only just fox.
As this is more of a proof of concept until i finished at least one character.
Afterwards i will be asking for suggestions on individual characters.
The reason why i'm building it like this is so that its systematic.
Making it easy for me to copy paste the complete system to another character and just make the corrections, or changes needed.
That's sweet!

Also in case you want a quick reference, someone in the subreddit made a list of fastest OOS options for every character. Just for when you get that far.
 

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
It gives me something to look for, the fastest isn't necessary the best option but it a good start for sure.
If it was more detailed like including the top five attacks per character would have been better.
For example grabs are mostly only supposed to work when you in front of them, but what about behind?
I guess i can use this list for all front option though...
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
It gives me something to look for, the fastest isn't necessary the best option but it a good start for sure.
If it was more detailed like including the top five attacks per character would have been better.
For example grabs are mostly only supposed to work when you in front of them, but what about behind?
I guess i can use this list for all front option though...
I tried for a short time to work on OOS options and eventually stopped, based on all the modifications you had to do to 3000-30B0 in Bowser and Fox its pretty complicated. Here's my view on how OOS options would work ideally:

Options
Everyone: Wavedash away OOS, Shield grab, Jump OOS, Buffered Roll/Spotdodge
Samus, Bowser, Link, etc.: Up-B OOS
Spacies and Lucas: Shine/Magnet OOS
Pikachu, Sheik, etc.: Fast aerial OOS, such as nair.

Unfortunately, CPUs tend to drop their shield fast enough that a lot of the time I don't even see them use OOS options.
 

nimigoha

Smash Ace
Joined
Jan 31, 2014
Messages
877
Also if possible, Lucas's OU Burst is a frame 7 option if he has a charge, I'm sure that could be put in too right?
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
KingClubber KingClubber OH THANK GOD. I tried messing with them, and they're so insanely complicated. Thank goodness.

Also, I have good news and I have bad news.

The bad news is, your teching routine will work great on final destination, but not on platforms, and not at all on some stages. I was right about my hunch on SCDBottom, unfortunately.

The good news is, I know why, and I know how to fix it. The even better news is, its why my wavelanding routine was failing, so I can solve both our problems at the same time. I'll post in a little bit, I've dug a lot into how SCDBottom works and I figured out how to get it to do what we want.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
KingClubber KingClubber OK, I might be off on this, but here's the issue I see: SCDBottom only returns the coordinate of the landing collision, not the distance to it. Since all the teching code checks thus far is SCDBottom less than 5, it will work perfectly as long as the opponent is right next to the main body of the stage (assuming the floor is at y=0). Otherwise, such as on platforms, it won't do anything.

My idea for a fix was to take the difference of YCoord and SCDBottom and check for that, but that doesn't seem to be working when I do it. They both are fine individually but when I take the difference things get really weird.

EDIT: Still slogging through recoveries, scripts and changelog viewable in the downloads in OP. Just took Samus's code and edited it so that Lucas now uses his tether to recover sometimes, greatly improving him as a CPU. Also started fixing ZSS's recovery, wish me luck y'all.
 
Last edited:

nimigoha

Smash Ace
Joined
Jan 31, 2014
Messages
877
ZSS recovery is so strange, it seems like the wackiest to program AI with.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
ZSS recovery is so strange, it seems like the wackiest to program AI with.
All I've done so far is make her less reluctant to use her side-B to grapple to the ledge. I'm putting off adding in the down-B part of the recovery. It doesn't help that my ZSS is trash.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
ZSS recovery is so dumb, don't how it even works half the time.
I've gotten pretty good at reading the recovery routines now, and I'm pretty sure the issue is (partly) that ZSS tries to be under the stage, but plasma wire won't snap to the ledge if you're under the stage, leading to SDs. Not to mention it doesn't use down-B at all, the tether code is terrible and tells her not to recover sometimes (I already fixed that, luckily), and the CPU likes to go offstage all the time.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
3 days ago:Sees ZSS SD because attempts to Fair when grabbing the ledge. Assumes that its just some bad AIPD or routine call. Forgets it.

Today: Finds a piece of code that very clearly tells ZSS to fair when close to the ledge and offstage. Not even when the opponent is nearby, just when she's close to the edge. Its like she's literally coded to fail! WHO WROTE THIS EVEN??? AAAAAAAAGH

Good news is I understand how to do recovery code, so its going pretty well.
 

nimigoha

Smash Ace
Joined
Jan 31, 2014
Messages
877
Probably ignorant question: would the Nintendo team have coded AI using the same language in AIScriptpad? As in, are you guys tweaking AI the same way and they just had more knowledge, or did they have another level that let them do more or generalize more? Like is AIScriptpad a creation that modifies routines in a unique way or does it do the same thing they probably did?
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
Probably ignorant question: would the Nintendo team have coded AI using the same language in AIScriptpad? As in, are you guys tweaking AI the same way and they just had more knowledge, or did they have another level that let them do more or generalize more? Like is AIScriptpad a creation that modifies routines in a unique way or does it do the same thing they probably did?
That is an excellent question! ...which I do not know the answer to. I'm like 90% sure that theirs was not coded in the same language, especially based on the way some of the edgeguarding routines look. One of them doesn't use multiple variables, it just resets the same exactly variable literally dozens of times throughout the code, which doesn't speak to me as great coding methods.
 

nimigoha

Smash Ace
Joined
Jan 31, 2014
Messages
877
Sothe person who made AIScriptpad create a new language that successfully alters the code? That really impressive.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
Sothe person who made AIScriptpad create a new language that successfully alters the code? That really impressive.
KC would know better than I, since he actually knew Bero. I just worked off Bero's instructions/tutorial. I'm completely shooting in the dark, may be 100% wrong.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
Interesting fact: Snake's C4 detonation doesn't seem to be controlled by any routines. He just automatically uses it if the opponent is far away from him and close to a mine or has been stickied. That's kind of awesome. Snake's AI is weird though, I'm teaching it chain throws and tech chases and its still trying to sticky me and mine the field every once in a while.

EDIT: Yeah, definitely uncontrolled by any routine. How bizarre. Also, I'm fairly close to a snake/charizard routine which allows zero-death down throw tech chases, since I'm a bad person like that. The routine is ugly, but it works on everyone but Mewtwo FRoll (funky tech roll is really hard to deal with) and Squirtle Getup attack (Hurtbox super tiny and getup attack causes too much shield knockback). Barring bad placement at the ledge, which I'm already working on, Grab=Automatic zero-death.
 
Last edited:

nimigoha

Smash Ace
Joined
Jan 31, 2014
Messages
877
That video was cool!

Can you edit the routine so the reaction time is increased to make it more human? Or is there really any point, it's not much of a training tool to get tech chased by human-perfect reaction. Your call, but imo it would be sufficient for Uthrow chains to sticky.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
That video was cool!

Can you edit the routine so the reaction time is increased to make it more human? Or is there really any point, it's not much of a training tool to get tech chased by human-perfect reaction. Your call, but imo it would be sufficient for Uthrow chains to sticky.
Thanks! I frankly just figured out how to make this possible, and I'm doing it by reading the frame of animation that the opponent is on (yay for 3.6's normalized getup invincibility!). I think if I just increased the grab frame it would be a lot more human, as well as actually escapable through buffering rolls and such. This was just to see how good I could make a CPU if it flat-out abused things that human's can't do.

EDIT: Just edited to fix and merge the routine with grab. Should work with a few characters, just most applicable to Snake. This code seems super useful actual, since I'm also using it for jab resets and missed tech punishes.
 
Last edited:

Deku_Scrub

Smash Rookie
Joined
Nov 18, 2014
Messages
1
Location
Marcellus, Michigan
I think this project is incredible and definitely deserves some more attention! I was always interested in how the AI functioned in Smash, but the complexity is overwhelming! Props to everyone involved and I can't wait to see what's next!
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
I DID IT. I DID WHAT I THOUGHT WAS IMPOSSIBLE.

I fixed ZSS's recovery.

Rather than write my own recovery routine (I rather like the ones built into the game) I decided to fix what was wrong with the original one. And oh boy, was there a lot wrong with it.

Things I fixed:
  • Zamus no longer uses Fair offstage randomly. This was hardcoded into the script, but I have no clue why.
  • Zamus uses Down-B to recover when a decent distance from the ledge. I wrote my own code for this, and it works like a charm.
  • Zamus actually uses her tether at the correct time. This was the biggest issue with her in P:M, that she tried to be like marth and only tether when both falling and beneath the stage. Now, she basically uses it as soon as she jumps, keeping the momentum of jumping to get the best ledge box, and is far more willing to use it when diagonal to the stage. This by far was the hardest part to figure out.
  • As a side effect of the fixed up-B tether, Zamus sometimes throws out an offstage side-B tether which misses, but the hitbox comes out onstage, before jumping and using up-B to recover. This is unintentional, but kinda cool since it lets her attack onstage edgeguarders.
The only remaining issue is that sometimes she'll use her tether when really far from the stage, but this is generally only in situations when she would've been KO'd any way. I'll upload the text file of my fixes to the link in the OP and store it with the other recovery buffs. I'm also thinking of just creating an add-on for this one, since it makes a 100% unplayable CPU actually playable.

I'm not sure which recovery to work on next. Also, something I'm thinking about: I might work on having CPUs throw out attacks if they notice their recovery is being offstage edgeguarded (Kirby will attempt to kirbycide them, Jiggs will use pound, etc.)
 

nimigoha

Smash Ace
Joined
Jan 31, 2014
Messages
877
Can you make an add-on that's like your whole pack? Like whatever you've worked on so far that you're happy pushing out?

So excited about ZSS. Video? You know me, I'm always hungry for your stuff.

Can you make Lucas use his Magnet to turn himself around and then tether to the ledge? He doesn't use his tether at all, and sometimes he'll Up B and overshoot the angle, for example instead of recovering at a 60 degree angle from the bottom left to the stage, he'll do like a 100 degree angle and kill himself.

Also making him do frame perfect multi magnets on shield would be dope ^_^

Pikachu will also kill himself with single QA that goes to the height of the ledge but too far away, and then falling to his death.
 
Last edited:

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
Can you make an add-on that's like your whole pack? Like whatever you've worked on so far that you're happy pushing out?

So excited about ZSS. Video? You know me, I'm always hungry for your stuff.

Can you make Lucas use his Magnet to turn himself around and then tether to the ledge? He doesn't use his tether at all, and sometimes he'll Up B and overshoot the angle, for example instead of recovering at a 60 degree angle from the bottom left to the stage, he'll do like a 100 degree angle and kill himself.

Also making him do frame perfect multi magnets on shield would be dope ^_^

Pikachu will also kill himself with single QA that goes to the height of the ledge but too far away, and then falling to his death.
I'm pretty much just working on buffing CPU recoveries right now, and I actually already made Lucas tether by stealing some code from Samus (I'm not familiar with magnet turnaround, What is that?). If you look in the OP link, I've got a folder filled with .txt copies of the recovery code, as well as a changelog of what I've added to each so far. I'm thinking about pushing out a pack, since I've got a lot of random unreleased stuff that could be interesting.
 

nimigoha

Smash Ace
Joined
Jan 31, 2014
Messages
877
I'm pretty much just working on buffing CPU recoveries right now, and I actually already made Lucas tether by stealing some code from Samus (I'm not familiar with magnet turnaround, What is that?). If you look in the OP link, I've got a folder filled with .txt copies of the recovery code, as well as a changelog of what I've added to each so far. I'm thinking about pushing out a pack, since I've got a lot of random unreleased stuff that could be interesting.
Sounds awesome!

Well since you can only tether to the ledge when you're facing it, if you're knocked offstage and facing away from the ledge, you use magnet quickly and either B reverse it or B turnaround (B turnaround is usually better, and is just doing down and slightly towards ledge on the stick then B). You can also use it before you use your jump then jump out of the magnet after it turns you around, which should be faster than jump and then magnet and then wait for all of magnet end lag (since you can jump out of magnet before the first IASA frame). And of course airdodge before tether.
 
Top Bottom