Taking A Group of AI Followers Indoors

Started by
12 comments, last by Thaumaturge 9 years, 5 months ago

What are some good ways to deal with a group of AI followers when moving into confined spaces like corridors or sewers in a game with a 3rd or 1st person perspective? I'm looking for gameplay examples / conventions I might check out or design suggestions. Hopefully it might scale so that the followers could be very large (3 or 4 dozen), and it doesn't have to be realistic.

Some ideas:

1) Pick N - When transitioning into interiors you must select N followers. Everybody else waits outside.

2) Pick X which represent Y - Same as Pick N, but each follower abstractly represents the powers of a group of followers. Everybody outside disappears as if they're riding in the pockets of the Y followers.

3) Blobber - Game mode changes indoors to FPS and followers are abstracted to completely abilities, like an old-school blobber, perhaps even appearing as selectable portraits

4) Level Design - Game only has interior spaces that fit maximum number of followers

5) Claustraphobia - Tragically, all followers suffer from a severe fear of closed spaces, and just can't enter confined areas

6) Fading Followers - Followers fade in and out of areas, like in Destiny Warriors games of old.

7) Teleporting Followers - Same as Pick N, but followers can teleport to player. May require a resource to use.

Issues the design is meant to address would be

  • Followers causing player to get stuck (especially if player needs to turn around in tight spaces)
  • Follower pathing killing CPU resources
  • Needing a specific follower in a specific place (thief needs to pick lock)
  • Followers in combat
  • Followers without ability to navigate path same as player (e.g., player has jet pack, follower doesn't)

I'm sure there's more. Thanks for any thoughts!

--------------------Just waiting for the mothership...
Advertisement

It completely depends on your gameplay requirements.

Typically I'd suggest something like pre-computing chokepoints (measure width + length from entry points all the way through the indoors area), and use that data when entering tight spaces to make them do a single file line (Enter the line by closest follower),

Your issues:

  • Followers causing player to get stuck (especially if player needs to turn around in tight spaces)

Allow the player to walk through their followers, or always leave enough width to fit the follower + player. So if the follower is 32 units wide, and the player is 32 units wide, the follower will hug the wall and only follow if it's 65 units wide or larger.

  • Follower pathing killing CPU resources

Followers only need to calculate movement to the follower (or player) directly in front of them when in this situation.

  • Needing a specific follower in a specific place (thief needs to pick lock)

Store the list of followers in the line. If the front member reaches something they can't do, remove clipping on the closest follower who can do that command, and have him move to the front/perform the action/take the front space

  • Followers in combat

Isn't the intention of narrow spaces to limit the effectiveness of larger armies? This is probably fine as is. Especially if you have the followers follow the player inside to a (presumably?) larger space. As the party trickles out, they should resume normal AI and engage just fine.

  • Followers without ability to navigate path same as player (e.g., player has jet pack, follower doesn't)

Then they lose that follower, unless you teleport them. This isn't really relevant to the initial question though.

Insufficient information :)

- Is it turn based or realtime?

- Free move or grids?

- Does the player control them manually or AI is doing it?

- Can characters pass through each other?

- Can characters occupy the same space?

- Can characters occupy the same space temporarily (like they can pass through each other but can't end the turn at the same space)?

- Can characters "swap" places (a powerful trick, used in some roguelikes IIRC)?

(note: in Bionic Dunes they simply abstracted all characters into one object on the map that moves together - yet you can select which one is active and only that one is damaged by enemy fire - a completely twisted mechanic, yet it seems to work :D)

Stellar Monarch (4X, turn based, released): GDN forum topic - Twitter - Facebook - YouTube

I can't think of good examples of games that have followers ranging in the dozens. Mount and Blade maybe? Some starcraft missions? Though they let you control the mob and do the work. The Diablo games? They do a lot of teleporting when players play a character than can have a large NPC mob. (And they might range to a dozen or so at the high end)

If the party including the character is supposed to have a tank/dps split, unless the player is confined to one of these roles the player needs to be able to set whether one NPC should behave like a tank. Traps are also an issue - in many games traps would be pointlessly easy if NPCs could see them, but if a tank NPC can't see them they're just going to walk into them all which is also pointless.

I want to help design a "sandpark" MMO. Optional interactive story with quests and deeply characterized NPCs, plus sandbox elements like player-craftable housing and lots of other crafting. If you are starting a design of this type, please PM me. I also love pet-breeding games.

I'm with @conq on this.

Followers causing player to get stuck (especially if player needs to turn around in tight spaces)

Don't have Player -> NPC collisions.

Follower pathing killing CPU resources

Don't have NPC -> Player, NPC -> NPC, or NPC -> Enemy collisions.

By taking dynamically moving objects out of the picture, you're only pathfinding against static environments (pre-baked nav meshes, also!), and it only needs to be called once every few seconds, or even (best case) only once until the character reaches his destination.

If your party is staying together, a single "path" can be calculated for the entire party (one call of your pathfinding algorithm), or for smaller sub-parties of five or so followers, and every member of the party follows the same path but has a natural desired "offset" to spread out everyone, and only pushes closer to the path (possibly walking through other NPCs) when going through doorways and narrow hallways and the like.

Needing a specific follower in a specific place (thief needs to pick lock)

Carry your own lockpicks, and stop trusting thieves to watch your back.

(just kidding)

Followers without ability to navigate path same as player (e.g., player has jet pack, follower doesn't)

All followers without jetpacks become grouped into one sub-party, and get their own pathfinding call.

This is perhaps a bit over the top, but there's a nice talk on how Naughty Dog made Ellie as non-annoying as possible in The Last of Us:

http://www.gamasutra.com/view/news/217215/Video_Ellies_buddy_AI_in_The_Last_Of_Us.php

Dealing with large numbers of followers... it's a tough problem unless you disable collisions or make the collision volumes tiny. Perhaps in confined spaces have a minimum follow distance. If the player goes too far inside the minimum follow distance, the whole column of followers back up. I think not breaking stealth is quite important, maybe they try to stay in cover if you're sneaking, and the enemies ignore them unless they do anything too blatant.

Thanks for the replies!


Allow the player to walk through their followers, or always leave enough width to fit the follower + player.

I think allowing walk through is going to produce some pretty hideous visual artifacts (characters faces merging, gear like guns sticking through chests, possible z-fighting as character polys overlap). Width requires uniformly sized characters, which isn't a limit I exactly want to take on unless there's no other good choice.


Then they lose that follower, unless you teleport them. This isn't really relevant to the initial question though.

I think maybe you're thinking my consideration is more just pathing management. But I'm looking at the design as a whole and altering how it works to try and fit the problems. If you think of a follower as a resource that you've invested time developing, I'm not sure it's really a good decision to tell players that they suddenly can't use it. Teleporting, maybe at a resource cost, might work though.

--------------------Just waiting for the mothership...


Is it turn based or realtime?
- Free move or grids?
- Does the player control them manually or AI is doing it?
- Can characters pass through each other?
- Can characters occupy the same space?
- Can characters occupy the same space temporarily (like they can pass through each other but can't end the turn at the same space)?
- Can characters "swap" places (a powerful trick, used in some roguelikes IIRC)?

Good questions! Likely real-time, as I'm leaning toward FPS controls. AI is meant to have behavioral settings like aggressiveness and the ability to select them, select an item or ability, and select a target. AI can be grouped under a leader so that the leader acts like a grouping key in an RTS.

As noted above, I think it will really be bad if players occupy the same space. I remember an Aliens console game that did this and how weird it looked to see a half dozen colonial marines all merge and demerge from the same spot. That was using 3d with an isometric camera, so I think FPS would look even worse.

As for swapping, that might work. Two party animations are usually very finicky, though, so I'd have to test it out.

--------------------Just waiting for the mothership...


I can't think of good examples of games that have followers ranging in the dozens. Mount and Blade maybe? Some starcraft missions? Though they let you control the mob and do the work. The Diablo games? They do a lot of teleporting when players play a character than can have a large NPC mob. (And they might range to a dozen or so at the high end)

Yeah I kept thinking of Mount & Blade posting this and how it works if you've got a large, open area. For indoors teleporting, especially if I confined the group, might be the way to go, but it's not my favorite solution.


If the party including the character is supposed to have a tank/dps split, unless the player is confined to one of these roles the player needs to be able to set whether one NPC should behave like a tank. Traps are also an issue - in many games traps would be pointlessly easy if NPCs could see them, but if a tank NPC can't see them they're just going to walk into them all which is also pointless.

Good point on traps! In fact thinking about it, it seems like every instance of some sort of challenge test, like sneaking past something, making a jump or passing a trap, is going to be an issue for followers when they fail the challenge. If you have a group of two dozen followers, for instance, trying to bypass a sentry, as a player you're going to feel helpless if one character (like, say, the last in a long line) trips the alarm.

Maybe that's okay, though. Maybe it forces you to break up the followers, tell most to hang back while you go forward with more skilled groups. This can also answer your point about roles, too. Roles likely come from follower skills and gear, so I'm imagining positioning say a tank to guard a corridor or cover you while you move the group forward.

Meh, realizing having them all with you is a real can of worms. Can a follower take point? How do you tell them how far to go forward if they can. It would almost demand a dual interface, like a isometric game mixed with FPS. *claw eyes*

--------------------Just waiting for the mothership...

This topic is closed to new replies.

Advertisement