What are the main data structures used in programming games and for what purpose is each one used?
What are the main data structures used in programming games and for what purpose is each one used?
This sounds an awful lot like a homework question, which our homework policy would prevent me from answering directly (though I don't think it is). Also, it's extremely Google-able, I did so and got tons of results. However, there is a third reason we can't really answer it: it is far to broad. What kind of games specifically: RTS, MMORPG, FPS, racing/vehicle simulations, arcade/adventure/scrolling, puzzles, etc, etc, etc? What aspect of the game: graphics engine, player/object modeling, AI, world/environment/maps/routes/route-finding, networking/multiplayer aspects, etc?
Games are often quite complex and diverse, and there's no concrete list we can give of "if you know these data structures then you can write a game". Discussing even one of these topics in much detail would be quite an undertaking. If you are really interested in game programming, grab a few books and find some online tutorials. Read and try coding up some of the examples and simpler games to get your feet wet. That should give you an overview of the field, and when you have a more specific idea of what you're interested in, you can ask more specific questions, and we can probably give much better help.
All that being said, I would pretty much bet that, at the very least, you would need to know your basics: FIFO, LIFO, linked lists, trees (binary and N-ary), heaps, etc. Many of the data structures you use will probably be based off of those, but be much more specialized for the needs of that one game or type of game. I'm sure there are people here with more game programming experience than me, who may have more to say.
Simple answer. The same ones used in applications. The reason for using them is universal. Vague question = vague answer.
No it wasnt's a homework problem.. I was just interested. But you're right I should have googled it. Thanks anyway.