• 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

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
Kinda hard to explain, which is why i said you aren't doing it wrong. It mostly just takes more data by being longer than it needs to be.

The basics is simple theory, just using math.

You can use varX in various ways, but i'm unsure if it would for what your using since that is a custom function.

It works something like this.

Code:
var10=YDistFloor
var11=8
if var10 <= var11
    var11=var10
endif
You would do something similar with the multiple stick's your using with something like this.

Code:
var1=XDistFrontEdge
var2=XDistBackEdge
var4=-0.7
if var1 < 3
var3=-1
Seek
elif var2 < 3
var3=1
Seek
else
var3=OPos
Seek
endif
Mul var4 var10
which would need work in a way to auto subtract to the values u need.

This is just theory as in UNTESTED, as i'm just doing it off the top of my head, so sticking this into your code won't work.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
Kinda hard to explain, which is why i said you aren't doing it wrong. It mostly just takes more data by being longer than it needs to be.

The basics is simple theory, just using math.

You can use varX in various ways, but i'm unsure if it would for what your using since that is a custom function.

It works something like this.

Code:
var10=YDistFloor
var11=8
if var10 <= var11
    var11=var10
endif
You would do something similar with the multiple stick's your using with something like this.

Code:
var1=XDistFrontEdge
var2=XDistBackEdge
var4=-0.7
if var1 < 3
var3=-1
Seek
elif var2 < 3
var3=1
Seek
else
var3=OPos
Seek
endif
Mul var4 var10
which would need work in a way to auto subtract to the values u need.

This is just theory as in UNTESTED, as i'm just doing it off the top of my head, so sticking this into your code won't work.
Yeah, making my code shorter has always been something I've struggled with. Thanks, I see what you're saying, and that would be a lot faster. I'll work on rewriting to allow for something along those lines, and try adding in a YSpeed check in order to stop the random wavedashes.
 

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
Trust me, i did stuff like this a lot.

Rebuilding Scripts over and over, Stuff that looks like it should work won't work, and stuff that looks like it shouldn't work will work. It really a huge mess sometimes, so if nothing else works, do what will work.

Easy enough right?
 
Last edited:

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
Trust me, i did stuff like this a lot.

Rebuilding Scripts over and over, Stuff that looks like it should work won't work, and stuff that looks like it shouldn't work will work. It really a huge mess sometimes, so if nothing else works, do what will work.

Easy enough right?
Lol yup, that's the life.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
Also, I just thought of something: There's a function I've never used called "AirTime" which counts air time in what I'm assuming is frames. If I just set that to the right value, it'll prevent characters from wavelanding when trying to SHFFL or full hop, while not preventing them from doing perfect wavelands or wavelands while they're moving upward!

EDIT: Well it was a tiny bit more complicated than that, but it worked! The code functions exactly as before, but CPUs are prevented from doing wavelands when they attempt to full hop! (Not short hop, because CPUs shouldn't be short hopping unless they're SHFFLing, comboing, or in the middle of a routine, so they shouldn't attempt a waveland anyway. Technically I could prevent it during short hops as well, but that would mean a few full hop wavelands wouldn't take place while the CPU is moving upward).

Now I just have to rewrite the middle to make it less sloppy, and we should have a universal wavelanding code on our hands!
 
Last edited:

nimigoha

Smash Ace
Joined
Jan 31, 2014
Messages
877
This is soooooo cooooooool! Wish I could help in some way, but my coding knowledge is close to zero.
That's me. I pretty much just follow in awe as CPU and KC perform magic. I hopefully provide some sort of motivation to show them their work is appreciated, but then again I may just be making myself look like a toddler comprehension-wise.

I just get excited each time one of them busts out a new code.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
CPU Wavelanding V2 [FifthCPU]

PSEUDOCODE REMOVED BECAUSE PARANOIA

Here's my second version of the code! So this fixes up the CPUs doing wavedashes out of fullhops, and just generally looks a lot neater and more compact. Also, I fixed the directions on the airdodge, so CPUs don't SD anymore! I need to tweak the amount of vertical the stick has, but other than that its laid out exactly how I want it.

