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.
311 questions
0
votes
1
answer
91
views
Triangle data structure not working for LoD algorithm
I would like to implement a LoD algorithm to my 3D game in order to simplify meshes at certain distances from the player. My meshes are created / loaded using a VBO, so the vertex data is stored in a ...
2
votes
2
answers
332
views
Manually creating cycles in planar, procedural trees?
I am creating a procedural map using delaunay triangulation and an MST. I'd like to have a bit more control over my final graph. Like when i was looking looking at the MST I wondered how I can connect ...
2
votes
1
answer
178
views
How to deal with a many to many relationship between objects
In my game, I keep a list of all clients currently connected to the server and a list of all actors in the game. Each actor is "relevant" ( currently replicating ) to 0 or many clients, and each ...
0
votes
1
answer
146
views
a shader type class in c
Is it possible to setup something sort of like a class in C++ but in c in the simplest terms? I want to avoid using c++ but I would like to create a simple struct that has glsl shader program.
for ...
1
vote
1
answer
452
views
Finding the "Important" nodes of a grid path
On a Navmesh Grid, all nodes are essentially vertices or turn-points so the returned path is efficient in that it only involves points where an entity must change its direction.
A grid path, however, ...
1
vote
2
answers
1k
views
How to make "Events"/ Scripted Scenes
I want to make cutscenes etc, in my game.
I thought of a similar System like in the RPG Maker:
If you enter a certain Area, a list of commands and arguments is played.
E.g. like this:
[Move Object:...
1
vote
1
answer
886
views
Efficient container(s) for units in an 2D RTS game
As the title says, I'm toying around with developing a 2D space RTS game. All of my units are spaceships that basically just shoot at one another, but they have to do a variety of other things as well:...
1
vote
3
answers
1k
views
How can I store a large amount of items in a space-efficient manner?
How can I store a large amount of items inside my game?
Are each of the items default data be loaded from a file into an item class and then stored in a giant array/list/dictionary?
For a point of ...
0
votes
2
answers
546
views
Efficient Collisions Iteration?
My project has upwards of 3000 2D objects but not all of them collide with each other. Between each object that can collide, a CollisionPair is created and stored inside a flattened array.
Currently, ...
3
votes
2
answers
3k
views
Efficient removal and adding of Components in ECS
i'm working with the Ashley Entity-Component-System (related to libGDX) to program a server-side simulation for an online game and i stumbled upon a serious performance drawback, that is probably ...
9
votes
1
answer
5k
views
Why are 16×16 pixel tiles so common?
Is there any good reason for tiles (e.g. Minecraft's) to be 16×16?
I have a feeling it has something to do with binary because 16 is 10000 in binary, but that ...
0
votes
1
answer
301
views
How can I store additional attributes on DCEL edges?
I am currently working on a city generator, and I've ran into some issues with data storage while working on the roads. I currently use a doubly-connected edge list (DCEL for short), to store the road ...
3
votes
1
answer
737
views
Structure for attacking in RPG
I'm going over different ways to implement attacking in a "dungeon crawler".
What I have kind of abstracted out...
There are 2 kinds of people, The Player, and the enemies, these are both living ...
-1
votes
2
answers
121
views
How to make a proper cache on user computer?
Currently when launching the client of the game, it connects to the server and loads all the cachedata in a normal form (= folders, .txt files and .png files). However I don't like that the players ...
1
vote
4
answers
3k
views
Class design and data structures for a Tower Defense
I was trying to come up with a structure for a simple TD game that has following elements
Tower
Each Tower has a set of properties like range, damage, health etc
There could be different types of ...
1
vote
2
answers
1k
views
Bubble shooter clone, structure for storing/adding of bubbles
Im having a few issues trying to figure out what the best data structure to use for storing bubbles on the grid, and how to connect new bubbles to the grid when a moving ball collides with a ball on ...
3
votes
1
answer
215
views
Planar scene graph
Suppose there are many line segments on a plane (2D scene) and I would like to redraw only small portion ("window") of the whole scene. The scene is dynamic, meaning one can add/remove/transform lines....
3
votes
2
answers
7k
views
Storing Type/Game Data Within A Unity 3D Game Using An Offline Flatfile Database
I've read several documents on how to manage game type data:
Would it be better to use XML/JSON/Text or a database to store game content?
How to choose how to store data?
Im developing an offline ...
1
vote
2
answers
423
views
Organizing scene graph nodes that have multiple parents
I am trying to understand how, from an abstract sense, scene graphs should be organized.
Say that in a game, there is a scene where the user is inside a house. The house has four walls, and on one ...
1
vote
2
answers
512
views
Encoding/decoding data with byte arrays
For my multiplayer game, I'm trying to figure out a system to send multiple pieces of data from one client to another and separating pieces of data.
When sending a message, all parameter data has to ...
23
votes
3
answers
4k
views
Command Ordering Architecture of Dwarf Fortress
What is the most elegant way to implement a command ordering system for AI? for example in dwarf fortress when you mark a forested area for wood cutting, the dwarfs then would do the following ...
3
votes
2
answers
653
views
Is std::deque the best option for storing my graphics objects?
I am currently implementing an object buffer, which stores all the objects used in the game at one place. All other components of the game, like the user interface, the level loader, etc, add objects ...
1
vote
1
answer
252
views
Place tile values over 'chunk' boundries
My game has a 'chunk' engine similar to Minecraft's but in 2 dimensions.
Each chunk is a square of 32 by 32 tiles.
What I want to do is generate a defined shape across multiple chunks without ...
2
votes
2
answers
261
views
MeshParts - Why do they exist?
For my current game I'm working on I've decided to implement a custom model class to store my models in. Reasons being is that I want to make adding new models as painless as possible for the rest of ...
2
votes
3
answers
283
views
How to convert non-discreate data for discreate pathfinding?
I have a list of entities that looks like [{x,y,width,height}, {x,y,width,height}, ...]. This list is non-discreate, It doesn't follow a grid. entities can be ...
0
votes
0
answers
203
views
Data structure to store map layers in each Tile while keeping the order of terrain, items and monsters intact
My game represents its map as a 2D array of tiles, each of which stores a stack of layers. I'm looking for a data structure to efficiently represent this .
I want to be able to add layers dynamically,...
1
vote
2
answers
4k
views
How should I store edge weights for my A* graph?
I am working on A* pathfinding in Unity, using C#. I am implementing Dijkstra's shortest path algorithm. I have a Dictionary with nodes as keys and corresponding ...
1
vote
1
answer
440
views
How to handle game objects in DirectX
Coming from XNA, I would use the content pipeline and create XML files for game objects. However, if I changed something in the XML, I would need to do a rebuild of the project so it will create the ...
-1
votes
2
answers
93
views
Word for a relationship specifying that 2 objects don't affect each other
I am aiming to create an Enum for a terrain_surface_layer.type property. The 3 types of terrain_surface layers I wish to implement are the following:
Single - only a single type of terrain_surface is ...
1
vote
3
answers
1k
views
What datastructure would you use for a collision-detection in a tilemap?
Currently I save those blocks in my map that could be colliding with the player in a HashMap (Vector2, Block). So the Vector2 represents the coordinates of the blog.
Whenever the player moves I then ...
1
vote
1
answer
967
views
Data structures for territories in a 2D map
I am diving into game development with a 2D game. The game will display a territorial map (borders, capitals, etc.).
What is a common data structure to use for storing and manipulating the data in ...
1
vote
1
answer
1k
views
Animal Crossing-like Map Data Structure
I've been looking closely at how Animal Crossing (for GameCube) creates town maps, and as far as I can tell, it's something like this:
The town is made up of a 5x6 grid of acres. Each acre is 16x16 "...
0
votes
1
answer
186
views
Array of map data
I'm looking for your thoughts on the best way to store map data.
I need to store data for territory ownership for each pixel on the map.
The data for each pixel is as such:
...
0
votes
2
answers
4k
views
What are some ways to store level data in a game like Gunpoint? [closed]
Gunpoint is a 2D stealth game available here. I was wondering how you might go about storing level data for a game like this. I'm mostly concerned about how the collision detection is saved. There are ...
2
votes
1
answer
1k
views
How should I store grid-based character inventories in the database?
I used to encode the whole inventory data into binary but I'm thinking of doing something different now.
The inventory has a 64 slots in an 8×8 grid. Large items like weapons fill up 6 to 8 ...
2
votes
1
answer
3k
views
Best way to store a large amount of game objects and update the ones onscreen
Good afternoon guys! I'm a young beginner game developer working on my first large scale game project and I've run into a situation where I'm not quite sure what the best solution may be (if there is ...
0
votes
1
answer
124
views
assets access with index offsets
My question if about resource management.
Is it a good idea to store resources like Sounds in an array and then make a second array(lets call this SoundCollections) as a sort of reference table(name + ...
23
votes
1
answer
38k
views
How to edit key-value pairs (like a Dictionary) in Unity's inspector?
I have a spell system I am creating, the principle is as follows:
Each spell is an autonomous prefab. It contains a script with some properties (base damage, duration...) that can be modified in the ...
2
votes
1
answer
685
views
Dynamic Quad/Oct Trees
I've recently discovered the power of Quadtrees and Octrees and their role in culling/LOD applications, however I've been pondering on the implementations for a Dynamic Quad/Oct Tree.
Such tree would ...
1
vote
0
answers
777
views
Big game in Flash - how to create levels structure
I'm building a game in Flash similar to the structure of Angry Birds or Cut the Rope (where there are a number of "rooms" and unique levels created within each "room").
The user gets through the game ...
6
votes
2
answers
1k
views
How do I simplify terrain with tunnels or overhangs?
I'm attempting to store vertex data in a quadtree with C++, such that far-away vertices can be combined to simplify the object and speed up rendering.
This works well with a reasonably flat mesh, but ...
2
votes
2
answers
1k
views
In MySQL, how would I model moves that Pokemon can learn?
I'm making a Pokemon MMO Game with Unity + SmartFoxServer/MySQL. At the moment I'm creating the base structure for the database.
If you are not familiar with Pokemon Games, every Pokemon can learn ...
0
votes
1
answer
244
views
Possibly a more efficient way to structure my game's map?
I need a little help with structuring my map. I want to make it efficient but I'm not sure if there's a better way to do this:
...
2
votes
2
answers
2k
views
Is any data structure more efficient than quad-tree for storing and querying points that lay within an OBB?
Is there any method more effective than quad-trees for storing and searching sets of points that are not spread uniformly on the plane?
I need to be able to add, remove and search for points that are ...
0
votes
1
answer
697
views
Player & Level class structure in 2D python console game?
I'm trying to create a 2D console game, where I have a player who can freely move around in a level (~map, but map is a reserved keyword) and interfere with other ...
5
votes
2
answers
6k
views
How do i define array in shader's constant buffer with C#?
I am using SharpDX to render 3D graphics and i cannot get to work constant buffer in my shader since it contains an array. Currently it looks like this:
...
0
votes
1
answer
613
views
Data structure fo a ship like in Faster Than Light
I am wonder me, whats the best data structure for a ship like in FTL.
At first I thought its easy and I need only to make a array with the rooms(Tiles).
But than I noted, that I must put somewhere the ...
3
votes
2
answers
2k
views
Alternatives to storing all my entities in an SQL database
I've been trying to build my entity system based on pure SQL data storage as explained in this post series. The idea is that every entity or component is stored in an SQL table. I created my framework ...
1
vote
1
answer
1k
views
How to store generic data in game database?
To clarify things a bit:
I want to create a kind of database for my game, that simply is a class that stores all game-state information like object positions, player scores, etc.
The main problem I ...
0
votes
2
answers
1k
views
How to store tiles with different sizes?
in a tilegame, how can we use several tiles for 1 object?
I thought I could add each tile in a json file, with the type and its coordinates, like :
...