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

JLukas

  • Fan Project Leader
  • Squaretable Knight (+400)
  • *
  • Posts: 426
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #45 on: July 13, 2008, 02:51:18 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).

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

Try these:

Action 10 - 4 bytes
Action 14 - 10 bytes
Action 16 - 12 bytes

Are you sure about Enemy B5/B6?  The 06 bytes I see in those are part of wander commands.


Vehek

  • Errare Explorer (+1500)
  • *
  • Posts: 1756
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #46 on: July 13, 2008, 03:02:49 am »
I'm too lazy to check right now. Do the 28 (set party stat) and 29 (set party status) commands Chickenlump mentioned actually exist?

JLukas

  • Fan Project Leader
  • Squaretable Knight (+400)
  • *
  • Posts: 426
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #47 on: July 13, 2008, 03:31:38 am »
Enemy AI page updated.

CL's (or was it waddler?) mention of Action 09 as a 2 byte command that causes the attack animation to flash seems to be correct.  But I haven't seen an enemy that uses it yet.

Decode 13 as a 3 byte command.  It might not be used.

03 and 08 are no routines.

Re: 28 and 29 stats.  He might have mistaken the surrounding data bytes as commands, or was looking at something else.  Those values are too high to be Condition or Action commands.

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #48 on: July 13, 2008, 02:45:03 pm »
Updated AI Editor with new info.

it must have been an wrong command causing 06 to show up it doesn't appear now.  Everything seems withing range now.

I haven't added the unused command lengths yet but I will soon.  Hopefully this zip file contains the final correct uses for all actions/conditions.  After a quick glance there are a few interestingn points. 

Action 10 is only used by Guardian/Giga Gaia (Enemy Revive?) we should see if it only works with certain enemies
Action 15 is ONLY used by mother brain...
Action 14 is only used by Nizbel and...some unknowns (probably lavos monsters)
Condition 23/24/25/26 are only used by Golem and it's lavos equivalent


that's all i have time to look at for now...next up I'll mark off the knowns from the unknowns.

EDIT:

Wow I just fixed a pretty major bug in the ai editor...it was adding an extra FE for every Section End (the FF) ...... Sorry about that

EDIT 2:

ok this shouldn't take too awfully long to figure these out, i'm just clearing out gato and changing his conditions until he does stuff:

1B XX 00 00:
    If there num PC's (alive??) is <= XX Do this
         used by nizbel to determing if he should do his earthquake attack, used by gorrilas to make see if they should do their throwing attack

08 XX YY ZZ - Definately something to do with HP:
            Slash-  08 03 50 02
            Son Of Sun-08 02 10 27
             Magus - 08 03 94 11

With my own 5000 HP monster 08 03 XX 02
XX = 50 (HEX) the monster started triggering the condition at about 500 HP
XX = 94 (HEX) the monster started triggering the condition at about 800 HP

Condition 0B seems to be another flag (like 07).  That can be set to true/false by action 0B and other longer actions


--JP

[attachment deleted by admin]
« Last Edit: July 13, 2008, 04:48:03 pm by jsondag2 »

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1765
  • Nu-chan
    • View Profile
    • Maurtopia
Re: Enemy AI needs better documentation. (research thread)
« Reply #49 on: July 15, 2008, 12:51:13 pm »
I'm having some trouble with the AI editor.

- I can't get new SwitchStates in for some reason.
- Paste doesn't seem to work properly. I always get TempNodes.
- Revert doesn't automatically refresh. I have to switch to another monster and back to see the original.

Edit: Action 10 is definitely revive.

10 ?? SS MM - SS = Sound played. MM - Message shown.

Here's a fun thing to do. Set Hetake's final attack to revive and and fight them in Guardia forest. It's worth a laugh or two.
« Last Edit: July 15, 2008, 01:12:14 pm by Mauron »

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #50 on: July 15, 2008, 01:12:36 pm »
The tempnode is on purpose :?.  It's honestly cause I was lazy haha.  I wanted to allow people to be able to paste "across sessions" so you could have 2 copies of the program open and paste between them.  To do this i utilized the windows clipboard.  The easiest way for me to communicate the data through the clipboard was simply to use the raw hex of each node as a string and parse it over to the other side.  Unfortunately the way i wrote the program the decoding from hex -> the decoded node is done at a specific time and it's a pain to fix it.....sorry you should be able to paste and then reload the enemy (new enemy-> original enemy) I'll add a refresh later?


Revert is an issue I'll fix that tonight. 

Hm....I tried to force the user to use switch states/actions/preconditions properly and I may have been to  controlling.  I believe i didn't let them change the sectionends at all.

Hm ok you can get switch states by copying a switch state and pasting it on a precondition.   from there you can copy/delete/cut the actions around to your liking.....it's a pain I'll try to make it more lenient with adding nodes.

Hm.....just realized I didn't add a way to add switch states w/o copying pasting is that what you are referring to?

--JP

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1765
  • Nu-chan
    • View Profile
    • Maurtopia
Re: Enemy AI needs better documentation. (research thread)
« Reply #51 on: July 15, 2008, 01:21:29 pm »
Lazy is a good excuse.

There's no switch state addition and when I tried copying it didn't want to copy the right thing for me.

