Author Topic: Enemy AI needs better documentation. (research thread)  (Read 14488 times)

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #30 on: July 06, 2008, 01:40:23 pm »
Hm...

Does the  07 01 reaction happen before the 0D XX XX action in Golems default AI script?

EDIT:

Also looking at Masa & Mune (the combined enemy) what are the weapon preconditions I don't recall them reacting to any specific weapons?  Obviously 18 XX is a weapon precondition cause of Magus and Mammon Machine I'm just curious what weapons are for masa and mune.

--JP
« Last Edit: July 06, 2008, 01:42:02 pm by jsondag2 »

JLukas

  • Fan Project Leader
  • Squaretable Knight (+400)
  • *
  • Posts: 426
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #31 on: July 06, 2008, 01:51:25 pm »
No.  It won't display the "I'm afraid of heights" string until that 0D command was hit.  Maybe 0D sets the enemy to near death mode?

Oh, I forgot to mention, there's bugs in the AI data:

Enemy $7F Red Beast is missing a final FE at the end of the Action block.  With $FF following I'm guessing it doesn't cause a problem in game.

Enemy $F4 Johnny (who never has a battle) has no Reaction block of it's own, and reads the following data for Enemy $F5 Basher.

Just two things to be aware of that may cause errors in the AI editor.

edit: no idea what the story with Condition 18 is.  It contains Masamune item index for Mammon M. and Magus, but other enemies like the one you mentioned it doesn't seem to be related?
« Last Edit: July 06, 2008, 01:55:29 pm by JLukas »

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1772
  • Nu-chan
    • View Profile
    • Maurtopia
Re: Enemy AI needs better documentation. (research thread)
« Reply #32 on: July 06, 2008, 02:14:17 pm »
Mammon M., Magus, and Masa & Mune all make sense in my testing.

18 ii 04 29 - Hit with weapon index ii.
18 ?? 03 37 - Purpose unknown.

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #33 on: July 06, 2008, 02:18:00 pm »
I would guess the 0d command can turn the 07 condition on and off like hecran

Jp

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1772
  • Nu-chan
    • View Profile
    • Maurtopia
Re: Enemy AI needs better documentation. (research thread)
« Reply #34 on: July 06, 2008, 05:17:28 pm »
I noticed the Encyclopedia was updated - the 18 condition only behaved the way noted when tested using 04 29 as the last two values. Anything else and it did nothing.

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #35 on: July 07, 2008, 12:43:37 pm »
Quote
If you do find a monster that has one of those Actions, please post it.

Panel uses action 05.

EDIT: 

Some notes:

Condition Unknown03  is used by gnawer, probably checking if T'Pole is present, in which case it attacks it and absorbs it's HP. The Target in action 01 (attack) must have some positions for other enemies as well (not just nearest PC and random PC).

This site is useful because it has all of the enemy AI's is there something like this on the compendium:

http://www.rpgclassics.com/shrines/snes/ct/enemies.shtml

It's almost as though they went through the if conditions one by one (For example look at gnawer on that website and then in my tech editor).

Final Edit:

Updated link on first page.  the editor is definately coming along.  With the "custom mode" figured out there's definately room for some interesting ai's to be made.  The idea of custom mode got confirmed for me by the reptite enemy who enter's "shocK' when  hit by lightning. 

I'd definately say the most wanted commands would be the long 10/12 byte commands.  Black tyrano and magus use them.

Also figuring out what command 18 is used for if it's not weapon index.


--JP
« Last Edit: July 07, 2008, 01:18:37 pm by jsondag2 »

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #36 on: July 08, 2008, 01:08:29 pm »
I added an import/export system.  It should be more reliable than the tech editors because there's not as many places in the rom to worry about. 

--JP

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #37 on: July 09, 2008, 09:20:38 pm »
So I modified the code temporarily to output to files for each command.  I aggregated those files into one excel spreadsheet so you can see what enemies are using which commands.

There are some major glitches in it though due to unknowns messing up the parsing. a quick glance at it made it clear that we need to figure out the lengths of command 05.  Also JLukas you put action 06 as "nothing no routines" but did you get the length of it?   It seems like it is still being used.

Once we figure out the lengths of these commands I'll run the program again and hopefully we'll have some better output.

--JP

