øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=2351.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index2b35-3.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&board=17.20e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index2b35-3.html.zx9h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈà•¤íOKtext/htmlISO-8859-1gzip@øÕíÿÿÿÿÿÿÿÿWed, 11 Mar 2020 01:20:46 GMT0ó°° ®0®P®€§²ð®9h^ÿÿÿÿÿÿÿÿñ(í New Information about Targeting

Author Topic: New Information about Targeting  (Read 750 times)

Xardas

  • Siren
  • *
  • Posts: 75
    • View Profile
New Information about Targeting
« on: March 27, 2017, 08:06:34 AM »
Hello
This was originally a sidenote from my Mod-Topic. But since it really seems to be new info, I thought it's better to seperate instead of having a discussion on my mod thread.
So what is all this about?
[...]I have some information about targeting offsets in Enemy AI scripts. I think some of you already know this, but since I did not find it neither here
http://slickproductions.org/slickwiki/index.php/Jorgur:FF5_AI_scripts#Codes
nor in Squall's FFViewer (Yes, that bad pun was intentional^^), I think it's better to shout this info out:
12 means "All Characters in front row"
13 means "All characters in back row"
I realized that Shiva targets characters with her Ice2 only this way in my first playthrough, actually. And as I was looking up her AI via Squall's Viewer, I realized that those values have the said effect.[...]
And Squall already answered, being a little sceptic:
Quote
12 means "All Characters in front row"
13 means "All characters in back row"
Did you tested it, does it work that way? A good test will be to put 2 in front 2 in back, beef up stats (so you can survive longer) and see the damage - do really only 2 chars get dmg?
I'm asking, because as far as I know there is no such mechanic implemented. You either hit all or single target ...
Well, I did not test it until today. I thought the Shiva AI would be enough of evidence. I would have said "Just look at Shiva's AI and then go to youtube and watch someone fighting Shiva - her Blizzara always only hits the fronters first, then the backers and so on..."
But additionally, I took a fresh ROM, edited BlandLamia's AI into Target 12 (Front row) Blowfish and then Target 13 (Back row) Breath Wing. Here's the Link to the video:
https://www.youtube.com/watch?v=DrGQ9kHX89Q&feature=youtu.be

x0_000

  • Siren
  • *
  • Posts: 72
    • View Profile
Re: New Information about Targeting
« Reply #1 on: March 28, 2017, 05:02:50 PM »
I've seen that behaviour after playing Fiesta several times. I have a few targeters not covered by the wiki in my notes too:
Code: [Select]
fd f3 XX XX - set target
note: ally refers to player, enemy refers to monster
00 F0 - target bartz
01 F0 - target lenna
02 F0 - target galuf
03 F0 - target faris
04 F0 - target krile?
06 F0 - single enemy in front row
0D F0 - target self
0E F0 - all enemies, not self
0F F0 - all enemies
10 F0 - single enemy, not self
12 F0 - singly ally (front?) row
13 F0 - single ally (back?) row
18 F0 - target single woman
19 F0 - target single man
1B F0 - single ally
1C F0 - all allies
1D F0 - target single enemy with wall
22 F0 - target single ally (with wall?) used by calofisteri
23 F0 - target all allies
24 f0 - target single ally (with wall?)
25 F0 - target all dead enemies
26 F0 - target single enemy (dead? used by hellraiser)
27 F0 - target enkidu
28 F0 - target bartz
29 F0 - target lenna
2A F0 - target faris
2B F0 - target galuf
2C F0 - target krile
2d F0 - target previous attacker (last action)
2e 00 - target dead ally?
2f F0 - ?

Xardas

  • Siren
  • *
  • Posts: 75
    • View Profile
Re: New Information about Targeting
« Reply #2 on: March 28, 2017, 06:34:35 PM »
Well done. Although I see a small error:
I've seen that behaviour after playing Fiesta several times. I have a few targeters not covered by the wiki in my notes too:
Code: [Select]
12 F0 - singly ally (front?) row
13 F0 - single ally (back?) row
Rather than "single", it should be "all allies in front/back row", according to Shiva's behavior and my test video.

x0_000

  • Siren
  • *
  • Posts: 72
    • View Profile
Re: New Information about Targeting
« Reply #3 on: March 28, 2017, 09:41:25 PM »
Yeah, I might have meant "a single row that belongs to the ally". I do not keep the clearest notes :v

LightPhoenix

  • FF5 Hacker
  • *
  • Posts: 130
    • View Profile
Re: New Information about Targeting
« Reply #4 on: April 01, 2017, 07:56:54 PM »
A couple of notes here based on an hour or so of quick research:

First, below I refer to "player" as one of the four slots of Bartz etc.  "Monster" refers to one of the eight monster slots.  I prefer this to ally/enemy to prevent ambiguity.

Second, F3 doesn't actually use the second parameter.  It's meaningless to include, and gets overwritten (to store monster targets).

00-04 are targeting a specific player as noted, and yes 04 is Krile.

05-0c are targeting a specific monster slot (offsets 0200 through 0580).

0e-11 are various combos of targeting random monsters (not players).  10 and 11 are specifically a random targetable monster; 11 is unsurprisingly random monster including self.

Side note: if you're looking at the code (F3 at C2/33EC, or parsing the parameter at C2/2C27) $2724 is true if targeting all available targets.  The code for checking this is in 33EC.

12-19 all use the same function and check bits in $2000,X.  12 is All in Back Row, 13 is All in Front Row, 14 is RST in Back Row, 15 is RST in Front Row.  16 is All Female, 17 is All Male, 18 is RST Female, 19 is RST Male.  For these functions, this is *only* checked for players, not monsters.

I haven't looked at any of the others, but there are 33 total (see indirect jump at C2/2C4A).

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: New Information about Targeting
« Reply #5 on: April 03, 2017, 03:58:02 AM »
Excellent work LightPhoenix! Its a pleasure to read your digging, because its deep, yet presented in a clean, systematic way!

I never knew that there is extra targeting code (outside Action target byte), which allow to select any number of targets, not just single or all.

P.S. What RST mean in "15 is RST in Front Row"?

LightPhoenix

  • FF5 Hacker
  • *
  • Posts: 130
    • View Profile
Re: New Information about Targeting
« Reply #6 on: April 03, 2017, 11:18:55 AM »
Random single target.  The workflow is something like this:

The game gets a random number 0-7
Checks if that number corresponds to a valid player target and chooses it
(if no player) Checks if that number corresponds to a valid monster target and chooses it
Repeat if no target found

Xardas

  • Siren
  • *
  • Posts: 75
    • View Profile
Re: New Information about Targeting
« Reply #7 on: April 03, 2017, 05:22:38 PM »
I agree on Squall's post, nice work. I thought maybe I'll do that later, since it wasn't researched that deeply. Anyway thank you for your work!

LightPhoenix

  • FF5 Hacker
  • *
  • Posts: 130
    • View Profile
Re: New Information about Targeting
« Reply #8 on: April 09, 2017, 03:08:24 PM »
So, I wanted to follow up on this since I don't like leaving things half finished.  Plus, I've been looking into AI a bit after I realized how much space in RAM it takes up.  Anyway, based on the code, here's the list of target parameters:

00   Target Bartz
01   Target Lenna
02   Target Galuf
03   Target Faris
04   Target Krile

05   Target Monster 1
06   Target Monster 2
07   Target Monster 3
08   Target Monster 4
09   Target Monster 5
0A   Target Monster 6
0B   Target Monster 7
0C   Target Monster 8

0D   Target Self (Effectively, see below)

0E   All Non-Self Monsters
0F   All Monsters
10   Single Non-Self Monster
11   Single Monster

12   All Front Row Players
13   All Back Row Players
14   Single Front Row Player
15   Single Back Row Player

16   All Female Players
17   All Male Players
18   Single Female Player
19   Single Male Player

1A   All Available Players (see below)
1B   Single Availble Player

1C   All Monsters With Reflect (not really useful)
1D   Single Monster With Reflect
1E   All Monsters With Critical (aka Near Death)
1F   Single Monster With Critical

20   All Monsters Less Than Half HP
21   Single Monster Less Than Half HP

22   Single Player Without Reflect

23   All Players In Team (see below)
24   Single Player In Team

25   All Monsters Dead Or 0 HP
26   Single Monster Dead Or 0 HP

27   ??? (see below)

28   Target Bartz If Jumping (see below)
29   Target Lenna If Jumping
2A   Target Faris If Jumping
2B   Target Galuf If Jumping
2C   Target Krile If Jumping

2D   Target Previous Attacker

2E   All Players Where Flag Set (see below)

2F   Target Bartz if Dead (see below)
30   Target Lenna if Dead
31   Target Faris if Dead
32   Target Galuf if Dead

Notes:

Unless explicitly targeted, single targets are randomly chosen from the list of available targets.

0D: This isn't explicitly targeting self unless a flag (7C56) is set to zero, but appears to serve that function.  I suspect the additional code is for counters that trigger on self, but I have not verified this.

1A: By available here - players that are Present and not Petrified, Dead, Erased, Hidden, or Jumping.  These are checked for most of these targeting functions.

23/24: I'm not sure offhand what the difference between this and 1A/1B are.  This checks the "In Team" flag (#40) in the player info byte (2000,X) similar to Gender/Row.

27: This parses more of the AI code, and it's a can of worms I'm not prepared to look into yet.  When I've unraveled more of the AI parsing I'll come back to this.

28-2C: These target a jumping player, if they are not already affected by Interceptor Rocket.  The way IR works is that it tells the affected target to perform action #50, overwriting whatever it was doing before.  This function checks if the player is performing command action #50 already and skips them if they are.  This prevents IR from being used on a target twice.

2E: This checks $7C87 and if the player's bitflag (80 = B/L/F/G/K/-/-/-) is set, and adds them to the target list if it is.  I don't know what sets this flag, but it's something in C1 so it's likely to be animation based.

2F-32: There is no function to explicitly target a dead Krile.  Oops.

samurai goroh

  • FF5 Hacker
  • *
  • Posts: 221
  • Gender: Male
    • View Profile
    • My page
Re: New Information about Targeting
« Reply #9 on: April 09, 2017, 04:07:36 PM »
I find odd that Krile is handled as a different case, considering you cannot have both Galuf and Krile at the same time (sounds to me like it was planned to have all 5 members at some point in development but was dropped out). Also, why does the list stops at 0x32 and not something more meaningful like 0x3F, ran out of space to handle more cases?

- When I read 0x27 I though it was related to the Sandworm because of "???" and "can of worms" XD
- 0x2E sounds to me like it checks if players are in the back row
- A funny thing is that despite the game handling code for up to 8 monsters in battle, only up to 7 monsters are ever handled (and just in 2 battles IIRC).
I'm the best in the universe! Just remember! [F-zero X]

x0_000

  • Siren
  • *
  • Posts: 72
    • View Profile
Re: New Information about Targeting
« Reply #10 on: April 09, 2017, 05:12:29 PM »
Internally, Krile is a different entity from Galuf so there's no clean way to have a single target Galuf/Krile vs target Galuf and target Krile.

Squall

  • Dark Dragon
  • *
  • Posts: 486
    • View Profile
Re: New Information about Targeting
« Reply #11 on: April 10, 2017, 02:31:44 AM »
Quote
Also, why does the list stops at 0x32 and not something more meaningful like 0x3F, ran out of space to handle more cases?
Its just a list - enumerated items, not bit field or XXX bits value. When your wife gives you a list of 5 items to buy from a shop, she doesnt care that for 5 you need 3 bits and can hold max value of 7, so she can ask for 7 instead (thanks God) :)))

Quote
A funny thing is that despite the game handling code for up to 8 monsters in battle, only up to 7 monsters are ever handled (and just in 2 battles IIRC)
Thats the usual case. How much the game can handle is part of the game engine. How much the game is actually using is part of game design. Usually different teams work on both.

Personally I feel like you samurai goroh, and I have said it in many occasions - FFV has incredible engine, but is not used enough from designers ...