• 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!

AI: (Get Well Soon Bero!)

Clai

Smash Lord
Joined
Dec 9, 2007
Messages
1,254
Location
Where men are born and champions are raised
did i mention that dantarion has the atkd files documented already

http://spreadsheets.google.com/pub?key=t4rs0MkPoOH2VwJVQjoIyRQ&output=html

we need to get the data categories documented before we move on to something else. we also need to stop randomly filling large ranges of data with random numbers. it doesnt accomplish anything
If I knew how to edit specific parts of data to reach a conclusion, I would, but I don't understand what the numbers are supposed to signify, so I'm doing all that I know how to do and changing the entire data file to see what general behaviors the CPU's exhibit. I took a look at dantarion's document, but from the looks of it, the data sheet seems to be a compilation of how the moves themselves work, but not how the CPU determines when to use said moves.

One thing from the past session I was really interested in is the test where Jab3 was substituted with taunt and when the CPU was tested, it would often do jab1-jab2 but never use jab3. If the CPU really uses a roulette wheel to choose what action to take, we can find a way to assign very low values to moves that we don't want the CPU's to be using so that the CPU will have a higher chance of using good moves and a lower chance of using bad moves. It appears that we won't be able to do that, though, until we document the data as you said.

If I haven't already said this before, I'll acknowledge now that I know next to nothing about manipulating the data we have. I've been trying to teach myself about this, but without the knowledge to constructively tinker with the data, I can't accomplish much. I do want to move this project forward, though, so helping out would be much appreciated.

Looks like documenting the data seems to be our top priority now. Everyone is welcome to help out with this, but if anyone is kind enough to lead me in the right direction to contribute to this myself, I would be incredibly grateful.
 

Dantarion

Smash Champion
Joined
May 21, 2007
Messages
2,492
Location
Santa Barbara, CA
I figured out all the values already.
I dont remember specifics, but it has to do with which frames of the move are considered "dangerous"

In that link, short 2 is always 0.
short 3 is the frame to start dodging
short 4 is the same to stop dodging.

Think of the range numbers as creating a "Box" of danger.
I made a youtube video about this somewhere...


PS. Changing things randomly isn't going to help, but at least you found what affects what. Remember. A lof of the AI is shared, meaning we won't be able to edit it inside a characters files. However, recovery is one place where the AI has to have some kind of logic to decide what to do.

I haven't looked at any of those files.
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
...So, do we have to consider how to edit ai_common that is in Fighter.pac?
 

Clai

Smash Lord
Joined
Dec 9, 2007
Messages
1,254
Location
Where men are born and champions are raised
...So, do we have to consider how to edit ai_common that is in Fighter.pac?
Yes, we will have to consider the ai_common as well. Changing values in there will change the behavior of all the CPU's instead of a particular character. If we're fortunate/determined, we can find and change some common traits like air-dodging after being hit all the time.

The last MiscData[0] file appears to contain the data that the CPU needs to analyze its 'danger' zone and determine its course of action. At the very bottom of the file, after subtracting all the filler, the text in the file comes to this:

#full_f
#key_f
(#full_f.#range_chk_f
#jump_start_f.#meteo_range.#atk_range_base.#atk_range_rnd.#quick_range1.#quick_range2.#dash_range
#key_f
(#full_f.#range_chk_f
#range_chk_f
(#full_f.#edge_range
&#wait.#edge_range
#hi_base
#wait_f
(#full_f.#edge_range
(#full_f.#range_chk_f
Changing these values will change how the CPU will perceive attacing ranges, running ranges, edge ranges, etc. Documenting this would be a godsend.
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
Do you mean making ATKD editable?
If so, I can do it in five minutes.
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
Oh, that work seems to be yours.
But if my USBGecko is fine, I will try it.
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
Search for where a characters AI file is held in memory, then set read breakpoints and ****
I see:bee:
Low-level language always makes me confused but I'll do my best(I'm not sure if I try that though)
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
Original post had mistakes so many that I deleted it.

EDIT
MiscData's header contains address of entry and strings.

EDIT2
Each entry has header. It contains unknown(4Byte),type(4Byte),entry part2 offset(in other words entry part1 size, 4Byte),unknown2(4Byte)

EDIT3
Completing second MiscData[0] seems not to be so hard, so I will be glad if someone tries to analyze AIPD file.

EDIT4
Finished analyzing each Offensive AI Entry. I may be able to add support of it BrawlLib.
 

leafbarrett

Smash Lord
Joined
Jun 8, 2009
Messages
1,388
Location
USA
The game froze when Fox threw Ganon offstage, but before that the CPU looked promising with its defensive play. I'm going to test this further and see if this test was just an anomaly or if something in the data freezes the game.
It's not an isolated event. I tried it, and it happened to me too.
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
I almost finished second AI data.

First, MiscData has some AI entries.
The characters seems to override AI entry in ai_common with their own AI entry. Each AI entry has an ID and ai_common has most entries that has same IDs. And they are very similar each other, but different a bit.

Second, AI entry has AI events. they are consists of type, number of entries, its own size, entries. Sometimes AI event has nothing but type and size. This means type itself has something important meaning. ...Oh limit word..
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
Sorry for double post but I'm writing this on PSP.

Well, we will have to make a thread about AI type,etc if we finish analyzing AI.

At the end, I haven't finished understanding words that are bottom in the file like "#wait_f" "#key_f". If there is someone who found a rule of their order, please tell me.
 

Clai

Smash Lord
Joined
Dec 9, 2007
Messages
1,254
Location
Where men are born and champions are raised
Sorry for double post but I'm writing this on PSP.

Well, we will have to make a thread about AI type,etc if we finish analyzing AI.

At the end, I haven't finished understanding words that are bottom in the file like "#wait_f" "#key_f". If there is someone who found a rule of their order, please tell me.
What exactly do you mean by AI type? Do you mean specific behaviors of the CPU, do you mean types of files, do you mean specific characters, what kind of new threads would we be making?
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
We don't need a new thread now. It will be needed if we completed AI. (or reuse this thread?)

I can't explain well about AI entries, AI events, so I will send you modded BrawlBox that can open second AI data. You will be able to understand in that way.
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
Finished analyzing second MiscData. So, I show you the steps from now to custom AI.

Step1 Analyze AIPD file and make it editable. (each character's AI is editable in this step.)

Step2 Analyze another two MiscData in ai_common.pac. This will be done soon.

Step3 Consider about each value's meaning. This will be a hardest part. This can be done by people that have no programming knowledge because replace, edit, insert, deleting each entry will be made easier until that time.
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
BrawlBox with OAI minor support
http://www.mediafire.com/download.php?wy2gwhiyt54

@Dantarion
I've waited for you.
Dumps will be useful in Step3! But I can't describe them well, so I show you some source codes. The man who can understand Kryal's code will be able to understand this.

Code:
unsafe struct OAIHeader//stands for offensive AI header
    {
        public bint _unk1;
        public bint _numEntries;//number of offsets
        public bint _unk2;//0x1
        public bint _unk3;

        public VoidPtr Address { get { fixed (void* ptr = &this)return ptr; } }
        public bint* entryOffsets { get { return (bint*)(Address+0x10); } }//contains entry offset. each offset is distance from Address
        public bint* stringOffsets { get { return (bint*)Address + 0x10 * _numEntries; } }//contains string offset but there seems to be other entries on that address
    }

    [StructLayout(LayoutKind.Sequential, Pack = 1)]
    unsafe struct OAIEntry
    {
        public bint _ID;
        public bint _EventsOffset;
        public bint _part2Offset;
        public bint _unknown;

        public VoidPtr Address { get { fixed (void* ptr = &this)return ptr; } }
        public VoidPtr Event { get { return (Address + _EventsOffset); } }
        public bfloat* part2 { get { return (bfloat*)(Address + _part2Offset); } }
    }

    public unsafe struct OAIEvent
    {
        public sbyte _type;
        public sbyte _numEntries;//sometimes, it is 0
        public bshort _entrySize;

        public VoidPtr Address { get { fixed (void* ptr = &this)return ptr; } }
        public bint* Entries { get { return (bint*)(Address + 0x4); } }
    }

    public unsafe struct OAIString
    {
        public bint _numEntries;
        public bint _unk1;
        public bint _unk2;
        public bint _unk3;

        public VoidPtr Address { get { fixed(void* ptr=&this)return ptr;} }
        public bint* Entries { get { return (bint*)(Address + 0x10); } }// each entry is 8Byte
        public VoidPtr StringAddress { get { return (Address + 0x10 + 0x8 * _numEntries)
    }
for example, these are captain falcon's data

0x00-0x0F OAIHeader
0x10-0x1F Offsets of OAIEntry
0x20-0x2F OAIEntry1
0x30-0x88F OAIEvents1
0x890-0x913 Floating points1
0x920-0x92F OAIEntry2
0x930-0x1213 Floating points2
0x1220-0x12CF OAIString
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
I've just started looking into AIPD.
0x10-0x16F are Floating points, right? And 0x170-0x263 are entry offsets from beginning of the file.
But there seems no rules of each entry size.

EDIT
There seems to be some integer points. I continue to analyze aipd using USB Gecko.

EDIT2
I found OAI parser routine.
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
Note:
Entry types of AIMain may be able to be categorized.
・Reserved words: Type0,Type4,Type8,Type9,Type21,Type30,Type32
Also, numbers of Type6 and Type9 are almost same. And Type6 is always before Type9.
I think this means Type6 is sign of "Begin block" and Type9 is "End block". I don't know what block it is though.
 

Clai

Smash Lord
Joined
Dec 9, 2007
Messages
1,254
Location
Where men are born and champions are raised
I want to take this opportunity to say thanks again to everyone who is continuing to work on this process and I apologize if my inaction is causing any problems. Due to lack of coding knowledge on my part, I'm essentially useless when it comes to information like this, but if there is anything specific you want me to test that you cannot on your own, I would be more than happy to help out.

Again, thank you very much for doing this and I hope that whatever you guys are doing can lead to results.
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
@Dantarion
What are you saying? This is my only reason that I haven't quit SSBB hack.
At least, I will find command input type.

Looking into this by using USB Gecko is IMPOSSIBLE. All we need is collaboration. First, it will help us to make AIMain that contains only one entry(like Type1,Type2,Type3...) and replace all other AIMain.
I added automatic replacer to BrawlBox Modset3.2. This helps you to replace all entries.

I did that using Type1 and Type6. Type6 froze the game, but Type1 caused this
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
What makes me wonder is there are few people that think Bero is a programmer and one of the active SSBB hacker.
This also makes me feel that I'm not needed.
 

Eldiran

Smash Lord
Joined
Jan 8, 2008
Messages
1,707
Location
Pennsylvania
Don't be disheartened Bero. It's more about who's been around longer, and been more in the public eye. I'm not actually a programmer on the level of Dantarion -- I'm only good with PSA when it comes to Brawl. (I am flattered though aanssell25.) You're way better at this stuff than I am.

Honestly, you and Dantarion are the only two people I know of who are actively making progress in hacking new areas of Brawl. You're the 2nd most knowledgable person around when it comes to Brawl hacking.
 

[TSON]

Hella.
Joined
May 7, 2008
Messages
3,422
Location
Macomb, MI
NNID
oTSONo
Eldiran, you're talking to a bot that quoted the first post in this topic XD.

And Bero, you are needed. Very much so.
 

Eldiran

Smash Lord
Joined
Jan 8, 2008
Messages
1,707
Location
Pennsylvania
The sig should have tipped me off... I am flattered nonetheless that mindless AI think I am a good programmer :p
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
So, there are still people that are interested in AI, right?
I'm relieved.
 

Life

Smash Hero
Joined
Jul 19, 2010
Messages
5,264
Location
Grieving No Longer
Bero, I also would like to thank you for your work. (Your English is great!)

I'm currently just kind of playing around with stuff in these files, will edit this post if I find out anything.

Right now, I'm going to deal with #dash_range and set the values associated with it to zero and something massive and see what happens.
 

Clai

Smash Lord
Joined
Dec 9, 2007
Messages
1,254
Location
Where men are born and champions are raised
@Dantarion
What are you saying? This is my only reason that I haven't quit SSBB hack.
At least, I will find command input type.

Looking into this by using USB Gecko is IMPOSSIBLE. All we need is collaboration. First, it will help us to make AIMain that contains only one entry(like Type1,Type2,Type3...) and replace all other AIMain.
I added automatic replacer to BrawlBox Modset3.2. This helps you to replace all entries.

I did that using Type1 and Type6. Type6 froze the game, but Type1 caused this
I have also expressed my thanks for your efforts in this, Bero. You were one of the first people to get into this project and thus you couldn't have more of a pivotal role.

However... your video contains a malformed ID. You might want to look into fixing that ;)
 

Bero

Smash Journeyman
Joined
Jan 10, 2010
Messages
409
Location
Japan
http://www.youtube.com/watch?v=cZV80r9yclo
Fixed.

Well, you guys don't know what Dantarion and I were doing. So, I explain that from now.
AI is consisted of AIPD,AIMain,ATKD.
・AIPD has been analyzed but we don't know how to use this.
・AIMain is main file of AI. This includes condition evaluation,command input and more. Each AIMain files have their own ID. ID and its usage list has been completed by Dantarion.
20 - Get on same platform
40 - Walk up to you
50 - Jump!
60 - Dash up to you
70 - Shield+Roll
80 - Gets on the other side of you
1010 - Stick toward?(Meta used Down b to approach with this)
1020 - Stick toward
1030 - Stick towards (Did not change platforms)
1040 - Stand still (Meta used Side B though)
1050 - Get on same platform (Olimar did NOT do this)
1060 - Same platform or under(Olimar went under)
1070 - Jump repeatedly (No R or L, just double jumping till out of jumps)
1080 - Same platform, or DIRECTLY UNDER (Olimar still didn't want to jump. INSANE perfect dashdance on either side of target)
1090 - Same as above?
10A0 - Character specific stuff
10D0 - Nothing?
1120
1130 - Marth did netral B offstage with this?
1140 - Follow Offstage (For edgeguarding?)
1160 - MK spammed down b
1170 - Follow to end of ledge? (For edgeguarding?)
2010 - Jump Recovery (Edge)
2020 - Side+B Recovery [All Chars]
2030 - Jump Recovery (Land on Stage)
2040 - Recovery [Character Specific]
3020 - Premptive Shield?
3090 - Walk in range?(Not too close though)
30A0 - Spotdodge
30B0 - Dodge when attacked
30D0 - Airdodge when attacked
6030 - Rapid Attack
6040 - Attack
So, we should look into this first. This is the most important file of three.
・ATKD is a file to be used by the game to know opponent's attack. This was entirely analyzed by Dantarion.

I added BrawlBox feature that allows us to edit AIfiles. All we need to do is finding the way to poke them.

...Well, I explain AIMain file from now.
AIMain file was called "CE" on BrawlBox screen.(I thought it was only condition evaluation, but they contain many elements. So, I changed their name into "AIMain". This will be reflected in next Modset.)
AIMain has many Type** entries. They have their own meanings such as "If","Endif","Input Command".
Sometimes, they have variables of float or integer. But like Type4 or Type9 or so, there are types that always have no variables. I think they are "reserved words"(please google it). Because of these things, I think I can categorize them.
1 Call function
2 Reserved words
3 Command input

*sigh* So, to look into AIMain, replacing all AIMain entries into one of them is make it easy.
Dantarion did it using codes. http://www.youtube.com/watch?v=8rFnjqzXrxo
But you don't have to make any codes. Open your AI file and right click on "Events" in "CE**". Select "Auto replacer", choose your AIMain entry file. BrawlBox will automatically replace all entries into selected file.
I think we can look into meanings of types in each AIMain entries by making AIMain entry which has only one entry.

If you can't understand what I said, please ask me questions.
 

humble

Smash Ace
Joined
Oct 25, 2009
Messages
888
Location
Portland, OR
Bero...That is awesome! Thanks for all the info! I'll be reading this over to understand again, but this is really cool!
 
Top Bottom