1 / 13

Homeworld 2

Nicholas Mezza CIS 488 Winter 2006. Homeworld 2. Homeworld 2 is a 3D Real Time Strategy Game (RTS) The player controls a fleet of spacecraft and must fight it out with up to 5 other players. Overview. There are two major forms of AI in this game:

nicolewest
Download Presentation

Homeworld 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Nicholas Mezza CIS 488 Winter 2006 Homeworld 2

  2. Homeworld 2 is a 3D Real Time Strategy Game (RTS) The player controls a fleet of spacecraft and must fight it out with up to 5 other players. Overview

  3. There are two major forms of AI in this game: Tactical / Unit AI determines how each unit reacts to orders or how they react to other units. Strategic AI determines how a computer player builds their fleet and attacks other players. Forms of AI

  4. This is an excerpt from an interview done with Dan Irish, a Sierra programmer. These are the two main goals the creators had when designing the AI The main goal in designing and implementing an AI for Homeworld2 is to ensure that it offers a challenge, while providing the subtleties that make it play as a human would. I remember playing Homeworld when it first came out (I worked at a different company then) and instantly realizing that the AI formations would always act a certain way and the ships would always fly in perfect formation when coming to attack. The second challenge is the introduction of random errors into the AI's routines, so that it has the ability to scale the difficulty depending upon the skill level of the player. Dan Irish on AI

  5. Homeworld 2 uses SCAR (a proprietary scripting language) and Lua scripting for its decision based AI. The game itself is coded in C++. The game AI is a rule-based system using weighting (priorities). How does it work?

  6. function Logic_military_groupvars() cp_minSquadGroupSize = 4 cp_minSquadGroupValue = 150 if (sg_moreEnemies > 0 and s_selfTotalValue < s_enemyTotalValue*2) then cp_minSquadGroupSize = cp_minSquadGroupSize + 2 cp_minSquadGroupValue = cp_minSquadGroupValue + 75 else -- if we are winning, meaning we have quite a bit more military then the enemy then reduce minsize and value --aitrace("playerthreat:"..playercompare) if (s_militaryStrength > 120) then cp_minSquadGroupSize = 3 cp_minSquadGroupValue = 120 end end end Example – Strategic Ruleset

  7. Data = { -- when approaching the target use this method to split the formation and transition in to the attack style howToBreakFormation = StraightAndScatter, -- Maximum distance to get from the target when breaking away. maxBreakDistance = 4000.0, -- break off the attack run when this distance from the target distanceFromTargetToBreak = 2000.0, safeDistanceFromTargetToDoActions = 2800.0, useTargetUp = 0, -- data for picking the position in space to fly to when we break off the attack run -- how to orient the choice of break point, options are Attacker,Target and TargetAttackPoint coordSysToUse = Target, horizontalMin = 0.6, horizontalMax = 0.9, horizontalFlip = 1, verticalMin = 0.2, verticalMax = 0.6, verticalFlip = 1, Example - Tacticalflyby_Interceptor_vs_CapShip_mod

  8. -- done at the end of every strafing run RandomActions = { { Type = PickNewTarget, Weighting = 1, }, { Type = NoAction, Weighting = 2, }, }, BeingAttackedActions = { }, FiringActions = { { Type = FlightManeuver, Weighting = 99, FlightManeuverName = "RollCCW", }, }, } flyby_Interceptor_vs_CapShip_mod

  9. Original Script Differences: -- Maximum distance to get from the target when breaking away. maxBreakDistance = 1600.0, -- break off the attack run when this distance from the target distanceFromTargetToBreak = 800.0, safeDistanceFromTargetToDoActions = 1200.0, useTargetUp = 0, Example - Tactical 2flyby_Interceptor_vs_Capship

  10. -- It has more, less common, actions upon firing FiringActions = { { Type = NoAction, Weighting = 25, }, { Type = FlightManeuver, Weighting = 3, FlightManeuverName = "RollCW", }, { ... flyby_Interceptor_vs_Capship

  11. Lets see this change in action... Demo

  12. Tactical AI is scalable and works well even with a large number of units. Tactical AI results in fluid, realistic battles. While Strategic AI is relatively simple, it does not require much CPU time. Strengths

  13. Strategic AI essentially just throws waves of units at you. There are rules (modified by game difficulty) as to how many ships should build up before this happens. Strategic AI requires a large number of defined rules for specific things to build or research. No learning Tactical AI cannot switch between multiple tactics per unit type. i.e. It's limited to a single ruleset and can only randomly choose predefined reactions. Weaknesses

More Related