06 Sep 2005 11:59 | Dusty | Xbox 360
Xbox360News.com | Read & Add Comments (7) | Link to this article
Since you don’t need an Xbox 360 development kit to start coding Xbox 360 games, Microsoft has published a document targeted at unsigned Xbox 360 developers which reveals some interesting info. .......................................................
Unsigned Xbox 360 Developer Best Practices
Developers who are interested in writing games for Xbox 360 can be productive without having an Xbox 360 development kit. This paper describes hardware and software that can be used to emulate Xbox 360. It also includes recommendations for programmers wanting to get a head start on Xbox 360 development.
The Xbox 360 console is composed of a PowerPC-based triple-core CPU and a custom ATI graphics processor. Neither of these processors is available in standard PC-based hardware. We recommend the following system for emulating Xbox 360 using a PC:
Microsoft Windows® XP
PC with multiple hardware threads (hyperthreads) or multiple independent CPU cores
ATI graphics card with support for High Level Shading Language (HLSL) shader model 3.0 (when available)
Widescreen HDTV monitor
Xbox 360 games are programmed using the Microsoft® Visual Studio® development system. The Xbox 360 development kit (XDK) supports development using either C or C++. We recommend the following software for writing Xbox 360 code using a PC:
Microsoft Visual Studio 2005 or Visual Studio .NET 2003
Direct3D 9.0 Software Development Kit
Microsoft Cross-Platform Audio Creation Tool (XACT)
Xbox 360 Programming Recommendations
Developing for Xbox 360 has many similarities to writing games for other consoles, as well as some unique qualities. Following is a list of best practices for creating games for Xbox 360.
Multithread your game engine. Single-threaded games use only a third of the potential processing power of the system.
o Prefer using native Windows thread APIs and synchronization primitives. Xbox 360 supports similar APIs.
o A simple architecture for multithreading on Xbox 360 uses one thread for world updates and another thread for graphics processing. An additional CPU core can be used for audio, decompression, geometry generation or other game tasks.
o Another way to utilize additional cores is with OpenMP. OpenMP is supported in Visual Studio 2005.
Ensure your game memory footprint fits within 512 MB. Xbox 360 does not have hard disk paging like Windows.
Access memory carefully. As is typical with high-performance CPUs, memory latency can be a significant bottleneck.
o Optimize for the L2 cache. Xbox 360 has a 1MB L2 cache. Think of RAM as a fast hard drive rather than as infinitely fast memory.
o Avoid walking linked-lists or any other data structure that has nodes spread across memory. Avoid walking any large data structure more than once per frame. Prefer contiguous data structures, like arrays.
Prefer calculating data to loading it. The Xbox 360 CPU is a mathematical monster. Avoid code that’s special-cased to skip heavy duty math. In particular, avoid floating-point comparisons and avoid converting or casting data from int to float or vice-versa.
For best performance, prefer native Windows functions to C runtime functions. For instance, prefer ReadFile over fread.
Delay low-level engine tuning until you have an official Xbox 360 development kit. Over-optimizing can be counterproductive, but on the other hand, plan to spend time optimizing for the platform once you have a development kit. Xbox 360 has a ton of power, and time spent on optimization can have a huge impact on your game’s performance.
Target the Direct3D 9.0 interface. This interface forms the basis of the Xbox 360 graphics API.
Don’t rely heavily on Direct3DX (D3DX). D3DX utility functions are not tuned for Xbox 360—there are almost always faster ways to accomplish the same task.
Support a 16:9 widescreen aspect ratio. Support a minimum frame buffer size of 1280 × 720.
Use HLSL for shaders. The Xbox 360 GPU has an extremely efficient shader architecture. HLSL shader model 3.0 programming is the right way to harness the GPU.
Using a Z-only pass to build the Z-buffer is a technique that works well on Xbox 360.
Avoid using the fixed-function pipeline. It is not supported on Xbox 360. Use custom shaders instead.
Use PIX, a performance-analyzing tool for game and graphics tuning. PIX is available in the DirectX SDK.
Use XACT. XACT is the preferred way of creating and playing audio content on both PC and Xbox.
Source material should be sampled at a minimum rate of 48KHz. Author dry source and plan for real-time effects.
XMA is the native audio format for Xbox 360. Plan to take advantage of surround sound and XMA compression.
Use basic sockets or Winsock for network programming. Xbox Live libraries are currently available only in conjunction with the XDK.
Prefer UDP as the network protocol for most games.
Plan for voice chat within your game. Architect your network engine with the assumption that you will send voice data as well as game data.
Update your content pipeline to support big-endian hardware. Intel-based PCs are little-endian, while Xbox 360 is big-endian. We recommend that all content on the Xbox 360 game disc be in big-endian format for best performance.
Ensure the game art pipeline supports features like vertex compression, texture compression, and triangle stripping.
Consider DirectX effects (DX effects), commonly authored using .FX files. A modified version of DX effects are supported on Xbox 360.
General Console Programming Recommendations
Developing console games is very different from writing PC games. With this in mind, the following list provides some general recommendations for making an effective console game.
Design for controller input, not for keyboard & mouse input. Console players press simple buttons—they don’t move the mouse or tap a keyboard.
Design for the ten-foot experience. Use fonts that are readable on televisions. Use simple menus; avoid long scrolling lists.
Consider using a television as an output device during development. PC-to-TV video adaptors are widely available.
Minimize load times. Console games don’t install to a hard drive—they run directly from the game disc, so using the game disc effectively is important. Plan to stream data from the disc throughout the game, plan to compress game data, and offload decompression to a separate thread. Consider replicating data to avoid unnecessary seeking.
Don’t assume the console player has a memory unit or that the hard drive is always attached. A game should have playable modes even if the detachable drive is removed.
Be aware of the title-safe region on televisions—that is, avoid displaying critical UI elements or text in the outer edges of the screen.
Xbox 360 system specifications: http://www.xbox.com/en-US/xbox360/factsheet.htm
Xbox 360 consumer site: http://www.xbox360.com/
Visual Studio: http://msdn.microsoft.com/visualc/
DirectX Software Development Kit: http://msdn.microsoft.com/directx/
XACT for Windows is currently in beta. You can apply for the beta at http://beta.microsoft.com/ using the Guest ID: XACTBeta.
Advertise With Us
360 News is in no way affiliated with Microsoft Corp. All content/trademarks
are owned by their respective owners.
©Copyright 2005 All Rights Reserved Xbox360News.com