Advertisement

AI in MMORPGs battle systems

Started by August 22, 2006 01:37 AM
9 comments, last by Timkin 18 years, 3 months ago
Hello everybody! First, I am not a programmer (I just know the basics of C++) nor a wannabe MMORPG developer :) I am putting together a paper about MMORPGs. It is mostly focused on the network architecture (I have started a thread about it in networking), but I would love to complete it with more information about other "modules" that make a MMORPG. I have tried to research AI in MMORPGs, but for some reason I can't find precise answers (or probably answers clean enough for an unexperienced developer). I have managed to understand a few things 1) AI in MMORPGs is often more simplistic than in other games, also because it is handled server side and too complex routines would consume too many resources. 2) AI of NPCs in a MMORPG using a real time battle system is usually made of the following components - Server-side: Pathfinding. This is used only when really needed, for example when monster detects the player for the first time; but, for example, if the monster is just following a running player, it follows the path walked by the player, with minor random adjustments to make it look more "natural" (but I ask to myself: if a packet is lost, won't pathfinding be still needed to follow the player smoothly?). - Server-side: a NPC must be able to interpret and understand its surroundings. Field of view/hearing, linking with other fighting NPCs if some requirements are met (same race, aggressivity, etc.) - Client-side: Pathfinding can be part of client-prediction I couldn't find anything about the battle system; in other words, how does a monster "choose" which spells must be casted and which kind of hits must be dealt to the user? From many threads, it seems like the behavior of monsters in MMORPGs is often pre-scripted, with occasional forks, here and there (if(hp < 70% hp) use special skill). Can you add something to this? Is client prediction used also during battles? Are there some resources dealing with MMORPGs and AI I can read (considering I am not a programmer)? Thanks a lot!
Quote: Original post by MishaBear
Hello everybody!

First, I am not a programmer (I just know the basics of C++) nor a wannabe MMORPG developer :) I am putting together a paper about MMORPGs. It is mostly focused on the network architecture (I have started a thread about it in networking), but I would love to complete it with more information about other "modules" that make a MMORPG.

I have tried to research AI in MMORPGs, but for some reason I can't find precise answers (or probably answers clean enough for an unexperienced developer). I have managed to understand a few things

1) AI in MMORPGs is often more simplistic than in other games, also because it is handled server side and too complex routines would consume too many resources.
2) AI of NPCs in a MMORPG using a real time battle system is usually made of the following components
- Server-side: Pathfinding. This is used only when really needed, for example when monster detects the player for the first time; but, for example, if the monster is just following a running player, it follows the path walked by the player, with minor random adjustments to make it look more "natural" (but I ask to myself: if a packet is lost, won't pathfinding be still needed to follow the player smoothly?).
- Server-side: a NPC must be able to interpret and understand its surroundings. Field of view/hearing, linking with other fighting NPCs if some requirements are met (same race, aggressivity, etc.)
- Client-side: Pathfinding can be part of client-prediction

I couldn't find anything about the battle system; in other words, how does a monster "choose" which spells must be casted and which kind of hits must be dealt to the user? From many threads, it seems like the behavior of monsters in MMORPGs is often pre-scripted, with occasional forks, here and there (if(hp < 70% hp) use special skill). Can you add something to this? Is client prediction used also during battles? Are there some resources dealing with MMORPGs and AI I can read (considering I am not a programmer)?

Thanks a lot!


AI in all MMORPG I've played was horrible.

First, some comments about your points:

1) Its also by design. They want NPC that are very easy to predict, so that balance will be easier.

