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
2answers
48 views

How to store a Transform[,] grid in an ArrayList?

I am new to Unity game dev and trying to expand my knowledge of data structs. I'm building a match-3 game, and I currently have a multi-dimensional ArrayList holding transform coordinates on a grid of ...
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 ...
0
votes
1answer
508 views

Implementation a Prefix tree or Trie in Unity C#

I am trying to make a word game in unity. The game shall be an online game with 4-6 players. The gameplay is somewhat like this: Suppose 4 players are playing the game- p1, p2, p3, and p4. All ...
3
votes
2answers
116 views

Is there a generic name for the “layered” dictionary typically used in mod-capable games?

I'm asking here rather than on SO/SE/CS because I'll probably have less to explain what I'm talking about... I hope a lot of the users here are familiar with how many games implement modding (or ...
4
votes
1answer
90 views

Data structure for collecting entities for instanced rendering

My game, a citybuilder, has many simple entities that rendered via glDrawArraysInstanced. A large city has over 600,000 entities, but most of those entities are one of a few hundred meshes. Every ...
1
vote
1answer
90 views

What are some alternative options for saving level data for a game like Hurtworld?

For a multiplayer building/crafting game like Hurtworld (where the player can build structures on the map), what are some alternative options or example data structures for saving the world data on ...
1
vote
0answers
76 views

How can a system similar to Dwarf Fortress' legends mode be implemented?

In Dwarf Fortress, nearly everything that happens during world generation is logged and viewable in legends mode. An XML file containing that information can be exported and loaded into a utility such ...
0
votes
0answers
25 views

UE4 double linked list and queue does not work with UPROPERTY() macro

Could somebody explain why Unreal's TDoubleLinkedList and TQueue (and maybe some other containers, I'm not sure) does not want to compile with UPROPERTY() macro? Without macro all is OK. However, the ...
0
votes
0answers
15 views

How to handle grid based collision detection when one entity spans multiple grid cells?

While I do like the idea of quadtrees, I feel that they would be overkill for my game. So I want to use a simple fixed resolution grid for AABB collision detection. But I can't come with a cheap way ...
0
votes
1answer
36 views

Behavioural Items with ScriptableObjects

My game has an item system that is relatively small compared to most of the RPGs, but it is pretty similar to the games like Half-Life and Counter-Strike where you have an inventory consists of ...
0
votes
0answers
31 views

Efficient system to reach the “parent” variable

I've been stuck doing this in a very inefficient way and really want to know if there's some design pattern that solves this because it seems like a pretty common problem to have. I have a system ...
0
votes
0answers
88 views

How to organize objects in a tile-based game

I'm currently developing a tile-based RPG from scratch using C++ and SFML2. So far, I got the map rendering and collision detection working just fine and in a clean, maintainable way. The next step ...
0
votes
0answers
13 views

Filter data in scriptable objects

I have imported data from a csv file into a scriptable object. The scriptable object is made up like this. ...
0
votes
0answers
34 views

Help deciding data structure for spatial partitioning, using only value-types in c#

I simply want to implement some sort of grid where I can sort units in an RTS into cells, and then for each unit check to avoid other units and attack other units, in 2d. My map grid is currently 10 ...
1
vote
1answer
70 views

How to handle data for a competitive multiplayer games

I am kinda new to Multiplayer Games and I am really wondering how I should handle my data Should each player send and update their data to the database (server) everytime one of their essential ...
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.). ...
0
votes
1answer
75 views

Json Libgdx serialize / de-serialize a Object Map of Object Maps

