• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

The Unit AI

Status
Not open for further replies.
Level 19
Joined
Oct 12, 2007
Messages
1,821
The unit AI is a thing I've been working on for a while, but it's getting pretty neat right now.

Currently every area has a list of things that will keep that area alive. All of those things will start running whenever a player enters the area (to avoid letting units do things when nobody can see it anyway.)

I devided the AI things into subgroups in the map. Not that it matters. It's just the way I handle things and keep it easy to manage. It currently takes nearly no time to add/remove/change something to the AI for units in a specific area.
Here are the subgroups:
- Battlegroups
- Hero AI
- Small Chat Sounds
- Events
- Misc

Battlegroups:
Battlegroups are groups of units that are ordered to walk a certain path and attack enemies. With a nice system I can order units to walk a specific path with lots of (random) variations in it while they will attack enemies when they come across them. Battlegroups always start with a sound. So per example, if a group of footmen starts to move, their captain will call out something like "To Arms!!!".

Hero AI:
There are multiple Hero's in every area. Usually they're questgivers, which means they would have to stay where they are or always return to that spot when they're done with an order. With this I can make sure Hero's will always return to their initial spot while they don't force this too much. They prioritise enemies above standing ground.
I also added various abilities to each hero. Most NPC's also have a healing ability to heal nearby players that need it.

Small Chat Sounds:
When you click on a computer owner unit you will always hear a sound.
If it's an enemy, it's usually a taunting sound. If it's an ally it's usually something friendly.;-)

Events:
Every area has specific events that will be available as soon as a player enters the area. Some events order units/hero's to behave different.

Misc:
Some things don't happen at every area. Per example: A goblin Thief quest giver is hiding somewere (invisible) next to a tree. Whenever enemies approach him he will remain hidden unless they're low health. Whenever an ally approaches he will become visible; allowing the player to talk to him.
Some quest givers also only stand at a specific spot at night. So some quests cannot be done at day or night time.. Think about some undead classes per example. Some of them would highly prefer the night.;-)


I might come with some movies/screenshots about the battlegroup movement soon.
 
Status
Not open for further replies.
Top