Making a challenging enemy/boss have equal stats to a player - but has a insanely hard-to-beat AI?

Discussion in 'Game Mechanics Design' started by Misaki, Jan 17, 2016.

  1. Misaki

    Misaki Pikalyze Veteran

    Messages:
    156
    Likes Received:
    24
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    There's plenty of RPGs(mainly mmorpgs) where your boss is just a load of gigantic stats that spams a couple of spells that are stronger then the player - but otherwise they don't really do too much.

    There's rpgs where there's bosses with relatively smart AIs but doesn't really feel like it's on a fair level because they have lower stats then you, then occasionally the inbetween.

    What I'm thinking is - a boss or enemy that has equal stats to a player or relatively - but is programmed to pretty much counteract or beat anything the player tries to do with little error. It's pretty much "Player uses fireball skill - AI makes various checks like..

    - Does player have enough mana to cast another fireball spell?

    - Does player have other spells they can use as a alternate damage spell?

    - Is player probably dead anyways?

    - Is player's fireball spell going to activate an additional effect later that I can counteract?

    And make the AI find a way to counteract it.

    How would you balance it around this rather then "1000000 hp vs 9000 hp"?.
     
    #1
  2. jonthefox

    jonthefox Veteran Veteran

    Messages:
    1,284
    Likes Received:
    442
    Location:
    NYC
    First idea that comes to mind is to give the enemy a series of skills that follow a pattern, and the player has to figure out the pattern and then adapt to it by making optimal decisions of his own skill usage.  Quick example, let's say the enemy has:

    -Devastating Strike - does 300% dmg

    -Parrying Strike - does 50% dmg, but always strikes first and blocks 50% of incoming dmg next turn

    -Stunning Blow - Stuns the enemy for 2 turns

    -Shield Wall - reduces dmg by 25% and makes one immune to stun for 1 turn.  Instant activation.

    In this case it would be important for the player to:

    -use parrying strike right before the enemy uses devastating strike

    -use shield wall right before the enemy uses stunning blow

    -use devastating strike right before the enemy WON'T use parrying strike

    -use stunning blow right before the enemy WON'T use shield wall

    Assuming it was a 1 on 1 battle and the stats were equal, then success or failure would come down to how well you detected the enemy's patterns and were able to adapt to it.  
     
    #2
  3. Wavelength

    Wavelength Pre-Merge Boot Moderator

    Messages:
    4,076
    Likes Received:
    3,407
    Location:
    Florida, USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    Most AIs that can play a game as well as a human are created with the aid of machine learning (where the AI will develop its behaviors by looking at different actions taken in previous games and how those games resulted), and of those that aren't done with machine learning, many (like Chess AIs) "brute force" all the possible moves that can be made many turns down the line, which isn't a viable solution for an RPG.

    So assuming you don't want to spend all your time developing a neural net instead of developing an RPG, you have the option of designing the kind of decision trees or algorithms that you're describing, but such AIs are rarely as good as a human in a system of any real complexity, because they're somewhat predictable/abusable and they rarely account for everything that a player might do.

    Even then, you'd have to ask yourself whether such smart AI would make the game any more enjoyable for the player - and in a lot of cases the answer is going to be 'no'.  Let's take the example of a boss party with an equal number of characters to mine and equal stats, with a general "very good" AI that can figure out basic ways to counter what I do.  So I damage one of the enemies, and one of their allies heals the correct enemy.  I inflict a Poison on the enemy, and one of their allies cures the Poison.  Then one of their other allies does the smart thing and starts wailing on my healer.  My healer guards... so they start wailing on my mage instead.  Then, as soon as my Healer stops guarding to heal the mage, she gets popped by a perfectly timed Crit from the enemy DPSer, who was saving up their best move for when my squishy was vulnerable.

    How am I supposed to win that battle?  Does it sound enjoyable?  Is it something that players will want to experience with every boss, and maybe even every single enemy party, in your game?

    I think there are simple things you can use to improve enemy behavior (whether through the use of a combination of Enemy Behavior defaults and smart use of switches/eventing, or through actually scripting some elements of enemy decision-making yourself... or in the case of RPG Maker MV, using Yanfly's conditional behavior scripts well), such as picking injured targets to heal, attacking enemies that are generating "threat", and not repeatedly using Fire attacks on a character that's immune to Fire.  But beyond that, I think you're actually hurting the player experience in many games by making the AI too good.  In a card game or a fighting game where mastery is usually the main aesthetic of play, great AI is nice; in an RPG where progression is often the main aesthetic, it's not so nice.

    The better way to make battles interesting is to give the player something interesting to figure out or overcome - the problem with "pile of stats" bosses in most RPGs is not that the boss has to be overpowered stat-wise (this is okay), but rather that the player doesn't have anything interesting to do during the course of the battle.  Scripted battles, puzzle-like battles, action battles, battles with very unique enemies or mechanics, battles where enemy behavior changes in obvious ways based on player actions... those are all good ways to keep things interesting.
     
    #3
    Maliki79, laaghisce and bgillisp like this.
  4. bgillisp

    bgillisp Global Moderators Global Mod

    Messages:
    11,784
    Likes Received:
    11,822
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMVXA
    I actually tried this in my game, where I created a party of 3 enemies that used an intelligent combo together on the first couple of rounds, and (nearly) the same stats as my party. It was unwinnable.

    You see, the problem with making the AI as smart as the player and same stats is in most games that is setting up a battle that can only be won by lucky RNG, as that is the only thing that will decide the battle now. Plus, keep in mind in most RPG's, the enemies are more powerful than the player (after all, the great evil isn't so intimidating if it has the same stats as Joe farmer), so if you made them more powerful and use the best AI possible, the battle is unwinnable.

    A strategy game actually tried this approach once (HOMM3)...the game came out in 1999 and to this day very few have ever beaten that game, as the AI was too good AND you were out powered on almost every map due to the enemy having more cities/better stats/better monsters than you, making the game near impossible.

    As for the high HP problem, I think the reason most games go for high HP on bosses is because most boss battles are 3 (or 4) vs 1, so you need something to offset that, otherwise the battle is over in 2 rounds or less. Maybe making the boss not fight you alone would fix some of that problem, and keep it interesting?
     
    Last edited by a moderator: Jan 18, 2016
    #4
  5. SinのAria

    SinのAria The Chaotic One Veteran

    Messages:
    141
    Likes Received:
    72
    First Language:
    C++
    Primarily Uses:
    N/A
    With my system, I was able to do something like this, but my system is kind of strange because you have to prepare skills in order to use them (except for guard). The updated system I'm trying to implement uses time instead of turns, but the temporary system I'm using is essentially a rock paper scissors (Guard Crush > Guard > Swift Attack > Guard Crush) where each skill type aside from guard requires you to prepare.Each skill in the game falls under one of those categories in some way. (Normal attack would be "swift").

     

    Of course, boss tier AI would have special attacks, but those attacks could be countered (if you played my first fate game (the prologue), the items you started with hinted at how to counter them... Most people never bothered to read the item descriptions).

     

    Though for my final First Fate game, I'm developing several battle systems to choose from: Duel (1v1), 5th member assist (Standard battle with my combat system, but with a buff based on your fifth party member), Problem solving battles (the enemy has certain weaknesses and figuring them out through clues gained either during or outside the fight is the key to winning), Puzzle victories (There are ways outside of battle to win, you solve a puzzle, you might ignite the explosive barrels they are hiding and beat them that way, disable their weapons before they even get a chance to fight, etc.), and Standard (normal RPG battle mode) being the main systems.

    Essentially, in duel mode, what the "AI" would do is react based on what you did.

    Guard? It knows your next turn has to be either a prepare or a guard or an item. Increase the chance that it will prepare an attack.

    Prepare? Your next turn could be anything. If you have a tendency of using Crush, it might prepare a swift. If you have a tendency of using Swift, it might guard. If you have a tendency of guarding, it might prepare a Crush.

    The AI might even trick you by showing off that it is going to use a crush attack and then actually using a swift or a guard. Maybe it will show off that it is going to do a swift attack, then prepare an attack the next turn.

    The player might try to trick the AI as well.

    Essentially, I have a sort of "algorithm" where it calculates your likely next attack based on several factors such as how often you use certain actions, what your longest chain of certain actions are, what actions do you tend to chain with (do you tend to chain crush to swift? Do you tend to double prepare? triple prepare?), what your player health is at, how much EP/MP you are likely to have, how much SP/ST you are likely to have (preparing crush attacks burn SP, preparing magic attacks burn MP), what buffs might you have on, etc. For party scenarios, it would have to calculate each party member individually AND you overall as a player.

    Now, that isn't to say it can automatically read what skill you are using, but the idea is that it can guess based on your tendencies. Of course, the AI is also limited by stats. If it doesn't have enough SP, it can't use high SP skills. If it doesn't have enough mp, it can't use high MP skills. If it doesn't have enough HP, it can't use high HP skills.

    In reality though, it is a huge amount of effort. You are essentially developing a pseudo A.I. for a game. And honestly? Normal players won't get much enjoyment out of it.
     
    #5
    Lowell and Wavelength like this.

Share This Page