Ask a Game Dev 2022-09-22 19:01:57

I could probably write an entire book about the sorts of issues when implementing and designing a party-based game like Dragon Age and not even cover them all. It’s sort of a perfect storm of player expectations versus difficult implementations, because it shows just how hard it is to make AI actually behave in a believable fashion. Since nobody really has time for that (least of all me), I’ll try to just talk a little about some of the issues that stem from just the pathfinding.

image

Let’s just examine some of the issues that stem from pathfinding. When you have a single follower that needs to do pathfinding, you have a number of general issues - setting aside the rather complicated process of actually selecting where to go, you need to figure out how to get there. In a perfect situation, that requires solving navigational challenges like circumventing world geometry and obstacles. Will it traverse things that the player can traverse like jumpable gaps? If not, the player will potentially be able to cause the AI to misbehave by jumping back and forth over an obstacle, and watching the AI run back and forth around it to catch up. This could end up very bad if the AI is a boss type and the player is kiting it.

image

Coming up with a “perfect” algorithm to select the best path isn’t always what you want either. What if an enemy drops something like a burning patch of oil on the ground? The terrain is clearly traversible, but an intelligent person would want to avoid it. But then you don’t always want to avoid them either - a real person wouldn’t necessarily just completely bounce off of any environmental hazards, and it would become incredibly frustrating if the enemy AI also behaved the same way and avoided any and all environmental space control abilities that the player places. It severely weakens the effectiveness of those abilities when the AI is almost never affected by them. But players are also often frustrated when their AI allies stand in such hazards and continue to take damage.

image

Sometimes the player would want to take the fire damage if it was advantageous to do so as well - suppose you needed to get into range to heal an ally, or use that last special attack to finish off a powerful foe, then vacating the danger. In such a case, you want these environmental hazards to work sometimes, but how often is enough? How would characters decide whether it was “worth it” to stand in the fire? What if the player disagrees with the AI assessment? How would the player direct how willing the AI is to brave the environmental hazards? Would it be acceptable to stand in fire, but not an ice mine or a poison cloud? And then what happens if the hazard only exists sometimes? Imagine a statue that spits out a cloud of fire that turns itself on and off every few seconds, providing enough time to get through. Would it affect the navigation graph each time it turned on and off? How often would you recalculate the path to take?

image

Keep in mind, we’re only talking about just one follower here. When you add a second, things get even more complicated. Let’s suppose your pathfinding algorithm decides that there’s one optimal path to get from point A to point B. If you have two followers that both want to get to point B, the algorithm will most likely say to take the same path. So instead of two “intelligent” people moving in an organic way, you’ll end up with a train of AI in a bizarre conga line to get to the target location. Additional followers just add to the length of the conga line until you get a weird looking caterpillar of characters all moving in a line. Solving this particular issue isn’t always cut and dry either, especially when you have to take the previous issues into account as well. 

image

Adding additional followers also adds to the content complexity at a geometric rate. If you have one follower from a group of N, you have N total options. But if you have two followers, you have N * (N-1) possible combinations. Three pushes this to N * (N-1) * (N-2), four pushes this to N * (N-1) * (N-2) * (N-3) and so forth. What happens if you need somebody to make a comment about something? Since the player can have up to some constant number of party members, you cannot guarantee that any given party member will be there, aside from (possibly) the protagonist. That means every single character has to have a response or comment for specific triggers, in case they are the only one present. You need to have them interact with each other, or it takes away from their believability as characters - the party banter in Dragon Age is a wonderful example of this. But it’s also extremely complex, because there’s an awful lot of it.

image

This isn’t even taking into account resource limitations, like needing to load each companion’s entire asset suite and how much of the budget is left for enemies and ambient NPCs, which will affect level design. We’ve also completely ignored the actual decisions the AI needs to make in order to decide where to go, and not just how to get there. Each character should also exhibit and build his or her own personality through in-game actions and behavior, not just what he or she has to say. As you can see, there’s quite a rabbit hole when it comes to creating a coherent system of companions for a game like Dragon Age. A real companion system has to be one of those core, fundamental game features that the entire game is planned and built around like stealth. You can’t realistically make a good companion/party system without committing a huge amount of resources to it. 

~~~~~~~~~~~

Vote for this week’s topics!

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *