• Welcome to Final Fantasy Hacktics. Please login or sign up.
 
May 01, 2024, 02:41:52 am

News:

Please use .png instead of .bmp when uploading unfinished sprites to the forum!


Buggy AI for self target skills that have Charge Time

Started by R999, February 25, 2010, 02:51:33 am

R999

I am pretty sure even in FFT 1.3 the Accumulate skill has problems with this. For some reason, these skills for the AI do NOT follow the target, meaning, if they cast the skill right now, and then make a movement, when the skill fires off it will be onto the panel at which it was casted previously. I have tried many combinations of possible flags in FFTPatcher without success (including all of the Unknown flags).

You can test this out easily, with any skill that has: Auto target, Target Self, Follow-Target, Hit Caster, Hit Allies, Animate on MIss. If you also decide to check "Targetting" for whatever reason, it will make the AI cast the said spell and do a Wait (instead of a move command). Go into any battle, when your unit's turn comes up, put that unit with the said skill in AutoBattle:Protect Allies, and then select himself as the target. For better results, make it so that he only has that self buff skill learned. With the "Animate on Miss" flag on, you should be able to see that he will indeed fire off the spell on an empty panel (either that or you have Targetting checked, making him never make a move (always Wait)).

By the way, I have even went as far as tested out every single stats formulas available in FFTPatcher formula on this behavior. You'll think that those Bard formulas should work, but what actually happens behind the scenes is the Range=255 Height=255 and Target Allies + Target/Hit Caster checked. If you make the Bard Songs' Range to be 0 (target self), the same behavior can be observed.

I am curious if there's a way to fix this bug. In the meantime I will have to force all self-buff skills to be instant cast in order to avoid this AI-only bug.


edit: To a lesser extent, self AoE spells share a similar AI related problem. That is, the AI will cast the self-target AoE spell, and walk out of range while it is charging (whether it is a healing or offensive spell, it does not matter, they will still be able to walk out of range). You can try it out yourself, give any of the Samurai abilities a charge time and see them walking completely out of range (of allies or enemies).

formerdeathcorps

Try unchecking auto-target.  I think auto-target is assuming the spell is an instant.
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

R999

Thanks for the suggestion,

^
I tried turning Auto off. Didn't change the behavior for me.

formerdeathcorps

Then try turning off auto and targeting.  Maybe the two don't work well together?
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

R999

I have tested that as well. It seems the problem is most definitely range=0. Turning on Targetting will force the AI to always Wait after cast. Stupid behavior. If I turn off Targetting, it will sometimes move, sometimes not. The only solution is to set Charge Time to 0 for now...

Skip Sandwich

hey, I've got a ingenious idea, why not set the skill to range 1, area 1v255, but only allow it to hit self (no target enemy, no target ally)?
"Dave?  Are you there?"
"Yeah.  I can't get you through the cell now."
"You have to talk through the bratwurst from now on. I'm sorry. I didn't know it would do that."
http://www.johndiesattheend.com

formerdeathcorps

Quote from: "Skip Sandwich"hey, I've got a ingenious idea, why not set the skill to range 1, area 1v255, but only allow it to hit self (no target enemy, no target ally)?

That won't work.  To hit yourself, you need both the target self and the target ally flags checked (note that dances have target self, but not target ally).
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

R999

Well you can hit self even with Hit Allies unchecked (the Hit Allies in the bottom, and I have tested this several times). However the AI thinks differently and I believe it needs to have Target Allies checked at the AI behavior section. The problem with this approach is, even if it works, it'll look slightly confusing for the player (you need to select a target for a self cast skill, on yourself basicaly, and you'll have those green selection panels show up). This is going to cost an extra ability slot and an extra skillset slot for each of these abilities (for the AI) to get them work right (provided that it can work with Hit Allies off). That alone is already too expensive for my uses. Although I am curious enough to go try it out.


Update on this. I seem to have gotten the AI to work by turning Auto Off AND Targetting Off AND Hit Allies Off. Even with Range=0. This is weird but this combination seems to be working so far (not seeing anything strange yet). Only problem here, is that the player will be required to manually select himself as the target since Auto is off. I will go do so more testing with Hit Allies = Off and see if there is another way to help fix this.

