Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

How important is pathfinding in an RPG?

Well...?

  • Pointless waste of resources

    Votes: 0 0.0%
  • Nice to have but not required

    Votes: 0 0.0%
  • No RPG is complete without proper pathfinding

    Votes: 1 100.0%

  • Total voters
    1

Lemunde

Scholar
Joined
Jan 16, 2006
Messages
322
I've been rolling this around in my mind. Having good pathfinding in a game is great but it comes at a cost. Besides the headaches of implementing and debugging something so complex, it really makes a big hit on the CPU. It can literally mean the difference between 10 AIs running at the same time and 10,000.

I started thinking about all the RPGs that didn't really have very good pathfinding. Neverwinter Nights had some pretty basic pathfinding but it wasn't reliable. NPCs were constantly getting stuck on walls. Morrowind didn't seem to have any pathfinding at all. I'd often use this to my advantage by hopping onto a rock and tossing shurikens at everything. And you'll be hard pressed to find a jRPG that uses any sort of pathfinding. Still you don't see these problems holding them back from selling well.

I figure it all depends on what you want a game to do. If you have a system where NPCs are running on schedules and doing their own thing pathfinding is a must. Even so, such a system will cost you dearly in system resources as you will need to process each and every NPC in the game at the same time, at least up to a certain level.

So what are your thoughts on this?
 

DraQ

Arcane
Joined
Oct 24, 2007
Messages
32,828
Location
Chrząszczyżewoszyce, powiat Łękołody
Lemunde said:
Morrowind didn't seem to have any pathfinding at all. I'd often use this to my advantage by hopping onto a rock and tossing shurikens at everything.
That's not the evidence for lack of pathfinding, merely the lack of jumping ability.

Morrowind had quite a lot of pathfinding, the problem with it was it's unreliability which made NPCs constantly get stuck on obstacles they thought they could cross, and confused with routes they thought they couldn't use.

And you'll be hard pressed to find a jRPG that uses any sort of pathfinding. Still you don't see these problems holding them back from selling well.
facepalm.jpg
dancingandhaira.gif
failureofthefreemarket.meme
If you have a system where NPCs are running on schedules and doing their own thing pathfinding is a must.
No, it isn't. When it comes to schedules, putting NPCs on predefined paths, or at least grids of waypoints can make the pathfinding unnecessary or greatly simplify it.

What does need pathfinding is combat and all the other kinds of unpredictable situations AI may face.

If the game doesn't have any 'physical' representation of the gameworld (old Wizardries), such representation is irrelevant to the gameplay (JPGs), or the game lacks mobile, actively seeking hazards (um, Portal?), then the pathfinding is indeed a waste of resources.
Otherwise, the pathfinding is absolutely crucial if the horribly broken and retarded gameplay is to be avoided. Whether the 'physical' representation we talk about is 2D or 3D is largely irrelevant.
 

shihonage

Subscribe to my OnlyFans
Patron
Joined
Jan 10, 2008
Messages
7,163
Location
location, location
Bubbles In Memoria
When it comes to RPG, convincing appearance of good pathfinding is more than an adequate substitute for good pathfinding.

There's plenty of CPU time to waste elsewhere.
 

JarlFrank

I like Thief THIS much
Patron
Joined
Jan 4, 2007
Messages
33,206
Location
KA.DINGIR.RA.KI
Steve gets a Kidney but I don't even get a tag.
In a party based isometric RPG like the Infinity Engine games, at least basic pathfinding is a must. Having to lead your characters by the hand so they don't get stuck on obstacles is not fun. In combat, when your enemy gets stuck behind an obstacle it might sometimes be good because if he didn't get stuck, you'd be dead, but it's not really fun either and takes away the challenge from the game. Either design the dungeons in a way that they don't get stuck, or make sure they don't get stuck by including proper pathfinding.
 

sheek

Arbiter
Joined
Feb 17, 2006
Messages
8,659
Location
Cydonia
Doesn't the infinity engine let you choose how much computational power to give pathfinding in game options? Not that it helps much, because the designers will still aim for the consumer with the computer with the highest performance, and neglect gameplay.
 

obediah

Erudite
Joined
Jan 31, 2005
Messages
5,051
Just enough not to be frustrating. Which depends entirely on the game. If you love making me lead NPC's through massive labyrinths, then it better be pretty good. If you like area triggered traps, then you had better damn well make the pathfinding take into account whether or not the trap is detected.

If you're making a single player RPG with wasd controls, and no escort quests, then skimp away. Monsters getting stuck may be silly, but they don't make you scream at the computer.
 

Zomg

Arbiter
Joined
Oct 21, 2005
Messages
6,984
There's a lot of problems with pathfinding that aren't really about brute force problems. Like for example it's a big pain when the path a character has selected gets cut off, so he derps all the way to the visibly now-closed door (or whatever), takes a moment to recalculate a new path and then hikes forty seconds out of his way to take a new circuitous path and drags fifty monster spawns along on his way (btw designers if I think in terms of MMO monster spawns while playing your game, you're shit). I don't know if it's even possible to create a situation where the player isn't much better off, tedium aside, from babysitting pathing completely - we're just better at it and able to assimilate more holistic information into even our minor, lame decisions. All designers can really do is mitigate it by limitations and tricks.
 

