Questions tagged [data-structure]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
203 views

Direct3d - Code structure

I'm learning directx in a master's degree and they taught us to have a GraphicsLayer class which is the one connecting with the direct3d library. That way this class is completly independent from the ...
2
votes
1answer
348 views

Ray Tracing concers: Efficient Data Structure and Photon Mapping

I'm trying to build a simple ray tracer for specific target scenes. An example of such scene can be seen below. I'm concerned as to what accelerating data structure would be most efficient in this ...
2
votes
1answer
144 views

Torque2D, Class vs Datablock

I'm scripting my first game with Torque2D and have not fully understood the difference between "Class" and Datablock. To me it seems like ...
1
vote
1answer
102 views

Data model for unlockable card collection

My game has a collection of cards (about 64) that are unlocked (one by one) provided that 4 items are collected/gained in the game. Right now the deck of cards is modeled with a plist file, like ...
-4
votes
2answers
403 views

Read only array, deep copy or retrieve copies one by one? (Performance and Memory) [closed]

The question is asked regarding an environment with garbage collection.(Java, AS3) I am writing a level editor using MVC and the view needs to have read only access to the data in the model for ...
2
votes
2answers
2k views

Game Database Connectivity Java

I'm developing a simple multi-player puzzle game in Java. Both players should be able to view the same game board on his own computer. Then, when one player makes an action in the game (ex. drags an ...
2
votes
2answers
3k views

Data structure for bubble shooter game

I'm starting to make a bubble shooter game for a mobile OS. Assume this is just the basic "three or more same-color bubbles that touch pop" and all bubbles that are separated from their group fall/pop....
2
votes
1answer
155 views

How can I correctly manage different utility classes between engine and libraries?

I'm currently building an engine over SFML and Box2D. The problem is that each of these use different types for things like Vector2, etc. So to the question: is it a good idea to replace Box2D and ...
2
votes
1answer
1k views

Object detection in bitmap JavaScript canvas

I want to detect clicks on canvas elements which are drawn using paths. So far I have stored element paths in a JavaScript data structure and then check the coordinates of hits which match the element'...
2
votes
2answers
803 views

Best practice for designing a risk-style board game

I'm just trying to figure out how to set up the code for a game like risk... I would like it to be extensible, so that I can have multiple maps (ie- World, North America, Eurasia, Africa) so ...
8
votes
2answers
3k views

Custom extensible file format for 2d tiled maps

I have implemented much of my game logic right now, but still create my maps with nasty for-loops on-the-fly to be able to work with something. Now I wanted to move on and to do some research on how ...
7
votes
1answer
629 views

Settlers-like terrain representation

Remember this beauty? I'm playing it now on my old Amiga 1200. My question is: How do you think they represented the terrain, data structure wise? Obviously it's some kind of points, with a height. ...
1
vote
1answer
501 views

What data structure should I use for a 3D platformer game? [closed]

I am developing a platformer game with the XNA framework, like "Metroid", but in 3D. I have to draw models, and I have the question of the title. I read many posts, and I know that the main data ...
2
votes
1answer
730 views

Which data structure should I use for dynamically generated platforms?

I'm creating a platform type of game with various types of platforms. Platforms that move, shake, rotate, etc. Multiple types and multiple of each type can be on the screen at once. The platforms will ...
0
votes
1answer
281 views

Design patterns for effects between actors and technology [duplicate]

I'm working on my first game, and taking the opportunity to brush up my C++ (I want to make as much of it as portable as I can.) Whilst working on the technology tree and how it affects actors (...
3
votes
1answer
1k views

Tic-Tac-Toe game AI

I'm looking into creating a simple tic tac toe/noughts and crosses game in Actionscript3 and am trying to understand the ideas behind the AI used in a game like this. I've seen some simplistic ...
0
votes
2answers
653 views

Storing and sending English word list using trie data structure

I was planning on making a word based game something like Scramble or Boggle. I searched on the internet and found that one of the best way to store the Word List is by using a trie. My question: Is ...
0
votes
2answers
1k views

Game Logic - Tree Based Game Design

I'm trying to write an easy to use and extremely modifiable game engine in C++. I was thinking about using a tree to store game data. All objects would inherit a from the Node class and would have ...
-4
votes
1answer
379 views

Database structure for level packs, levels and level information

I have a game which shall consist of several level packs (and also be extended by additional level packs). Each level pack should contain some levels. Each level will have its own level information. ...
1
vote
1answer
2k views

