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

1
vote
2answers
70 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
35 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
35 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
20 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 ...
2
votes
1answer
77 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
386 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
64 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. ...
57
votes
5answers
19k 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?
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
194 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
703 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
49 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 ...
1
vote
2answers
118 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 ...
9
votes
1answer
664 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
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 ...
0
votes
2answers
90 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
155 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
544 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 ...
2
votes
1answer
781 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 ...
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 ...
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 ...
1
vote
0answers
278 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 ...
14
votes
2answers
718 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
288 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
372 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
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
117 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
164 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 ...
39
votes
8answers
24k views

How'd they do it: Millions of tiles in Terraria

I've been working up a game engine similar to Terraria, mostly as a challenge, and while I've figured out most of it, I can't really seem to wrap my head around how they handle the millions of ...
0
votes
1answer
158 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
913 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 ...
2
votes
2answers
210 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 ...
1
vote
2answers
180 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 ...
0
votes
2answers
301 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
692 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 ...
10
votes
6answers
2k views

How much memory usage is too much in a Flash game?

I'm developing a Flash game, and I can appreciate that the memory usage is a little high for a Flash game (I think). Let's say 100+ MB. So how much is too much when talking about memory usage in ...
0
votes
4answers
1k views

How powerful is modern hardware for complex, intensive 2D graphics?

I am embarking on a massive (image quality, file size, high frame count) project. I am still working on the basic engine, but have a big question that I would like answered before I begin testing. (It ...
4
votes
1answer
1k views

OpenGL FBO to OpenCV image

I am trying to figure out the best way to share an image between OpenGL and OpenCV libraries. I perform a render to texture on OpenGL, so I have and FBO/texture that then I want to pass it OpenCV, ...
6
votes
1answer
792 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. ...
12
votes
3answers
5k views

Custom allocators used in game development

I have been researching creating my own allocator methods (that will support things such as a memory pool and profiling), however, as I continue my research I have been looking for how this was done ...
-5
votes
2answers
1k 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
88 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
321 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
158 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
73 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 ...