Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++
As a game developer, which data structure will use to develop the game? and the list should load super fast.
Posted 23-Jun-13 20:40pm
Comments
nv3 at 24-Jun-13 1:59am
   
Probably, all of them.
Stefan_Lang at 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.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 290
1 Jochen Arndt 165
2 DamithSL 125
3 PIEBALDconsult 110
4 Garth J Lancaster 90
0 OriginalGriff 5,790
1 DamithSL 4,601
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,195


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 24 Jun 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100