Trending
Opinion: How will Project 2025 impact game developers?
The Heritage Foundation's manifesto for the possible next administration could do great harm to many, including large portions of the game development community.
In a technical article originally printed in Game Developer magazine, veteran game programmer Noel Llopis <a href="http://www.gamasutra.com/view/feature/3998/secrets_of_multiplatform_data_.php">continues his look</a> at data baking by examining how differ
May 6, 2009
Author: by Staff
In a technical article originally printed in Game Developer magazine, veteran game programmer Noel Llopis continues his look at data baking by examining how different console and PC game platforms treat data in memory. Llopis last covered the basics of data baking, from the time data is exported from the content-creation tool, to the time it makes it into the game. Now, he writes about the different in-memory formats that different target platforms have -- since when a memory image created in the baking process is off even slightly, the result can be completely unusable data. There are ways to skip the problem, Llopis says: It is possible to bypass the problem completely by baking your data in the target platform. Then all you need to do is load up your data structure and save it to disk. End of story. That approach might work well for PC games, even when you're doing cross-platform development. If you're developing in Windows, it's pretty easy to involve a Mac or a Linux machine in the baking process. Although in the case of PC games, the amount of data baking you can do is limited because you hardly ever know the exact hardware your game will run on, so you might not need to involve target machines at all. If you're developing for game consoles or other fixed platforms, where you definitely want to create the exact memory image of your data, you could consider involving the target platform in the data baking process. After figuring out the size of data types, it's still essential to know exactly how they're stored in memory -- you might know that an integer is 32 bits, but what bit pattern describes a particular number? Explains Llopis: There are two parts to that answer. The first one relates to how data types are represented in different hardware. And here, there's good news: Most modern platforms use the same method to represent basic data types. Signed integers are represented with two's complement, and floating point numbers use the IEEE 754 standard for both 32- and 64-bit numbers (sign, mantissa, and exponent). A few platforms might not support floating point numbers, in which case we'll need to translate the data to fixed point or some other format. But in most cases, this is not something we have to worry about. That's not the end of the story, though. The second part of the answer relates to how that number is stored in memory. In all modern platforms, a byte (8 bits) is the smallest addressable memory unit. Data types that are just a byte long (like a char) are simply stored at a particular memory address in a single byte, with nothing more to it. You can now read the full data baking feature at Gamasutra (no registration required, please feel free to link to this feature from other websites).
Read more about:
2009You May Also Like