shihonage

Subscribe to my OnlyFans
Patron
Joined
Jan 10, 2008
Messages
7,163
Location
location, location
Bubbles In Memoria
Diablo 2 had a hilarious solution to minion pathfinding - it simply didn't give a shit - it warped them to your location all the time.

My own solution lies among having level architecture be navigable via "basic" pathfinding. Still working on that.
 

denizsi

Arcane
Joined
Nov 24, 2005
Messages
9,927
Location
bosphorus
There is no such thing as "no pathfinding". Even in a bare minimum grid based system, you set priorities and rules for there will be multiple choices of destination for NPCs at any given time. And even in a game where NPCs wander about completely randomly and aimlessly, you'll do something similar so that they won't walk into structures.

Gothic had some crazy pathfinding. Bipedals climb up or down in pursuit of you, and sometimes even help each other climb. I have a specifically crazy moment of experience, where I was shooting down at small goblins by a cave from above a hill higher than even I could climb had I fallen down. A few of them ran away, the others gathered right by the rock wall. A few minutes later, some of them stood still down there, started stacking up and several of them climbed! I panicked, started running away but was trapped as the few goblins which I thought simply ran away, had shown a brilliant amount of pathfinding to reach me by going around the hill that housed the cave, climbed all the way up the mountain from the river and found me. A few of them from behind, several more through climbing, it was a gang rape.
 
Joined
May 17, 2009
Messages
41
For fucks sake, pointless waste of resource? Its a goddamn basic gaming need, not a fucking rpg exclusive feature, like c&c for example ;P
 

Andyman Messiah

Mr. Ed-ucated
Joined
Jan 27, 2004
Messages
9,933
Location
Narnia
Pathfinding is vital in rpgs where you have to babysit your party members. All BioWare-games come to mind. YOU HAVE TO GATHER YOUR PARTY BEFORE YOU CAN KILL YOURSELF WITH YOUR DAD'S HUNTING RIFLE!

edit: But like Rev. Flashback says, it's not a rpg genre exclusive feature dance dance revolution thingamajig. If the game at several points have you, the player, escort npcs from A to B, then good pathfinding is vital. Ever play Dead Rising? Holy shit, those damn survivors don't make it easy on poor Frank.
 

NiM82

Prophet
Joined
Jun 21, 2007
Messages
1,358
Location
Kolechia
If there's no/poor pathfinding the enemy AI is obviously going to be terrible. It's a must in my eyes.
 

Rosh

Erudite
Joined
Oct 22, 2002
Messages
1,775
There's really few games in the genre, and few genres, that could exist without pathfinding, and without good pathfinding/AI, it becomes a crippling wound to both the development and gameplay of the title.

Here's the thing about pathfinding and AI in general.

RT comparatively and completely sucks for excellent pathfinding, AI, etc. Correction, it sucks when you have many actors on the screen at once, and thus either the capabilities of each calculation for individuals must be cut down or the actors must be limited in number on a constant basis (see the Radiant AI issues). FP is also often used as the control scheme doesn't require that the player characters to have pathfinding routines as in click'n'move controls.

