Sign in to follow this  
mordimer

Realistic movement in Diablo like game

Recommended Posts

mordimer    100
Hello Everybody,

I'm a hobbyist programmer creating an engine to diablo like game. I would like to create an AI for my monsters which would make them move in a realistic (or at least semi realistic) way.

It's quite easy to detect player, find the shortest way towards him and make monsters to charge at that direction. In my experience moving everything linearly it's not the best AI behaviour in terms of reality. Are there any well known algorithms / approaches to make the movement more realistic (or even synchronised to make the monsters work together)?

Thank you!

Share this post


Link to post
Share on other sites
Ashaman73    13715
You should take a look at Steering behaviour, which is a common approach to handle movement of one or more characters in a game: [url="http://www.red3d.com/cwr/steer/"]clicky[/url]

Share this post


Link to post
Share on other sites
JTippetts    12970
The problem I've found with trying to implement realistic movement and AI in a Diablo-clone is that nobody notices. They're too busy pounding the buttons that make things die to realize that those six Cannon Fodders they just killed, like, totally worked together and stuff. The outcome of the fight was completely uninfluenced by their working together. Diablo-clones by nature are mow-em-down type games, so it's probably a waste of development time to get too complex with the behavior systems. There seems to me to be an inversely proportional relationship between the number of enemies on-screen and the amount of time the player spends thinking about the behavior of those enemies. To make AI and behavior actually have an influence on the outcome of the fight and make an impression on the player, I think there needs to be a dramatic reduction in monster count, and Diablo-clones are more interested in throwing more and more mobs at the player, not less and less.

Furthermore, the scenario of your typical Diablo-clone doesn't really necessitate complex reasoning. Bear in mind, of course, that when I mean Diablo-clone, I mean [i][b]Diablo-clone[/b][/i]. Hordes of baddies, flashy special effects, gold and loot and items and spells flying all over the place. You know, like Diablo. In such a scenario, the two opposing factions (player and mobs) each have the same goal: kill the other. They do so with resolute intensity, pouring all of their focus into that task. The player collects items and skills and levels for the sole purpose of being more effective at killing the mobs, and the mobs use their special mobly powers of mobbiness to... well... kill the player. Maybe some do it in a sneaker fashion (teleport+shoot, retreat+summon, what have you) but the overriding goal is still the same. In such a scenario, there really doesn't need to be a complex behavioral system driving it. A few randomized behavior trees can give the appearance of intelligence on a passing glance, and that is about all that is necessary.

If the intention is to move beyond this, then by nature you are moving beyond being a Diablo clone. But still, it's not exactly a field requiring complex AI. Have you ever been in a bar fight, or a school-yard scrap, or just a ninja-swords-made-from-PVC-pipe-fight with your cousins? Try to imagine that scenario only bigger. Deadlier. In the vast majority of these cases, there is going to be a straight-line approach made to the most dangerous opponent, followed by perhaps a bit of circling and dancing in the course of what is mainly a frontal assault. The main baddy's friends will circle around, maybe some will be too scared to approach, maybe others will try to jump in, but for the most part these untrained combatants will not cooperate and will, in fact, just bumble around doing their own thing and getting in each other's way. Trained combatants, on the other hand, will cooperate. But so often, this cooperation can simply be simulated in-game with a few clever tricks like evenly spacing the mobs around an opponent to threaten him from all sides, throwing buffs on one another as needed, prioritizing certain abilities based on an analysis of the player's build, etc...

In all of this, the actual mechanical act of moving is the simplest part, and any basic A* shortest-path-finder with some dynamic obstacle handling is probably going to be more than sufficient.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this