Porting a PS2Centric Game to the Xbox
A Case Study of State of Emergency
Dr. Jonny Dobson
Head of Software
VIS entertainment (Dunfermline Studio)
jonny.dobson@visentertainment.com
Talk Summary
• • • • • • •
An overview of the original PS2 version. The timeline of the Xbox porting project. The initial conversion. Architectural differences between the platforms. Xbox specific optimizations. Differences between the two versions. Finally, some results and conclusions.
State of Emergency PS2
• We needed as many NPCs as possible. • So we developed a renderer with an integrated animation subsystem. • Most of the animation is performed on the VUs. • And scene data was converted into a format so that it could be DMAd to the VUs. • This allowed 100-200 NPC visible at once.
Conversion Timeline
• It was decided to port to the Xbox after the PS2 release. • We didn’t just want a port, we wanted expand on the original. • Split-screen modes had already been investigated, so we included these. • And we also wanted to revise the missions.
Conversion Timeline
SOE Xbox was an 8-month project. Roughly 14 people on the team. On average 8 full-time team members. Mostly software development. 5 months production, 2 months alpha, 1 month beta. • Microsoft approval on 24th Dec 2002.
• • • • •
The Initial Conversion
• The R&D team developed the Xbox renderer. • The director and designer began reviewing and revising the missions on a PS2. • The game engine programmers started converting the code to the Xbox.
The Initial Conversion
• The PS2 rendering functionality was reimplemented quickly with DirectX functions. • The game engine code was complied and running in a few hours. • The initial conversion took 3 months. • … and the result was disappointing...
The Initial Conversion
• We had assumed (hoped!) that the engine would run fast straight away. • However it actually ran slower. • The PS2 version maintained 30 frames-persecond most of the time. • The Xbox conversion ran at 30fps about 50% of the time.
Architectural Differences
• This initial conversion showed the architectural differences of the two platforms. • The code was finely balanced on the PS2. • But the performance on the Xbox “broke” this balance. • Overall, the Xbox performance was initially poor.
Xbox Specific optimizations
• To achieve the same performance we needed to make Xbox specific optimizations. • There were three major optimizations: – Pushbuffers. – Animation Caching – Frame reorganization.
Pushbuffers
• Pushbuffers are the native Xbox GPU format. • DirectX instructions build pushbuffers for rendering. • We create the pushbuffers offline. • And used the old “execute buffer” method for rendering the scene. • This resulted in a reduction of CPU time required for rendering.
Animation Caching
• On the PS2 the animation was performed in Vector Unit assembly code. • On the Xbox it is performed on the CPU. • We kept a cache of animation frame matrices. • Each matrix had a reference count and a score. • Slots are considered free when both the reference count and score are zero. • If the cache is full, we have non-cached space.
Animation Caching
Cached Frames
Divided into 10 groups
Uncached frames
Renderloop Restructuring
• The pushbuffers and animation caching reduced CPU usage. • But this misbalanced the parallelization. • There were key points where the CPU or GPU became stalled. • We spread the processing over two frames. • This final optimization brought the framerate up to a near constant 60fps.
Xbox Game Differences
• The best focus testing comes from releasing the game to the public! • The Xbox conversion was an opportunity to evolve the game. • The mission mode was revisited. • Art was increased in detail. • And multiplayer (split-screen) modes were added.
Missions Revisited
• When developing the original we found out that just watching NPCs was fun. • But this behavior was emergent and wasn’t designed in. • We removed the missions that were not fun. • And built new missions around using multiple NPCs.
Art Improvements
On the PS2, the memory usage was tight. The Xbox had double the geometry footprint. Many of the textures were doubled in resolution. A wider variety of more detailed NPC were produced. • Some geometry was increased in polygon resolution. • Finally we introduced some more exotic shaders.
• • • •
Multiplayer Modes
• The biggest change to the game code was the addition of split-screen multiplayer modes. • We discovered that 2-4 player “hand-to-hand” combat was not always fun. • We biased the game modes away from that mechanic. • We also locked the frame rate at 30fps for 2-4 players.
Unanticipated Challenges
• … or rather “bugs”! • Issues that arose from retrofitting multiplayer functionality. • Bugs due to differences between the hardware of the two platforms. • And things we couldn’t do because of the way the engine was structured on the PS2.
Retrofitting Multiplayer Games
• The rendering was straightforward - this was already built into the PS2 renderer. • But the engine was totally single-player-centric. • The initial implementation was quick. • But a lot of code assumed a bit too much. • A lot of QA and coding time was spent tracking down and fixing special cases.
Bugs Due to Hardware Differences
• It is not unusual to find bugs that were present in the original. • Some of these bugs were much more fatal on the Xbox. • Floating point “not-a-number” calculations. • Memory corruptions and memory map issues.
Things We Couldn’t Do
• Hard disk caching - due to the PS2 renderer file loading. • Anti-aliasing - because of the frame-rate. • Online gaming - we couldn’t transfer enough data over a broadband connection. • Split-screen shadow volumes - oh dear… they didn’t work on PS2, and it made it’s way in!
The Submission Process
• Two pre-certification submissions to Microsoft. • And passed actual submission second time. • Key points to look out for, especially with port from other consoles: – The save game method. – Safe areas. – Longer localized TCR text.
Results
• • • • • • • •
The Xbox port contains all the PS2 functionality... … and 60fps single player modes. … and multiplayer split-screen games. … and higher resolution textures. … and more exotic shaders. … and better LOD levels... … and better NPC volume management. … and dropped objects don’t line up!
Conclusions
• We used the Xbox port to improve the game. • We achieved the performance by optimizing an Xbox implementation of the PS2 renderer. • The different architecture meant that the very different optimizations were required. • And the whole game loop needed restructuring. • The increased performance would have been unlikely if we used an off-the-shelf system.
Key Points
• What are you trying to achieve? • For projects that are “achievable”, consider cross-platform technology. • For projects that are pushing the limits, choose a lead platform and stick to it. • However, you should be okay with existing consoles.
Further Listening, etc...
• “Squeezing Every Last Drop Out of The Playstation 2”, Matt Scott, Saturday 10.30 11.30am, Room J3. • “The Good and the Bad: A Second Chance”, Peter Molyneux, Saturday 4-5pm, Room A4. • The Xbox ATG on the Expo floor, and at www.xds.xbox.com. • And VTUNE, obviously.
Any Questions ?
jonny.dobson@visentertainment.com