AA3 Master Browser Upgrade
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.
The lead America’s Army 3 (an Unreal Engine 3 game title, see this blog post for a detailed description the AA3 systems I designed) game programmer and I identified a number of problems with the current AA3 game server browser (called the Master Browser System or MBS in AA3 nomenclature) this past week. These included an issue in the MBS SDK that prevented the multi-threaded server-query game-logic from executing game-server queries cleanly due to forcing the queries into a single-threaded state via an extraneous thread lock. Additionally the UnrealScript that interfaced with the SDK API call did not do so in a very efficient fashion. These problems were compounded by the thread-model confusion in the query pool design.
I began troubleshooting this problem by using the AA3 Arcturus framework to perform rapid application development (RAD) of a multi-threaded server-query testbed application based upon the existing single-threaded unit test design. I then used it to both tune the MBS SDK performance while eliminating the extraneous thread-lock in a thread-safe fashion. Additionally, this provided an ideal framework for optimizing how the SDK API call was utilized. Once this pass had been completed, I made a new SDK build, and also gave a copy of my testbed source code to the lead programmer to show a simple example of how to make the most efficient use of the component.
This process resulted in a radical performance enhancement in the in-game server-browser. Here are the current performance metrics: the SDK is able to obtain 365 servers from the MBS master server in 0.189 seconds, all 365 servers were queried (using a thread-pool of 16 threads) in 6.087 seconds with an average of 0.017 seconds per server. The total execution time, including SDK initialization and cleanup time was 6.459 seconds.
In summary, the performance went from a minute or two to query all of the AA3 game servers, to under 7 seconds. I currently anticipate that this upgrade will be included in the next build of AA3, namely 3.0.6. You can see the current set of online servers here.