Now here's the problem I've run into (if you're not KingClubber or someone who hasn't worked with AI, this might get difficult to follow. Sorry): CPUs will only waveland on certain stages, or only waveland on the ground of certain stages and not the platforms. Here's my theory as to why. I'm using "YDistFloor" because it detects exactly how close the CPU is to the floor, and thus is the only good way to detect where to waveland. But for some reason, different stages treat the "floor" as different things. For example, on Skyworld my bot wavelands all over the place, but on battlefield it only wavelands on the main stage and not the platforms. I'm unsure if my explanation is correct, but I have no idea how to combat this. Even so, I believe this code is WORTH USING, since it functions perfectly, just not 100% of the time.

My other theory (here comes the more technical stuff) is an issue how the routine gets called. Perhaps its simply not being called often enough on these stages, and what I've seen is just coincidence. In any case, this needs to be fixed, since when added into a vanilla P:M bot, they barely ever waveland. I need to figure out either what other slots to put the routine in, or how to get other routines to call it instead.
 
Last edited:

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
That looks really cool!

Which stages does it waveland on?
Skyworld, Training Stage, Smashville, Yoshi's Story and Delfino's Secret all seem to support wavelanding on every surface including platforms.

Battlefield occasionally had them, but very rarely.

Warioware and PS2 didn't seem to have any wavelanding.

Based on all this, I'm really thinking it might have to do with the full hopping routine as opposed to my routine. I'll have look into that. I think the full hop routine is still running as they jump toward a platform, so the CPU doesn't try to waveland.
 

TeiunBomb

Smash Apprentice
Joined
Jan 22, 2010
Messages
124
As much as I love the work you're putting into wavelanding the other projects you're working on, I am rather curious to know where that update of Squirtle is. I understand that life tends to get in the way of things, so if its currently halted or you just plum managed to forget about it, then ehn, no big deal.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
T TeiunBomb Thanks for the reminder!

I just uploaded version 2. Changelog:
  • Slightly more stable (may still crash, but less frequently)
  • Better at dealing with attacks from above
  • Smoother movement and utilization of squirtle's options
  • Meteor Cancelling enabled (?)
  • Reverted DI system to Random DI on level 7, standard PM DI on all other levels. Personal DI system requires revision and was overriding too many things.
 

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
This is pretty much my plan for 4.0

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

What I want to do is check for it's set LvL at the beginning of the script, and if it's not the correct LvL it calls a custom routine that acts like a Hub to call out the best possible Script in the Cpu's current position.

Custom Set's are a set of Script to set a certain difficult LvL above Melee LvL AI. Each Set add makes it more difficult and adds more mix ups so that the AI doesn't follow a set pattern.

Custom Team AI was an idea by a PMDT member, for people to be able to practice Team Matches. This idea might fallout as I've never attempted to do something like this before.

The Player Based AI is something you've already tried before, but this time I will be putting a lot more work into re-watching video of these players over and over to make them feel like you are playing against that actual player. This will be the most difficult task as I'm sure you can guess.

Just a reminder this is planned for 4.0 nothing else between, if any more patches happen between that time expect very little AI work, or test stuff, and maybe recovery fixes. Really need to get on top of those....

That is all.
=~|<•>|~=​
 

Life

Smash Hero
Joined
Jul 19, 2010
Messages
5,264
Location
Grieving No Longer
Had a crash with the Squirtle AI.

Set it against level 7 Fox on Battlefield and it lost by two stocks.

Set it against level 7 Falco on PS2 and it crashed right before being star KO'd on its second stock (and Falco's last).

Could be just a random thing, but I'll keep messing with it.

EDIT: Actually, I might have done the file replacement incorrectly, come to think of it--if .pac files have the same corruption issue that .brstm files do, then...

EDIT2: Re-replaced the file more carefully. Squirtle vs. Falco @ PS2, just got through a full game when Squirtle was level 9 but froze quickly when Squirtle was level 7. Could it be the DI code?

EDIT3: Did get a crash on level 9 Squirtle this time. So it's probably not that.
 
Last edited:

nimigoha

Smash Ace
Joined
Jan 31, 2014
Messages
877
This is pretty much my plan for 4.0

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

What I want to do is check for it's set LvL at the beginning of the script, and if it's not the correct LvL it calls a custom routine that acts like a Hub to call out the best possible Script in the Cpu's current position.

Custom Set's are a set of Script to set a certain difficult LvL above Melee LvL AI. Each Set add makes it more difficult and adds more mix ups so that the AI doesn't follow a set pattern.

Custom Team AI was an idea by a PMDT member, for people to be able to practice Team Matches. This idea might fallout as I've never attempted to do something like this before.

