🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Combat and Goals

Published February 12, 2011
Advertisement
They're persistent little buggers now. I think I liked them better when all they did was wander around bashing into trees.
screen.jpg
screen3.jpg

Finally buckled down to start writing the "official" monster controller yesterday. Stripped the old random walk controller out and started experimenting with a goal-based controller. I remembered doing something like it in my old Golem project several years ago, so to gather some ideas I took a quick dive into Golem's source. I survived, but it was a close one. Hooo wheee, was that old project a tangle of poorly written spaghetti.

So anyway, a monster controller is responsible for making decisions and passing off commands to the Combatant component for execution. The decisions it makes are relatively high-level: use this item on that enemy, use this skill on itself, etc... It'll set goals for itself, then a set of goal update routines will attempt to execute the goals. If the goal is to, say, use a Wand attack on the enemy, but the monster isn't close enough yet, then it will move until it is in range.

I set up a number of basic goal types: use item on target, use item on self, use item on location, walk to target, walk to location, etc... Decisions are made in a think() function that evaluates the environment, the proximity of enemies, current frame of mind (angry, terrified, hungry, etc...) and tries to come up with a set of goals to match its needs. I am currently taking notes for a threat-level component that will independently attempt to assess the level of threat any given nearby enemy presents, and pass off suggestions for target selection via messages.

If I can get the time today, I'd like to set up a basic encounter that presents a good range of the possible behaviors and provides a comprehensive test case for all the goals. Something a little more complex than the current singleminded destructiveness that brings goblins and reavers from all the way across the map in order to blast me with generic red dots and smoke clouds of doom.


EDIT: While tweaking the global cooldown and cast time systems, I took the time to do a quick (stupid) goblin cast animation, plus I added a cast bar and an on-bar global cooldown countdown. This first shot shows me in the process of using the dreaded Lethal Stack of Wood (it's very lethal) to perform a powerful AoE attack, and the second shot shows just after it goes off. No visual for the Lethal Stack of Wood AoE, since it's just a quick test. All it does is, after a 2.5 second cast-time, delivers a stunning amount of damage (10 - 20) to anything in a 4 unit radius.

screen1.jpg

screen2.jpg


The whole interface is still pretty crudely hacked together. One of these days, I'm going to need to do an interface cleanup and "officialize" push. But that can wait for a polish stage, I think.
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement