Editing Halo 3 Engine
From Halopedia, the Halo wiki
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 9: | Line 9: | ||
Individual tasks can "turn themselves on and off"; when a high-priority task is turned on, squad members are reassigned as necessary to ensure its completion. When a task is completed (and turned off), the squad members that were working on it are reassigned to any other tasks that need completion. | Individual tasks can "turn themselves on and off"; when a high-priority task is turned on, squad members are reassigned as necessary to ensure its completion. When a task is completed (and turned off), the squad members that were working on it are reassigned to any other tasks that need completion. | ||
An example | An example<ref name="bnetpub-betterbattle"/> is the task of guarding an indoor environment. This task is broken into sub-tasks (such as guarding a main entrance and guarding a hallway). These sub-tasks are assigned priorities ("The most important thing is to guard the door, but if you can, also guard the hallway"), and each is broken into additional sub-tasks ("Guarding the hallway means guarding the front, the middle and the rear of the hallway."). | ||
In addition to specific task trees, there are also three general stages of battle: advance, retreat, and make a last stand. | In addition to specific task trees, there are also three general stages of battle: advance, retreat, and make a last stand.<ref name="bnetpub-betterbattle"/> | ||
===Behavior trees=== | ===Behavior trees=== | ||
The behaviors of an individual AI-controlled combatant are also represented as tree structures where each [[Wikipedia:Node (computer science)|node]] is a self-describing behavior, such as "throw [[grenade]]" or "[[melee]]". | The behaviors of an individual AI-controlled combatant are also represented as tree structures where each [[Wikipedia:Node (computer science)|node]] is a self-describing behavior, such as "throw [[grenade]]" or "[[melee]]".<ref name="bnetpub-betterbattle"/> The [[Wikipedia:Tree (data structure)#Terminology|root node]] of the tree is simply the beginning of a combatant's decision-making process. That node's children are the general tasks that the combatant is performing ("hide", "fight", etc.). Those nodes' children are specific behaviors. An example<ref name="bnetpub-betterbattle"/> behavior tree can be represented with a multi-level bulleted list: | ||
*Make a decision | *Make a decision | ||
Line 30: | Line 30: | ||
===The specific algorithm=== | ===The specific algorithm=== | ||
The specific algorithm has been described as: | The specific algorithm has been described as:<ref name="bnetpub-betterbattle"/> | ||
#Consider a subtree fragment | #Consider a subtree fragment | ||
#Determine which children [tasks] are active | #Determine which children [tasks] are active | ||
Line 42: | Line 42: | ||
#Iterate to next "priority group" | #Iterate to next "priority group" | ||
In mathematical notation, the squads are expressed | In mathematical notation, the squads are expressed<ref name="bnetpub-betterbattle"/> as a [[Wikipedia:Set|set]] <var>S</var> with <var>n</var> members; the tasks are expressed as a set <var>T</var> with <var>m</var> members. Bungie's goal was to find a mapping <var>F</var>(<var>S</var>)→<var>T</var> -- in other words, Bungie needed a function (<var>F</var>) that would effectively assign squads to tasks. There were two parts to this function: the developers needed to respect all task-capacity constraints and minimize the cost function <var>H</var>(<var>F</var>) -- in other words, they needed to avoid assigning too many squads or personnel to a task, and they needed to make the function (<var>F</var>) as efficient as possible (with <var>H</var> measuring how much it "cost" to use <var>F</var>). The first part of that problem (respecting task-capacity constraints) was referred to as "bin-packing".<ref name="bnetpub-betterbattle"/> | ||
The cost function (<var>H</var>(<var>F</var>)) gave Bungie "a basis for choosing one distribution over another". | The cost function (<var>H</var>(<var>F</var>)) gave Bungie "a basis for choosing one distribution over another".<ref name="bnetpub-betterbattle"/> Basically, not every member of a squad will be performing the same tasks or behaviors in a given situation. Different tasks and behaviors will be distributed amongst the squad's members. Bungie needed a way to choose between two different distributions. The cost function allows the game to weigh different concerns—for example, the squads "don't want to travel far" but do "want to act coordinated" and "get near the player".<ref name="bnetpub-betterbattle"/> The only danger in attempting to minimize <var>H</var>(<var>F</var>) is that "AI can look really stupid with [the] wrong <var>H</var>(<var>F</var>)". | ||
The "greedy approach" to this system, expressed in [[Wikipedia:pseudocode|pseudocode]], is: | The "greedy approach" to this system, expressed in [[Wikipedia:pseudocode|pseudocode]], is:<ref name="bnetpub-betterbattle"/> | ||
while (S is not empty) | while (S is not empty) | ||
find pair (s,t) that give the minimum H(s,t) for all S x T | find pair (s,t) that give the minimum H(s,t) for all S x T | ||
Line 57: | Line 57: | ||
end | end | ||
Refinements have also been made to that system; some are listed below. | Refinements have also been made to that system; some are listed below.<ref name="bnetpub-betterbattle"/> | ||
;Filters | ;Filters | ||
:Particular tasks are only available to specific types of personnel. For example, only [[Jiralhanae|Brutes]] can drive [[Type-26 Ground Support Aircraft|Banshees]], and only [[Kig-yar|Jackals]] can act as [[Sniping|snipers]]. | :Particular tasks are only available to specific types of personnel. For example, only [[Jiralhanae|Brutes]] can drive [[Type-26 Ground Support Aircraft|Banshees]], and only [[Kig-yar|Jackals]] can act as [[Sniping|snipers]]. |