1. 28

  2. 27

    I think the author misses the point. Enemy AI isn’t intended to be realistic or human-level challenging. The author even unwittingly provides evidence when he mentions the guards yelled “flush him out” before throwing a grenade. That dialogue isn’t there for the AI, it’s there for player to hear, deal with, and learn from. They only yell at each other for the player’s benefit. Hearing “flush him out” and having a couple seconds to do something is much more fun than being pinned down, spraying some fire, trying to figure out what you’re going to do, and then cutting to a game over screen because the enemy tossed a short-fuse grenade you didn’t hear hit the ground over the gunfire, shot you through a window instead of crashing through it, flanked you by coordinating with hand signals instead of yelling, etc.

    FPS enemies are fodder. It’s really obvious in stealth games, where the lone enemy always goes to investigate that odd sound/movement directly instead of taking backup. They’re person-shaped challenges, not persons. The “realistic” approach would look like real-world police/guard response protocol, which is something like: find cover, call for backup, keep your damn head down, just stay alive until an effectively infinite amount of heavily armed-and-armored experts arrive. Not fun for the player when a single misstep means the mission is over.

    Speaking of not fun, I remember reading an article on Gamasutra 10-15 years ago talking about a AI in a stealth game (maybe Splinter Cell?). In an early build, if a military guard spotted the player and wasn’t spotted themselves, they’d take the correct action: silently shoulder their rifle and plug them in the back. It turned out that players weren’t too happy about gameplay that went “sneak, sneak, peek, sneak, btw you’re dead” with no idea what happened. They changed it so guards spotting would always yell in alarm or call for backup, then run for cover. This was all timed slow enough the player could turn around and see who’d spotted them to learn from the experience. I couldn’t find it again, but Gamasutra and other industry sources have no shortage of info on how to develop fun AI, and most explicitly mentions that the goal is not complexity or realism.

    1. 7

      +1. There are a couple of games that are interesting in relation to this topic. The first is ArmA, which is not renowned for having fantastic AI (if scripted badly, they can just be stationary mannequins standing in a field). However, the AI reacts fairly competently and realistically to contact: they spread out, seek cover, and return fire. It’s extremely easy to screw up only slightly, get noticed, and then hear “chunk” as a bullet kills you, without ever noticing the AI squad that spotted you (or knowing why).

      The second is Invisible Inc, which went through several iterations of adding more and more information to the player’s knowledge, until it’s basically a puzzle game rather than a traditional “try try again” stealth game. The result is one of the best “stealth games” around, to the point that I have no urge to ever play a traditional stealth game again.

      1. 6

        One of the funny things about Arma is that, iirc, they only use one thread for AI.

        They eventually added a way of adding dedicated headless (read: AI-only) servers.

        So, one of the main clans (Shacktac) tried this out.

        This did not end well for them.

        1. 1

          First half of that was useless as I have no idea what was going on. Might have been better to show first team’s perspective. Although seeing their bodies everywhere later knowing enemies must be somewhere had a nice, survival-horror flare to it. The second part was fun. Also, interesting in that it gave me ideas for AI patterns that could’ve given the humans hell. Especially a combo of scouts to spot positions of soldiers all clumped together followed by combo of nade spamming that area to flush those that survive w/ MG’s or rifles waiting at likely exits. Is there a write-up on the AI that was used, though, as it seemed OK?

        2. 1

          The gameplay trailer for Invisible Inc did look neat. Funny quip that the executive’s computer was “the larger one with the simplified controls.” Haha. One thing I didn’t get was what effects came with the security level going up every turn. They had that happening and were setting off alarms. So, it wasn’t clear what reactions each were producing outside guards showing up. Also, can you move bodies so they don’t see them or that becomes immaterial to its style of gameplay?

          1. 2

            The security level is the clock that drives players through the level. It ticks up every turn or based on certain player actions (getting spotted, knocking out/killing advanced guards, triggering particular hacking defenses). Every 5 ticks fills the circle, the number goes up in the middle, and something bad for the player happens. Effects include changed patrols, additional guards, increased firewalls, elite guards who can scan areas to find agents in cover, and instant locating of one or two agents (which alarms every guard). The functional gameplay effect is that the player wants to move as fast as possible through the level, balancing speed and risk of detection.

            You can hide bodies out of sight, whether they’re unconscious and will wake up in a few turns or dead. Unconscious guards wake up alerted.

            1. 1

              Thanks. That sounds really neat. I like the diversity of it instead of “alarm followed by all guards coming after you” as only thing that happens in many games. I can already see how that might interact with the basic gameplay, esp if level design is good.

        3. 4

          For anyone who wants to read more about these design considerations in the context of stealth games, I’d strongly recommend this article, the first half of which discusses the idea of the “partial failure margin”. Essentially, in a stealth game, interesting gameplay mostly takes place in the relatively narrow margin between total failure (i.e. getting caught and failing the level) and total success (i.e. sneaking through the level perfectly, with the guards oblivious to your presence).

          Because this partial failure margin is where all of the fun takes place, it’s arguably the role of the designer to expand this margin as much as possible. Thus you get guards with deliberately “unintelligent” AI designed to draw out engagements with the player, rather than to shut them down as quickly as possible once detected (as would usually be “realistic” in the situations these games portray).

          [Quick edit: just noticed one of the sibling comments here mentions Invisible Inc, which has also been discussed in greater detail by the author of the post I just linked. I’m also partial to this analysis, which talks about some of the same concepts under the label of the “failure spectrum”.]

          1. 3

            The original Killzone AI was quite good at analyzing the battlespace.

            As I recall, they had an issue where the AI got a bit too good at flushing enemies out of cover using indirect-fire weapons (rockets and grenades):

            The infantry can easily do the same with rifle-launched grenades and rockets, but that behavior was too challenging for the player and therefore disabled in the AI’s configuration.

            1. 2

              Exception to that good writeup being MGS 2 or 3 when enemies are alerted but you’re brinb stealthy. They do bring backup. They’ve occasionally put pressure on me if I landed a spot with little cover or escape opportunities.

              1. 1

                I can’t find the link, but I remember watching a GDC talk about ‘smart’ AI, and this was one of the main issues that the presenter mentioned. You can spend hours designing and implementing complex and intelligent AI, but if that means that the player gets killed quickly then the game will seem unfair.

                At the end of the day games are designed to be fun, and designing with that in mind is what will make a game memorable.

                1. 1

                  Speaking of not fun, I remember reading an article on Gamasutra 10-15 years ago talking about a AI in a stealth game (maybe Splinter Cell?). In an early build, if a military guard spotted the player and wasn’t spotted themselves, they’d take the correct action: silently shoulder their rifle and plug them in the back.

                  Agreed. Bots tend to behave predictably and stupidly so that one of the more fun and frustrating things to do is play with actual humans online. More when on a team match but sometimes in a pub game you get surprising use of cover and clever tactics. If you’re not playing enough to fully explore and memorize the maps you’re done. The Call of Duty franchise has realized that the stealth and snipe aspect annoys casual players so they’ve nerfed the long- and medium-range weapons except in hardcore mode, designed maps with short lanes and limited sight lines, bumped up health and healing rate, and fiddled with the mechanics of movement. It makes for a frenetic game that you can pick up and put down but takes away a lot of the reward.

                2. 4

                  There’s a paper on the AI here. It’s a really good read.

                  1. 1

                    Operation Flashpoint (ArmA predecessor) series also has a great AI, although I only played the first game.

                    1. 1

                      Anyone know any good programming games where you can write AI to play online games with other AI? Would be fun to write an AI for a shooter game.