2022 Developer Survey is open! Take survey.

Questions tagged [optimization]

The process of modifying software to make some part of it work more efficiently or use fewer resources. Generally, this means it executes more rapidly, or will require fewer resources.

Filter by
Sorted by
Tagged with
1 vote
1 answer
83 views

Find closest open space in grid of rectangles?

I'm making a builder game where you snap arbitrarily sized rectangles into a 2D grid. I want the player to be able to drag and drop these rectangles anywhere on the grid, but prevent collisions (i.e., ...
user avatar
  • 13
0 votes
1 answer
31 views

Use of CPU vs. GPU on mobile devices

I was always told that if a task can be parrarelized, I should put it on the GPU for better performance. Although this is defenetly true for computer GPUs, I was wondering if the mobile GPUs were so ...
user avatar
  • 5
0 votes
0 answers
41 views

What is the most efficient way to detect collisions of a large number of similarly sized objects?

Also, the maps are around 4000x4000 (pixels) So, all the objects in my game are 2D circles, and they all have a radius of between 5 and 10 pixels. My current solution is to use a spatial hash where ...
user avatar
0 votes
0 answers
26 views

How much grass can Unity's terrain system handle performantly, and are there any optimizations?

[Unity 2021.3.0f1] I'm making an open world game, and I'm creating the open world using the Unity terrain system. My grass model is very simple, the prefab being 4 planes with a grass texture on each ...
user avatar
0 votes
0 answers
26 views

Usefullness of a manual vertex shader optimization?

After having implemented a texturecube RGBA16F to generate shadows for 4 pointlights in one pass (forward shader), I've compared with array[4] of textucube R16F and with texturecuberarray with 4 ...
user avatar
  • 27
0 votes
0 answers
14 views

Why does my profiler show more CPU usage after setting Application.targetFrameRate? [duplicate]

I read optimization recommendations for mobile devices on a website. It was written that "targetFrameRate" would be good to stabilize at 60 on average. I wrote the following code in ...
user avatar
  • 13
0 votes
0 answers
18 views

Unity - determine if textures are not used, such as "blank" normal texture and black occlusion texture etc

To try to optimize for runtime load of arbitrary 3D models, many of which have "fake normal textures" (basically, just a flat shade of purple - does not really add much to the look), how do ...
user avatar
  • 166
0 votes
1 answer
43 views

Alternative to redrawing the background canvas for camera movements?

I have multiple canvases placed on top of each other for different layers (background, game objects, foreground). I was expecting this to allow me to have the background and foreground update at a ...
user avatar
  • 3
1 vote
1 answer
79 views

Optimal way to find the closest entity to player with a restricted set of functions

The scripting engine of Skyrim (and Fallout 4) has an interesting function called FindClosestActor(x,y,z,radius). If you call it with x,y,z center coordinates and a radius, it returns the closest ...
user avatar
-1 votes
1 answer
82 views

Best way to save game in story game

In a while I plan to create a story game that would have different routes and endings and I was wondering what would be the best way to save a game of a game like this, if it would be a folder, ...
user avatar
  • 1
0 votes
0 answers
70 views

How to implement crowd movement in Unity without rigidbodies?

I am working on a mobile game where its core gameplay includes a bunch of objects (can exceed 100) walking around autonomously in an environment where they push each other and get pushed by other ...
user avatar
0 votes
0 answers
52 views

Unity - Creating a plane that you can deform on runtime creating a path

So I'm doing this project which is similar to Castle Raid (https://youtu.be/ZiAv1smyCKM) And I'm having trouble implementing the path creation by deforming a mesh and making the players move on it. I ...
user avatar
  • 21
0 votes
1 answer
216 views

Does setting the alpha of a UI canvas group to 0 stop Unity from wasting resources rendering it? Is this a valid optimization for off screen UI?

I am trying to improve the efficiency of a big UI Scroll View in my Unity app. These Scroll Views tend to be inefficient and can be prone to jittery/stuttering motion if they are taxed. I came across ...
user avatar
  • 197
3 votes
1 answer
124 views

Should you avoid memory allocation and deallocation while the game is running?

I recently read this answer on this site, which says the following: making sure no allocation/deallocation is being done while the game is running is a golden rule of thumb. I interpret this as ...
user avatar
  • 135
1 vote
1 answer
89 views

Should I be worried about textures higher than 4K?

