Could you get me started with how to toy with the A.I. I think if i could look at the fake flea's then I could teach myself atleast the basics.
Or better yet is there an example of an enemy that does a preemptive attack, I'd say lavos at zeal with his rain from the heavens but he's so pumped up he might just be that fast.
--jp
Not much is known about the AI right now, but here is everything I have so far.
This is (I think) a collaboration from Proto K and Waddler D.
http://www.helmetedrodent.kickassgamers.com/Proto_K/attackbytes.rtfThe AI starts in the unheadered ROM at offset 0C8D08 and ends at 0CCBC8
Gato's AI is at CA77B.
Here is a conversation I had on IRC with Waddler D on the subject, and all the stuff he found out about it.
---------------------------------------------------------------------------------------
WaddlerD 85: The AI tactics is quite interesting.
WaddlerD 85: All the monsters has 2 main patterns.
WaddlerD 85: A "normal", move on will pattern and a "counter, move with the response of an attack or action, pattern.
WaddlerD 85: It's always seperated by FE FF
WaddlerD 85: The stuff between the FE FF is simple and complicated in a way.
WaddlerD 85: The first 4 bytes are ALWAYS to going to be a precondition.
WaddlerD 85: followed by a FE
WaddlerD 85: to seperate the precondition from the actual actions.
WaddlerD 85: I haven't found out all the preconditions yet, as there are quite a few, but usually 00 00 00 00 is the default.
WaddlerD 85: As it means, "If the monster is alive" probaby.

WaddlerD 85: probably*
WaddlerD 85: You can put more than one precondition in a pattern, though.
WaddlerD 85: Like for instance.
WaddlerD 85: FE FF 00 00 00 00 FE Blah blah blah FE 00 00 00 00 FE Blah Blah FE FF <--- Normal attack pattern
WaddlerD 85: The four bytes.
WaddlerD 85: Though it's also good to know that the precondition can be expanded into some big "and" precondition.
WaddlerD 85: Like for instance 01 03 00 00 15 40 00 00 = "When HP is at 50% AND Monster is hit with Shadow based elemental attack.
WaddlerD 85: There is quite a few interesting preconditions that I found out so far.
WaddlerD 85: Somewhat sloppy, but it should be good enough
WaddlerD 85: Byte #1: 00 = No Attack
01 = Attack
Byte #2: 00 = Normal Attack
01 = Secondary Attack
Byte #3: (Target?)
Byte #4: Animation that is done before attack
01 = Up Close
04 = Stand Still Action
0A = Circle around
0E = Going Astray
02 XX 05 XX XX XX
Byte #1: 02 = Techs/Magic
Byte #2: XX = Attack Type
Byte #3: Targeting style?
Byte #4: Double Tech targeting?
Byte #5: Triple Tech targeting?
Byte #6: Message
0A XX XX
Byte #1: 0A = Disables Enemy
XX = Special Attack
XX = Message
0B XX XX 00 XX
Byte #1: 0B = Setting Stat
Byte #2: XX = Stat Type
Byte #3: XX = Stat set
Byte #4: 00 = ?
Byte #5: XX = Message
0C 3D XX XX
Byte #1: 0C = Adding Stat
Byte #2: 3D = Offense
39 = Magic
3B = Evade
38 = Speed
3E = Defense
3F = Lightning Defense
40 = Shadow Defense
41 = Water Defense
42 = Fire Defense
Byte #3: Increment
Byte #4: Message
0F XX
Byte #1: 0F = Message Enable
Byte #2: XX = Message
Attack/Counterattack Preconditions
15 XX = Counters with Type of Attack
20 00 00 00 = Final Attack
17 XX 00 00 = Chances Pattern will be used
1F 04 XX 00 = Distance
07 01 00 00 = Custom Pattern is active
11 00 00 00 = Physical Attack
12 XX 01 = Magic Attack
01 03 = HP is at 50%
05 XX = Number of Monsters in battle
WaddlerD 85: Found out another precondition.
WaddlerD 85: I think 40 00 XX 01 points out "When Monster XX is dead"
WaddlerD 85: So if you put 40 00 CF 01 in there, it says "When Monster "Bit" is dead", do this.
WaddlerD 85: Ok, should be simple enough.
WaddlerD 85: You know though...
WaddlerD 85: There may be something more than what I put down for 1F 04 XX XX
WaddlerD 85: A lot more...
WaddlerD 85: Because Gato has 1F 06 00 00 for his counter attack precondition...
WaddlerD 85: Well, 1F usually deals with distance
WaddlerD 85: So I guess the three bytes after it have to do with something...
---------------------------------------------------------------------------------------
So, it's fairly easy to give enemies new attacks and counter attacks, but there is still quite a bit left unknown. I found the set status bit earlier today by experimentation. Feel free to share any findings you happen across.
I did a hex search for 02 10 (02 for magic attack, 10 for Gato's singing attack) and found Gato's script fairly easily. Just look through the Attack Bytes list for the attack of the monster you wish to edit and attempt a search through the area marked as AI, or you could follow the pointer table for it (0C8B08- 0C8D07) to get to the monster (I wish I knew how >_>).