For future reference, this is the settings I used to let the AI use the skill properly, although it does come with a catch being that you need Auto off.

Screenshot


edit: I just tested with
Range-0
Effect-255
Auto On
Target Self On
Hit Caster On,
Hit Allies Off  
Hit Enemies Off.

Result:

The game actually casts the spell on ALL units regardless if it is allies or enemies when this happens.

Also, it lets you do a target selection even with range=0 and effect=255, with auto On, targetting off. This is getting more and more unpredictable by the day.

formerdeathcorps

As I said on the ability flag thread, targeting doesn't actually allow you to target to not.  All it does is ensure that if the AI (and maybe you) did target something, the charging unit won't change their spell mid-charge if they get a turn.  Units with targeting can move away from the target while casting spells (you see this quite often; if you test a black mage against any melee unit, if the melee unit falls into range of the black mage, on the black mage's turn, he'll target the enemy unit with black magic and then run away).  The only exception to this is when a unit is auto-flagged (but the only auto-flagged "spells" in the game are dances and songs, which don't need targeting since they hit everything and have persevere status; note, this is also why dancers and bards, if they get a turn in between using last song/dance, will often change their song/dance and terminate the first performance before completion).
Also, what exactly do you mean by target selection?  Target selection (as in having red areas and green panels to click on) exist only when range > 0 and auto is turned off.  Target selection as in having to click execute (which always happens) or unit/panel (this is follow target, by the way) is not determined by targeting.

As for the zero range discovery, you just found yet another bug in the FFT code.  I'm willing to bet the problem is either auto somehow has a default as hit all when hit self is checked (which is modified if the hit allies or hit enemies flag is checked), or that hit self has the default as hit all (which is modified into just hit allies or just hit enemies depending which of those two flags are checked).
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.

R999

Quote from: "formerdeathcorps"As I said on the ability flag thread, targeting doesn't actually allow you to target to not.  All it does is ensure that if the AI (and maybe you) did target something, the charging unit won't change their spell mid-charge if they get a turn.  Units with targeting can move away from the target while casting spells (you see this quite often; if you test a black mage against any melee unit, if the melee unit falls into range of the black mage, on the black mage's turn, he'll target the enemy unit with black magic and then run away).  The only exception to this is when a unit is auto-flagged (but the only auto-flagged "spells" in the game are dances and songs, which don't need targeting since they hit everything and have persevere status; note, this is also why dancers and bards, if they get a turn in between using last song/dance, will often change their song/dance and terminate the first performance before completion).
Also, what exactly do you mean by target selection?  Target selection (as in having red areas and green panels to click on) exist only when range > 0 and auto is turned off.  Target selection as in having to click execute (which always happens) or unit/panel (this is follow target, by the way) is not determined by targeting.

As for the zero range discovery, you just found yet another bug in the FFT code.  I'm willing to bet the problem is either auto somehow has a default as hit all when hit self is checked (which is modified if the hit allies or hit enemies flag is checked), or that hit self has the default as hit all (which is modified into just hit allies or just hit enemies depending which of those two flags are checked).


Oh NOW I see what you were saying about the Targetting. But have you tested it to be sure? (That targetting is to make sure that the AI do not interrupt their spells) The abilities that also have auto flagged include Draw Outs (targetting off), self target skills like Scream (targetting On), Accumulate, etc, usually with a combination of Range=0. Yes I realize that they are instant cast spells, but still it is puzzling. For these skills, when targetting is on, the AI will never use the Move command after using the said skills (if you give it a charge time).

To clarify what I mean by Target Selection:
1. is Not the "Execute Action" command.
2. is where the player needs to select a panel, have ability to move cursor(or not, depending on range/area/hit allies/enemies factors)
3. is where the player needs to select Unit or Area, have ability to move cursor(or not, depending on range/area/hit allies/enemies factors)
4. is where the player gets to see the effected units/area (green panels) before the Execute dialogue, no ability to move cursor (this is the fullscreen case)

Case 2 and 3 can exist independently or together, that is actually determined by more rigid checks (like Target caster, hit caster, hit allies, hit enemies, range, area effect, auto, follow-target flags).