• Welcome to Final Fantasy Hacktics. Please login or sign up.
 

How to implement AI in FFT-similar game?

Started by The_Absent_King, June 09, 2010, 11:57:40 pm

The_Absent_King

No, thats cheating. Making an AI that cheats results in the game not being fun. Id rather there be a strategy for each level then have the player figure out how to beat the AI at that one particular game (what do I bring in to win, against what it will bring in to counter me) and use the strategy every time.

Its possible I could make it so that certain core abilities are always present somewhere on the team (like rez).

---

One thing Id like to discuss is Speed. Atm, I plan for speed to be static - dependent upon class and equips but NOT upon level or what class you leveled up in.

The effects of progressively higher speed isn't directly felt in FFT - only in that your longer casting skills start taking even 'longer' to cast. This is counter productive in my mind. I would have to either plan obsolescence, increase the skills speed in level, or something similar.

Can you think of any draw backs to this? Itd give me more control, but slightly decrease the options the player has for building characters.

Archael

How is it cheating? The AI is usually stuck with static builds and r/s/m combos... having it choose it's own items and r/s/m seems like a logical process to me. It doesn't HAVE to be based on what the player brings, but it can be based on a set of pre-defined (read: not optimal) combos which work together, odd or common. It's still AI, and it will always be at a disadvantage vs the player.

This wouldn't mean that strategy is removed for every level... They would still be stuck in pre-set jobs and pre-set positions.

The_Absent_King

An AI that knows more about the game state then a human does/can is said to 'cheat'. It is generally agreed upon that cheating AIs are bad. An AI that knows what you are bringing to a fight, and adapts its build accordingly, is 'cheating'.

I was already planning on having pseudo random builds. Never having considered random battles in depth I never realized that many (all?) of the builds of foes in an encounter are static.

Also, you might want to rethink this: "AI will always have a disadvantage to a human". With the right approach, enough RAM/CPU time, an AI will kick a human's ass every time, on any zero sum game. The problem, of course, is if the platform is powerful enough for the AI to play perfectly, without exceeding the time limit.

Archael

Quote from: "Voldemort"It doesn't HAVE to be based on what the player brings,

The_Absent_King

Yes; I was replying to a question you asked before you clarified.

I then further clarified by stating that I was always planning on pseudo random load outs for the enemy team.

Pickle Girl Fanboy

I think I have a name for the Witches Curse/Blessing Skillset:
vergeltung
revenge, pay someone back, compensate them, reward them, even to bless them
German, I think.

It's gonna be nice to have an enemy that creates favorable conditions for itself and knows how to work together.  How about abilities like equip change?  Will the AI know what to equip?  And could you do something to increase the odds of enemies equipping x ability and y equipment if they already learned z ability?

If a human player already has MP Switch learned, then he is more likely to learn other abilities which work in tandem with MP Switch, like Move-MP Up.  Shouldn't the enemy mimic this behavior?  And I only said increase the chances of this happening, it shouldn't be 100%, or even 75% of the time.

The_Absent_King

Witch's Curse/Blessing skillset? What are you talking about there? Regardless, Vergeltung is cool and all but why obfuscate the word Retaliation?

Equip Change presents a problem. Not insurmountable, but the effort required to solve it exceeds the need to, at this time. Thus, for the foreseeable future, Equip Change will be unavailable to the AI.

Choosing skills will occur before choosing gear, when generating the enemy load-out. Some combinations of items might not be chosen together well, but I think I can definitely swing making item choice dependent upon skills. Implementing this before the AI will actually give me a framework to ease the transition (it is very similar to how I plan to make the stochastic vector - that is, the playout strategy).

As for how to choose the skills... what if I create skill groups? Having skills within the group gave you a chance of having other skills in the same group, for free, decided after the rest of the process. Since having X may strongly imply Y, but Y may weakly imply X, this can best be stored as a 2 dimensional array.

