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.
159 questions
1
vote
0
answers
51
views
Reserved Memory Keep Increasing When Loading the Same GameObject Using Unity Addressables
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 ...
0
votes
1
answer
133
views
What is the preferred memory to store game object into, Stack memory or Heap memory
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 ...
0
votes
1
answer
150
views
How to efficiently construct model matrices in a vertex shader from a small amount of data, for instanced rendering of many moving 3d game characters
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 ...
0
votes
0
answers
59
views
What are some different ways that tiles are stored in a game during runtime
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 ...
0
votes
0
answers
122
views
Unable to determine cause of memory leak in Unity when using Addressables. Can anyone give suggestions on what the cause might be?
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 ...
3
votes
2
answers
189
views
How to make a digger-like procedurally generated maze that can be queried at coordinates without having to generate?
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 ...
1
vote
1
answer
266
views
I am testing the flyweight pattern on thousands of GameObjects but its not helping save memory. What am I doing wrong here?
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 ...
0
votes
0
answers
56
views
Can I extract/bake the collisions generated by a tilemap collider?
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 ...
2
votes
1
answer
341
views
Padding in a vec3f array in WebGPU memory layout
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:
...
1
vote
0
answers
129
views
Can you append values to an appendbuffer and then immediately read from that same buffer?
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. ...
4
votes
2
answers
3k
views
How does Godot 4 copy vectors?
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:
...
16
votes
1
answer
6k
views
Blank 2.2 KB sized PNG costs 2.1 MB in Unity? What does this represent? What to do?
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 ...
0
votes
1
answer
941
views
what is more memory intensive in Unity: 100 GameObjects with PaticleSystems, or 100 GameObjects spawning other GOs
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, ...
0
votes
2
answers
783
views
If I create a prefab out of an object on scene will my game take more memory in Unity?
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 ...
1
vote
1
answer
9k
views
Issue with Texture2D memory leak in Unity
I have a simple method that converts RenderTexture data into Texture2D
...