Click here to Skip to main content
15,920,503 members
Please Sign up or sign in to vote.
1.29/5 (3 votes)
See more:
As a game developer, which data structure will use to develop the game? and the list should load super fast.
Posted
Comments
nv3 24-Jun-13 1:59am    
Probably, all of them.
Stefan_Lang 24-Jun-13 4:32am    
"data structure" is most probably not what you are looking for. Are you looking for a "framework" or "Developer environment"?. Also, what "list" are you talking about, what size do you expect it to be, and just how fast do you consider "super fast" to be? 0.01 seconds? 2 seconds? 50 seconds?

Please try to be more concise and more informative on the subject of your problem.

This is not a question we can answer.

Because it will depend on your game, and what you are doing, and the type of data you are trying to move around, and the speed you need to move it at we could have no idea what you need.

So look at your game, and work it out. Try a couple of different ways to organise your data. If you need speed, then KISS: "Keep It Simple Stupid" - complexity adds processing time.
 
Share this answer
 
In C++, the choices are class and struct. These can be created as static objects, on the stack, on the heap and as temporaries. There are subtle programming differences but no performance difference between class and struct. If there are a lot of instances of your data, there might be a slight performance improvement by creating instances but not pointers to instances. Dereferencing pointers within a class might see page faults. If a class/struct contains another class/struct, there is no visit to another page or a pointer dereference. Use of an array of objects will be more performant than a linked list. Use of an iterator through an array of objects will be faster than using a loop with an index.

These are somewhat subtle points. Really the answer to your question is better answered by what your code looks like. How you use the data is probably more important than what the data looks like.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900