Skip to main content

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
3 answers
1k 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 ...
0 votes
2 answers
270 views

What data structure would be the most efficient for a task scheduler?

So in a game with various objects that perform various tasks, a naive approach would simply be to update the state of all of the existing items in the world every game update. This is what Minecraft ...
3 votes
1 answer
706 views

How to store condition dependent item information in JSON

I'm developing a RPG-game. After searching about various ways to save item information in RPG-game, I determined to save information in JSON files. The problem is that in my game, some equipment's ...
0 votes
0 answers
52 views

Clarification on scene graph implementation. Adding object/node to a root node or container?

I learned about scene graphs from this chapter on learnopengl and using this I'm trying to make a simple imgui window that can display the scene graph, but one thing that wasn't made clear/I'm having ...
0 votes
1 answer
90 views

Where to put data/values of Status Effects... in Status effect object or just reference from Ability source?

for turn based game, units can get buffed/debuffed with status effects, like poison, etc. I would like to ask the advisable place where to put amount of poison in the data structure. I can think of ...
0 votes
1 answer
178 views

How can I handle voxels that require extra data in my octree?

I am using octrees as an efficient way to store voxel data in a voxel game. The details of my octree implementation can be found here, but in a nutshell, each node is 16 bits, and the most significant ...
0 votes
0 answers
133 views

Separating Game code and Engine code

I've decided to take on a challenge of making 16 c++ games based on this challenge from FamTrinli, I'm using SDL + OpenGL. I've created a simple 2D game in the past, but I didn't like the code ...
0 votes
0 answers
105 views

Euro Truck Simulator Standard Telemetry Format

My son's enjoying Euro Truck Simulator 2 on a Windows PC. I've ben looking a the SDK to extend its functionality. I thought it would be useful to serve the telemetry and build a physical dashboard ...
3 votes
2 answers
2k views

What is the recommended way of storing large sets of organized, immutable data in Unity?

Since I'm making an RPG in Unity, I need a place to store all the possible moves/attacks in the game. These have the following properties: there will be a very large number of them, in the hundreds ...
0 votes
1 answer
90 views

How to add a slot to processing queue using a ring buffer with three pointers?

I am working on a farm game made in C. I am currently working on adding item processing, such as milling wheat into flour. Under the hood, I am using a ring buffer to handle the queues for processing. ...
0 votes
2 answers
194 views

What is the best way to store level data in HTML5

I am currently making a game in HTML5 using canvas, and it is currently just 1 js script and HTML file with references to png files for assets. Right now, I have the level data baked into the script, ...
77 votes
11 answers
26k views

How to design a replay system

So how would I design a replay system? You may know it from certain games like Warcraft 3 or Starcraft where you can watch the game again after it has been played already. You end up with a ...
0 votes
0 answers
87 views

Group voxels into object?

I'm working on Voxel editing software, and I need to have the ability to group voxels into objects. As for simple editing, I'm using the following data structure: Chunk - represents a fixed 3d grid ...
1 vote
0 answers
42 views

Is there a name for a game world structure composed of component trees?

im having trouble phrasing the issue, so apologies if the title isn't correctly descriptive. I'm creating a basic game engine for the first time and have an idea for setting up the worlds data. The ...
1 vote
1 answer
615 views

Data structure for storing / looking up type objects representing different item types

I'm still learning C++ and am no way an expert so I could be conceptualizing this wrong. I'm having trouble getting the right data structure for items in my game. I don't need actual object instance ...
1 vote
2 answers
86 views

Loading game state before first save has occurred (chicken/egg problem)

I've learned that storing and loading game saves is commonly done by serializing runtime data into binary files and then loading in those binary files de-serialized to reconstruct the runtime state ...
1 vote
2 answers
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 ...
0 votes
1 answer
58 views

Should the state object be defined inside the actual object? For Save/Load purpose

I have a class Furniture with a subclass of FurnitureState where all the "live" data will be stored. During gameplay when the furniture will be turned off or relocated (Player action) it ...
1 vote
1 answer
434 views

Where to Save Health on Character with Behavior Tree - UE5

I've looked but havn't been able to find a the workflow for this searching online. I have an NPC, with a behavior tree. Right now it just moves around the map. It's supposed to have a health variable, ...
1 vote
1 answer
73 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 ...
2 votes
2 answers
2k views

How to store and organize my data in a JRPG style game?

I am trying to make a JRPG style game using Unity. See this image below to get a sense of the "feel" of the type of game I am making: http://www.juicygamereviews.com/uploads/3/0/5/0/30501048/...
0 votes
1 answer
231 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 ...
0 votes
0 answers
45 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, ...
2 votes
2 answers
5k 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
1 answer
2k 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). ...
1 vote
1 answer
962 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 ...
-1 votes
1 answer
168 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, ...
1 vote
2 answers
199 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: ...
-2 votes
2 answers
552 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 ...
0 votes
0 answers
69 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 ...
2 votes
1 answer
566 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 ...
0 votes
2 answers
3k 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 ...
0 votes
1 answer
261 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 ...
0 votes
0 answers
30 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 ...
0 votes
0 answers
22 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 ...
2 votes
1 answer
1k views

Applying Perlin Noise to Tiles

Playing with some Documentation about Perlin Noise I managed to create this map: Nothing different from other Procedural Generated Maps. It is a HeightMap with colours at given heights. The problem I ...
0 votes
0 answers
124 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 ...
0 votes
0 answers
1k 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 ...
0 votes
1 answer
409 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 (...
0 votes
0 answers
291 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 ...
0 votes
0 answers
132 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 ...
0 votes
1 answer
1k 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 ...
22 votes
1 answer
37k 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 ...
0 votes
0 answers
149 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, ...
1 vote
1 answer
136 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 ...
0 votes
0 answers
110 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 ...
3 votes
2 answers
186 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 ...
3 votes
2 answers
148 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
1 answer
293 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 ...
2 votes
0 answers
214 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 ...

1
2 3 4 5
7