Skip to main content

Questions tagged [memory-efficiency]

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.

Filter by
Sorted by
Tagged with
1 vote
0 answers
52 views

I'm trying to learn how to use Addressables in Unity to improve memory usage, but there's something I don't understand. I use ...
Ahmed Dyaa's user avatar
0 votes
1 answer
135 views

In the context of game dev, what is the preferred memory to use to store structs like Entities or MapData which are large in size and have lifetimes lasting the entire game run-time. For example here ...
Syntax Error12's user avatar
0 votes
1 answer
151 views

I am trying to efficiently render many 3d game characters: many instances of the same 3d model which can change their positions and z rotations each frame. For reference I'm using OpenGL but this ...
greenlagoon's user avatar
0 votes
0 answers
61 views

I am making a 2d rpg game that uses tiles to store the terrain data. Also the map is procedural generated infinite world type. I saw an approach called clipmaps to ...
Syntax Error12's user avatar
0 votes
0 answers
128 views

I'm creating a simple bullet hell game for Android and I ran into an issue when diagnosing my game using the Memory Profiler where memory usage was increasing after each play-through. I had calls to ...
hoffer's user avatar
  • 1
3 votes
2 answers
194 views

I would like to procedurally-generate ant farm-style layouts on a grid: long horizontal spaces connected by short vertical spaces. Also similar to cave systems formed by water erosion. Every tile in ...
user avatar
1 vote
1 answer
267 views

I am trying to understand the flyweight pattern better by trying to optimize memory usage by spawning 10000 copies of an enemy GameObject that I have which has an Animator component, SpriteRenderer ...
mtg's user avatar
  • 23
0 votes
0 answers
56 views

Given a tilemap, with a tilemap collider, is it possible to extract/bake the current collision(s) onto a separate gameobject independent from the tilemap/tilemap collider? My 2D game streams a large ...
Saturn's user avatar
  • 1,763
2 votes
1 answer
344 views

I'm trying to write a WGSL structs parser (sort of webgpu-utils thing). In order to better understand the memory layout, I'm using wgsl offset computer as a helper. Having the next struct: ...
Michael Sazonov's user avatar
1 vote
0 answers
133 views

I am looking to achieve the following: I have a compute shader that receives a Texture2D as input, where a small percentage of the pixels in the texture are white. ...
Daniel Cardin's user avatar
4 votes
2 answers
3k views

I'm an old coder, but a newbie to Godot. I'm using version 4. I got some unexpected (to me) behavior when I tried this code: ...
Adam Smith's user avatar
16 votes
1 answer
6k views

I am starting to work on optimization for my app. I need to understand the information Unity displays about file sizes. For example, just to prove a point, here is a 2.2 KB completely blank PNG which ...
mike's user avatar
  • 501
0 votes
1 answer
941 views

I am making a bullet hell game. Say there are 100 bullets on the screen, and each bullet has a trail effect. Is it more performant to give each GameObject a ParticleSystem, or for each GameObject, ...
Leftover Salad's user avatar
0 votes
2 answers
787 views

If I create a prefab out of an object on scene will my game take more memory in Unity? I have 30 enemies on my scene. I created a prefab for every one of them. I am going to use each of the created ...
qqqqqqq's user avatar
  • 278
1 vote
1 answer
9k views

I have a simple method that converts RenderTexture data into Texture2D ...
Digvijaysinh Gohil's user avatar
0 votes
0 answers
101 views

This was the closest question on found here: Help with a Fast 2D Grid-Based world rendering technique I'm doing a basic 2d grid where each box is filled with a texture pulled from a chipset. I'm ...
Seph Reed's user avatar
  • 275
2 votes
1 answer
863 views

I am interested in understanding a bit more behind how OpenGL does its memory management and what are some good practices before I start heavily coding and back myself into a corner. The real question ...
Josh B.'s user avatar
  • 123
0 votes
0 answers
118 views

I just recently added interstitial ads to my game. I loaded my interstitial ads when the main game actually starts so it wouldn't take long to load after the user exits to the menu, but on profiling ...
thatGuy's user avatar
  • 25
-1 votes
2 answers
115 views

I'm working on a 3D game engine, currently I load ALL of my 3D modells into the memory when my game starts, but obviusly there will be hundreds of 3D modells, so somehow I should unload them when they ...
user140927's user avatar
1 vote
0 answers
65 views

I'm creating an open-world RPG like Neverwinter nights. But I’m worried about memory and am afraid if I just populate a huge world with physics based sprite nodes, I won't have any memory for anything ...
Mugs's user avatar
  • 111
4 votes
1 answer
6k views

I'm a bit confused on how to implement an allocator for my game engine. I'm currently trying to implement PhysX for the physics in my game and it requires an implementation of an abstract allocator ...
Sammi3's user avatar
  • 229
0 votes
0 answers
97 views

I am developing a simple 2D game. I have multiple sprites. Each sprite has around 80 png/frames of 265* 256. I used LibGdx's Texture packer to package the atlas. Am enabling mimap using following code ...
user93796's user avatar
6 votes
1 answer
1k views

My troubles I've been trying to create a game engine but since I am not well experienced in C++ I am having trouble deciding on how to load new scenes efficiently level by level or just an open world. ...
user avatar
-1 votes
1 answer
201 views

Over the past months I have been developing an application using Vulkan. Recently I have implemented loading 3d models from .fbx files and their associated .png textures. At this point there appears ...
KKlouzal's user avatar
  • 242
8 votes
1 answer
2k views

