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
0
votes
1answer
1k views

Is there a reason to inherit both generic and non-generic version of an interface? [closed]

I've just gotten into some C# programming and decided to expand my knowledge of how games are made in C# by looking through some open-source frameworks. While doing this I noticed something very odd; ...
3
votes
1answer
928 views

How to design a Skill/Monster/Item etc. dictionary for a game?

I am trying to build a turn-based RPG where party members and enemies can cast skills and use items. How could I implement a modular list of skills/items/monsters (and maybe character classes, if I ...
0
votes
2answers
194 views

Relational Databases vs XML vs public static finals: Pros and Cons [closed]

I'm working on a game (single player, metroidvania type, Java) and I'm torn as to how data should be stored. For example, monster stats, dialogues, flavor text for weapons, gear stats... there is all ...
2
votes
1answer
518 views

How can I build a data structure that will persist across saves/loads in GameMaker version 8.1 and earlier?

I wish to build data structures such as trees, linked lists, graphs, stacks, queues, etc. in Game Maker. However, the concept of object in Game Maker Version 8.1 and older does not have a reliable ...
-1
votes
2answers
126 views

How do I convert data from a custom editor to a static data structure for use in-game?

I have created a custom editor to allow me to structure data regarding "actors" in a scripted dialogue. This allows me to conveniently store information about how that "actors" dialogue should be ...
0
votes
1answer
199 views

Three levels deep composition (player<-character<-spell), with preset character+skill sets

So I'm creating a rather generic strategy game similar to Warcraft or League of Legends, which needs to have: a Player class for representing the users playing the ...
0
votes
1answer
241 views

How to implement Boids steering efficiently? (ie. find nearest neighbours of moving entities)

As I understand it, modern pathfinding uses ideas such as Boids steering on top of traditional A* and Dijkstra's algorithm. It's easy to find recommendations for implementing Dijkstra's algorithm ...
1
vote
2answers
941 views

Where and how to store players collection in a computer card game?

I am developing a trading card game ( something like Hearthstone but not as complex) and I am faced with the following problem: I don't know what is the optimal way to store players collections and ...
1
vote
1answer
329 views

How to structure a non rectangular maze

I have built a few mazes and are familiar with maze algorithms however all examples I have learnt from are square or rectangular. In these mazes the code structure usally has a 2d array of maze cells ...
0
votes
3answers
141 views

How to make compound data in Game Maker?

In other languages, such as Lisp, there is such a thing as "compound data", where several variables are grouped together. For example, if I want to represent an orbital that rotate around the player ...
1
vote
3answers
150 views

Most efficient way to determine if an entity is in a player's field of vision?

So I'm creating a real time multiplayer game.. and I only want entity data to be sent to a user if it's in their field of vision + a little more. (It's third person so it would be a giant box around a ...
0
votes
1answer
626 views

Appropriate data structures for large item database

I'm currently building an RPG Game and as such I intend to have a lot of items. In my current system I have a database of items stored in a JSON file which I read and then store the items in a generic ...
1
vote
2answers
106 views

What pattern is used to render tiles?

I want to render a tile-based map and I am not sure which class structure to use to keep logic and rendering separeted. My class structure so far on the logic side: One abstract parent ...
0
votes
0answers
66 views

Choosing a data structure for a group of static (almost) thousands of objects on HTML5 canvas

I have this requirement to implement a data structure for a group of thousands of displayable objects, on HTML5 canvas. Something like a particle system. The objects are randomly spread on the map. ...
1
vote
1answer
149 views

How do I use data-orientated programming without object-orientated programming?

I have been reading many resources about data oriented programming, and one thing I understand about it is that it's about keeping chunks of memory together to improve performance. Other than that, I ...
0
votes
2answers
925 views

Flipping Textures in Modern OpenGL

How do I flip a texture in modern OpenGL (3.1+)? This is the unflipped render, keep in mind it is drawn with 8x8 tiles from a texture atlas, so I edited green squares below him into the image to ...
0
votes
1answer
160 views

Best way to add and remove quads in a VBO?

What's the best way to handle adding and removing 2D sprites (quads) in a VBO? I am working on a mobile board game and sometimes game pieces (represented by quads graphically) need to be added to or ...
3
votes
0answers
62 views

Representing a high-resolution deformable solid in 3D

I am currently working on a design that will incorporate an object that can change size and shape. For an example, I'll use a brick of clay. It starts out with normal dimensions of 1"x3"x6", but that ...
0
votes
1answer
107 views

How do I manage monster tables and item databases in my Android game?

To learn more about AI during combat, I made a demo in Unity where a player would fight a creature in an arena. I started here because I plan to implement the system I'm working on in another game. In ...
1
vote
1answer
156 views

Barter system data type

My game has 4 supplies, Gold Wheat Iron Fuel, a player is allowed to select a supply to trade and what supply to receive from merchant NPCs. Currently, when the ...
1
vote
2answers
115 views

How do I handle loads of (prefab?) objects in Unity2D/3D?

I have been looking around for information regarding this process but I was unable to come across anything that would help me out. Basically, in a game where you may have many items or enemies or ...
1
vote
1answer
29 views

get value from UniformParameterPtr in Ogre

I have a variable of type UniformParameterPtr decalared by Ogre and I want to get its value. What is the right way to this? I ...
1
vote
1answer
37 views

Having trouble with constructors and the deque class [closed]

I've recently been trying to make a better version of my previous remake of the classic snake game by implementing data encapsulation and abstraction. I also decided to replace my horrible choice of a ...
0
votes
1answer
79 views

Feasibility of nested voxels

Out of curiosity, does anyone know how feasible it would be to have a voxel engine that allowed for voxels within other voxels? For example, you would have the usual chunks filled with voxels, but ...
1
vote
1answer
562 views

Data Structures for Game State

I'm writing my first game. It's an adventure-RPG in the style of Starflight. I'm thinking about how to represent game state. There are three obvious parts of game state: dialog, combat, and story/...
1
vote
2answers
131 views

Difficulty with linked lists in drawing

I've recently started game development in C++ and decided to make an ASCII based snake game. To hold the values of the snake tail I decided to use a linked list due to its flexibility when it comes to ...
2
votes
2answers
250 views

What kind of data structure to use for planetary populations?

I am in the process of building out the prototype for my space strategy game, which is focused on empire building type gameplay. One of the most important elements of the game are the various planets ...
1
vote
1answer
86 views

How to change a class's variables at runtime without knowing in advance which class's variables to change?

I am creating a nuclear war simulation game a bit like Defcon if any of you have played that. In the game you can chose one of several regions to play as and in my game I want each region to have ...
0
votes
1answer
943 views

Saving Information in Byte[]

sorry for the unhelpful title. I'm trying to understand how to convert information to bytes so that I can save it using Google's Saved Games feature that comes with Play Services, as explained here. ...
1
vote
2answers
703 views

How can I architecture the cards and boards of this board game?

I want to create a board game (at least it's structure and engine, not the graphics), and since It's the first time I do this I don't know where to start. It's a turn based strategy card game where ...
1
vote
0answers
131 views

Database design

I have a Ship class, into which components can be added which change the performance of the ship. The question is regarding modelling this. My first approach essentially was an EAV approach (a ...
3
votes
1answer
1k views

General Octree question: What do you actually store?

Ok, So I'm experimenting with various terrain generation methods, primarily in Unity, but i'll admit to not use all its features because I started learning about Game Dev in XNA YEARS ago. So, I made ...
32
votes
5answers
7k views

Use an instance or a class for game resources (wood,iron,gold)

So I'm making a game where you can send ships to locations to sell or buy resources like wood, iron, gold, etc. Now I was wondering how the resources should be created in de game. I came up with 2 ...
4
votes
1answer
332 views

Data structure to store breakable parts of a mesh

I have a wall mesh that is divided into destructible pieces. As it gets destroyed, the wall can collapse into separate objects with physics that can be destroyed as well. (Cut the wall in half ...
0
votes
2answers
143 views

How to program destructibles?

I'm thinking about programming a 2d simulation of a spaceship that takes damage depending on where the projectile came from (e.g. from behind - engine, from the front - lasers, sides - hull, etc.). ...
1
vote
1answer
3k views

How to handle interaction with the map in a 2D-RPG-typed TileMap?

Sorry if this is a long post, but I'd like to explain the context before asking my question ^^" I'm currently working on my "first" game (the more advance one, at least). It'll be a 2D-ARPG where the ...
2
votes
2answers
190 views

C++ Data structure pattern preferability?

So im looking at ways of handling large amounts of data in situations such as an entity manager or particle system. So i have concluded to use an object pool, and there are two things that I could do ...
2
votes
1answer
1k views

Ability/Skill Data and Method Structure (C#, Unity3D)

So I've come to design my game which players will be having a unique set of skill or ability to come with. I can store skill name, mana cost, cooldown, etc in database which each skill have in common, ...
1
vote
0answers
172 views

What is the most efficient way to store world data for a 2D tile game? [closed]

I'm working on a 2D tile based survival game for my programming class and as I was working on GUIs I realized that I would need an efficient way of storing and recalling not only the tile data and ...
0
votes
1answer
98 views

design / data structures

I'm working on a game which I'm writing in Javascript and then porting to iOS/Android via phonegap/cordova. For the most part, I understand how to code and how to get what I want to happen, BUT I ...
2
votes
1answer
2k views

2D infinite grid data structure

I'm currently developing a game, and I'm in a process of experimenting with various data structures to support my game model and simulation. Here are some of the requirements: Grid structure where ...
2
votes
3answers
2k views

Managing data for large number of levels in Unity?

I am making a Unity game vaguely in the vein of Candy Crush Saga for a client and am moving in circles trying to decide how to manage the data for all of their levels. In brief, they want to divide ...
2
votes
2answers
4k views

Tile base Farm Simulation in Unity

I am thinking of creating a sprite base 2d top down farm simulation game. The game uses tiles and I was wondering (conceptually) what is the best way to handle the farm tiles. Each tiles should have ...
1
vote
1answer
766 views

How do I correctly shift arrays on a Tetris line clear?

I'm writing a Tetris clone in C++ and I am at the last stage, I need to delete a row when it is full. Once a piece falls it is stored in a boolean array grid[20][10]...
1
vote
2answers
90 views

Translating a world position to an array position

Lets keep this simple, so, assuming I have an array like this ... var array = new bool[10,10,10]; .. and then I have a start and end vector3 ... ...
1
vote
1answer
1k views

About HLSL array packing policy

This is not a question but a confirmation if I'm correct about the behavior of HLSL arrays. I'm working with a standard lighting vertex shader, HLSL plus C++, DirectX11.1 API. For storing my lights ...
0
votes
2answers
3k views

how to check if an array element is defined? (Game-maker studio)

The code is this: if is_undefined(A_SA[V_X,V_Y])=false and A_SA[V_X,V_Y]=0 { //actions from the "if" statement } The error message is this: ...
1
vote
1answer
44 views

How to give a value to all elements of an array?

This problem is encountered in Game-maker studio: I created an array using the following iteration: ...
0
votes
1answer
813 views

Why do KD trees put the median split exactly on a point?

I've understood that KD tree split points using the median while cycling on each axis. I've also understood that at each node traversal, a nearest search must use a sphere to store to nearest neighbor ...
7
votes
1answer
1k views

Component arrays vs. entity structs? [closed]

Two of the main systems I've seen in entity system tutorials are: An Entities class with one array / [hash]map for each component, with indices corresponding to ...