I think the order Im going to make the classes in is gender (irrelevant to stat growth, I have a trinity of stats instead of FFT's duality of  Brave/Physical and Faith/Magical ), then primary class, then secondary class, equipped RSM, then random active skills from both skill sets, then skills from skill groups, then items.

Only problem with above approach is how to resolve conflict from RSM gains from skill groups and the equipped RSM's themselves. Especially if multiple skills are chosen from the skill groups.

That, and it makes no allotment that, as an example, "Fire 3 shall not be used by characters under level 5".

What about a passive skill that lets you change your reaction or movement skills? I think that could be damn powerful. AI will need to be tweaked to use it, but doable come Beta. Thoughts?

Also, what do you guys think about speed being level/growth independent? Im really torn on if this is a good idea or not.

Pathogen

Speed was level dependent in the sequel games, FFTA and FFTA2. So obviously, squads with mismatched levels would have huge speed differences and high level units might move several times before lower level units got to have a chance. Whether this matters or not depends on the goals of your game, I think. In single player it is not a big deal, it only amounts to extra challenge if the player moves through the campaign without leveling (I do this, often I just want to see the story missions without grinding levels for my units). If your game is going to have any sort of multiplayer, or if enemy unit levels do not grow with the average level of the player's party, then you could get some balance problems.

(In FFTA, enemy levels did not increase with your party's average level as they do in FFT, you would occasionally come across a low level mission that you had skipped earlier on. When it's the player's squad that has 30+ more levels than the AI's, the mission is a boring cakewalk!)

The way I see it, most of the time we want our units of the same level to have relatively the same power, with some minor variance based on selected job, equipment, etc. So why bother implementing a speed increase system if we want most units of the same level to have the same speed? We can just *give* bosses and tougher units a higher speed than average. It just seems like extra work for little payoff. (You could make the same argument for most of the statistics in FFT though... how about a game with no levels, where learning abilities, unlocking jobs and finding equipment are the only means of progression?)

On generating random encounters, yeah, every band of enemies you face in FFT (and the sequels, I'm pretty sure) was preset. You could come up with a system for generating random units with r/s/m abilities and gear that make sense together... but at that point, it might be easier to design a few hundred preset units, and choose from that pool for each random battle. It might also be interesting to generate some units completely at random, with no effort to make sure the abilities blend well together. There will be plenty of misses, but I bet that such a system would turn out unexpectedly tough and interesting combinations too. An easy way to maximize the utility of a completely random unit: randomize which two A-ability lists it gets to have, give it every skill in each category, and let your AI figure out which of those abilities to use together.

The game you're developing sounds great! FFT is in dire need of a good spiritual successor; I've been playing with the same idea. I have written some very preliminary code in my spare time (for a different engine than Unity3D), but mostly I've been thinking about the mechanics of the game and what purpose they serve exactly. The linked thread on AI for an FFT-like game is illuminating. I could talk about game design and balance all day. Good luck!

Pickle Girl Fanboy

If you don't want to do away with leveling altogether, then you could make something similar to FF2 or the SaGa games, where you gain stats according to what actions you choose in battle.  SaGa games usually come with something called Battle Rank, which is a score based on how many battles you fought and how difficult those battles were.  The higher your BR, the higher your enemies stats/smarter the enemy AI.

Romancing Saga divides speed into Dexterity, which is part of the hit rate for weapon attacks and partly determines how fast you act, and Agility, which is part of evasion and affects the trigger rate of some counters and interruptions.

SaGa Frontier 2 uses your skill level for each weapon type (hand to hand, Sword,...) to determine who acts first, as well as for counters and interruptions.

I'm not familiar with SaGa Frontier 1.

One other thing... In your tactics engine/game, please include options to turn off the in-battle messages (like the navigation message, jp/exp gained,...), speed up battle effects, and fast forward through dialog.

FYI -> difference between counters and interruptions.
Hamedo is an interruption and a counter.
Counter Dash is a counter.
Blade Grasp is an interruption.