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

3
votes
1answer
51 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
276 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 ...
0
votes
2answers
79 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
2answers
409 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
88 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
37 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
37 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 ...
0
votes
0answers
21 views

Sprites power of 2 are better? [duplicate]

I was starting a Unity project, and wanted to have tilesets of 20x20, but the graphic designer mentioned that tiles like 8x8 or 16x16 are better, because it being power of 2. I asked what was the ...
9
votes
1answer
430 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 ...
2
votes
1answer
102 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 ...
10
votes
6answers
2k 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
226 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 ...
1
vote
0answers
54 views

Dynamically allocate memory for object array [closed]

I'm trying to create a RPG game and for a test I thought I might draw the same tile(20x20 pixels) over the whole window(720x480), it works and renders the tiles fine but the amount of memory and CPU ...
1
vote
0answers
18 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 ...
0
votes
1answer
65 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. ...
1
vote
2answers
120 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
94 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 ...
9
votes
1answer
669 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 ...
0
votes
2answers
91 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
113 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
71 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 ...
5
votes
5answers
2k views

how to make blocks like “redstone” working in a minecraft-like game when the block is very far-away from your character

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 ...
2
votes
1answer
163 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
581 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 ...
23
votes
6answers
6k 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 ...
10
votes
2answers
1k 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
302 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 ...
1
vote
0answers
290 views

Why are png files so much larger in RAM than on disk? [closed]

I have images that take up 119 MB on disk, but when I load them into my game, they use 850 MB of RAM. Why is this? How can I decrease the amount of RAM they use? My images are high resolution PNG ...
2
votes
1answer
818 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 ...
0
votes
0answers
27 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 ...
0
votes
1answer
120 views

What coding issues can be significant in damaging the performance of a game? [closed]

I have just finished a 2D game in Java that I've been working on for a while. I found that on some computers it runs fine, and on others (which are not particularly slow in general), the game runs a ...
2
votes
2answers
172 views

Why aren't resources such as Pixmap disposed on finalization in LibGDX?

I've been looking at the LibGDX framework, and certain classes such as Pixmap require to be disposed manually when you are no longer using them (call the dispose method). I'm wondering, since this is ...
0
votes
1answer
162 views

Load all bitmaps at once or only when needed?

I am starting to get a pretty hefty amount of bitmaps in my 2d game for android. I load them all in 3 colors to save some memory but the thing is, I load all of them when "Start game" is pressed, even ...
1
vote
3answers
979 views

How do I efficiently use 16 bit texture coordinates?

While loading a model I get a big array of 32 bit floating point texture coordinates. I just upload that to a single vertex buffer (along with other data, such as vertices, normals, etc.) and use it ...
0
votes
2answers
385 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 ...
2
votes
2answers
213 views

Replicating no. of sprites without letting the app to slow down and crash

Is it possible that if I'm making a a simple drag-n-drop game, does making a new sprite via constructor with texture as a parameter makes the game slower and depletes more memory until it crashes or ...
9
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 ...
14
votes
2answers
735 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 ...
0
votes
2answers
308 views

What alternatives to large arrays do I have for level data?

So I'm going to store my levels in int[] arrays. Most levels are going to be 300*300*300. However, there will be about 24 levels and so that is 24 int arrays of size 300*300*300. However, that would ...
3
votes
2answers
738 views

What is the range of RAM consumption for the typical 3D character in a video game?

What is the average number of KB in memory for a 3D character? Granted, this will obviously be biased based on what game we're talking about. However, I am less interested in actual size in KB, and ...
1
vote
2answers
189 views

NPOT texture and video memory usage

I read in this QA that NPOT will take memory as much as next POT sized texture. It means it doesn't give any benefit than POT texture with proper management. (maybe even worse because NPOT should be ...
6
votes
1answer
823 views

MMORPG game map in-memory storage techniques

For 2-3 years I've been interested into MMO development. I'm browsing some emulators source codes and open source projects. Usually I'm checking how the game server stores data about the 2D map. ...
-5
votes
2answers
2k views

How much lines of code is 1kB? [closed]

My friend told me that it's something about 40 lines of code for 1kB. For an old 8-bit computers with 48kB of RAM it is only 1920 lines of code! Then when I think about it, it seems to me ...
1
vote
0answers
89 views

Replacement memory allocators - pros and cons [duplicate]

I am developing a hobby project to learn game engine development and to have a platform where I can test new ideas and have fun. Currently I have a quick-and-dirty multiplayer server and client using ...
0
votes
1answer
325 views

Is a HashTable the best way to store replay data in C#?

I'm looking to make a deterministic replay in my 2D game. I want to follow a similar approach to braid in storing the relevant information every frame (at 60 frames per second). I wanted to know what ...
1
vote
4answers
160 views

How to get a large quantity of photographs in an app while being memory efficient??

There have been a lot of word games (apps) lately and some use graphics but others use photographs and I was hoping that someone could explain how these games manage to get so many photos in an app ...
1
vote
0answers
74 views

Another Question from the Image Efficiency for Memory Handling [closed]

At this topic, "Which image format is more memory-efficient: PNG, JPEG, or GIF?", one of the fellow Game Development community @Panda Pajama told about the complex concept about image memory handling ...
-2
votes
1answer
262 views

Music and SFX Question on Memory Efficiency [closed]

What should I recommend: MP3 or WAV for the SFX? Also, what should I do to handle the memory in music or SFX?
58
votes
5answers
20k views

Which image format is more memory-efficient: PNG, JPEG, or GIF?

Which image format is more efficient to save memory? PNG, JPEG, or GIF?
1
vote
1answer
624 views

Game-components and memory management

I'm stitching together the workings of a component based game engine, and as such have been deeply reading into many aspects of both game engine architecture and a fair amount of opinionated theory of ...