Click here to Skip to main content
13,147,037 members (61,560 online)
Rate this:
Please Sign up or sign in to vote.
See more:
As a game developer, which data structure will use to develop the game? and the list should load super fast.
Posted 23-Jun-13 19:40pm
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.
Rate this: bad
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.
Rate this: bad
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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170915.1 | Last Updated 24 Jun 2013
Copyright © CodeProject, 1999-2017
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