XNA Creators Club Online
Page 1 of 1 (4 items)
Sort Posts: Previous Next

DBP Entry - Hive

Last post 01-28-2008 8:49 AM by Handkor. 3 replies.
  • 01-28-2008 1:22 AM

    DBP Entry - Hive

    It's done and submitted, this is three weeks of work with a major rush at the end.

    Our entry is called Hive and it's a small game to demontrate Hive AI where groups of simple entities can act together and acheive more complicated goals. My implementation uses simple units that communicate by broadcasting messages to each other and those messages flow along the network.

    You do not control any units but instead you decide what to spawn and give them an original destination, the rest is up to them.

    The game supports single and multiplayer and even coop. If i had more time the main menu would have allowed to increase the number of players to more than two as the code actually support it.

    This was quite the final 3 days rush the only down side is not the code is a mess with tons of really bad practices, to save time I stopped commenting and made some call member variables public instead of making an interface or at least a property. I feel dirty.







    Link to project page with download of executable
  • 01-28-2008 2:53 AM In reply to

    Re: DBP Entry - Hive

    This looks quite interesting. Can you talk about the AI routines you are using?
    There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.
    -= Paulo Coelho =-
  • 01-28-2008 5:22 AM In reply to

    Re: DBP Entry - Hive

    Looks good, Congrats.
  • 01-28-2008 8:49 AM In reply to

    Re: DBP Entry - Hive

    For the AI routines for this game I used a hive mind style AI. There is not smart general anywhere thinking for the colony but the colony behavior is dictated but each individual.

    There are three states the units can be in: Harvest, Attack and Defend. Each mode is only a simple goal oriented pattern. For example an attacking unit moves around randomly until an enemy comes in range. It will then chase it and attack it until it's dead.

    The group intelligence come from the way each unit talks with each other. When a harvesting unit finds resources it broadcasts a message telling others where they are. Other harvesters, if close enough or not busy, will head to this location and even attackers might change to harvesting duty if not fighting. Each unit has a mood that can be swayed but messages. These messages can be seen as sprays of particles (red stars for attack, green gears for harvest and blue shields for defense)

    The messages have limited range and it is each units duty to rebroadcast them to allow the messages to propages to the rest of the colony. Factors like distance and repeat count affect the efficiency of the message and may be ignored by other parts of the colony.

     

Page 1 of 1 (4 items) Previous Next