In free roam, out of combat, NPC pathfinding can be handled by a movement script, to follow along predetermined paths. They usually tie in well with schedule engines. The only real non-static movement would be by the player characters and anything special/initiated by the players. The actors on the schedule routines can be easily switched over to a full AI when combat is initiated (even if it's just to flee, depending upon the actor flags set), without any noticeable stutter in gameplay performance. A lot of RT engine stutter is from switching an NPC or several between routines. Not all engines can smoothly switch over heuristics from one routine to another, and so the routine starting up eats into CPU cycles to gather the bit of data it requires to function. When you talk to a roaming character in a movement script or otherwise act with them, you will often see a skip in action unless your computer's specs can outweigh the draw of resources by the starting routine.

Tag-along pathfinding, as typically used in escort quests, is a relative pain to do well because it constantly changes and needs to find a movement resolution for the follower on a constant basis. Most times it's a simple line, and so the escort is caught behind a simple object. Other times, devs cheap out and make the escort go along a scripted path.

Where it becomes a big issue is during combat, which is also where errors cause the most problems. I've had the Inbred Engine cranked to max and still had characters who couldn't find their way to the other side of the map; they instead just dryhumped the side of a simple, squareish building. Without handholding a mage, I've had them run up to a pack of enemies and point blank a fireball spell when I had them target the critter. That leads me to believe the range finding was borked somewhere, or got lost in the mess of other routines. Dropped heuristics from database overflow is a sadly common thing for most RT games using a lot of actors at the same time, and it's not a good thing.

In TB, writing AI/pathfinding is INSANELY easy and offers far more capability. As the defining characteristic of TB is that one character moves/acts at a time, a lot more CPU power can be given to calculation and heuristic depth for that one instead of 10 or so at the same time. Yes, that means effectively you could use ten times the power - OR MORE - on one character in TB than you could in RT. RT is hindered by another sad thing that tag-along pathfinding suffers from - as each actor moves, EVERYONE ELSE has to constantly re-adjust their heuristics to follow and react accordingly.

TB adds more capability for challenge, as they can write real AI routines instead of using "shortcuts" or stacking stats against the player (leading to comments like "This fucking AI is CHEATING!"), and this is likely why most games of late tend to have really easy enemies or pull shit tricks like many racing games.

Oh, wait, TB gets even BETTER! Since it calculates each in turn, and in greater depth, it can keep a rolling set of heuristics for subsequent actors/turns. It also allows for a much more complex integration of teams/allies. I'll use an example from X-Com. When one alien would spot one of your troops, through telepathy the others would also know. This can be expanded into mechanics like a policeman actually using time units/turns calling for back-up and to further report on a suspect, as the remote actors take reports from those in the immediate area of combat. This is done in several rudimentary forms in RT games, but it generally doesn't go much deeper than the police pursuits in Grand Theft Auto, where police magically appear out of thin air in whichever direction you are heading.
 

DraQ

Arcane
Joined
Oct 24, 2007
Messages
32,828
Location
Chrząszczyżewoszyce, powiat Łękołody
Rosh said:
Correction, it sucks when you have many actors on the screen at once, and thus either the capabilities of each calculation for individuals must be cut down or the actors must be limited in number on a constant basis (see the Radiant AI issues).
Unless your coding is smart enough to handle pathfinding centrally, or on group basis rather than individually for each pawn.
 

Rosh

Erudite
Joined
Oct 22, 2002
Messages
1,775
DraQ said:
Rosh said:
Correction, it sucks when you have many actors on the screen at once, and thus either the capabilities of each calculation for individuals must be cut down or the actors must be limited in number on a constant basis (see the Radiant AI issues).
Unless your coding is smart enough to handle pathfinding centrally, or on group basis rather than individually for each pawn.

You need to have heuristics and resolutions for each of the actors in their own locations. You can't simply batch together an entire town unless the routines are going to be simplified into schedule routines (as I mentioned would work for during out of combat roam, and then you're just going from Point A to Point B or some variation of that with some slight detour capability), but thinking you can group actors together in a combat engine and use the same single set of heuristics for every character is kind of naive. They are in different places, have different ranges to enemies/cover/etc., and have different items/abilities. That means they would each individually come out with a different set of heuristics even if the pathfinding routines were the same for each actor. You could share some of the heuristics, but that would also assume everything in the source data of those heuristics remained static. Again, not good for RT, because actors all move at the same time, and so it has to be recalculated on a constant basis.
 

Khor1255

Arcane
Joined
Sep 8, 2008
Messages
59,115
Yeah, good pathfinding = ai getting where it needs to be which means not only more challenging enemy encounters but also less chance of an npc getting stuck somewhere instead of doing their routine.

Good pathfinding is a must.
 

Murk

Arcane
Joined
Jan 17, 2008
Messages
13,459
God I've been talking about ToEE a lot lately, but I guess I'll just keep at it.

The game features both great and atrocious path finding - when simply moving in the game world a lot of your characters won't even budge if there's any turns or bends in the movement path that goes outside their visible range - perhaps this has to do with some kind of ingrained fog of war, but it comes off as your characters being idiots and only being able to move every 30 game-feet at a time reliably.

Incidentally, it also features some great use of enemy pathfinding, like the bugbear room in the moathouse - in the first room there are maybe 4 bug bears, and 2 behind individual doors.

During the fight, one of them in the main room will run into the back room and get the other 5 bug bears to join the fight, sometimes one will open one of the doors, and in other cases they won't do either.

I remember the one running into the larger back room basically always going off but I can't tell if its because I would use very similar tactics or if that's just a common sense reaction in the enemy - but the same had happened to be in the top two levels of the Temple itself, where small groups of enemies would get larger ones to join the fight.

Bad examples would be using 5 foot step to avoid a full attack. You're fighting a troll - you full attack it, five foot step away - and the troll uses its move action to come to you and does a single attack instead of 5 foot stepping to you and using a full attack. You see how this would turn a worth while melee opponent into a pussified version of itself.

Other problem I could see in the game, and this may be just due to its general bugginess and not pathfinding, is when enemies would be felled they would show up as closer than they are - thus when you tried to coup de grace a troll, you'd get a "too far away/not enough time" message because the troll was actually 5 feet that way.

IE games were absolutely horrible in path finding, and in AI, as has NWN 2 been. I'd always leave AI off and just micro manage my party as I could never trust the AI to do anything remotely intelligent. The path finding, even with ass loads of CPU cycles devoted to it, would always resort in characters taking the long route (usually a VERY long route) if something simple was blocking their path, like a closed door that they could open.
 

SCO

Arcane
In My Safe Space
Joined
Feb 3, 2009
Messages
16,320
Shadorwun: Hong Kong
That's because the problem is algorithmic not a question of processor cycles.
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom