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
0 answers
32 views

How to separate player state on shared object?

I'm new to game dev and I'm learning about quadtrees for planet rendering. I'm curious on how do I separate player state with quadtrees. For example I have a ship A that's getting close to a planet, ...
user avatar
0 votes
1 answer
139 views

How do I cast a float4 to a float[4]?

I've a RGBA16F texturecube for 4 pointlights shadows rendered in one pass. Each color channel stores the object to light distance for one pointlight shadow (e.g red channel is for light 0 and so on). ...
user avatar
  • 47
-1 votes
1 answer
90 views

Best way to save game in story game

In a while I plan to create a story game that would have different routes and endings and I was wondering what would be the best way to save a game of a game like this, if it would be a folder, ...
user avatar
  • 1
0 votes
2 answers
78 views

How would you structure a CSV file to load level data for a Match3 puzzle game

Am facing a bit of a problem regarding the structure of a CSV file that will be used to generate levels in a match3 game, my in-engine data structure is the following: ...
user avatar
1 vote
1 answer
60 views

How do I handle a non-hierarchical, referential network of game data?

I've been using JSON to store a lot of my game's data. I love it compared to my previous workflow. Having a human-readable hierarchy of arbitrary information is a godsend. My needs have grown more ...
user avatar
  • 33
0 votes
0 answers
47 views

TRPG data structure

I have this question since a while now. In a TRPG game like Fire Emblem or Advanced Wars (or even in something simpler like a chess game) with tiles and units, you need to store where each unit is in ...
user avatar
  • 105
2 votes
1 answer
186 views

How is data regarding items in RPGs and other loot-based games stored and implemented?

I am currently practicing game design and development by implementing singular (or a small set) of mechanics in Unity. For example, -- and this is relevant towards the end -- I've just finished a ...
user avatar
0 votes
0 answers
37 views

How to group a list of Vector2 points into Rects for more efficient storage?

I'm working on a fog-of-war system for a tile-based strategy game (e.g. Civilization), and I need to store which parts of the map have been revealed so the game can be saved/loaded properly. The ...
user avatar
  • 174
0 votes
1 answer
98 views

How to convert large grid data to easily saveable format?

I'm trying to recreate the grid system from RimWorld, and I'm facing an issue when having to save the map, which can be up to 500x500 tiles in size. My map has multiple layers, the base layer is ...
user avatar
0 votes
2 answers
874 views

What data structure do I use to store Archetypes in ECS?

I am implementing an ECS with "archetypes" similar to how they are defined in Unity: A unique combination of component types is called an Archetype. For example, a 3D object might have a ...
user avatar
0 votes
0 answers
28 views

Organising gameobjects into multiple lists

I have a very simple little game that consists of a player, zombies, food, and treasure. It's all automated. The player will walk towards a zombie and shoot within a certain distance, which costs ...
user avatar
0 votes
0 answers
21 views

Appropriate database schema for heroes' skills in a Tower Defense game? [duplicate]

In a Tower Defense game, each hero (or character) has some skills. Each skill has some "chance of appearance" (CoA for short) when attacking enemies and if appeared it has some "hit ...
user avatar
0 votes
0 answers
55 views

Where to store polygons and polygon animation?

I thought about making something with ApeOut graphics long before it came out and its release motivated me to try - I'm having tons of fun but I stumbled upon a pickle. I can imagine storing polygons ...
user avatar
  • 254
0 votes
0 answers
553 views

Loading external file data into Scriptable Object in Unity

I've been at this for two long days, trying to figure out a way to handle saving and loading data for a mobile puzzle game I'm working on. The game has level packs and each level pack has multiple ...
user avatar
  • 121
0 votes
0 answers
111 views

Data structure backing tile-based map?

I'm building a tile-based game with a similar art style as Stardew Valley, but have a few questions around technique. My understanding is that it's best to store the maps as a byte array of tile ids ...
user avatar
0 votes
0 answers
50 views

How do multiplayer turn based games handle computation

I am building a turn based multiplayer simulation game that at the end of each turn takes all of the users inputs/actions then compiles all the data and interactions returning the result of the ...
user avatar
0 votes
1 answer
572 views

How can I load and store data for a large map in Unity

I'm working on a tower defense game. I have this structure: int array (public int[,,,] gridArray = new int[2000, 2000, 9, 9];) that I'm using as a map-bible; by ...
user avatar
0 votes
0 answers
74 views

Data structure for objects in a galaxy of star systems

I'm having some difficulty coming up with the appropriate data structure to use for a game. I'm aiming for a galaxy view with tens of thousands of visitable star systems. Structure Hierarchically, ...
user avatar
  • 650
0 votes
1 answer
168 views

Is naming convention a good base for a sorting and tagging system for game assets?

TLDR: what are the pros and cons of using a naming convention for tagging and sorting game assets? for the UI to search and handle it for devs and gamers to move files around I am building a game ...
user avatar
0 votes
0 answers
71 views

How to make a snake game where each snake tile follows it's connected tile

I want to make a basic snake game. It has a head and a series of tails that occupy a tile in a grid. The first tail in the series is adjacent to the head. and each tail that comes after is adjacent to ...
user avatar
  • 237
3 votes
2 answers
166 views

How to store and update presentation strings describing effects with parameters?

Consider this spell: As you can see in my design a Spell is a composition of one or more Effects. An Effect has properties on ...
user avatar
0 votes
2 answers
466 views

How to smooth a voxel mesh?

Currently I have refined voxels, I want to smooth it to achieve accurate projection. After some web search, I came across smoothing algorithms such as Catmull-Clark, Doo-Sabin etc. Along with this, I ...
user avatar
4 votes
1 answer
132 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 ...
user avatar
2 votes
0 answers
148 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 ...
user avatar
  • 31
0 votes
1 answer
103 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 ...
user avatar
  • 13
0 votes
0 answers
36 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 ...
user avatar
  • 1
0 votes
0 answers
242 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 ...
user avatar
0 votes
0 answers
122 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 ...
user avatar
2 votes
1 answer
337 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 ...
user avatar
1 vote
1 answer
222 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 ...
user avatar
  • 13
3 votes
2 answers
135 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 ...
user avatar
  • 421
0 votes
1 answer
424 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 ...
user avatar
  • 59
-2 votes
2 answers
267 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 ...
user avatar
0 votes
2 answers
202 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 ...
user avatar
  • 443
0 votes
1 answer
70 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: ...
user avatar
0 votes
0 answers
40 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.: ...
user avatar
0 votes
1 answer
259 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 ...
user avatar
  • 111
6 votes
3 answers
719 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....
user avatar
  • 163
1 vote
1 answer
126 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 ...
user avatar
2 votes
1 answer
210 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 ...
user avatar
0 votes
0 answers
79 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 ...
user avatar
1 vote
3 answers
3k 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....
user avatar
0 votes
1 answer
75 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 ...
user avatar
2 votes
2 answers
2k 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..),...
user avatar
  • 25
1 vote
1 answer
1k 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 ...
user avatar
0 votes
1 answer
2k 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, ...
user avatar
  • 101
1 vote
1 answer
42 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....
user avatar
2 votes
2 answers
156 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 ...
user avatar
0 votes
1 answer
638 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 ...
user avatar
1 vote
2 answers
204 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 ...
user avatar

1
2 3 4 5 6