Jump to content
  • Advertisement
Sign in to follow this  
Carbon101

Implementation of Data Structures and pointers in games (C++)

This topic is 2446 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have been reading up on data structures and pointers, but can't seem to connect these topics in game development. I have tried using google, but nothing has turned up. How do you use data structures, pointers and/or enumerations in game development.

Share this post


Link to post
Share on other sites
Advertisement
The same way you use bricks in house construction.


Data structures are a central part of any kind of program; whether it's a game or not is irrelevant. Take a really simple one: lists. That horde of Zerglings running into your base and pwning all your pylons? Yeah, they're probably stored in a list (or a similar structure).

Pointers (in an abstract sense) are integral to implementing most data structures in imperative programming languages. It's worth noting that a "pointer" in the abstract sense is different from the C/C++ concept (which is more like a memory location than an abstract reference); C/C++ style pointers are useful in implementing data structures but not necessarily essential. Indirect references of some kind, however, are definitely mandatory for implementing basically anything beyond arrays.

Enumerations are also commonplace in basically all well-designed software. Human, Protoss, and Zerg are probably three members of a "race" enumeration, for instance.


Basically, if you're really grokking the concepts of these things, it should be hard not to see how they apply to software. And, since games are just software, it should be clear how they apply to games by extension.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!