game data structures

I am working on a game that will be a 3D-shooter (camera trailing player), and want to impose some architecture on the game being that a level is composed of ...
3
votes
1answer
992 views

Storing game objects with generic object information

In a simple game object class, you might have something like this: ...
10
votes
3answers
658 views

How to add a sound that an enemy AI can hear?

Given: a 2D top down game Tiles are stored just in a 2D array Every tile has a property - dampen (so bricks might be -50db, air might be -1) From this I want to add it so a sound is generated at ...
1
vote
2answers
323 views

How to track and find entities within radius in realtime game?

What is best approach to implement tracking in real time for, say, 1000 npcs? Every frame update simple a square grid (remove or insert into linked list) and every time check in square radius? I tried ...
4
votes
1answer
502 views

How does Starcraft 2 load its metadata?

Lets say you are playing Starcraft 2 melee map. The game loads the map. Melee maps have the following dependencies: Liberty (Mod) Liberty Multi (Mod) I think the game engine will load the data from ...
2
votes
2answers
141 views

A decent design for handling large creation/deletion of random objects?

So I was attempting a 'Hit the X' game (e.g Toss the turtle, spank the monkey) in which an uncontrollable object travels across the screen in hopes of hitting certain objects and avoiding others. My ...
12
votes
1answer
2k views

How to represent cliff faces in terrain?

I'm trying to figure out the best way to programmatically represent terrain in my game. I've been considering using a heightmap (or grid of evenly spaced vertices) to represent the surface of the ...
8
votes
6answers
1k views

How can I store all my level data in a single file instead of spread out over many files?

I am currently generating my level data, and saving to disk to ensure that any modifications done to the level are saved. I am storing "chunks" of 2048x2048 pixels into a file. Whenever the player ...
9
votes
3answers
6k 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 ...
1
vote
2answers
1k views

Which data structure to use to render a large isometric game world?

I'm starting development of a 2d isometric (tiled, roguelike) game and I'm brainstorming which kind of data structure I would use to store runtime data like tiles and entities, but I don't want to use ...
1
vote
4answers
855 views

Is there an in memory data store that is feasible for real time, non-networked games?

I would like to know if anyone has recommendations or experience with using an in memory data store for a real time, non-networked game. This is not necessarily for loading levels or saving data, but ...
14
votes
4answers
5k 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 ...
4
votes
2answers
193 views

What is the best way to store temporary selected characters and their insertion order?

I'm developing word game, similar to "Word Mole". I'm having a hard time determining how to store temporarily selected characters, which in turn, will changed into a word. For example, say, I have ...
7
votes
2answers
9k views

Quad Tree with a lot of Moving Objects

I have a Quad Tree implementation that is very useful for what I am trying to do. My problem is that when my viewport has a lot of objects, the Update for the Quad Tree takes a very long time. It ...
2
votes
1answer
148 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 ...
5
votes
1answer
1k views

Is using a half-edge mesh structure feasible?

Is it feasible to use half-edge mesh, in games, instead of vertex-face structure? What comes to my mind is that it could be useful in mesh simplification (dynamic level of detail). However, I'm ...
9
votes
2answers
1k views

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

I'm making a tile engine for top-down 2D games. 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 best: each ...
3
votes
1answer
904 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 ...
18
votes
2answers
4k views

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

.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: ...
0
votes
2answers
700 views

How do I organize my class structure for networking?

In my gameclient I have the following classes(compontents): Game, GameScreen, GameWorld, Player. They are structured like this: Game has two GameScreens: MenuScreen and MainScreen. MenuScreen has an ...
7
votes
4answers
1k 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 ...
27
votes
4answers
8k views

Is there a 3D equivalent of hex tile maps?

Probably the biggest advantage of a hex-based versus square-based map tiling is that the center of each hex has the same distance to all its neighboring hexes. Is there a similar shape that tiles this ...
11
votes
3answers
25k views

How can I implement fast, accurate 2D collision detection?

I'm well aware of how to detect if two or more 2D objects collide but I'm interested in how to decide whether to check for a collision. In previous projects, I just had every object check against ...
8
votes
2answers
279 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 ...
10
votes
3answers
2k 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 ...
18
votes
4answers
16k 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 ...
3
votes
1answer
435 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 ...
9
votes
1answer
1k 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 the ...
10
votes
2answers
2k 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 ...
8
votes
2answers
1k 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
463 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 ...