informa
/
2 MIN READ
News

Feature: Managing Data Relationships

In this independent technical article, game development veteran Noel Llopis looks at how coders should structure and retrieve the intertwined world of game data in me
How do the parts of your game data relate to each other? In this independent technical article, originally published in Game Developer magazine and posted online as part of Intel's Visual Computing section, game development veteran Noel Llopis looks at how coders should structure and retrieve the intertwined world of game data in memory. Each approach to describing relationships between different data parts has advantages and disadvantages, writes Llopis, and finding the right method for the job is important. For example: "In C++, regular pointers (as opposed to "smart pointers," which we'll discuss later on) are the easiest and most straightforward way to refer to other data. Following a pointer is a very fast operation, and pointers are strongly typed, so it's always clear what type of data they're pointing to. However, they have their share of shortcomings. The biggest drawback is that a pointer is just the memory address where the data happens to be located. We often have no control over that location, so pointer values usually change from run to run. This means if we attempt to save a game checkpoint which contains a pointer to other parts of the data, the pointer value will be incorrect when we restore it." One way to get around this limitation is through the use of indexing, but even that's not a perfect solution: "Unfortunately, they still suffer from the same problem as pointers of being strictly a many-to-one relationship and making it difficult to relocate or delete the data pointed to by the index. Additionally, arrays can only be used to store data of the same type (or different types but of the same size with some extra trickery on our part), which might be too restrictive for some uses. A good use of indices into an array would be particle system descriptions. The game can create instances of particle systems by referring to their description by index into that array. On the other hand, the particle system instances themselves would not be a good candidate to refer to with indices because their lifetimes vary considerably and they will be constantly created and destroyed." You can now read the full technical feature at Gamasutra (no registration required, please feel free to link to this feature from other websites).

Latest Jobs

Treyarch

Playa Vista, Los Angeles, CA, USA
9.12.23
Senior Level Designer (Zombies)

PlayStation Studios Creative Arts

Petaling Jaya, Selangor, Malaysia
9.14.23
Lead Concept Artist

High Moon Studios

Carlsbad, CA, USA
9.20.23
Technical Designer at High Moon Studios

High Moon Studios

Carlsbad, CA, USA
9.18.23
VFX Artist
More Jobs   

CONNECT WITH US

Explore the
Advertise with
Follow us

Game Developer Job Board

Game Developer

@gamedevdotcom

Explore the

Game Developer Job Board

Browse open positions across the game industry or recruit new talent for your studio

Browse
Advertise with

Game Developer

Engage game professionals and drive sales using an array of Game Developer media solutions to meet your objectives.

Learn More
Follow us

@gamedevdotcom

Follow us @gamedevdotcom to stay up-to-date with the latest news & insider information about events & more