Design and Development of America’s Army 3

From the original Xaede archive. This is historical writing, preserved in a new reading edition. Technical advice, tools and project status reflect the time of publication.

March, 2009

Now that the Unreal Engine 3 game title America’s Army 3 (AA3) is nearly ready for release, it seems like a good time to talk about some of what my team has done to improve on what we did in America’s Army 2 (AA2).  I’ll cover several subsystems that Pragmatic Solutions has provided and how they are designed to improve the gameplay experience.

First I’d like to give some background on what we did for AA2 and how it impacted the development of AA3 technology.

When we began work on AA2, the game had already been released.  Its only custom component was the authentication system, which we were tasked to replace.  If that went well, we’d start replacing some of the game’s off-the-shelf components with custom designed solutions.  So our first requirement was to provide a new authentication service that would support the existing communication protocol, and which could be dropped in to seamlessly replace the existing system.

At that time AA2, which was built on the Unreal 2 game engine, ran on Windows, Linux, and Mac OS X, so we needed an application framework that would run transparently on all three operating systems.  It also needed to be in a language that would integrate with the game engine which meant either C or C++.  In order to address these issues we developed an application framework in C, code-named Andromeda, which provided the APIs that we needed to build and deploy cross-platform software.

We took a hard look at the existing messaging protocol and noticed two serious flaws.  The first was that even though it was encrypted using the Blowfish algorithm, it used the same key for every message.  This was compounded by the key being vulnerable to a simple dictionary attack.  The second problem was that the messages were not self-descriptive, leading to many parsing errors and causing innumerable problems both on the client and server, including garbage data being inserted into the server databases.

We developed a new communications protocol that solved the existing protocol’s problems.  The new messages are self-defining, which addressed the parsing error problems.  Also, per the Army’s requirements, we developed a new cryptographic communications protocol that used the RSA algorithm with a trusted third-party methodology to exchange either a Blowfish or AES cryptographic key.  The exchanged key is used for successive messages.

In order to use the legacy protocol for the initial rollout we created a message translation layer that converted existing messages into our new format.  To use our new framework to exchange messages we created both client and server modules that supported the new protocol.  Once our new framework had proven itself, we removed the message conversion code and began using the new message formats natively via a set of in-game APIs.

The server module in the framework used a transaction-management design pattern where a different message-handler function was executed for each type of message received.  This design methodology has allowed us to use the same messaging protocol and accompanying server component for each new service that we have implemented.  From this base we were able to create new modules for AA2, including a match-making solution, an in-game asset delivery system, and a statistics tracking system.

When we were ready to begin AA3 development, we sat down with the game developers, reviewed the systems we were providing for AA2, and discussed what problems they had and where we could develop solutions to those problems.  Specifically we focused on any issues they had with our components, on what existing features they no longer needed, and on what new features they anticipated having a use for.

In order to develop the suite of components for AA3 we began refactoring our cross-platform framework by implementing a set of consolidated APIs.  We code-named the new framework Arcturus.  Arcturus improves on Andromeda in a number of ways, chief among them being a simplified set of functions that followed a common design pattern.  This gave Arcturus a more cohesive design than what had evolved in the Andromeda code base and better prepared us for the work ahead.

One of the biggest performance issues with the AA2 architecture is the excessive overhead required to implement the cryptographic communications protocol.  The processing time required was extreme enough to impact the player experience as well as game server performance.  Additionally the security system implemented to monitor the exchange of messages compounds the problems by rejecting good messages from locations that have high latency, causing them to resend the messages, with all of their cryptographic overhead.

For AA3 we designed two new protocols to address this issue.  The first, which we termed the high-security protocol, was a new self-descriptive format that was designed to be used via TCP/IP.  This implemented a new cryptographic communications protocol via a known-key, low-latency, stream cipher, which had much lower overhead.  Additionally, the encryption can be disabled for any transactions that don’t need it, resulting in even lower overhead.  The second protocol, which we termed the high-performance protocol, used a new lightweight, self-descriptive format transported via UDP.  The second protocol also supports multi-packet transactions for large messages.

The first system we implemented for AA3 was the authentication service.  Because we were not dropping in a replacement for an existing service we were able to design from a clean slate.  We started by noting that authentication transactions in AA3 are one of two types, synchronous or asynchronous.  In synchronous authentication the player must wait for the authentication to complete before continuing.  Asynchronous transactions are used by the game to gather information that requires authentication but that is not directly tied to player interaction.  For synchronous transactions we provided an API that blocks until the transaction is completed (the communication with the server has received its response).  For asynchronous transactions we implemented a message queue allowing the developers to periodically poll the queue to see if responses have been returned.