I know for shaders, floats should be used because they are the optimal choice for performance. Doubles are slow and use more memory which isn't ideal for shaders. While floats are less accurate and ...
Dan's user avatar
  • 276
1 vote
1 answer
98 views

I've written a memory tracker for use in my game engine. I based it on this slide in a talk by Nicolai Josuttis. One problem I'm having is that, during reporting, the implicit string conversion and ...
Casey's user avatar
  • 2,095
1 vote
0 answers
337 views

I'm reading this example of ffmpeg hardware decoding: https://github.com/FFmpeg/FFmpeg/blob/release/4.2/doc/examples/hw_decode.c At line 109 it does this: ...
Poperton's user avatar
  • 111
0 votes
1 answer
555 views

i have Incorporated gravity mechanics and collision mechanics to my game. the game works fine for some period of time after that i am getting significant amount of frame rate drop.i am doing some ...
viraj chavda's user avatar
1 vote
2 answers
1k views

I'm using this piece of code to save renders and I'm saving renders in every frame inside Update(). Code: ...
Maifee Ul Asad's user avatar
0 votes
0 answers
55 views

We have been working in a Node.js game, part of a game network, which seems to be working slower and slower as you keep it open, as well as it seems to increase the RAM and CPU usage over time. We ...
Chris Russo's user avatar
1 vote
0 answers
98 views

Problem I need a collection with non-duplicate values minimising memory allocation during access operations. I am prepared to compromise with a slight decrease of performance to make up for the ...
Adunato's user avatar
  • 31
0 votes
2 answers
304 views

With my past experience of having my little game lag because of the size of the world, I have decided that in whatever next project I might choose to create, I will split said world into chunks. Now ...
Pipi Caca's user avatar
  • 101
1 vote
1 answer
2k views

I'm trying to profile the game using Unity Profiler, I can see in the Hierarchy tab that there's an 18.3 KB correlated to ...
Emad's user avatar
  • 1,136
1 vote
1 answer
1k views

I'm in the process of optimizing my application memory consumption. To do so, I'm using Unity profiler while connecting to an Android device, which runs a development build of the application. The ...
Yaniv Shaked's user avatar
3 votes
1 answer
3k views

From proper leak protection do I need to delete both of these or will getting rid of one take care of both? Currently I am destroying the script AND the gameobject ...
Jacksonkr's user avatar
  • 259
1 vote
2 answers
929 views

I'm working on a 2d adventure game where the player can explore a random generated map. It's working perfectly if I set it to be about 3000x1000 blocks (my array is 3000x1000x2), but this is TOO SMALL....
pocokknight1's user avatar
1 vote
1 answer
630 views

My Players experience crashes on older computers when they enter a scene with a lots of 3d models. Is there anything I can do to avoid this, except deleting those models from the scene?
OC_RaizW's user avatar
  • 1,480
0 votes
1 answer
869 views

I'm currently working on a 2D open world game loaded in chunks, initially I thought It would be sufficient to spawn entities randomly in a specific "radius" close to the player, and periodically ...
Row Rebel's user avatar
1 vote
1 answer
3k views

Manager script(simple script attached to an empty GameObject on scene) on Start() instantiates 1000 default cubes with rigidbody component added and gravity check ticked. ...
metamorphling's user avatar
1 vote
0 answers
51 views

I have some levels, with enemy waves and two Text components for: Enemies killed, like: "13/57" Waves passed, like: "68" On each enemy kill/new wave, I make a <...
Jacob's user avatar
  • 2,552
3 votes
0 answers
221 views

I have a ready-to-launch application, cleaning everything right now. I have these strange spikes on Mesh Memory. The best part of it is that this view below is ...
Jacob's user avatar
  • 2,552
-1 votes
1 answer
118 views

When I profile my apps, I make sure that the code like this one: private void Update(){ int count = GetEnemyCount(); } get's converted to this one: ...
Jacob's user avatar
  • 2,552
1 vote
1 answer
1k views

I want to create a custom allocator that stores objects to the heap sequentially. The allocator itself is very simple. It just allocates a big chunk of memory and moves an offset as ...
k_kaz's user avatar
  • 125
3 votes
2 answers
733 views

Let´s say I have a single frame stack allocator, so I´m using it for allocating memories for my temporary data. ...
Pins's user avatar
  • 589
30 votes
2 answers
6k views

I'm just starting to learn about path-finding and have been looking into the A* algorithm and my main concern is that it all of the examples I have seen show static obstacles that it computes around. ...
Ethan The Brave's user avatar
0 votes
1 answer
3k views

I have built a game I have been working on for Android (Unity). It's a simple game: air hockey. It weights 21mb with all the assets and scripts. After playing for a bit I have noticed that cache of ...
Candid Moon _Max_'s user avatar
24 votes
1 answer
6k views

I have read about this pattern several times (from a best-practices perspective): Memory Allocation: Instead of instantiating the new object on the fly, always consider creating and using object ...
Muhammad Faizan Khan's user avatar
0 votes
1 answer
2k views

If my game will use say 100mb of raw memory for textures, would it be a good idea to put all of them in srv array, bind once and leave it for the rest of the program so that I won't have to bind them ...
Werem's user avatar
  • 148
0 votes
1 answer
540 views

What is more efficient in Unity recorded animation or Slerp/Lerp? What will be faster? It is obvious that the animation will take a lot more space.
hellomates's user avatar
1 vote
0 answers
135 views

LWJGL3 has two methods of creating buffers that I know of: Auto-managed buffers that clean up the buffers automatically using the MemoryStack class, and manually managed buffers that must be manually ...
GiraffeKey's user avatar