The Player Based AI is something you've already tried before, but this time I will be putting a lot more work into re-watching video of these players over and over to make them feel like you are playing against that actual player. This will be the most difficult task as I'm sure you can guess.

Just a reminder this is planned for 4.0 nothing else between, if any more patches happen between that time expect very little AI work, or test stuff, and maybe recovery fixes. Really need to get on top of those....

That is all.
=~|<•>|~=​
This is amazing, if even 2 of these levels are in 4.0 it will be a huge deal.

For level 4, can you port over those Melee CPUs? Confused as to what you mean by this.

Can you compare things like current Fox/Falco/Roy to these forecasted levels? Like will the current Level 9 Fox AI be your eventual Level 5 Fox or something similar?

Also this is 369 different AI scripts. Are you the only person writing AI for PMDT? And will each of those 369 scripts be very different from every other one? Or will the Level 1/2/3 be very close to each other across the characters?

And by 4.0 do you mean like final version or next big big (like 3.0 big) release? Is this something to be expected only in the very last release of PM?

Sorry for the barrage of questions, I don't think you ever did an AMA Monday on the subreddit, and I'm very keen to learn about AI.

ALSO last question for now, sorry again. Can you rename the AI levels in game so they say "Team" or "Sethlon" or "Shield" or "Tech/DI"?

Could you rename them across different characters so Level 9 could be "IPK" and one could be "Sethlon" and one could be "Junebug", so you wouldn't have to refer to anything outside the game to determine "who you're fighting"?
 
Last edited:

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
This is pretty much my plan for 4.0

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

What I want to do is check for it's set LvL at the beginning of the script, and if it's not the correct LvL it calls a custom routine that acts like a Hub to call out the best possible Script in the Cpu's current position.

Custom Set's are a set of Script to set a certain difficult LvL above Melee LvL AI. Each Set add makes it more difficult and adds more mix ups so that the AI doesn't follow a set pattern.

Custom Team AI was an idea by a PMDT member, for people to be able to practice Team Matches. This idea might fallout as I've never attempted to do something like this before.

The Player Based AI is something you've already tried before, but this time I will be putting a lot more work into re-watching video of these players over and over to make them feel like you are playing against that actual player. This will be the most difficult task as I'm sure you can guess.

Just a reminder this is planned for 4.0 nothing else between, if any more patches happen between that time expect very little AI work, or test stuff, and maybe recovery fixes. Really need to get on top of those....

That is all.
=~|<•>|~=​
Wow. That is a concrete and awesome plan! The "hub script" is pretty similar to how I was thinking a multi-level AI would work. A few questions/thoughts on my part:
  1. Won't this drive file size really high?
  2. Won't the lower level CPUs be affected by the CPU level difference (not reacting and calling routines as often)?
  3. Custom Team AI... I have no idea how that would even work. I've thought about it before, but I couldn't think of anything besides some character distance checks.