EDIT:  there are two sheets in the excel file one for actions and one for conditions

[attachment deleted by admin]

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #38 on: July 09, 2008, 10:29:11 pm »
Updated main link.  I added the battle messages in so you don't just see a random hex number :)

It also makes it easier to see which parts of code are certain parts of the battle.

--JP

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1772
  • Nu-chan
    • View Profile
    • Maurtopia
Re: Enemy AI needs better documentation. (research thread)
« Reply #39 on: July 11, 2008, 12:50:20 pm »
There's a bug with the editor and the 04 command. Take a look at (E1) Spekkio for an example.

Edit: I think 04 may be a command by itself. I tried playing with it a little and that was the only way Spekkio's AI made sense.
« Last Edit: July 11, 2008, 01:12:40 pm by Mauron »

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #40 on: July 11, 2008, 01:23:06 pm »
Hm, 

You sure?  You're the one that decoded that action initially:

Quote
04 YY XX ?? ?? - Seems to be another tech command. XX is the tech used, and it didn't do anything when YY was not 02.

However....you did mention it didn't do anything unless YY was 2, which is the Tech command isn't it...so I guess that would make since.  JLukas can you confirm if 04 is a one byte action?

Mauron it might be a good idea to put a link to the wiki on the first post, I can't remember did we give you a wiki account?

Notes for myself from you that I forgot to add:

03 ?? ?? ?? - Relates to movement. Used by Bugger's Attacked by moving object.
0C XX ?? ?? - Status counter. XX: 00 - none, 01 - chaos, 06 - sleep. I haven't checked the others yet.

I'm assuming these are both conditions when you decode an action make sure you say they are conditions/actions cause I handle them differently
--JP

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1772
  • Nu-chan
    • View Profile
    • Maurtopia
Re: Enemy AI needs better documentation. (research thread)
« Reply #41 on: July 11, 2008, 01:37:10 pm »
I'm pretty sure. I just tried taking out the 04 and the attacks seemed the same.


Notes for myself from you that I forgot to add:

03 ?? ?? ?? - Relates to movement. Used by Bugger's Attacked by moving object.
0C XX ?? ?? - Status counter. XX: 00 - none, 01 - chaos, 06 - sleep. I haven't checked the others yet.

I'm assuming these are both conditions when you decode an action make sure you say they are conditions/actions cause I handle them differently
--JP

They're both conditions.

I don't have Wiki access.

JLukas

  • Fan Project Leader
  • Squaretable Knight (+400)
  • *
  • Posts: 426
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #42 on: July 12, 2008, 06:31:40 pm »
However....you did mention it didn't do anything unless YY was 2, which is the Tech command isn't it...so I guess that would make since.  JLukas can you confirm if 04 is a one byte action?

I checked into this and it is 1 byte.  You can give it the description "Random Action"  What it does is load a random number to pick one of the following Actions to start with.

If Gato had the following Action pattern :
04, attack, wander, tech, FE

The 04 random result could cause the attack command to be skipped.  Gato would wander, use tech, and jump back to the beginning of the loop.

Overall, it's similar to the Random % Condition, but allows for random actions within the section, instead of determining if the _entire_ section is executed.

When you update that in the editor it should correct a lot of the errors, and should set the number of times Action 06 appers back to 0.  I have not looked at 05 yet, let me know if that's still broken.

I'll update the wiki later.

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #43 on: July 13, 2008, 12:38:24 am »
Yup that fixed, all the action5 defects are in action 4 now.

There is some action6 being used by B5:unknown   B6:unknown
and then there's some errors on the bottom (errors being that they loaded bytes beyond the action command range).

Here's the updated .xls.


EDIT:
Command 10 is used by Guardian/Giga Gaia and is breaking it as well as the lavos equivalents (I think we found our revive enemies action :)
Command 14 is used by Nizbel it may be 4 bytes (based of Nizbel II) but i'll wait for confirmation.
Command 16 is used by enemy EF:


--JP

[attachment deleted by admin]
« Last Edit: July 13, 2008, 12:52:10 am by jsondag2 »

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1772
  • Nu-chan
    • View Profile
    • Maurtopia
Re: Enemy AI needs better documentation. (research thread)
« Reply #44 on: July 13, 2008, 12:55:13 am »
That zip file is empty.