Any one have any ideas on how I can serialize / de-serialize an ObjectMap<Enum, ObjectMap<String, Object>>(); (Object is usually a String Integer ...
0
votes
1answer
119 views

Good data structure for storing graph-like map

I'm creating a strategy-based kingdom expansion game, where you start with one city and try to expand as far as possible from there. All the cities fit on a hexagon-grid and are connected by the edges ...
0
votes
2answers
97 views

Querying game objects in real-time

I'm thinking about working on a game where I need to find all the objects matching certain properties. For instances I might need to look up all the objects... Producing gold. Whose level is 5 or ...
0
votes
2answers
109 views

Formatting Unity data for communication with a REST API

I am pretty new to unity but I am not new to programming. I am building a Hololens application in Unity 2017.2 and it communicates with a REST api that I built. I am using Unity as a front end more or ...
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 ...
0
votes
1answer
61 views

How do I keep historical variable value tied to certain period of time?

I'm currently trying to figure out how I can keep ever-changing variable values and make it available for other classes to access the said variables. In my example, I have the following: ...
3
votes
2answers
432 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 ...
3
votes
2answers
6k 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 ...
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
0answers
34 views

Best data types for DNA, edibles and creatures

So I am making a sort of continuous evolutionary system in the Unity3D engine. Currently I have a DNA class that has values that gets applied to a Creature object on initializing e.g.: ...
0
votes
1answer
124 views

Is it possible to customize the Scriptableobject inspector for Simple level data, without the use of PropertyDrawers?

I've invented an innovative, new game mechanic for Bricker Breaker Quest and want to create a quick prototype to recruit a game development team. After wasting a week researching the best way to ...
0
votes
2answers
3k 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 ...
6
votes
3answers
391 views

How to store relations between NPCs?

For an RPG I want to generate a world with lots of NPCs, and the NPCs all have relations to eachother. They can be eachothers parents, children, siblings, friends, bosses, lovers, lieges, vassals, etc....
19
votes
2answers
25k 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
1answer
154 views

How can I avoid writing a class for each of my 800 different items?

I have a webgame written in PHP and using MariaDB for the database. I'm currently looking into ways of improving core systems. One example would be items. Currently, there is a table ...
0
votes
0answers
72 views

Unity: Get excel type data from an html website

So is there a way that I can use an html page as a database? My end goal is to put everything into an excel sheet that the people I am making the application for want. I need to upload data from the ...
0
votes
0answers
69 views

How to organize data transfer between the client and the game server?

I have a game like minecraft, I can run, set and delete blocks. The world consists of a limited set of chunks. I want to write a server for it with the help of a library called boost asio. I need help ...
0
votes
1answer
70 views

Sequencing / triggering messages based on conditions in an adventure game

I've been struggling conceptualizing the best way to make a level flow with dialog and help hints changing as you play etc. Imagine your goal is to make this one screen 'adventure' game, where you ...
1
vote
3answers
790 views

How to efficiently store a large amount of data?

I am doing minecraft-like game. I have a limited world in size 32x16x32 chunk. Each chunk is a structure in which there is a three-dimensional array containing the values ​​of the blocks located in it....
2
votes
2answers
1k views

How should I store world data in a 2D grid sandbox game?

I'm just a beginner game developer and working on my own first project (beyond copying other games for learning skills). Because I really like sandbox games (like Minecraft, Rimworld, Terraria etc..),...
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
438 views

Running a scene in the background

I've made 2 scenes where a room is another scene and the other is the outside of it. But whenever I do something in either scenes, and enter the other, it resets everything I did in the first one. I'm ...
0
votes
1answer
1k views

How do I allocate to a C# dictionary having a string key and an integer 2D array or transform for value?

I'm working in C# on a Unity 2D game that spawns a shape that has only one correct landing place. There are 7 basic shapes but the component 4 squares of each shape are unique, with each bearing, say, ...
1
vote
1answer
40 views

Tiledata management

I've been trying to create a grid-based open world game. In order to do that I've decided to create a personal map editor. The problem I've encountered is handling data because of the actual data size....
2
votes
2answers
128 views

How to better refactor loops in procedural world generation?

One of the steps for cell-based dungeon generation is deciding the amount and location of exits for each room. My current set up consists of the following: Define my exits. There are 15 types of room ...
0
votes
1answer
102 views

C++: Setup the basic Update function in different classes which all derive from GameObject

Im working on a little game-framework in c++. Currently i have a (base)class called "GameObject" from which all future in-game objects will derive from. Class enemy will be ...
1
vote
2answers
141 views

Simulating an aging population

Introduction: The main idea is to "classify population as they age". Let me further explain it with an example: Example: There are 50k population (we are not going to care about if male or female ...
0
votes
0answers
276 views

How to set up a Quiz game with multiple types of questions? (Structs and DataTables)

I am looking to integrate a quiz mode into a game I am in the process of developing in Unreal Engine 4. I'm really just kind of stuck on how to set up my data structures and not really know the way to ...
4
votes
7answers
3k views

Benefit of using Vector2 data type over separate x & y variables

I'm really curious about why a lot of people and game engines use Vector2 as its coordinate system instead of the traditional x and y value. Is there any benefit to this? I feel like it's just slow ...
0
votes
1answer
196 views

Creating a Nations Stockpile

If I created different XML files for each Nations' Stockpiles and made an XMLmanager to do updates such as resource consumption and trade, wouldn't that be too much resource intensive? I mean, if I ...
1
vote
1answer
51 views

Data structure for a body

I'm writing a game in Java and am struggling to think how to appropriately manage character's bodies. My current structure is, in relevant part: ...
3
votes
2answers
684 views

Appropriate Cache Friendly Associative Container For An Entity Component System

The intro to this problem is a bit of a long one so my apologies in advance. In short I am asking for suggestion as to what type of collection I should use to store data for a particular part of my ...
0
votes
1answer
172 views

Rotate a ds_grid 90 degrees in GMS2

I need a function that allows me to rotate a grid data structure an arbitrary number of times 90 degrees clockwise. Currently it doesn't appear as though the function has any effect on the ...
1
vote
2answers
178 views

Voronoi graph - traversing from vertex to vertex

I'm working on a Unity Project in C# I've built a 3D Voronoi Diagram using the csDelaunay library from PouletFrit and using the X and Y values from a 2D diagram to instead setup some Vector3's with ...

1
2 3 4 5 6