Let me know if there's any ways in which I can help. I'm obviously not a PMDT member (I'm applying if applications for coders ever get reopened) but I'm keen to help in improving the game's AI in any way that I can.

(Also nimigoha nimigoha You can rename AI levels in BrawlBox, but they apply globablly. So they could be renamed to descriptions based on "Character Specific" and "Melee" and such, but not specific to each character)
 
Last edited:

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
For level 4, can you port over those Melee CPUs? Confused as to what you mean by this.
Going to be replicating how Melee LvL 9 AI works myself, it won't be ported.

Can you compare things like current Fox/Falco/Roy to these forecasted levels? Like will the current Level 9 Fox AI be your eventual Level 5 Fox or something similar?
M2K/Kels Fox will be LvL 9
Sethlon Roy will be LvL 9
Falco will be LvL 7

Also this is 369 different AI scripts. Are you the only person writing AI for PMDT? And will each of those 369 scripts be very different from every other one? Or will the Level 1/2/3 be very close to each other across the characters?
I don't know what you mean by 369 different AI scripts.
Yes, I'm the only but others have dipped their hands into AI.
Yes, LvL 1-3 will be across all characters.
Yes, All Scripts other than those will be different.

And by 4.0 do you mean like final version or next big big (like 3.0 big) release? Is this something to be expected only in the very last release of PM?
Correct, The next big release and no sooner.

Sorry for the barrage of questions, I don't think you ever did an AMA Monday on the subreddit, and I'm very keen to learn about AI.
I Didn't, and don't plan too. Here's a good place to ask questions, and or learn.

ALSO last question for now, sorry again. Can you rename the AI levels in game so they say "Team" or "Sethlon" or "Shield" or "Tech/DI"?
I can request it, but i doubt it would be agreed upon.

Could you rename them across different characters so Level 9 could be "IPK" and one could be "Sethlon" and one could be "Junebug", so you wouldn't have to refer to anything outside the game to determine "who you're fighting"?
No.
 

nimigoha

Smash Ace
Joined
Jan 31, 2014
Messages
877
Going to be replicating how Melee LvL 9 AI works myself, it won't be ported.



M2K/Kels Fox will be LvL 9
Sethlon Roy will be LvL 9
Falco will be LvL 7



I don't know what you mean by 369 different AI scripts.
Yes, I'm the only but others have dipped their hands into AI.
Yes, LvL 1-3 will be across all characters.
Yes, All Scripts other than those will be different.



Correct, The next big release and no sooner.



I Didn't, and don't plan too. Here's a good place to ask questions, and or learn.



I can request it, but i doubt it would be agreed upon.



No.
By 369 scripts I meant you have 41 characters by 9 levels, and was wondering how many of them would be extremely similar to others, but you answered that.

All I mean for the rename is that names like "Burly" or "Nasty" aren't going to be particularly descriptive when your training AIs are applied to them, and renaming Level 1 to "Tech/DI" would be more clear.

But yeah, figured you wouldn't be able to vary the level names across characters.
 

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
Won't this drive file size really high?
I'll be doing my best not to let that happen.
Won't the lower level CPUs be affected by the CPU level difference (not reacting and calling routines as often)?
Only LvL 1-3 is effected by that which is why i chose to use those for training purposes.
Custom Team AI... I have no idea how that would even work. I've thought about it before, but I couldn't think of anything besides some character distance checks.
The bases for the idea is to let the cpu's play as support, keeping a base distance check to keep distance from a far enemy and deal with a nearby enemy, letting the player deal with ledge guarding, while the cpu keep its distance to deal with high recoveries. Stuff like that.
 
Last edited:

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
All I mean for the rename is that names like "Burly" or "Nasty" aren't going to be particularly descriptive when your training AIs are applied to them, and renaming Level 1 to "Tech/DI" would be more clear.
You have to remember that Project M is a Team project, meaning that I would have to request it, if its not agreed upon it won't be changed. That is an aesthetic change, nothing to do with what i work on.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
Only LvL 1-3 is effected by that which is why i chose to use those for training purposes.
Makes sense, I've noticed similar stuff when trying to figure out level values. Also, if we can detect Level 0 AIs, something could theoretically be added there (Do nothing at all AI? Easter egg AI? Who knows.)
The bases for the idea is to let the cpu's play as support, keeping a base distance check to keep distance from a far enemy and deal with a nearby enemy, letting the play deal with ledge guarding, while the cpu keep its distance to deal with high recoveries. Stuff like that.
Interesting. That sounds like the best way of doing it, given that CPUs can't really tell who's on what team and just kinda do their own thing. Should be helpful for those people who try to team with AI in teams.

I'm really impressed. These levels are very well thought out, and seems like a really good system. It should satisfy pretty much everyone who wants to train in different ways, and keep there from being "better" AIs for different things. Congratulations.
 

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
Makes sense, I've noticed similar stuff when trying to figure out level values. Also, if we can detect Level 0 AIs, something could theoretically be added there (Do nothing at all AI? Easter egg AI? Who knows.)
I doubt it would be added really.
Interesting. That sounds like the best way of doing it, given that CPUs can't really tell who's on what team and just kinda do their own thing. Should be helpful for those people who try to team with AI in teams.
That's the plan.
I'm really impressed. These levels are very well thought out, and seems like a really good system. It should satisfy pretty much everyone who wants to train in different ways, and keep there from being "better" AIs for different things. Congratulations.
This plan was revised plenty of times, and after the whole 20XX thing people were requesting all kind of things that just wasn't possible on my end. So i had to think of what would work best.
 
Last edited:

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
This plan was revised plenty of times, and after the whole 20XX thing people were requesting all kind of things that just wasn't possible on my end. So i had to think of what would work best.
Ooh yeah, the 20XX bots. Its definitely a quandry, people are so divided about it. Eh, making everyone happy is tough, but multiple options seems like it would definitely help a ton.

I'll just work on refining my various bots and codes until I can apply (or maybe just make more silly AIs like jiggs). Maybe figure out why my stupid bots won't waveland on Battlefield grumble grumble grumble "Floor" grumble. :mad:
 

nimigoha

Smash Ace
Joined
Jan 31, 2014
Messages
877
Sounds so solid. Looking forward to all your stuff, both of you.

Crossing my fingers that you can get into PMDT Fifth!
 

Qazzquimby

Smash Cadet
Joined
Jul 25, 2014
Messages
25
Not relevant to the current conversation:
I've spent a lot of time thinking about training a learning ai using frame by frame gameplay, with the goal of making something that can naturally simulate the meta (as time reaches infinite), learning all techniques through trial and error, and eventually become as close to perfect as such a thing can be, with the processing power we have. I get that that isn't realistic, and I don't know where to start, especially since I imagine the ai would have to run outside of PM and interact with simulated controller inputs, but I think learning ai deserves a lot of attention.

Is there anything I can help with, or a good way to learn the ai building? I'm not proficient but I know enough coding I probably won't be lost.

Edit: I just got (relatively) wrecked by your squirtle, and I'm so excited by that.
I notice there is still air-dodging off stage. Is that not fixable?
And can you make him sweetspot with upB?
If you can make him rar off stage with bair to edgeguard, I find that important.

Editedit:
I used to get an error saying memory exceeded 2gb in dolphin.
That seems to be replaced with:
invalid read from 0xb9f69616, PC = 0x80928c34
"" from 0xb9f6917, PC = 0x80928b78
and a bunch more that I'm not copying down.
 
Last edited:

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
I used to get an error saying memory exceeded 2gb in dolphin.
That seems to be replaced with:
invalid read from 0xb9f69616, PC = 0x80928c34
"" from 0xb9f6917, PC = 0x80928b78
and a bunch more that I'm not copying down.
Hmmm, thanks for that info! That (unfortunately) means that I probably exceeded the file size with squirtle, and that's why he gets occasional crashes. The airdodging offstage honestly confuses me, since I took out everything in his code that can cause that. I'm thinking of just pasting his code into a new file routine by routine and seeing if I can fix everything that way. This bot...I love it to death, but it gives me so much trouble :/

I've spent a lot of time thinking about training a learning ai using frame by frame gameplay, with the goal of making something that can naturally simulate the meta (as time reaches infinite), learning all techniques through trial and error, and eventually become as close to perfect as such a thing can be, with the processing power we have. I get that that isn't realistic, and I don't know where to start, especially since I imagine the ai would have to run outside of PM and interact with simulated controller inputs, but I think learning ai deserves a lot of attention.

Is there anything I can help with, or a good way to learn the ai building? I'm not proficient but I know enough coding I probably won't be lost.
You're definitely right, it would have to be done outside of P:M/Brawl's AI system, since that one isn't built to accomodate reading of inputs, or learning at all. As far as learning AI building goes, its all done through a program known as AIScriptpad 2.0 (There are threads on it on KC-MM, but only KingClubber and I work with it currently). Essentially there is the ATKD (Defines attack ranges for dodging), AIMain (Contains all the routines, or maneuvers, that the AI knows) and AIPD (Neutral game, defines which maneuvers are called when). All of this is located in the "Etc" portion of a character's FitMotionEtc.pac, which overwrites the common AI in the common3.pac.
 

Qazzquimby

Smash Cadet
Joined
Jul 25, 2014
Messages
25
Once I have a clue what I'm doing, how could I be helpful?
And until then, how do you think I could be useless in a way that best accelerates me towards being helpful?

How do you test the ai? I usually build the game as an iso, but that takes a while and would discourage experimenting.

In the hypothetical out of game ai, would a system like that be able to take input from the game? That seems like the biggest obstacle. It would basically need all the variables normal ai has, and as much information about the game state as possible, such as what attack an opponent is using, so it can keep track of how much lag it has left and space it.

How do I extract the files from motionEtc? Brawlbox shoes them as "MiscData[0]".
 
Last edited:

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
Once I have a clue what I'm doing, how could I be helpful?
And until then, how do you think I could be useless in a way that best accelerates me towards being helpful?
I have no idea how to be helpful, I just make random things that I think people would enjoy, and if KC or anyone else approaches me on a project I give my input or try to help out in the best way I know. Its pretty whatever :) , I'm not PMDT so I just do my own stuff kinda and try to make things I think are cool.
How do you test the ai? I usually build the game as an iso, but that takes a while and would discourage experimenting.
I strongly recommend using a virtual sd card (like the P:M netplay has switched to). Its really fast to make edits, and with AI, you have to do A LOT of editing and guess/check. Virtual sd is 100% the way to go.
In the hypothetical out of game ai, would a system like that be able to take input from the game? That seems like the biggest obstacle. It would basically need all the variables normal ai has, and as much information about the game state as possible, such as what attack an opponent is using, so it can keep track of how much lag it has left and space it.
I have no idea, honestly. I feel like that would take some serious ASM work, which I'm not experienced with. At this point (correct me if I'm wrong, anyone) there's no ways to read inputs :(
How do I extract the files from motionEtc? Brawlbox shoes them as "MiscData[0]".
So if you're working with AIScriptpad, you actually don't have to extract the files. You just make a folder for your bot and drop the FitCharMotionEtc inside, then boot up the program and create a project. There's a "help" section and some tutorials that can get you started with the format.
 

