HQ NETWORKXbox One | Xbox | C64 9,125 HQ Network UsersHQ Network: 9,125 | Members OnlineGuests: 4913 |Guests OnlineMembers: 1

Xbox 360 Forums
Get involved in our Xbox 360 forum discussions..
Get Xbox Game Pass Ultimate
360-HQ.COM :: Unsigned Xbox 360 Developer Best Practices
Unsigned Xbox 360 Developer Best Practices
360-HQ.COM Forum Index -> Xbox 360 General Discussions
Post new topic Reply to topic    
 Unsigned Xbox 360 Developer Best Practices View previous topic :: View next topic  
 
 
 
 
forahobby
Administrator
Administrator




Joined: May 22, 2003
Posts: 23944
Location: NSW, Australia
XP: 3,060,024

Post Posted: Fri Apr 21, 2006 3:44 am   
Post subject: Unsigned Xbox 360 Developer Best Practices
Reply with quote
 
Unsigned Xbox 360 Developer Best Practices

Information from Micro$0ft

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.

Hardware:

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

Software:

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.

General Programming

* Multithread your game engine. Single-threaded games use only a third of the potential processing power of the system.
* Prefer using native Windows thread APIs and synchronization primitives. Xbox 360 supports similar APIs.
* 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.
* 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.
* 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.
* 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.

Graphics

* 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.

Audio

* 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.

Networking/Live

* 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.

Content

* 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.

References

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.
OpenMP: http://www.openmp.org/

_________________________________________________________
HQ Network:
www.xbox-hq.com | www.xboxone-hq.com | www.360-hq.com | www.c64-hq.com


View user's profile Send private message Send e-mail Visit poster's website
 
Display posts from previous:   
  Post new topic  
 
  Reply to topic  
|
 All times are GMT | Page 1 of 1
Jump to:  
 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum