An entity for organizing data in a specific way so it can be used efficiently. Examples are arrays, objects, records, structs.
3
votes
1answer
52 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 ...
0
votes
0answers
35 views
Time-based events in Unity
I want to do stuff based on some time (I have a list of events and a corresponding Unix timestamp). The frequency of events in time varies and I want to capture that in a efficient and not to ...
31
votes
5answers
6k 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 ...
5
votes
1answer
315 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
1answer
106 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
117 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 ...
1
vote
1answer
95 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 ...
3
votes
1answer
109 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
62 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
28 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
127 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 ...
1
vote
3answers
104 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 ...
1
vote
1answer
90 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]. For example I check which row is ...
1
vote
2answers
29 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 ...
var start = new Vector3(-21,-21,-21);
var end = new ...
1
vote
1answer
92 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
1answer
143 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:
Push :: Execution Error - Variable Index [0,10] out of ...
1
vote
1answer
29 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:
V_X=0 //these are coordinates of my "pointer"
V_Y=0
repeat(100)
{
A_CA[V_X,V_Y]=choose(-1,0,1)...
0
votes
1answer
46 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 ...
2
votes
1answer
178 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 entity IDs.
A list of Entity structs, ...
2
votes
2answers
116 views
numeric identifiers associative array
edit: clarified my question. I also realized that I didn't pick a very conclusive question title, which unfortunately I cannot change anymore, sorry.
Hey everyone,
to improve my programming skills a ...
1
vote
1answer
297 views
Is Google's Protocol Buffer viable for the serialisation of game data? [closed]
Simple yes it is suitable, no it is not suitable for communications between game clients and/or server clients. Also is it suitable for serialising and storing game data or is a more customisable, ...
1
vote
1answer
35 views
Separating .js elements/ .js element communication
So I have 2 questions regarding the code below:
function goldClick(number){
gold = gold + number;
document.getElementById("gold").innerHTML = gold;
};
function buyMiner(){
...
2
votes
1answer
151 views
Efficient datastructure to store a galaxy map
I'm working on a project for an intro level Ai class, and the project I've closen is to create a simulated universe in which Ai actors play against each other economically and militarily. I have the ...
1
vote
0answers
60 views
General pointers and advice in creating inventory structure?
I am working on text-based Diablo-like RPG, where each weapon and armor has unique stats and names and there is a lot of overlap. Ie I can generate Silver Sword with 40 damage, but I can also generate ...
2
votes
1answer
178 views
ID3D11Device::CreateInputLayout: Encoded Signature size doesn't match specified size
I get [ STATE_CREATION ERROR #161: CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE] with the following code:
// Vertex data
struct VertexData {
XMFLOAT3 v;
XMFLOAT2 vt;
XMFLOAT3 vn;
};
// ......
4
votes
1answer
63 views
What is a viable way of finding the minimum swaps to sort numbers in pyramid?
I have made a game that consists of a pyramid of hexagons with numbers from 00 to 99 randomly positioned in groups of 6, 10 or 15 elements. Now, I'm working to create an auto-solver but for the last 2 ...
2
votes
1answer
210 views
How should I store dynamic game entities for efficient area-based selection?
In my 2d block-based game I'm trying to implement a data structure that would store entities entities in a way that's capable of:
Direct selection based on coordinate.
Iteration
Iteration limited ...
2
votes
1answer
43 views
To find a success list in group
I try to find a success list among players for my project.
I thought If I find the winning probability of players , it would give me the success list in group.
I would like to give an example to ...
2
votes
1answer
55 views
Quadtree splitting
A quadtree has limit on number of item in each nodes. Suppose a node has already has same number of item as the limit. If I add another item on same node the node should split and new item should be ...
1
vote
2answers
133 views
Using hard coded values for Items?
Is it a bad idea to use hard coded values for things like items (static data) that would change infrequently in an online game? I'm designing an online game in node js, and I'm trying to decide if it ...
0
votes
1answer
38 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
2answers
235 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
1answer
144 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
0answers
36 views
Wrong value from uniform block on OSX+OpenGL
I have a uniform block defined as follows:
layout (std140) uniform u_LayerUniform {
LayerStruct Layers[150];
};
and the LayerStruct is defined as follows:
struct LayerStruct {
vec4 ...
0
votes
1answer
64 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
1answer
94 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, ...
0
votes
1answer
158 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
1answer
204 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
3answers
220 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
2answers
62 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
2answers
570 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
1answer
856 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 might be a coincidence.
I want to know ...
0
votes
1answer
184 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
1answer
249 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
2answers
83 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
4answers
459 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
2answers
250 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
1answer
104 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....
2
votes
2answers
3k 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
2answers
112 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 ...