We also added new features to the AA3 service that go beyond typical authentication transactions.  Once a player is logged in, their session is handed off between the various AA3 systems, so they need not login again as they move from game to web to other game-related systems.  We also provide, via this service, for the management of a player’s account and game characters within that account.  Additionally other information generated by AA3 services, such as statistical reports, can be accessed through this system.

The next system we implemented was an event-driven, rule-based, scoring engine, known as the Attribute Tracking System (ATS).  ATS is designed to provide a mechanism for calculating player scores as well as managing player character progression.  It accomplishes this by allowing the developer to define in-game events which are examined by the ATS engine.  The engine uses a rule-based design, similar to a scripting language, to determine which player scores should be updated or which character attributes should be modified.  This all takes place in real-time, which allows players to view their player scores and character attributes, as they change, while playing the game.  Once a round of game-play is completed the set of ATS events are uploaded to the master ATS server where they are processed to create the official scores and attribute changes which are then persisted to the database.  The ATS service also provides a web-based interface which allows game developers to update the rules whenever they feel it is necessary, without the need to deploy new game patches.

To further explain how the AA3 ATS system is currently being used, here is a  real-world example:

Some AA3 player-attributes:

  • Duty
  • Respect
  • SelflessService

Some AA3 events and event-attributes:

  • Mission Completed
    • Player’s Team
    • Is Fire-team Leader
  • Objective Completed
    • Player’s Teammate Links
    • Is player low on health

The ATS engine can update the above-shown player-attributes via rules such as the following:

  • Rule “Mission Completed – Fire-team Leader Bonus”
    • Event Name: Mission Completed
    • Processing Priority: 10
    • Qualifiers:
      • Player’s Team: is on the winning team.
      • Is Fire-team Leader: true
    • Actions:
      • Increment “Duty” by the “Mission No Man Left Behind Bonus” multiplied by the “Number of Friendlies Left Alive”.

In the above example, when a “Mission Completed” event occurs, the ATS rule engine will examine the event to determine if if matches any of the qualifying criteria for the current set of defined rules. When the criteria is met, the action of incrementing the “Duty” player-attribute will occur as a product of a bonus variable multiplied by a game-state variable.

Note that in the above rule example, the processing priority allows rules to be executed in a hierarchal fashion, based upon their priority as defined in the ATS system. Additionally, variables may be defined in the system to be used when constructing a rule – for example the “Mission No Man Left Behind Bonus” is a variable used when incrementing the player’s “Duty” score. Another variable is the “Number of Friendlies Left Alive” - which reflects the current state of the game during play. Variables may be set in two ways – one, by defining them in an ATS rule, or by setting them via the SDK API to reflect the current state of the application. The way in which the ATS is used is very open-ended, given that any number of attributes, events, variables and rules can be defined. Additionally, any number of rules can be defined for the same event, any number of qualifiers can be defined for a rule, and any number of actions can be implemented for a given rule.

In AA2 we implemented a match-making solution to replace the off-the shelf component that they started with, this new, custom system, was called MBS, for Master Browser System.  Match-making, in a game, is the process of finding a server on which the player wants to play.  The decision is often based on where their friends are playing, or may just be based on what servers seem popular at the moment.  This system was designed around the concept of providing a filtered list of players and servers to the browsing player based on a set of constraints that they specify.  The system suffered from several critical flaws, primarily the overhead of the message cryptography.  Additionally, the query engine used a string parsing design pattern which was slow.  Lastly it pulled from the MBS server the entire list of online servers and players, including all of their current state information, which turns out to be a huge amount of data to get all at once.

In order to provide a better performing system under AA3, we first switched to our newly designed message protocols, eliminating much of the old protocol’s transactional overhead.  Additional speed was gained by the switch from TCP/IP to UDP.  Then we implemented the MBS server around a search engine which eliminated the overhead caused by the old string parsing methodology.  Finally, we limited the data returned by not including all the state information about the servers, allowing the client software to collect that information directly and only for the filter-reduced list of servers.

