A way of organizing and storing information so that it occupies as small an amount of memory as possible while still retaining its full usefulness.

learn more… | top users | synonyms

0
votes
1answer
82 views

CPU and RAM usage in OpenGL too high in Swift

My game is set up so the the display controls the game loop, usual in Cocoa. The callback function calls run() which is this. The thing is, the thread running the callback is using 63% CPU and the RAM ...
0
votes
0answers
38 views

Storage and Lookup of Voxel Chunks

How can one store chunks in such a way that they can be looked up using their XYZ location without wasting memory? The problem with a HashMap<Vector3i, Chunk> is that you have to keep creating ...
18
votes
1answer
3k views

Any downsides to exporting an audio file at double-speed then have the game engine playback at half-speed?

I want to cut back on my game's file size and music and SFX are taking up a good chunk. If I make a song or sound effect at 120bpm and then apply a tempo and pitch doubling using a DAW or standalone ...
0
votes
1answer
78 views

Libgdx crash on dispose()?

Whenever I try to manually call the dispose method in one of my screen my game just crashes. My dispose looks something like this @Override public void dispose() { battletheme.dispose(); ...
3
votes
1answer
68 views

Performance differences: one empty GameObject with multiple child objects vs. single GameObject formed by pre-merging the former child objects

Imagine a robot game where robots are made of pre-built blocks. Therefore, each block is a separate GameObject, with one mesh each. I am trying to understand the conceptual differences behind the ...
3
votes
1answer
152 views

Efficient vertex buffer memory management?

I am building a voxel engine with a similar mechanism to minecraft(yes, I know...). It works by loading and unloading individual chunks of 16*64*16 cubes each in a square grid around the player. This ...
5
votes
1answer
118 views

Libgdx: how does dispose() work?

My game uses a lot of images, for the over-world, battle screens, chats, etc. I'm really meticulous when it comes to memory management, and I've noticed that even though I dispose every image when I ...
16
votes
4answers
2k views

Is there any documentation comparing/contrasting C++ standard library implementations? [closed]

(This is not game programming per se, but I'm certain if I asked this on SO I'd get told not to prematurely optimize, even though history tells us every large game ends up worrying about these ...
16
votes
2answers
923 views

How do you prepare for out of memory conditions?

This can be easy for games with well defined scope, but the question is about sandbox games, where the player is allowed to create and build anything. Possible techniques: Use memory pools with ...
-2
votes
1answer
148 views

Libgdx incredibly high RAM usage! [closed]

Alright so I'm new to Libgdx and Game programming in general, and I've got a huge problem. If I leave my game on, it will start to eat memory, pretty fast at that, until it reaches a point my PC ...
0
votes
1answer
40 views

Generating Formulas for glDrawElements with Tile Grids

glDrawElements can be used to save you from uploading a lot of vertices to the GPU. Many 2D games use tiles, which are rendered in grids. I have done some experimenting with the indices array. For a ...
1
vote
1answer
90 views

Method of handling audio and memory in game

I've started coding a new game project and I've implemented Ogre for the graphics rendering and begun thinking about the audio side of things. I was considering using the SFML audio component for ...
2
votes
0answers
271 views

Unity Profiler - What would cause PlayerEndOfFrame to have 10-16MB in GC Alloc?

I can't find much documentation on what "PlayerEndOfFrame" does. Sure it is the end of a frame but what would cause the GC Alloc to go so high? This is the profiler results from a debug build on a ...
2
votes
1answer
63 views

Java - Loading background music into memory

I am currently developing a game with Java, with a soundtrack consisting of ten tracks in .ogg format, 1-2 MB in size each. To be able to switch between these tracks quickly and easily in the game, ...
1
vote
2answers
167 views

How can I minimise memory thrashing when doing vector math in C# or C++?

I'm doing a lot of 3D math in my game engine loop using typical classes like Vector3D, Matrix4x4, Plane3D, etc. Currently every operation causes a new object to be created for the result value. The ...
5
votes
3answers
358 views

What is the most appropriate path-finding solution for a very large proceduraly generated environment?

I have been reading quite a bit in order to make the following choice: which path-finding solution should one implement in a game where the world proceduraly generated, of really large dimensions? ...
10
votes
1answer
711 views

Why is it Important to have render targets with the same bit size?

I am currently thinking of what type of GBuffer I'll need for deferred shading, hence I tried also to document myself online about the most common ones and their format. Most of the GBuffer that ...
6
votes
5answers
2k views

How to make blocks like “redstone” working in a minecraft-like game when the chunks are not loaded

I'm working on a 2D minecraft-like game, I use chunks to save my world and each chunk has 128*128 blocks in it. And infinite chunks can create an infinite world. Memory should never be infinite and ...
4
votes
1answer
497 views

Memory-Efficient, Optimized Terraria-Like 2D Lighting

I am working on a terraria-clone and I am aiming for it to be able to be run on most Android devices. I am able to generate a world, jump around, etc but I am not looking to add in some efficient ...
0
votes
1answer
31 views

OpenGL Mapped Memory Shader Source

Is there any way to get a pointer to a newly created shader object's source? I'd like to load a shader directly from file in to my shader object instead of loading to an intermediary variable and then ...
14
votes
2answers
686 views

Good way to handle offscreen AI?

For example sake: Let's say there are 10 rooms in the world. And let's say the world is inhabited by 10 entities. And each entity has it's own "daily routine" where it performs certain actions in ...
0
votes
2answers
89 views

Amount of Data Calculated in a Game [closed]

So... I am theorizing the development of a 2d living persistent fullsized world with simulated ecossystem, etc..., and many, many objects, but how can I handle the giant amount of data that will be ...
3
votes
1answer
97 views

Multiple semi-dynamic objects in one VBO

I am working on a game that uses opengl 3. The huge geometry is spread over a grid of about 270,000 cells. The geometry in each cell, though not very frequently, can change independently from other ...
2
votes
2answers
312 views

C++ struct doesn't align correctly to a pixel shader cbuffer

To expand from my previous question, I must add I can't correctly map my C++ structs to a corresponding cbuffer inside the pixel shader. When outputing random colors defined in the struct C++ side, it ...
4
votes
2answers
711 views

Mapping a C++ struct to an HLSL cbuffer

Out of curiosity (and peace of the mind...) I wondered how DirectX decides which attribute from a struct corresponds to the right variable inside an HLSL cbuffer-register(x) (apart from the order/type ...
1
vote
2answers
157 views

Smallest, most memory-efficient way to have tiles? (C++/OpenGL)

I need to have tiles in my game, just 16x16 images, there would be hundreds (or even thousands) that make up a level. Of course it's not viable to have thousands of memory-hog normal entities, but ...
0
votes
1answer
55 views

Best approach for level specific textures

TL;DR: Best way to handle level-specific textures without overkilling memory usage and killing performance and keeping things clean in OpenGL for mobile (also lower-end devices) and desktop using ...
0
votes
1answer
47 views

Segmentation fault on reallocation of memory but why? [closed]

I have been learning to code in C from this amazing resource http://c.learncodethehardway.org/book/ I am on exercise 17. Basically creating your own simple database using Malloc. I modified the ...
2
votes
1answer
258 views

Is it possible to completely avoid copying image data when uploading textures to the GPU on iOS?

I am not a game developer, but I have been doing iOS software engineering for many years. I have a particular interest in graphics and animation, but the finer details are still a little foreign to ...
9
votes
1answer
739 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
76 views

memorizing button tap code iOS game

I'm using a single view app in Xcode 6.1 for my game with Storyboards. Not unity or sprite kit. It's a small game not even 3MB. Anyways, I created un-lockable characters with a BOOLEAN. ...
64
votes
5answers
26k views
10
votes
6answers
3k views

Do Game Objects which lay outside camera view consume computer/mobile resources in Unity?

In unity, let us suppose that I have some Game Objects in my scene that are not visible to camera and so are not rendered while the game is running. Will these Game Objects be consuming ...
1
vote
1answer
420 views

Does game engines (like Unreal, Unity, Crafty) add value compared to pure js frameworks (react, ember..) for my isometric tile-based games [closed]

I'd like to create a huge tile-based board (say 100K tile). The game does not have any advanced graphics (you don't see the players or landscapes), the main difficulty is that it has 100K tiles to ...
4
votes
1answer
731 views

Storing large layered tilemap

My game consists largely of "sea" tiles and areas of tiles to form "islands". Each "sea" tile is exactly the same. The map is initially large and going to get larger. I'm trying to reduce the map ...
1
vote
0answers
23 views

Full-motion transparentized video clips

This is sort of a question following onto a previous question I wrote specifically targeting XNA. Understanding that it's an involved enough process that I'd want to manage memory myself, I'm now ...
1
vote
2answers
131 views

Memory strategy for multilayer, tilebased maps

I am currently developing a 2d mmorpg and am having some memory issues with regards to my tile based map. The client takes a little while to load and then sits around 1GB ram, because I am loading ...
0
votes
1answer
109 views

Is there a reason to keep maps in memory?

I've noticed for a long time that games (mostly FPSes) do not unload the map when the user has finished with it (aka, disconnecting from servers, server changing maps). The result of this is that the ...
0
votes
2answers
109 views

Maximum Number of Bends - Snake [closed]

A naive Snake game implementation works by using a queue data structure to store the position of every single square that the snake is a part of. You can reduce the amount of memory by only storing ...
0
votes
2answers
120 views

Manage game objects depending on visibility [closed]

I'm trying to create an adventure game in 2D and I'm thinking about map management/objects. Here is what I've got in mind in terms of modelling: Now, I would like to create entities based on ...
0
votes
0answers
72 views

Drawing pathmap [Solved]

I am developing an editor for my game and I like to implement something like this (screenshot from wc3 editor): (I need the pathmap) I have one implementation already, I just store in chunk renderer ...
2
votes
1answer
202 views

Rearranging array for memory efficiency

This is a question about a passage from this article: I suggest having every game object exist within a single giant array. This keeps game objects together in memory, and even though deletion ...
2
votes
1answer
871 views

Texture compression strategy for Android OpenGL ES that caters for alphas

I have a 2d Android game that is currently causing certain devices to run out of memory. I have a number of PNGs (about 10 MBs in total) that I use in the game at various times. At some points in the ...
27
votes
6answers
8k views

How to solve the big video memory requirements in 2d game

We are developing 2d game (Factorio) in allegro C/C++ and we are facing the problem with increasing video memory requirements as the game content increases. What we currently do is, that we gather ...
2
votes
1answer
1k views

glDeleteTextures - release data, but keep the texture ID?

In OpenGL, is it possible to release texture data, but keep the same texture id? I want to unload textures when they aren't needed, but load them again later when they are. There are a lot of objects ...
11
votes
1answer
2k views

How to benefit from cpu cache in a entity component system game engine?

I often read in the ECS game engine documentations that is a good architecture for using cpu cache wisely. But I can't figure how we can benefit from cpu cache. If components are saved in an array ...
10
votes
2answers
2k views

Why is custom memory management needed for assets?

Pretty much all resources relating to game programming, especially 3D open-world games, talk about how you have to constantly be unloading and reloading assets to and from disk, system memory, and ...
0
votes
2answers
434 views

Efficient way to check collision with potentially hundreds of objects [duplicate]

I am trying to make a top down shooter that could potentially have hundreds of objects at once at one point. I need to check collision with projectiles, walls, and enemies. I am currently using ...
0
votes
2answers
503 views

How can I reuse objects going off left side of screen, by putting them offscreen on the right side?

I have an array of roughly 10,000 tiles over a 2d grid. When a tile goes off screen, I'd like to recycle it by disabling the renderer, repositioning it just before it comes on screen again, then turn ...
0
votes
0answers
29 views

How can I handle collision detection between many objects efficiently? [duplicate]

I have made a game that runs poorly. I suspect that the way that I programmed the collision detection in the game loop could be the problem. My game has two player-controlled tanks which fire ...