An entity for organizing data in a specific way so it can be used efficiently. Examples are arrays, objects, records, structs.

learn more… | top users | synonyms

3
votes
2answers
2k views

Why can't I get a bool packed and aligned into a D3D constant buffer?

Alright, I'm having a hard time getting a bool packed and aligned into a hlsl constant buffer and I'm not sure why. Here is the buffer in hlsl cbuffer MaterialBuffer : register(b1) { float3 ...
11
votes
4answers
3k views

How to continuously find all entities within a radius efficiently?

I have a very large number of entities (units). On each step, each unit needs to know the positions of all units near it (distance is less then given constant R). All units move continuously. This is ...
17
votes
1answer
2k views

What are the pros and cons of these voxel data file formats?

.VXL .VOX .KVX .KV6 .V3A .V3B I am trying to decide whether it's worth going with any of the above, or some other, or if I should roll my own. The deciding factors in order of importance are: ...
2
votes
2answers
497 views

Best way to traverse triangles in a mesh

I'm implementing non-projective decals. As described in many places (ie: lengyel in the gpg2) I first need to detect all triangles that lie within some sort of frustum. Besides obvious brute-force ...
2
votes
1answer
116 views

What's a good way to store a series of interconnected pipe and tank objects?

I am working on a puzzle game with a 6 by 6 grid of storage tanks that are connected to up to 4 tanks adjacent to them via pipes. The gameplay is concerned with combining what's in a tank with an ...
8
votes
2answers
857 views

In a 2D tile-based game, how should NPCs and tiles reference each other?

I'm making a tile engine for 2D games (seen from the top). Basically the world is composed of a grid of tiles. Now I want to put for instance NPCs that can move on the map. What do you think is ...
3
votes
1answer
518 views

Better data structure for a game like Bubble Witch

I'm implementing a bubble-witch-like game (http://www.king.com/games/puzzle-games/bubble-witch/), and I was thinking on what's the better way to store the "bubbles" and to work with. I thought of ...
8
votes
2answers
674 views

Where do I store strings? What's an efficient way of loading them?

I'm making a top-down RPG for iPhone. I'm using tilemaps (CCTMXTileMap) and the cocos2d-iphone engine. I've made a class that can handle loading maps and NPCs onto the screen, a class that handles ...
0
votes
1answer
334 views

What kind of data structure should I use for a resource container?

I am curious what kind of container would be the best choice for a resource container. BTree, binary search tree or something else? What like is the priority of the operations over it? So best ...
7
votes
4answers
852 views

How can I improve this enemy database implementation?

I'm developing an RPG and I'm at the point where I need to start building an enemy database. There's a couple challenges associated with this and a few solutions I've been considering. Here's what I ...
21
votes
4answers
2k views

What data structure should I use for a Diablo/WoW-style talent tree?

I'm considering implementing a talent-tree system for an online RPG, similar to that seen in World of Warcraft, where acquiring a skill unlocks the next "tier" beneath it in the tree. Does anyone ...
7
votes
2answers
224 views

Determining if player-created structure matches a template in a 3D block-based game

Disclaimer: this is one of those dreaded Minecraft-style questions, but I feel it's more a data structures and algorithms question I'm really new to 3D data structures and am wondering what the best ...
11
votes
3answers
5k views

Which data structure should be used to represent voxel terrain?

According to the Wikipedia page about voxels, "[...] the position of a voxel is inferred based upon its position relative to other voxels (i.e., its position in the data structure that makes up a ...
8
votes
3answers
1k views

Proper way to handle destruction of game entities

Imagine a game world where loads and loads of entities are dynamicly loaded all the time, I would represent that as a list of entities perhaps, but what about removing them? While when adding i ...
3
votes
1answer
342 views

Good practices to hold terrain data in a 2D networked game

I am working on a client-server architecture game, its a 2D top view adventure. My main focus for the map system right now is to have editable terrain, that will actually change in realtime to other ...
6
votes
1answer
555 views

Appropriate level representation / data stucture for a 2D platfrom game?

I'm about to program a copy of Mario in Java. I'm thinking on 2 representations/data structures for the levels but I'm not sure which one should I choose: A 2D integer array. A quadtree to divide ...
6
votes
2answers
798 views

Data structures in older games

I'm curious about the data structures used when programming older games like Super Mario Brothers for NES and Super Mario World for SNES. My understanding is that games of this period were written in ...
6
votes
2answers
689 views

Data Structure (or algorithm) for fast distance-based entity lookups

For example, your game has 100 enemies (on different teams) running around and their AI wants to inspect the nearby entities to see which it should attack. What is a fast way to organize those ...
5
votes
3answers
350 views

How can I store information about what cells are connected to others in a 2D array?

I have a 10x11 array in my game. What is the best structure and way to store the connections between the elements of the array? Some info about the connections: they are simple (2 elements are ...
5
votes
3answers
1k views

Why aren't linked lists more common data structures for enemies?

I was recently listen to a talk that Jonathan Blow gave, you can find it here. In the talk, he was talking about what data structures he (and he seemed to imply many others) use, and why. Which is ...
1
vote
1answer
395 views

Scene graphs vs in-game representation

This is a general question which aim is to allow me to start digging on the subject by myself. As I noticed the general opinion is that scene graphs are good for describing the scene in a level ...
7
votes
1answer
1k views

How to create a game save file format in c++ using STL

Hey so i just learned about the i/o part of the STL, more specifically fstream. Although I can now save binary info and classes i've made to the hard drive, i am not sure how to define how the info ...
4
votes
3answers
416 views

Finding closest coordinate of a pre-known set

Let's say I have a large number of conceptual objects of some kind, each of which occupies a pre-known set of points in a Cartesian 3-space. 1) What is the best combination of data structure (for ...
1
vote
3answers
985 views

MySql Database design for Facebook game

I'm at the planning stages for a facebook game, it will be similar to farmville, but will feature parks. I've been a Flash game dev for many years but all this database stuff is new to me so I'm ...
3
votes
1answer
765 views

Implementing a tile-based game

Which data structure should be best used to store a pile of tiles from which a player can pick a random tile?
16
votes
5answers
6k views

When should vector/list be used?

I can understand when to use lists, but I don't understand when it is better to use vectors than using lists in video games: when it is better to have fast random access ? (And I understand why it's ...
3
votes
1answer
1k views

(real) 3d map rendering in wpf without an engine - how to handle the map data?

I'm just doing some research before embarking on rendering a 3D map inside a wpf app. I've never delved into 3D before, and hence the question.. I have map data (in several formats, and many files) ...
59
votes
11answers
7k views

How to design a replay system

So how would I design a replay system? You may know it from certain games like Warcraft 3 or Starcraft where you can watch the game again after it has been played already. You end up with a ...
6
votes
5answers
4k views

Alternative to 2D array in a tiled-map structure

After searching for a long time, I'm surprised this question was not asked yet. In a 2D, tiled-map game, how do you handle the map ? I'd be glad to have your point of view in any languages, though I'm ...
3
votes
4answers
190 views

Associate a texture to an object (from a data-model, not graphical point of view)

I'm writing a roguelike where objects and floor can be made of different materials. For instance, let's say we can have a wooden chair, an iron chair, a golden chair, and so on. I've got an Object ...
4
votes
1answer
651 views

Most efficient way to handle coordinate maps in Java

I have a rectangular tile-based layout. It's your typical Cartesian system. I would like to have a single class that handles two lookup styles Get me the set of players at position X,Y Get me the ...
-1
votes
1answer
1k views

Code Structure / Level Design: Plants vs Zombies game level dissection

I am interested in learning the class structure of Plants vs Zombies, particularly level design; for those who haven't played it - this video contains nice play-through: ...
3
votes
1answer
884 views

database design help for game / user levels / progress

Sorry this got long and all prose-y. I'm creating my first truly gamified web app and could use some help thinking about how to structure the data. The Set-up Users need to accomplish tasks in each ...
8
votes
3answers
591 views

Should I share the same tile structure for display and pathfinding?

I know how to display a 2D map with tiles. I know how to make a pathfinding algorithm using A*. Those two things demand a structure or a class. My question is : do you use the same structure for ...
3
votes
2answers
339 views

What are the technologies that makes physics engines so good for raycasting?

again. This question is strictly related to this one so, what is the technology that makes physics engines suitable for raycasting? It is a particular data structure? Has it to do with the engine's ...