Did you catch my edit about the revive command?

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #52 on: July 15, 2008, 01:48:06 pm »
haha i'll have to try that when I get home.  Glad to see you are using hetakes as your test species as well :)  I used gato but the sightscope doesn't work on him....

Hm, i investigated further and think I found the bug.  Were you having an issue of it pasting what you had highlighted?  In a certain condition I was adding the current selected node instead of the node that was suppose to be added (making you just paste whatever you were on top of currently.....).

I fixed it and hopefully that works you can download the new version now.

OK, i gotta start working haha.

--JP

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1765
  • Nu-chan
    • View Profile
    • Maurtopia
Re: Enemy AI needs better documentation. (research thread)
« Reply #53 on: July 15, 2008, 03:02:06 pm »
It still acts a little funky for me. Either it's adding them and not showing them, or not adding them and miscounting them.

Either way I can't get it to work quite right.

Edit: Here's a general idea of what the stat editing looks like. http://www.chronocompendium.com/Forums/index.php/topic,5061.0.html

Here's some more information on how it works: http://www.chronocompendium.com/Forums/index.php/topic,5492.msg98723.html#msg98723
« Last Edit: July 15, 2008, 03:23:34 pm by Mauron »

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #54 on: July 15, 2008, 03:42:54 pm »
I'll debug with it more later, hopefuly you can eventually get things in the right order?  though it's tedious?  If you can give me step by step examples I can go try to replicate it.

--JP

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1765
  • Nu-chan
    • View Profile
    • Maurtopia
Re: Enemy AI needs better documentation. (research thread)
« Reply #55 on: July 15, 2008, 05:04:22 pm »
It's pretty simple. There's a total of $42 stats. A lot of the stats are unknowns or don't apply (The format is shared with PCs), but the known ones can be changed easily. 0A and 0B for example, are max MP.

Say you want to have lightning defense change when the enemy is hit with lightning.

7E5FAD-7E5FEF contains the stats for enemy one. You can use that to view an enemy's changes in battle.

The last 4 are the ones we're interested in, elemental defenses, specifically the first of those, lightning defense. The offset for that is 3F. Set the StatType to that and you can change it as needed.

Mauron

  • Guru of Reason Emeritus
  • Errare Explorer (+1500)
  • *
  • Posts: 1765
  • Nu-chan
    • View Profile
    • Maurtopia
Re: Enemy AI needs better documentation. (research thread)
« Reply #56 on: July 16, 2008, 02:46:41 pm »
Condition 05 seems to be if number of total enemies is at most nn, not at least. Ozzie (A6), R Series (F8), and Guardian (D4) Seem to follow this pattern.

Edit: Action 07 byte 3 is reset HP? 0 = No, 1 = Yes.
« Last Edit: July 17, 2008, 11:51:22 am by Mauron »

JLukas

  • Fan Project Leader
  • Squaretable Knight (+400)
  • *
  • Posts: 426
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #57 on: July 29, 2008, 06:07:12 pm »
Action $0B decoded:

0B aa vv mm ss

aa - value to add to enemy stat set start (enemy index in hex x $80 + $7E5E2D) to get final address
vv - value used in calculation
mm - mode. if $00, set vv to address. if not $00, OR existing value at address with vv
ss - battle enemy message string


Example with Terrasaur using Enemy Index $03:

0B
3E ($7E5FAD + $3E) = $7E5FEB
40 mode is 00, so set $7E5FEB Defense to $40
00 mode 00
39 "Def pwr decreases when shocked"

Action 0C

0C aa mm ss

aa value to add to (enemy index x $100) / 2 + 7E5E2D to get final address
mm multipurpose byte  0x80 mode.  if 0x80 set, subtract. if 0x80 not set, add  0x7F amount to add/subtract
ss - battle enemy message string

Example with Mammon M. using Enemy Index $03:

0C
3E enemy index 03 x $100 = $300 / 2 = $0180 + $7E5E2D + $3E = $7E5FEB
30 <$80, add mode. add $30 to Defense
9F "Attack used to increase defense!"
« Last Edit: July 30, 2008, 11:08:07 am by JLukas »

Agent 12

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #58 on: July 29, 2008, 09:12:04 pm »
I got alot of updates to do, I'll probably have to push it to next week.

I imagine that $7E5E2D is going through some sort of cycle that I can use to figure out what stat is being set.  Something like

$7E5E2D       = enemy_1 stat_1
$7E5E2E + 1 = enemy_1 stat_2
$7E5E2F + 2 = enemy_1 stat_3
$7E5E30 + 3 = enemy_1 stat_4
$7E5E30 + 4 = enemy_2 stat_1
$7E5E31 + 1 = enemy_2 stat_2
$7E5E32 + 2 = enemy_2 stat_3
$7E5E33 + 2 = enemy_2 stat_4


etc.   is this true?  If so I should be able to mod the address to get the stat.

--JP


JLukas

  • Fan Project Leader
  • Squaretable Knight (+400)
  • *
  • Posts: 426
    • View Profile
Re: Enemy AI needs better documentation. (research thread)
« Reply #59 on: July 30, 2008, 11:55:31 am »
Updated the post above.

An easy way to determine most stats:

7E5FE5 is Enemy 03's Speed

In Chickenlump's editor, that stat and all the rest in the column go in order.  7E5FE6 is Magic, etc.