• 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

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
I mean there's no reason not to keep going as we're going in this thread right? Keeps things open and people can drop in and check it out instead of somehow finding out about it then requesting to be in the Skype group...

Are you trying to make the CPUs powershield as much as possible or can you cap it at like 30% of the time?
Yeah, I like this thread :]

As far as powershielding goes, I'm just trying to see if I can teach a CPU to do it effectively, then worry about frequency. I got one to do it a fair amount, but not how I wanted.
 

Qazzquimby

Smash Cadet
Joined
Jul 25, 2014
Messages
25
I'd like consistent powershielding to be an option, if that becomes possible.

What is the newest scriptpad I'm supposed to be using? Mine is 2.0, and I can't find anything newer.
 
Last edited:

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
Question:

How would people feel about me making a tutorial series on AIScriptpad?

I feel like there are very few good ways to learn how to use the program (KingClubber obviously taught me a lot of what I know, but a lot of what I learned was also through reading Bero's out-of-date notes and trial-and-error with my own work). I was thinking about creating a video tutorial on how to use the program, so that people can get into this section of modding more easily. Based on the messages I get, there are a lot of people extremely interested in this section of modding, but because the barrier-to-entry is so high (teach self programming language), only a few of us are actually successful in being able to make things and dedicated enough to continue, and our community is maybe like five people. I don't want this section of modding to die out, and due to a recent thread on reddit, a lot of people would be incredibly interested in an AI tourney, but there are no good ways to learn and not enough people to create.

What do you guys think?
 

Qazzquimby

Smash Cadet
Joined
Jul 25, 2014
Messages
25
I would obviously be for it. I don't see why anyone would not be for it.
I think a written tutorial might be better than a video though, since you can more easily give examples of code. I also prefer text tutorials in general.
 
Last edited:

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
I would obviously be for it. I don't see why anyone would not be for it.
I think a written tutorial might be better than a video though, since you can more easily give examples of code. I also prefer text tutorials in general.
Yeah, plus video tutorials take a LOT longer for me. Text=fast, easy, and me being clear. Videos=Need time to script and set up, or improvise and be unclear. Plus, I'm 100% fine with public speaking, but I have a huge issue with talking to not a live audience, its super different.

Also, (for everyone in the thread) a lot of people have begun expressing interest in an AI bot tourney. Take that however you want *shrugs*
 

Forsage

Smash Rookie
Joined
Mar 27, 2014
Messages
10
Location
Canada
NNID
WisdomAndCourage
I think a lot of people there were interested in the idea of watching extremely intelligent AI play, similar to TAS. I'm not sure how many know what goes into that.

At any rate, I'm currently getting Dolphin so I can experiment and debug my code, since I gave my Wii to my sister. I'd love a tutorial that goes over the meanings of some things. As an example, could you explain this to me?:

How does the Routine Call table work?
For Zelda: AIPD lists !FullCharge twice, calling Unk3030 times. The first is when she is !SamePlane, the second when she is. Parameters are different though, 90, 0, 100, 30 and 80, 0, 100, 30 respectively. Zelda can't hold a charge, unless it's referring to placing Din's fire, so the code seems redundant both times, yet the parameters are different. Do you know why?

Also, the Unk3030 file. It's a pretty simple file, which is why it makes a good example of everything, I'm pretty sure it's built just to stall a frame, but I want to make sure.

It includes AIMain and has an id, that's easy to understand.
It sets unk 0x60000, do you know why that number?
It sets str "#wait_f", these feel almost like comments to me and they're never seen again in the file. Do you know what str does?
Then the code is as follows:

Code:
if !(ODistLE 23)
Finish
endif
//____________________
label
if FrameGE 0 && !(FrameGE 1)
Finish
endif
Return
To my understanding, this says: If the opponent is further than 23 units away, return. Otherwise, loop until the execution of the thread has gone further than 0 frames but not greater than 1 frame. (In other words, exactly 1 frame). Then return.

Is my understanding correct? And I don't expect you to know everything, I'm going to experiment some myself, I just want to learn what I can. Thanks for the help!
 

Qazzquimby

Smash Cadet
Joined
Jul 25, 2014
Messages
25
I have the opposite problem, with recording my voice being fine (I imagine) and live audiences being terrifying.

People keep talking about extremely intelligent ai, and ai that plays like pro players. I was under the impression that was impossible with the tools we have, given restraints in the coding. If that's wrong, that's very exciting.

I don't see high level ai tourneys going anywhere, since it will take so long to make a high level ai interest will peter out, and only 1 or 2 will finish in any reasonable amount of time. Low level ai could work though, but it seems like that would involve picking the easiest character to code for it (cpuslayer puff), or working with the best existing ai (zelda, I think).

Am I supposed to be using a scriptpad newer than 2.0? King Clubber said I was using an old version, but I can't find any other version.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
I have the opposite problem, with recording my voice being fine (I imagine) and live audiences being terrifying.

People keep talking about extremely intelligent ai, and ai that plays like pro players. I was under the impression that was impossible with the tools we have, given restraints in the coding. If that's wrong, that's very exciting.

I don't see high level ai tourneys going anywhere, since it will take so long to make a high level ai interest will peter out, and only 1 or 2 will finish in any reasonable amount of time. Low level ai could work though, but it seems like that would involve picking the easiest character to code for it (cpuslayer puff), or working with the best existing ai (zelda, I think).

Am I supposed to be using a scriptpad newer than 2.0? King Clubber said I was using an old version, but I can't find any other version.
Yeah. I mean, I can thrash out a competent AI in only an hour, but its (by my standards) pretty rubbish, and I can only do it that fast because I've had enough experience to know exactly what to do and how. CPUslayer puff actually took forever, since I had to paste the rest check into like every single code plus a few. So I could see maybe one AI tourney ever taking place, and only as like a publicity stunt, if it ever happened. Still, fun to think about.

I think your version is definitely outdated, and mine is as well, although less so. Not sure what to do about that, I'll look into it.

Forsage Forsage Unfortunately, I don't know the answer to almost any of those things. The unknowns set at the beginning of the code seem to do literally nothing, as well as the str. Hint: Ignore them, and when writing your own routines just use unk 0x0.

As far as 3030 goes, its usually used for things like charge shot and such. Zelda's 3030 essentially appears to pass the frame, probably indicating that it was something relevant in brawl but not in P:M, so its been removed. Maybe something with Din's fire that's not useful anymore? The reason its in multiple AIPD slots is hard to put into words exactly, but its essentially for covering all the possible situations in which it could be used, so they cross over sometimes.

As far as TAS style play goes its possible, but those types of bots don't get made over night. Squirtle took me a huge amount of time, and its still not perfect.
 

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
a lot of people there were interested in the idea of watching extremely intelligent AI play, similar to TAS.
Watching Yes, Playing...not so much
How does the Routine Call table work?
AIPD chooses random by random random action.
For Zelda: AIPD lists !FullCharge twice, calling Unk3030 times. The first is when she is !SamePlane, the second when she is. Parameters are different though, 90, 0, 100, 30 and 80, 0, 100, 30 respectively. Zelda can't hold a charge, unless it's referring to placing Din's fire, so the code seems redundant both times, yet the parameters are different. Do you know why?
Ignore, there's a reason why i use 100,100,0,0 because these are random chance just a much as any, it doesn't choose the first on the list ever, or out beat another chance by a chance its just random/
Also, the Unk3030 file. It's a pretty simple file, which is why it makes a good example of everything, I'm pretty sure it's built just to stall a frame, but I want to make sure.
Might have done that myself. i forget.
People keep talking about extremely intelligent ai, and ai that plays like pro players. I was under the impression that was impossible with the tools we have, given restraints in the coding.
It's possible. just difficult.
Am I supposed to be using a scriptpad newer than 2.0? King Clubber said I was using an old version, but I can't find any other version.
Give me til Friday, I gotta remove and make new syntax for routines scripts. "Sorry FifthCPU FifthCPU "
 
Last edited:

Qazzquimby

Smash Cadet
Joined
Jul 25, 2014
Messages
25
Watching Yes, Playing...not so much
I'm personally very interested in playing unbeatable ai. It's not about winning, its about self improvement.

It's possible. just difficult.
Do the cpus have perfect information as to what's going on around them (lag left on opponent's current attack, etc)? Is there a limit to how many behaviours a cpu can have (besides filesize), or specific cases to call behaviours in?
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
I'm personally very interested in playing unbeatable ai. It's not about winning, its about self improvement.