The next system we developed for AA3 was the Dynamic Content Delivery System (DCDS).  The purpose of DCDS is to allow rapid delivery of data to the client systems and to reduce the load on the Army game servers.  There are two main types of data that need to be delivered, static and dynamic.  Static data includes such things as the game itself and any patches to the game, which are downloaded once and kept as long as the game is installed.  Dynamic data is data that is loaded for use in the game, particularly for temporary use tailored to the individual player, and then, often, discarded when it is no longer needed.  To allow for dynamic data, DCDS exposes APIs to the game developers that let them request new assets (such as textures or 3D objects) while the game is being played.  To reduce the load on the Army servers both static and dynamic content is delivered by a peer-to-peer protocol that is loosely modeled on the commonly used “torrent” systems.

One of the important tools for enhancing future versions of any game such as AA2 and AA3, and to provide feedback to players about their performance, is to capture statistics about the way the game is played.  In AA2 the game developers were required to capture statistical events and summarize them within the game code, uploading the summarized events at the end of a match.  This caused problems.  Game developers, as a core competency, are not statisticians, so it took several iterations to come up with the right set of information to report.  Additionally, the system we developed for them only allowed the upload of known summarizations, so we had to release patches to the game itself in order to gather new information.

We implemented a new service for AA3, called the Statistics Tracking System (STS).  We began by providing a simple API that allowed the game developers to notify the STS SDK (software development kit) of any in-game event that might be useful to track.  We then implemented a distributed, automated, rule-based, summarization server, following the Massively Parallel Processing (MPP) design pattern.  Use of the MPP pattern provides for high scalability, allowing the service to be deployed to fit the needs of the game.  This server obtains a bulk upload of game events from the SDK and transforms them into intermediate statistical summaries.  At optimal intervals, the intermediate summaries are uploaded to the master database repository, where they are assembled into final summary form.  The set of rules, by which the MPP servers summarize events, are defined by the game developers via a web interface, and can be updated at any time without the need to patch the game.  This allows the game developers to define new summarizations of game-play events after the game has been launched.  They only need to patch the game itself when they determine new events that they want to track.

To further explain how the AA3 STS system is currently being used, here is a  real-world example:

Some AA3 STS events and event attributes:

  • Enemy Neutralized
    • Mission ID
    • Mission Variant
    • Mission Size
    • Linked
    • Soldier Name
    • Mission Type
    • Range
    • Player Name
    • Target Soldier Name
  • Melee Fired
    • Weapon
    • Mission ID
    • Mission Variant
    • Mission Size
    • Linked
    • Soldier Name
    • Mission Type
    • Velocity
    • Player Name
    • Posture

From which some rules may be defined to automatically create statistical summaries, such as:

Number of Enemies Neutralized for Live-Variant Large Size

  • Event: Enemy Neutralized
  • Function: Count
  • Identifying Attributes
    • Soldier Name
    • Target Soldier Name
  • Constraints
  • Mission Variant: Live
  • Mission Size: Large

Number of Melee Fired by Player and Weapon

  • Event: Melee Fired
  • Function: Count
  • Identifying Attributes
    • Soldier Name
    • Weapon
  • Constraints
    • None

Average Melee Fired Velocity by Weapon

  • Event: Melee Fired
  • Function: Average
  • Identifying Attributes
    • Weapon
  • Constraints
    • None
  • Target Attribute: Velocity

In the above examples, the following statistical summaries would be automatically generated by the STS system:

  1. The “Number of Enemies Neutralized for Dev-Variant Large Size” will create a count of the number of enemies neutralized on large, “Live” variant maps for each player by each neutralized enemy.
  2. The “Number of Melee Fired by Player and Weapon” will create a count of of the number of times a weapon is fired in a melee battle for each player by each weapon type.
  3. The “Average Melee Fired Velocity by Weapon” will create the average velocity of a weapon fired in a melee battle for each weapon type.

Note that as shown in the above examples, each STS rule is for a given event, and will only execute if the set of identifying attributes are set for that event and if the event meets the constraint-rule criteria. The identifying attributes allow the STS system to create summaries for the identifying attribute values found in the event. When a target attribute is specified, the rule’s function is applied to the attribute-value found in the event. Currently count, average, high, low and sum are supported function-types.

These five systems, Authentication, the Attribute Tracking System, the Master Browser System, the Dynamic Content Delivery System, and the Statistics Tracking System, are a suite of solutions that the AA3 game developers are using to help create the next generation gaming experience.