1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  4. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  5. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

The Unit AI

Discussion in 'The Oakwood Forest' started by Sephalo, Aug 20, 2012.

  1. Sephalo


    Oct 12, 2007
    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 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.;-)

    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.

    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.