Upon developing a big project, it just happened that when stitching all the thousands of animations spriteframes of a single character together, the sprite sheet turned around to 2K by 13K texture!! (╯...
user avatar
1 vote
1 answer
279 views

Unity APK size is too big for building the same scene

I'm developing a game that should have 15-60 levels when all the environments of the levels are the same. I created a scene (level 1) and tried to build it; the total APK is around 38MB which is fine. ...
user avatar
  • 21
0 votes
0 answers
41 views

Is it optimal to use UI Canvas for a 2D platformer background?

Using UI Panel component is convenient in the sense that the panel will always be stretched to the size of the screen at any resolution, unlike a sprite (in simple mode) the size of which depends on ...
user avatar
  • 301
1 vote
0 answers
38 views

Z-Fighting mitigation performance overhead

Which of following approaches will have less performance overhead(using threejs renderer)? I am currently have an issue with z-fight for distant objects, while my near/far plane is already set to most ...
user avatar
1 vote
2 answers
74 views

What video settings make a game portable over different level computers?

I'm making a 3D video game, paying attention on optimization of my textures, materials, meshes, and so on. I've kept a good level of quality while having a relatively high and stable framerate, but I ...
user avatar
0 votes
0 answers
26 views

Performance: Multiple asset references vs. One public asset reference

I am making a dungeon crawler where each room can spawn its own enemies. Right now I need a way to reference the enemy prefabs. One way of doing it is by having the references on the room script, like ...
user avatar
  • 31
0 votes
3 answers
248 views

Why is the derivative important in game development? How did you use it in a real scenario?

I'm really eager to know how a programmer finds useful a derivative in game development, using a real scenario as an example. Also I plan to use this question to understand the importance of ...
user avatar
0 votes
1 answer
176 views

Improve cube rendering performance in lwjgl

I've been coding a minecraft-like game in lwjgl using cubes. I've reached a point where I can render 6 chunks of blocks before it starts lagging. I've searched online for optimizations and one of the ...
user avatar
1 vote
1 answer
108 views

What are the pros and cons to using Transform{position, scale, rotation} over Matrix (3x4)?

I'm using Transform in a certain case where I want extracting/changing/preserving the components {position, scale, rotation} to be straightforward - I guess that is a benefit. But when it comes to ...
user avatar
  • 111
0 votes
1 answer
92 views

How resource-intensive is the java.awt.Graphics2D object at different screen resolutions?

I'm currently making a 2D RPG in pure Java (yes, I know other frameworks/engines exist xD). I just created a resizing algorithm and I've noticed that different resolutions result in different FPS ...
user avatar
0 votes
0 answers
67 views

Solution for efficient time-keeping in Javascript games?

I'm developing a real-time browser roguelike using an ECS and currently I'm unsure of how to handle time. As of right now, whenever I need the current time, I just call ...
user avatar
0 votes
1 answer
45 views

How can I improve the performance of my game that plays a video?

I have a level where I have embedded 5 short videos and the levels lags a little compared to the other levels, so it seems that adding videos in a Unity made game is expensive on its performance and ...
user avatar
0 votes
0 answers
123 views

SDL2 - Updating part of a texture is slower than updating all of it

I'm programing a kind of cellular automaton in which each pixel is an automaton. I'm using a SDL2 streaming texture with the SDL_LockTexture() and ...
user avatar
  • 13
0 votes
1 answer
42 views

Lag Spike When Creating Model

I am creating a game using OpenGl in c++. Whenever I create a new model while the game is running, such as fire a bullet, there is a huge lag spike. The function that creates the model is below. ...
user avatar
0 votes
0 answers
883 views

Difference between putting shaders in "Always Included Shaders" vs "Preloaded Assets"

I am developing an mobile AR application with Unity AR Foundation. After a successful android build, I was told one of the shaders was not found. ShaderNotFoundException: GLTF/PbrMetallicRoughness ...
user avatar
0 votes
0 answers
22 views

Scaling transforms by time, Eigen Decomposition of Affine Transforms

I posted this question in mathematics, but that sight gets flooded with homework problems... 8 views total, most of them me. Plus, I think this question is more geared to game development anyway. I am ...
user avatar
1 vote
2 answers
175 views

Calculating bounds of a "dirty rectangle"

I'm following noita's GDC (10:30 is where the talk becomes relevant to what I'm doing) to implement various optimization techniques for my falling sand simulation. The one that's currently blocking me ...
user avatar
  • 1,019
1 vote
0 answers
119 views

Basic 2D Lighting Optimization Issue in Fragment Shader with OpenGL (GLSL)

I'm using a fragment shader to implement 2D lighting (code further below). Even though I am satisfied with the visuals of the light i noticed that it has a quite big GPU usage, and when trying to add ...
user avatar
1 vote
1 answer
147 views

Camera animation stutters on first launch

The camera stutter for a fraction of a second when animating a camera from one position to another position. This issue only happens when the game is launched for the first time after installation. ...
user avatar
  • 129
1 vote
1 answer
165 views

Are spritesheets worth it? Is a zip a good alternative?

I was wondering if spritesheets are worth it. I am making a game with pixi.js and was thinking about optimization, beginning with asset loading. I currently have an arraya of all files and use PIXI....
user avatar
0 votes
0 answers
666 views

Optimize spawn & destroy? (Unreal Engine)

I'd really like to know how you'd go about optimizing this? 20 actors each spawning 8 projectiles per 0.1 sec which are then destroyed 0.8 seconds later, all done through blueprints Gif: https://gyazo....
user avatar
  • 1
0 votes
1 answer
82 views

Prevent mesh generation function from blocking other functions from running

So, I have a procedural mesh generation system with chunks that load in and generate as the player walks into a nearby cell, and get removed when the player walks out. When each set of 9 cells is ...
user avatar
1 vote
2 answers
213 views

Modern Compilers Inlining and Header and Implementation Practices in Game Development

I was taught that in general practice its best not to try to beat the compiler, at least until its proven to be stupid. So in general, and since I was told that its generally only used as a suggestion ...
user avatar
  • 167
1 vote
0 answers
954 views

Optimizing falling sand simulation

So, for the past couple of weeks, I've been working on a falling sand simulation inspired by games such as The Powder Toy, Noita, and Sandspiel. I've been making it in Love2D and I'm please with what ...
user avatar
  • 1,019
0 votes
1 answer
48 views

Looking for tips on how to optimize/debug Java/Eclipse

I made a raycasting engine with wall textures. Before adding the texture the engine was silky smooth. With textures it has small lags (or stutters) when i move around and i would like to know why. My ...
user avatar
0 votes
1 answer
1k views

Should 3D transformations be represented by a 4x4 matrix or a 3x4 matrix?

Since 3D transformations are represented by 4x4 homogeneous matrices we know that their last row is always (0,0,0,1), and as such the behavior of this final row is implied so long as we know whether ...
user avatar
  • 167
0 votes
0 answers
27 views

Unity Optimization: Creating Multiple Similar Scenes Effectively

I've been working on a mobile game that uses the same framework for each level in the game, and I was wondering what would be the most efficient way to store all those levels in Unity. Should I only ...
user avatar
23 votes
1 answer
5k views

Optimization of rendering of cube world

I have a world made of many cubes (like in Minecraft), they have only color (not texture). I am rendering them using OpenGL 3.3 core profile (GLFW3, GLAD, GLM). I am already have done some ...
user avatar
  • 369
0 votes
0 answers
41 views

Punching holes through a texture and making them regenerate back again in an efficient way

I'm working on a prototype where the user can use the mouse to punch holes through a texture, making this texture see-through in that area for a certain amount of time. After that time, the hole will "...
user avatar
  • 331
0 votes
0 answers
104 views

Help deciding data structure for spatial partitioning, using only value-types in c#

I simply want to implement some sort of grid where I can sort units in an RTS into cells, and then for each unit check to avoid other units and attack other units, in 2d. My map grid is currently 10 ...
user avatar
14 votes
2 answers
7k views

How do Minecraft know where village's buildings are if the village is not generated yet?

I'm trying to understand how chunk generation works in a deep level and all the information I found does not explain how the villages are generated properly without visual glitches during generation. ...
user avatar
2 votes
1 answer
1k views

Do empty Update() methods get executed and slow down the game while playing?

From an optimization point of view, is it best practice to delete the predefined update() methods in all my C# scripts if there is no code inside them ? On hundreds/thousands of GameObject(s) with ...
user avatar
  • 23
0 votes
0 answers
60 views

Help me optimize my Line Of Sight on a 2d grid algorithm?

...
user avatar
1 vote
1 answer
169 views

Unity3D, voxel chunk mesh modification: Further performance improvements

I've flattened my 3D chunk array(Got nice 20ms speed up), modified my VertexData struct (that I use in Dictionary as a key) to have custom hashcode(another 20ms and -2.7mb GC.alloc data speedup). But ...
user avatar
  • 541
1 vote
1 answer
1k views

Excluding geometry from a shadow casting light in deferred rendering

Is it possible to exclude geometry from a particular shadow casting light in a deferred rendering pipeline? If yes, can it be done correctly or are there limitations? This is mainly to reduce the ...
user avatar
  • 2,079
4 votes
3 answers
3k views

HIGH energy consumption in Empty Scene Unity iOS

I am struggling from quite long about this issue where I am having High Energy Impact in Unity 2019.2.16f1 on iOS platform and it doesn't matter which device I am using. It occurs on iPhone6 to ...
user avatar

1
2 3 4 5
9