Welcome Guest [Log In] [Register]
Quick guide to building AIs
Topic Started: Apr 12 2011, 05:14 PM (4,437 Views)
Prof. 9
Member Avatar
Moderaptor

This little tutorial will explain how to use the MMBN6 Navi AI Editor once it's released. It's not a full guide yet as I wrote all of this up in a hurry.

AIs and the Attack Grid
The AI is what determines which attacks to use, and when to use them. The MMBN6 Navi AI Editor will compile into the game a custom type of AI called "attack grid". You can place an action on each block and the Navi's next action will be determined based on a specific set of rules:

After executing an action from a block, the AI will pick the next block from above, below, or to the right. No going to the left. In addition, the AI will not go to the previous block.

Posted Image

In this picture, the attack that was just executed was attack 3. The next attack will be either 4, 5 or 6. Each has 33% of being chosen.

The next rule is that upon reaching the right edge and trying to go further right, the AI will jump to the leftmost block on the same row. In other words, the above grid really acts like this.

Posted Image

However, this isn't the case with the top or bottom rows. Which brings me to the next rule. If the AI has no blocks left it can move to, it will selfdestruct.

Posted Image

If the Navi decides to do attack 4, it will get stuck after that because it cannot go up (it's hit the edge), it cannot go down (that's where it came from) and it cannot go to the right (since that block is empty). The Navi has nothing it can do, so it will instantly reduce its HP to 0. The same happens if the Navi picks attack 5.

The starting block is the first action the Navi will do in the battle. In the editor, you can set this by double-clicking a block.



Chip Pools and the Chip Stack
The AI editor lets you set two interesting actions: use from chip pool and use from chip stack.

"Chip stack" refers to the chips that hover above an enemy's head in battle. For instance, some Mettaurs and Swordies use Invis and Recov chips. The chip stack is not set by or included in the AI.

"Chip pool" refers to the 15 chip lists that are included in the attack grid AI. You can add chips to them and each time the AI encounters a "use chip from pool X" action, it will randomly pick one of the chips from that pool and use it. Chips from the chip pool are not displayed above a Navi's head.



Attack Preparation and Base Navis
In order to properly execute an attack, the Navi must first do some preparation. This preparation is different for pretty much each attack, hence why the custom AI uses a Navi to base the AI off. Unfortunately, not all Navi AIs are compatible (for now). If you want to make an AI mod for a certain Navi that's not supported try using a different Navi as the base.

The way the custom AI handles attack preparation isn't 100% stable yet. Some Navis might not work at all. It may be improved on in future versions.



Checkpoints and Jumps
The "jump to X" action changes the current block to the checkpoint block indicated by the X. You can add multiple checkpoints but there's no point as only one of them will be used and the rest will just act like a "skip" action.
:ninja: Follow me on Twitter! :trap: Fork me on GitHub!
Posted Image
Profile
Quote
 
MegaRockEXE
Member Avatar
BN Guides Author

Neat write-up. Makes more sense now that the program coincides with the hax.
Colonel was not working for me at all. Maybe it' how I set up the grid, though. I had completely forgotten you can make grids like you did; where one row has to be followed, then there are decisions.
The Rockman EXE Zone | YouTube
Profile
Quote
 
Dramz
No Avatar
Spastic Colon

Do any of the natrualy-occuring navis use an attack grid kind of setup?
Will this program support all versions of the game? (Falzar, Gregar, and the Japanese versions)
And is there any predicted release date for the program?
Profile
Quote
 
Greiga Master
Member Avatar
Admin of the stars, owner of your soul...

Ablon08
Apr 12 2011, 09:20 PM
Do any of the natrualy-occuring navis use an attack grid kind of setup?
Will this program support all versions of the game? (Falzar, Gregar, and the Japanese versions)
And is there any predicted release date for the program?
It's out already
http://s6.zetaboards.com/The_Rockman_EXE_Zone/topic/8730759/1
and it should support Greiga, Falzer in US and PAL versions.
Profile
Quote
 
Dramz
No Avatar
Spastic Colon

I posted that question before, or as you were posting the program.

I am still very interested in the ASM notes.
Don't make me construct an AI, and then figure out what the hell the program did!

The amount of spaces the navi moves before attacking IS determined in the AI data
080F2C89 for Heatman
080FBB38 for Protoman
...etc
I found these offsets awhile ago, why not release a more technical way to find them, as you obviously know how?

Also, does the program have a limit to the number of attacks that a navi can use?
By repointing the data, we are not restricted to 5 or 6 slots, so how many will the program allow?
Also, I' like to know about locating Attack Variables within the AI data generated by this program. It'd be a pain to have to reimport and use the program each time you want to change it, especially since I fiddle with it an excessive amount.

And for that matter, the guide does not discuss attack variables. Could you please elaborate on these things? I'm just really curious about this stuff in the absence of some notes to view.
Edited by Dramz, Apr 13 2011, 04:09 AM.
Profile
Quote
 
