Sign in to follow this  

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

Recommended Posts

Carbon101    1292
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
ApochPiQ    23005
The same way you use bricks in house construction.

Data structures are a central part of [i]any[/i] 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 [i]useful[/i] in implementing data structures but not necessarily [i]essential[/i]. 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 [i]not[/i] 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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this