Do the cpus have perfect information as to what's going on around them (lag left on opponent's current attack, etc)? Is there a limit to how many behaviours a cpu can have (besides filesize), or specific cases to call behaviours in?
The thing is, an unbeatable AI wouldn't really help you improve. A fox in real life won't usually dash up into a perfect drillshine shieldbreak, even if an AI is written to perfectly shield pressure every time, nor will a human usually do a hydropivot wavebounced b-reversed aqua jet, although you can write an AI for it. Basically what I'm trying to say is you can make an AI that does tas-style insanity, but that doesn't mean it'll help you improve.

CPUs have information about pretty much anything that's going on around them, not necessarily the lag on attacks although it wouldn't be too hard to write a code that punished endlag (not sure if it would work, but I have an idea of a way)

"No problem KingClubber KingClubber , my version works fine and I know what all the useful unknown routines do already."
 

Qazzquimby

Smash Cadet
Joined
Jul 25, 2014
Messages
25
Basically what I'm trying to say is you can make an AI that does tas-style insanity, but that doesn't mean it'll help you improve.
The main issue with practicing with ai, is it will allow unsafe attacks to go unpunished, and not apply a human level of pressure. If an ai could consistently punish unsafe attacks, even better than a human could, adapting to the ai would greatly improve your play, (excluding cases when you're playing with someone unable to punish due to skill level). If an ai could apply great levels of pressure, even better than a human could, learning to avoid and escape the pressure would similarly improve your play.
I might be being unclear.
Its sort of like how playing high level players won't help you against low level players as much as it will against high level, because the level of risk for each action changes. The analogy stands with high level replaced with TASbots and low level replaced with high level.

I'd also love for your squirtle to hydropivot wavebounce b-reverse aqua jet.

CPUs have information about pretty much anything that's going on around them, not necessarily the lag on attacks although it wouldn't be too hard to write a code that punished endlag (not sure if it would work, but I have an idea of a way)
I thought they had access to much less information than that, which was part of why I was thinking of an external program to handle ai using controller input. If it becomes possible to make the game write data to a file, all the learning ai hypotheticals would become possible.

If its possible to have any number of triggers and responses, with each trigger set (at least at first) to one response, could a near-perfect flowchart method of play be made? To make this more reasonable, imagine it was programmed only to perfectly fight one character (to allow code swaps based on opponent character). Knowing their frame data perfectly, it could determine from their position and state what options they have, and how to avoid them/punish. If it's a trap kind of setup, where one reaction leads to a punish, either have the cpu react randomly (weighted toward the lesser punish).
Am I speaking nonsense?
 

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
The reasons why i'm changing stuff again is because i'm trying think of a way to minimize "Bero's Curse"
One of my ideas is butchering AIPD in a way that make it only Ask for a AI Script that acts like an AI HUB.
So instead having multiple instance of stuff like this
Code:
JumpRecoverRange&&CanJump {
    EdgeRecover 10,20,100,0
}

//Entry number : 0x1
CanJump {
    JumpOnStage 100,100,0,0
}

//Entry number : 0x2
True {
    EdgeRecover 100,100,0,0
}
It will only be
Code:
Back&&!Back {
    AIHub 100,100,0,0
}
AIHub would control everything opening up more options than what AIPD does on it's own.
Another things would be finding every Script ran by Bero's Curse without the need for AIPD and force them to not work, this is controlled by Hard Code in Brawl's Source Code.
The aim is simple, remove all sources of randomness, and make AI completely controllable.

=~|<•>|~=​
 

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
AI Instinct aka Bero's Curse

In Brawl AI has its own source code much like SSBM's AI, its completely all under the hood AI mechanics that reacts to different actions even if you remove every possible AI script. These are all defensive in nature much like shielding ones self from being punch in the face when someone quickly move their fist even it wasn't threatening.

Bero was the one that discovered it thus Bero's Curse.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
AI Instinct aka Bero's Curse

In Brawl AI has its own source code much like SSBM's AI, its completely all under the hood AI mechanics that reacts to different actions even if you remove every possible AI script. These are all defensive in nature much like shielding ones self from being punch in the face when someone quickly move their fist even it wasn't threatening.

Bero was the one that discovered it thus Bero's Curse.
I just ran into some of this recently. I've been messing around with Reflect (30E0) for powershielding, but all the calculations for when reflect are called are under the hood and occur in extremely bizzare situations, and you can never get it to not be called, just make the routine automatically finish like in 3.6. In addition, even if you set every part of AIPD to nothing, CPUs are still not always happy about standing there waiting to be grabbed.

EDIT: Basically, don't use the reflect routine. It sucks.
 
Last edited:

nimigoha

Smash Ace
Joined
Jan 31, 2014
Messages
877
Wait...

Does Bero's Curse have anything to do with how CPUs set to "Stand" will sometimes climb up from the ledge, stand for a bit, then randomly jump, then do nothing?
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
Finished up the text for the first tutorial. Unfortunately, teaching the beginning of AIScriptpad isn't very exciting, so lesson 1 is super boring. Also, need to remember where the DL link is.
 

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
FifthCPU FifthCPU
Found more dumb AI Stuff
Remember the AI level values i gave you, and said something about them were wrong. Turns out you were partially right.
Take a look at this and tell me what looks wrong, but from my testing its perfectly correct.
Code:
if LevelValue >= 0 &&LevelValue <= 10 //1
elif LevelValue >= 10 &&LevelValue <= 20 //2
elif LevelValue >= 20 &&LevelValue <= 30 //3
elif LevelValue >= 30 &&LevelValue <= 40 //4
elif LevelValue >= 40 &&LevelValue <= 45 //5
elif LevelValue >= 46 &&LevelValue <= 50 //6
elif LevelValue >= 60 &&LevelValue <= 70 //7
elif LevelValue >= 70 &&LevelValue <= 80 //8
elif LevelValue >= 80 //&&LevelValue < 90 //9
endif
Don't believe me? Test it for yourself.

====
Adding on to this.
The first step to my plan is working.
I created the AIHub prevent all actions other than those caused by Bero's
Step 2 i just finished after doing the testing for the level values.
Now each cpu level will have it's own AIHub.
AIPD > AIHub > LvL1Hub > ????
The only ones i can't control right now are those used by force codes.
 
Last edited:

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
FifthCPU FifthCPU
Found more dumb AI Stuff
Remember the AI level values i gave you, and said something about them were wrong. Turns out you were partially right.
Take a look at this and tell me what looks wrong, but from my testing its perfectly correct.
Code:
if LevelValue >= 0 &&LevelValue <= 10 //1
elif LevelValue >= 10 &&LevelValue <= 20 //2
elif LevelValue >= 20 &&LevelValue <= 30 //3
elif LevelValue >= 30 &&LevelValue <= 40 //4
elif LevelValue >= 40 &&LevelValue <= 45 //5
elif LevelValue >= 46 &&LevelValue <= 50 //6
elif LevelValue >= 60 &&LevelValue <= 70 //7
elif LevelValue >= 70 &&LevelValue <= 80 //8
elif LevelValue >= 80 //&&LevelValue < 90 //9
endif
Don't believe me? Test it for yourself.

====
Adding on to this.
The first step to my plan is working.
I created the AIHub prevent all actions other than those caused by Bero's
Step 2 i just finished after doing the testing for the level values.
Now each cpu level will have it's own AIHub.
AIPD > AIHub > LvL1Hub > ????
The only ones i can't control right now are those used by force codes.
Wow. This is awesome. I've been messing around trying to find the level values when I'm working with AI, and this looks similar to what I came up with, since I had a range of 59 to 80 to get DI random at level 7 and 8. I'm guessing what you have is right. AIHubs for CPUs... wow. This is going to be crazy. Since I'm between projects atm, I'm probably going to work on buffing recoveries and making them work better, like ZSS and Mewtwo for example. Also, I need to check where it is, but I found the code in the common3 that handles shielding, which is cool and has some potential applications.

I guess potentially ones with force codes could be handled by adding a level check in the beginning of that code.

EDIT: Wow, forgot how complex recovery routines for JumpOnStage are. Still, I actually understand them now, and I'm pretty sure I can do some fixing (Make Ganon use Kick to recover, etc).
 
Last edited:

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
FifthCPU FifthCPU

This is for DI, what do you think?
Code:
var0=-1
var1=1
if Damage >= 70
    Mul var0 -1
    Mul var1 -1
endif
if KBAngle >= 0 &&KBAngle <= 90
    Stick var0 var0
endif
if KBAngle >= 90 &&KBAngle <= 180
    Stick var1 var0
endif
if KBAngle >= 180 &&KBAngle <= 270
    Stick var1 var0
endif
if KBAngle >= 270 &&KBAngle <= 360
    Stick var0 var0
endif
 
Last edited:

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
FifthCPU FifthCPU

This is for DI, what do you think?
Code:
var0=-1
var1=1
if Damage >= 70
    Mul var0 -1
    Mul var1 -1
endif
if KBAngle >= 0 &&KBAngle <= 90
    Stick var0 var0
endif
if KBAngle >= 90 &&KBAngle <= 180
    Stick var1 var0
endif
if KBAngle >= 180 &&KBAngle <= 270
    Stick var1 var0
endif
if KBAngle >= 270 &&KBAngle <= 360
    Stick var0 var0
endif
KingClubber KingClubber

WOOHOO! Nice!!!

This looks really similar to what I did for my version of DI a few months ago actually (correcting off of KBAngle), and I think its probably the best way to do things as well as the simplest. The only concrete disadvantage of this system is that throws will always be DI'd in at low percents, but otherwise heres the things I can think of off the top of my head:

I asked people on reddit for feedback when I made mine, and what one person said was that DI is generally corrected to a 60 degree angle if possible, to account for gravity. I'm not sure how true that is, but something to take into account maybe.

The Damage thing makes sense in that at higher percentages you want survival instead of combo DI, but what would be even more optimal is if we used "KBSpeed," since it would allow for basically constantly correct DI choice, even when hit by powerful attacks at low to mid percents. The issue that I ran into is that there are no units on KBSpeed, so there's no way of knowing what it calculates.

My bigger suggestion would be to do this in 45 degree increments as opposed to 90 degrees, or at the very least change things for the area directly around the 90 degree angles, since then you want to DI perpendicular. That is, unless AbsStick 1 1 would count as a full input in both the horizontal and vertical directions, in which case it doesn't matter. In any case, DI is going to get kind of weird in this system for really shallow or steep angles (5 degrees or 355 degrees of KB, for example). Does that make sense? Sorry for the wall of text, just thinking off the top of my head about potential applications.
 
Last edited:

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
No problems, i already knew this concept had some problems, such as throws when near the ledge making you go far and low to the point that trying to recover becomes a problem. So 45 degree increments might work better like you said and make it more versatile so already low Knock Back Angles don't go lower, just away, and just mid to high Knock Back Angles go lower.

The Knock Back Speed thing is a problem, I've yet to figure out how to make it work, i'll try some stuff with it tonight to try to get it down.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
No problems, i already knew this concept had some problems, such as throws when near the ledge making you go far and low to the point that trying to recover becomes a problem. So 45 degree increments might work better like you said and make it more versatile so already low Knock Back Angles don't go lower, just away, and just mid to high Knock Back Angles go lower.

The Knock Back Speed thing is a problem, I've yet to figure out how to make it work, i'll try some stuff with it tonight to try to get it down.
I'd work on it tonight too, but due to travel not really an option. I've tested KBSpeed in the past, but its pretty darn hard to figure out when there's no clue as to what the metric is. I think the numbers it deals in are pretty low (less than 10 generally) but I might be misremembering. Maybe its in units of distance per frame? KBAngle is 100% the way to go for DI though. Part of the reason my response was so long is since I've tried this before, so I started running into these issues.

I've also taken a look at DodgeWhenAttacked, and I think if I modify that I can make CPUs wavedash and Up-B OOS instead of just shield grabbing and buffering rolls and spot dodges. That is, if that's what they use to dodge things, its kind of hard to tell sometimes what they're trying to do.

To the entire thread (I'm just taking care of everything at once): Any good ideas as to where I can post the AIScriptpad tutorial? Its really long (hey, you try explaining labels) and there are multiple "Lessons" so I need a lot of space to work with.
 

nimigoha

Smash Ace
Joined
Jan 31, 2014
Messages
877
I think a new Smashboards thread specific to the tutorials, where you reserve the first few posts for subsequent lessons, would be a good idea. That way the discussion in there can be about the lessons and this thread can be about more general AI stuff. But then link to that head in your OP of this one. And xpost to reddit of course.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
I think a new Smashboards thread specific to the tutorials, where you reserve the first few posts for subsequent lessons, would be a good idea. That way the discussion in there can be about the lessons and this thread can be about more general AI stuff. But then link to that head in your OP of this one. And xpost to reddit of course.
Good idea, good thought on reserving posts as well (totally forgot that was a thing!). Ugh trying to make it as simple as possible, but such a not-simple program to teach if you want people to understand what's going on and make it clear. The part about actually coding routines is like two pages already, and I haven't even finished it, just because I'm trying to cover everything that people would possibly need to know.
 

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
There is no new Scriptpad, I'm just changing the syntax of script names. It's easy enough to change, add, and remove.
The reason why i have released it yet is because i'm busy with other stuff, I've already removed at lot of custom one, and added a few new ones. I'll will be posting it here to night in about 2 to 3 hours.

Edit: after i figure out the KBSpeed stuff honestly.
 
Last edited:

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
For those waiting for the AIScriptPad the download is below.

FifthCPU FifthCPU

I figured out how to use the KBSpeed command, but i don't know how to explain in detail how it works. Basically I used a team match to check on what triggers command. One Fox is teamed with me checking if the Opponent Triggers the command by using shine as a visual for myself. The other fox is then used to test different attacks that might trigger the command.
Low Knockback attack will trigger at "KBSpeed <=2" Stronger attacks will trigger at "KBSpeed <= 4, and Heavy Attacks would trigger at "KBSpeed <=6". Some attacks reach as high as "KBSpeed <=8" but i wasn't able to find anything beyond that, it mostly seems to be based off how high the Base Knockback is in PSA.

So i ended up finishing my DI Code last night.
Code:
if Rnd > 0.3 &&!OutOfStage
    var0=-1
    var1=1
    if KBSpeed > 2
        var0=1
        var1=-1
    endif
else
    var0=0
    var1=0
endif
if OutOfStage
    var0=1
    var1=1
endif
if KBAngle >= 0 &&KBAngle <= 45
    Stick var0 var0
endif
if KBAngle >= 45 &&KBAngle <= 90
    Stick var1 var1
endif
if KBAngle >= 90 &&KBAngle <= 135
    Stick var1 var1
endif
if KBAngle >= 135 &&KBAngle <= 180
    Stick var0 var0
endif
if KBAngle >= 180 &&KBAngle <= 225
    Stick var1 var1
endif
if KBAngle >= 225 &&KBAngle <= 270
    Stick var0 var0
endif
if KBAngle >= 270 &&KBAngle <= 315
    Stick var0 var0
endif
if KBAngle >= 315 &&KBAngle <= 360
    Stick var1 var1
endif
Return
I had it tested by an PMDT member who tested the last one i posted. Try it out.
Also I found the best "Near the floor" Command. "SCDBottom <= ?" This should help with Tech'ing and Wavelanding. "OSCDBottom <= ?" would then be best to track how high or low a opponent players is to the floor.

OArticleXCoord
OArticleYCoord
OArticleXSpeed
OArticleYSpeed

These need testing, cause i'm not sure they even work.
 

Attachments

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
For those waiting for the AIScriptPad the download is below.

FifthCPU FifthCPU

I figured out how to use the KBSpeed command, but i don't know how to explain in detail how it works. Basically I used a team match to check on what triggers command. One Fox is teamed with me checking if the Opponent Triggers the command by using shine as a visual for myself. The other fox is then used to test different attacks that might trigger the command.
Low Knockback attack will trigger at "KBSpeed <=2" Stronger attacks will trigger at "KBSpeed <= 4, and Heavy Attacks would trigger at "KBSpeed <=6". Some attacks reach as high as "KBSpeed <=8" but i wasn't able to find anything beyond that, it mostly seems to be based off how high the Base Knockback is in PSA.

So i ended up finishing my DI Code last night.
Code:
if Rnd > 0.3 &&!OutOfStage
    var0=-1
    var1=1
    if KBSpeed > 2
        var0=1
        var1=-1
    endif
else
    var0=0
    var1=0
endif
if OutOfStage
    var0=1
    var1=1
endif
if KBAngle >= 0 &&KBAngle <= 45
    Stick var0 var0
endif
if KBAngle >= 45 &&KBAngle <= 90
    Stick var1 var1
endif
if KBAngle >= 90 &&KBAngle <= 135
    Stick var1 var1
endif
if KBAngle >= 135 &&KBAngle <= 180
    Stick var0 var0
endif
if KBAngle >= 180 &&KBAngle <= 225
    Stick var1 var1
endif
if KBAngle >= 225 &&KBAngle <= 270
    Stick var0 var0
endif
if KBAngle >= 270 &&KBAngle <= 315
    Stick var0 var0
endif
if KBAngle >= 315 &&KBAngle <= 360
    Stick var1 var1
endif
Return
I had it tested by an PMDT member who tested the last one i posted. Try it out.
Also I found the best "Near the floor" Command. "SCDBottom <= ?" This should help with Tech'ing and Wavelanding. "OSCDBottom <= ?" would then be best to track how high or low a opponent players is to the floor.

OArticleXCoord
OArticleYCoord
OArticleXSpeed
OArticleYSpeed

These need testing, cause i'm not sure they even work.
Awesome! I'll try out the DI tonight, and SCD when I can. Thanks for the idea on SCDBottom, I was using YDistFloor for wavelanding and teching, but that unfortunately doesn't work all the time (platforms confuse it because it gets confused whether they're a "floor" or not).

I actually have some insight into OArticleCoord and Speed. I've been trying to use them for powershielding, and its either reflect (30E0) or OArticleCoord that's causing the issue. Given that I have the routine set to finish if the opponent's article isn't close enough and shield if it is and the CPU instead will just randomly begin spamming shield at different times, I think OArticleXCoord doesn't work. OObjectXCoord seemed to have the same issue. At the same time though, they did VERY occasionally throw out powershields, so maybe its just reflect causing the bugs, or its just a buggy function.

EDIT: Preliminary thoughts: The DI seems to work really well, and the CPU smash DId Marth's Fsmash like a TAS god, so bonus! The code could probably be a lot shorter with elif instead of all the separate if statements. I'll work on OSCD for teching, the early tests on it with wavelanding are promising so I like the chances!
 
Last edited:

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
are you still working on the mewtwo one?
At this point I'm working on more general AI stuff (Recovery, Wavelanding). I wrote Mewtwo when I had no clue what I was doing, so I should probably go back to it at some point but its currently in limbo.
 

Sneez

Smash Apprentice
Joined
May 11, 2014
Messages
105
Hey guys I'm looking to write a ROB AI, I've read through the scriptpad tutorial but still feel like there's a good amount of information that I am not clear on. Looks like you guys are thinking about making a text or video tutorial, I would be super interested.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
Hey guys I'm looking to write a ROB AI, I've read through the scriptpad tutorial but still feel like there's a good amount of information that I am not clear on. Looks like you guys are thinking about making a text or video tutorial, I would be super interested.
I'm done with the first two parts of the tutorial (teaching the basic layout and how to write a routine) but I have to revise them slightly because of the new script designations in the new AIScriptpad 2.0. I might just upload my routines.h file or copy of the program to make things easier, since that one works much better for making individual bots on your own, whereas KingClubber's new one is designed for actual good multi-level AI systems.

KingClubber KingClubber this OK with you? It'd be easier to teach with ATKMid than with CPU leveling and such.


EDIT: http://smashboards.com/threads/building-a-better-bot-fifthcpus-intro-to-ai-modding.422328/ is the thread, I posted part 1 since that's just a general intro into the file system.
 
Last edited:

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
Cool, thank you! I just posted part two, and made it as comprehensive as possible, it covers everything basically except how to string together an AIPD into a functional neutral.
 

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
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
LvL 5 - Custom Set A
LvL 6 - Custom Set A + Custom Set B
LvL 7 - Custom Set A + Custom Set B + Custom Set C
LvL 8 - Custom Team AI
LvL 9 - Custom AI based off a Player

LvL 1-3 Completed.
Added Teching, without interrupting DI or DI interrupting Teching.
With this My DI, and Teching codes are complete.
I should be able to have LvL 4 done soon, and start working on Custom Sets.

FifthCPU FifthCPU
Code:
if Frame****lag < 1
Seek
endif
to
Code:
label
if !InAir || Frame****stun < 1
Finish
endif
ClearStick
if SCDBottom <= 5
if Rnd >= 0.6
Button R
Stick 1 0.5
Finish
elif Rnd > 0.4 &&Rnd < 0.6
Button R
Finish
elif Rnd <= 0.4
Button R
Stick -1 0.5
Finish
endif
endif
Return
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
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
LvL 5 - Custom Set A
LvL 6 - Custom Set A + Custom Set B
LvL 7 - Custom Set A + Custom Set B + Custom Set C
LvL 8 - Custom Team AI
LvL 9 - Custom AI based off a Player

LvL 1-3 Completed.
Added Teching, without interrupting DI or DI interrupting Teching.
With this My DI, and Teching codes are complete.
I should be able to have LvL 4 done soon, and start working on Custom Sets.

FifthCPU FifthCPU
Code:
if Frame****lag < 1
Seek
endif
to
Code:
label
if !InAir || Frame****stun < 1
Finish
endif
ClearStick
if SCDBottom <= 5
if Rnd >= 0.6
Button R
Stick 1 0.5
Finish
elif Rnd > 0.4 &&Rnd < 0.6
Button R
Finish
elif Rnd <= 0.4
Button R
Stick -1 0.5
Finish
endif
endif
Return
Wow. This looks amazing, consistent and random teching. Quick question though: What about the FramesSinceShield > 40 argument, to prevent spamming the button? Also, apparently I've been using SCDBottom wrong. I've been trying to use it with var0=SCDBottom, var1=YCoord, and var2=var1-var0. That would explain why wavelanding failed so badly when I tried to implement it.

I'm working on recoveries as well, planning to create a folder with all the scripts of characters with buffed recoveries.

EDIT: Created said folder, I'm just making very easy 5 minute edits and additions at the moment, avoiding the nightmare that is the recovery of ZSS :(. So far just added the use of their Down-B and Side-B to Falcon and Ganon's recoveries, and made Jiggs start using rising pound and stop airdodging onstage so much.
 
Last edited:
Top Bottom