Prof. 9
Member Avatar
Moderaptor

Ablon08
Apr 13 2011, 12:54 AM
I posted that question before, or as you were posting the program.

I am still very interested in the ASM notes.
Don't make me construct an AI, and then figure out what the hell the program did!

The amount of spaces the navi moves before attacking IS determined in the AI data
080F2C89 for Heatman
080FBB38 for Protoman
...etc
I found these offsets awhile ago, why not release a more technical way to find them, as you obviously know how?

Also, does the program have a limit to the number of attacks that a navi can use?
By repointing the data, we are not restricted to 5 or 6 slots, so how many will the program allow?
Also, I' like to know about locating Attack Variables within the AI data generated by this program. It'd be a pain to have to reimport and use the program each time you want to change it, especially since I fiddle with it an excessive amount.

And for that matter, the guide does not discuss attack variables. Could you please elaborate on these things? I'm just really curious about this stuff in the absence of some notes to view.
The program, as far as I know, doesn't delete the .asm files it inserts. What's stopping you from taking a look at the ASM source code full of comments and explanations?

There really isn't a technical way to find Navi AI variables like amount of spaces to move because they mostly differ for each Navi. Really, by far the easiest and most straightforward way is to just look at their AI routines. Besides, if you wanted info on the amount of spaces the Navi moves you could just ask. I already told you over PM I would be happy to give you info or help you find info if you could at least be a little specific.

As far as I know, Navis are always limited to 6 attacks, simply because the 6th attack has the value 0x0F, and everything 0x10 or higher is interpreted by the game as a chip attack. The reason Bass has more is because his attacks are actually several attacks in 1. Point me to a clear guide/notes on how to add more attacks to a Navi that doesn't involve "use Bass lol" and I could add it to the attack grid.

Attack variables are not inside the attack selector part of the AI. They are inside the attack preparation routines (subroutines of those, even). Meaning the program doesn't change any of them (do note that the "base Navi" you use in the program also determines which Navi's attack variables are used; in future versions this should (hopefully) no longer be a problem).

Speaking of attack variables, I'm pretty sure I've already posted a very easy way how to find them and there's already offset lists for them. This guide is just a quick write-up of how to use GM's AI compiler so that people wouldn't be clueless about how to use it. It also says in the first sentence that this is not a full guide yet.

The only things I use when building ASM hacks is the information that's "publicly" available on TREZ and my own ASM source code. The only notes I make when building ASM hacks is stuff like calculations, offsets I'm currently debugging, etc. I really doubt there is anything useful. My notes are kind of like a RAM, which is why I don't save them.

Quote:
 
Do any of the natrualy-occuring navis use an attack grid kind of setup?
As far as I know, no (but I haven't looked at all of them in-depth). Some of them use a linear pattern, though. The custom AI is running on an engine I built myself.
Edited by Prof. 9, Apr 13 2011, 08:31 AM.
:ninja: Follow me on Twitter! :trap: Fork me on GitHub!
Posted Image
Profile
Quote
 
Naegi Makoto
Member Avatar
TREZian
Never thought would do this, but I tried the program just for fun.
Currently:
Working as an assistant programmer in this project : Ciel Fledge
3rd year of University, Information Technology Major

Profile
Quote
 
timaeus222
Member Avatar
The Tech Guy
I have a question.
- What does Skip do?
Edited by timaeus222, Jun 4 2011, 08:56 AM.
~Timaeus~
Web Designer, Music Composer

"There's so much water under the bridge that the bridge is gone." ~ DarkeSword of OC ReMix

My Technical Services || MPCR Home Page || My Best Game Mods || Music YT Channel || Gaming YT Channel || My Guides || My Challenges
Posted Image
Posted Image
Profile
Quote
 
Prof. 9
Member Avatar
Moderaptor

timaeus222
Jun 4 2011, 08:32 AM
I have a question.
- What does Skip do?
Nothing. It's basically a block with no action assigned to it, but it's not Empty: it can be chosen as a path.
:ninja: Follow me on Twitter! :trap: Fork me on GitHub!
Posted Image
Profile
Quote
 
timaeus222
Member Avatar
The Tech Guy
Cool. Well, I managed to create a working AI now!

http://i55.tinypic.com/fu6cqq.jpg
http://i55.tinypic.com/4ljbcm.jpg

11 moves, and it actually doesn't have any paths that freeze it. =D
Edited by timaeus222, Jun 4 2011, 03:15 PM.
~Timaeus~
Web Designer, Music Composer

"There's so much water under the bridge that the bridge is gone." ~ DarkeSword of OC ReMix

My Technical Services || MPCR Home Page || My Best Game Mods || Music YT Channel || Gaming YT Channel || My Guides || My Challenges
Posted Image
Posted Image
Profile
Quote
 
brianuuu
Member Avatar
SF Noise Spriter
Man...this is just way too complicated lol
Posted ImagePosted ImagePosted Image
Posted Image
Profile
Quote
 
timaeus222
Member Avatar
The Tech Guy
Hehe, well, the key thing is to put Jumps at the top and bottom edges, because that's where it freezes if the navi goes up further or down further. =)
Edited by timaeus222, Jun 4 2011, 07:48 PM.
~Timaeus~
Web Designer, Music Composer

"There's so much water under the bridge that the bridge is gone." ~ DarkeSword of OC ReMix

My Technical Services || MPCR Home Page || My Best Game Mods || Music YT Channel || Gaming YT Channel || My Guides || My Challenges
Posted Image
Posted Image
Profile
Quote
 
brianuuu
Member Avatar
SF Noise Spriter
but it's a bit hard to use attack 4 and 5 cuz it may always jump to checkpoint 0
Posted ImagePosted ImagePosted Image
Posted Image
Profile
Quote
 
Prof. 9
Member Avatar
Moderaptor

timaeus222
Jun 4 2011, 07:48 PM
Hehe, well, the key thing is to put Jumps at the top and bottom edges, because that's where it freezes if the navi goes up further or down further. =)
It freezes? It shouldn't freeze. If there's a legitimate issue with pathfinding, the Navi should selfdestruct, not freeze. How did you make it freeze?

By the way, there might be some small bugs in the AI; if anyone finds any unexpected behaviour such as freezing, please report it, as I can easily fix these bugs without GM having to update his program. I made a v1.1 attackgrid.asm a while back but I overwrote it (<_______<) with an older version and now I don't have it anymore.
:ninja: Follow me on Twitter! :trap: Fork me on GitHub!
Posted Image
Profile
Quote
 
timaeus222
Member Avatar
The Tech Guy
When you get back (end of July?), you'll see this:
I tried the v1.1 asm file, and after the AI compiled and I reopened the game, the navi freezes right before it tries to use its first attack.
(Yes, I back up my games. ;))