2) pathfinding: ok
Server-side: yes, but its incredibly simplistic. I wouldnt classify it as surrounding awareness, its barely reaction to some stimuli (player in some agressiveness radius, another NPC "call for help" (which they will always hear from the same distance, regarless of noise/weather, etc).

From what I know, decision (mainly choice of attacks) in MMORPG usually follow the old probabilistic MUD rules: i.g. 95% chance of normal attack, 5% chance of spell casting, regardless of situation. Occasionally, it will be reactive: unleash a certain attack if hit by spells, re-cast some defensive buff each time it runs out, etc.

I dont know any paper about MMORPG's ai specifically. Probably because its so dumb ;). You can look at some MUDs source-code and documentation: most MMORPG still follow their tradition, almost to the letter.
Advertisement
Actually, Guild War's Henchmen AI is very good for what it is. The henchmen - computer controlled party members - can do everything as well (or even better) than normal players.

I do not know how MMORPG's handle the AI, but I just wanted to clarify that not ALL MMORPG AI is supid.
Quote: Original post by Anonymous Poster
Actually, Guild War's Henchmen AI is very good for what it is. The henchmen - computer controlled party members - can do everything as well (or even better) than normal players.

I do not know how MMORPG's handle the AI, but I just wanted to clarify that not ALL MMORPG AI is supid.


I've played guildwars (Profecies/Faction). The henchmen are efficient, but still pretty dumb. They use a very small set of skills using very simple and rigid rules. Usefull for completing a group, but not believable nor entertaining like a good single-player RPG NPCs.
There is little AI in most current and past MMOs. By that, I mean there is nothing within the code that creates intelligent behaviour in and of itself; all 'intelligent' behaviour is produced by the designers. All of the systems I can recall hearing/reading about were based on scripting, which means the designers dictate exactly what happens at certain stages of an encounter and exactly what responses the mob will use to certain attacks. Mobs are generally represented by a Finite State Machine, with state transitions occuring based on events in the encounter (typically player actions and mob/player state transitions) and the encounter script.
That's clear, thanks. I also know that some MMORPGs have attempted to do something more, but I was speaking of the MMORPG as a whole. I read, for example, about the attempt of using more advanced AI for animals and NPC in Ultima IX, which was then removed from the game because few players really noticed it (while it costed a lot of resources).

From what I read so far and I have put together for this paper, to a mere student like me it seems like that MMORPGs, while being extremely complex games that require big funds and resources, in particular in the design process, are currently not as technologically advanced as other genres (leaving aside their network architecture). Is this an outrageous assumption?

I have one more doubt that came from reading your answers, this forums, and around the net. Basically, since the core of the game and calculations are executed server side (with exception of local pathfinding routines), the client could theoretically be 2D or 3D, with little to no difference server-side. I mean, in average MMORPGs, are there subtantial differences in AI routines between a fully 2D world and a 3D world?

Thanks everybody for helping me!
Advertisement
Quote: Original post by MishaBear
From what I read so far and I have put together for this paper, to a mere student like me it seems like that MMORPGs, while being extremely complex games that require big funds and resources, in particular in the design process, are currently not as technologically advanced as other genres (leaving aside their network architecture). Is this an outrageous assumption?


No, it's just an obvious one when you think about it. The majority of the expense goes into content creation and efficient architecture, and the majority of the CPU time is consumed with message passing between objects, keeping the game state persistent, and sending data across the network. There are typically no CPU cycles for more than the most trivial AI.
Quote: Original post by MishaBear
I have one more doubt that came from reading your answers, this forums, and around the net. Basically, since the core of the game and calculations are executed server side (with exception of local pathfinding routines), the client could theoretically be 2D or 3D, with little to no difference server-side. I mean, in average MMORPGs, are there subtantial differences in AI routines between a fully 2D world and a 3D world?


Yes. For example, for AI, ray tracing and field-of-view calculations are very useful to support behavior determination. While its trivial in 2D, it can be significantly more difficult in 3D. Pathfinding is also more of a pain in 3D. These are the most basic examples...
Further to this...

Problems such as pathfinding are typically mapped to a 2D problem space, where efficient algorithms exist. Since most search based algorithms run in exponential time, scaling to 3 dimensions really saps your processor budget. Hence, smart design will usually be applied, rather than throwing more cycles into the solution pot.

So, one can think of the server as describing a very 2D world as far as game agents goes, although this is projected into a 3D domain. The client then displays that domain, so is naturally 3D (usually).
But Timkin, isnt that 2D world representation that the AI agents have one of the reason they seems do dumb? To stay in the pathfinding problem, Im reminded of MMORPG RPG agents completely ignoring that they can jump...

This topic is closed to new replies.

Advertisement