Qazzquimby

Smash Cadet
Joined
Jul 25, 2014
Messages
25
there's no ways to read inputs :(
Controller inputs, or game data? Having the game output information about its state would take a lot of new code I think, and take a very long time, but having the game read inputs from another program should be relatively easy. You just get a virtual controller and have the programs communicate. I don't know how to do that off the top of my head, but I'm sure its doable.

AI can not learn, that is all.
I'm not talking about smash ai, or anything practical related to the project.


For recoveries, what is progress on the airdodging off stage problem? That's easily my biggest frustration when fighting cpus. After that, what changes to recovery are general enough to be applied to all characters, if any?

Edit: On adding FitGanonMotionEtc.pac to a project it said many functions (0x1043, 0x1042), many others close to that
value) were not defined. I had added 4010 and 4020 to routines.h, was there more to it than that?

//_____Section3 starts_____
//Entry number : 0x13
fVeryClose {
Unk1010 20,8,100,0
Unk1020 3,1,100,0
Unk1030 5,1,100,0
Unk3020 20,10,100,10
Unk22 0,30,50,0
RollF 1,1,100,0
RollB 25,1,100,0
DodgeWhenAttacked 20,0,100,20
Spotdodge 3,0,100,0
Unk3090 3,0,80,30
SHopAway 2,10,100,0
Unk10 0,20,50,0
}
This code is listing the options to take when fVeryClose is true? How do I practically work with the values after each routine? What do I do with the unknown routines?

In ATKD, putting spaces/tabs between the values to line them up would increase readability. Would that cause problems, or be worth doing?

When I opened FitGanonMotionEtc.pac in a new project, I didn't get an AIMain. I have a bunch of 2-4digit numbers.as, AIPD and ATKD. Am I doing something silly?
 
Last edited:

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143


Bero would be so proud.
----
If you wish to help with anything FifthCPU FifthCPU Q Qazzquimby working on AI Recoveries, those are a pain in my *** to work on or if your up for it tackle LvL 1~3, just get it working as it says. I can do everything else just fine.

AI can not learn, that is all.

=~|<•>|~=​
D'awww!

Ugh, recoveries... those are the worst to mess with, pain in the *** is right.There's some stuff I can think of to improve them, but first there's always the issue of figuring out what every variable and loop does in it. Time to break out my knowledge of vectors! I did improve jigglypuff's very slightly in the past, but that was just teaching it to use rising pound.

For anyone interested, I also wrote a powershield/SDI training CPU at fudgepop101's request, its literally just a Samus which does nothing but spam projectiles, recover, and aerial if someone's above it (not even shielding). Took like 20 minutes, so worth it. Now I'm wondering if I can make a CPU powershield, maybe feed into the level 4 goal. My instinct is no (based on how 30E0 is called), but I might try it still.

Q Qazzquimby So I'll answer as many questions as I can in my short time. AIMain is made up of all the routines thrown up on the side, its not labeled. I personally wouldn't mess with ATKD, I basically never even look at it. Airdodging offstage I've partially managed to fix sometimes by finding all the instances in the code involving "Button R" and adding some if statements, as well as making sure 30B0 is either disabled or like a Fox CPUs, but other than that I'm still looking. My instinct says its something in the common AI. To fix AIScriptpad not opening 4010 and 4020, open routines.h in a text editor and add them in the same format as the others. 4010 is groundcombo and 4020 is aerialcombo. We don't know exactly how the numbers after each routine work, its something to do with what level a CPU has to be to perform the routine and the frequency at which its performed, but we generally just put 100,100,100,0 (See Fox or my Squirtle for an example).
 