I think there might be an error in the asm.
~Timaeus~
Web Designer, Music Composer

"There's so much water under the bridge that the bridge is gone." ~ DarkeSword of OC ReMix

My Technical Services || MPCR Home Page || My Best Game Mods || Music YT Channel || Gaming YT Channel || My Guides || My Challenges
Posted Image
Posted Image
Profile
Quote
 
Kid1513
Member Avatar
TREZian
Strange, when I try using the program on Protoman, it basically doesn't change anything...
I wonder what I've done wrong...
Posted Image

...SF3 Random Battle modding Tool Detected!
...SF3 Auto Brother Modifying Tool Detected!
...BN5 E-Reader Modifying Tool Detected!
...Megaman Battle Network - Pokemon Crossover Patch Detected!

Posted Image
Profile
Quote
 
Prof. 9
Member Avatar
Moderaptor

kid1513
Oct 26 2011, 01:00 AM
Strange, when I try using the program on Protoman, it basically doesn't change anything...
I wonder what I've done wrong...
Did you change his AI pointer to the offset the program gave you?
:ninja: Follow me on Twitter! :trap: Fork me on GitHub!
Posted Image
Profile
Quote
 
Kid1513
Member Avatar
TREZian
Prof. 9
Oct 26 2011, 02:35 AM
kid1513
Oct 26 2011, 01:00 AM
Strange, when I try using the program on Protoman, it basically doesn't change anything...
I wonder what I've done wrong...
Did you change his AI pointer to the offset the program gave you?

<COOL> Thanks, that's what I forgot. <COOL>
Posted Image

...SF3 Random Battle modding Tool Detected!
...SF3 Auto Brother Modifying Tool Detected!
...BN5 E-Reader Modifying Tool Detected!
...Megaman Battle Network - Pokemon Crossover Patch Detected!

Posted Image
Profile
Quote
 
Hub197
No Avatar
Regular Member
I know this topic died 5 month ago, but i have something to ask.
I built a 5x10 will some cool chip pool for protoman, but i dunno how to import it to the game:facepalm: i asked mr.kid, he told me to press compile button, then notthing happened, the program gimme an offset, protoman's AI still normal.
Please help me.
Profile
Quote
 
Prof. 9
Member Avatar
Moderaptor

Hub197
Mar 22 2012, 05:41 PM
I know this topic died 5 month ago, but i have something to ask.
I built a 5x10 will some cool chip pool for protoman, but i dunno how to import it to the game:facepalm: i asked mr.kid, he told me to press compile button, then notthing happened, the program gimme an offset, protoman's AI still normal.
Please help me.
Did you change his AI pointer to the offset the program gave you?
:ninja: Follow me on Twitter! :trap: Fork me on GitHub!
Posted Image
Profile
Quote
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Guides & Research · Next Topic »