Qazzquimby

Smash Cadet
Joined
Jul 25, 2014
Messages
25
We don't know exactly how the numbers after each routine work
Quoting from the AIscriptpad page, in case it is useful.
How frequent the routine will be called is calculated by following expression: (levelvalue-min)/(max-min)*low+(max-levelvalue)/(max-min)*high. If levelvalue > max, (max-levelvalue)/(max-min) will be 1. If levelvalue < min, (levelvalue-min)/(max-min) will be 1.
And the numbers are High, Low, Max, Min.

Ironically, if you put 100, 100, 100, 0, the answer would be undefined, since it divides by (max-min).

You set everything to maximum frequency then? (Or maximum frequency as we understand it)

Do you want me to go through the common ai and look at uses of R? I can run it with squirtle who kills himself the least, so I'd pretty much get the common suicides.

If level 1 is dummy ai, I really like the idea of level 0 as easter egg ai. You could fight 3 zeldas who did nothing but teleport at you, or 3 puffs that just approach and rest.
 

FifthCPU

Smash Apprentice
Joined
Jan 20, 2015
Messages
143
Quoting from the AIscriptpad page, in case it is useful.
How frequent the routine will be called is calculated by following expression: (levelvalue-min)/(max-min)*low+(max-levelvalue)/(max-min)*high. If levelvalue > max, (max-levelvalue)/(max-min) will be 1. If levelvalue < min, (levelvalue-min)/(max-min) will be 1.
And the numbers are High, Low, Max, Min.

Ironically, if you put 100, 100, 100, 0, the answer would be undefined, since it divides by (max-min).

You set everything to maximum frequency then? (Or maximum frequency as we understand it)

Do you want me to go through the common ai and look at uses of R? I can run it with squirtle who kills himself the least, so I'd pretty much get the common suicides.

If level 1 is dummy ai, I really like the idea of level 0 as easter egg ai. You could fight 3 zeldas who did nothing but teleport at you, or 3 puffs that just approach and rest.
That's what I thought about the calculation (I started learning by reading the same thread), but apparently that's incorrect. I do know they modify level in some way, and that 100,100,100,0 sets it to max frequency for all levels.

Its up to you what you do (we all have different approaches here, lol). I looked through the common a while ago and couldn't find anything that hadn't already been overwritten in the individual character's AI. One reason I want to work on recoveries is that I know that certain characters (Jiggs, for example) are programmed to airdodge at the end of their recovery instead of using Uspecial, so that leads to a fair number of SDs.
 

archedmaid

Smash Apprentice
Joined
Oct 14, 2013
Messages
166
Having some thing to differentiate the AI types in 4.0, would be nice for the common player.
 

Qazzquimby

Smash Cadet
Joined
Jul 25, 2014
Messages
25
But then losers like me don't get to spectate the discussion :(
Why would you not be in the group? Skype username is qazzquimby, picture should be an overexposed faceless me.

How do I remove everything coded specifically for a character?

When I try to build I get the same error I got when loading the pac. As I said earlier:
"On adding FitGanonMotionEtc.pac to a project it said many functions (0x1043, 0x1042), many others close to that
value) were not defined. I had added 4010 and 4020 to routines.h, was there more to it than that?"
 
Last edited:

KingClubber

Smash Ace
Joined
Nov 15, 2010
Messages
969
Location
In a dark underground base in the middle of L.A
I don't do skype, so yea....

For recoveries, what is progress on the airdodging off stage problem? That's easily my biggest frustration when fighting cpus. After that, what changes to recovery are general enough to be applied to all characters, if any?
It seems impossible to completely remove what with I current have, but there are two different routines that cause it on stage and one off.
Edit: On adding FitGanonMotionEtc.pac to a project it said many functions (0x1043, 0x1042), many others close to that
value) were not defined. I had added 4010 and 4020 to routines.h, was there more to it than that?
Your using an old AI Scriptpad version that's why.
I'm wondering if I can make a CPU powershield
Bero did it once, so it's possible.
we generally just put 100,100,100,0
I use 100,100,0,0
 
Last edited:

nimigoha

Smash Ace
Joined
Jan 31, 2014
Messages
877
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?
 
Top Bottom