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
0 votes
0 answers
23 views

How to quickly traverse bi-directional nodes without repetition?

I want to optimize a bidirectional node traversal algorithm. Because the node is bidirectional, it may cause an infinite loop. The current algorithm uses memory records. However, memory writing will ...
noodle_run's user avatar
1 vote
0 answers
83 views

Tilemap vs terrain vs optimized mesh for top-down game

I'm experimenting with a top down vertical scroller in Unity, with a perspective camera, NOT orthogonal. (It's unclear how 'pixelated'/pixel art I will want the graphics but that's another question) ...
James Carlyle-Clarke's user avatar
3 votes
2 answers
538 views

Should I model with quads or with n-gons?

Model 1 — all 4-sided polygons Wireframe Gun Model 1 Model 2 — polygons have arbitrary number of sides/vertices Wireframe Gun Model 2
Paneer Handi's user avatar
0 votes
1 answer
101 views

AI for global decision-making in 4X games

I understand how things work in combat, but not quite in terms of global decision making. For example, in Civ, at the global level AI has to juggle multiple objectives, e.g. whether to invest money in ...
Alex's user avatar
  • 103
3 votes
2 answers
549 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: ...
Adam Smith's user avatar
1 vote
1 answer
154 views

Factorio style conveyer belts, how to implement multiple speeds?

I've been reading this article by Factorio about optimisation (please read it to understand the context of this question): https://www.factorio.com/blog/post/fff-176 I have implemented this ...
WDUK's user avatar
  • 135
1 vote
0 answers
429 views

Untracked memory in Unity's Profiler

I am working on doing a memory optimization pass on a fully developed game on Unity2021.3.16f1. I am trying to figure out what's the pain point and for that, I need help. Before sharing the profiler I'...
Syed Munim Raza's user avatar
1 vote
1 answer
53 views

Algorithm for distance based-activation of multiple actors

In our game we have many kind of actors that to activate certain behaviors can have one or more than one distance-based conditions. For instance a Rat Enemy could have ...
Matteo's user avatar
  • 15
3 votes
1 answer
133 views

What was the rationale behind the updating of 'changed' tiles in John Carmack's Adapatie Tile Refresh?

I was recently reading up on Carmack's Adaptive Tile Refresh, of which was written extensively in this thread, to implement in a hobby gamedev project of mine: https://retrocomputing.stackexchange.com/...
Hash's user avatar
  • 83
0 votes
0 answers
428 views

Is there a way around using yield return null for coroutines to avoid waiting an extra frame at the end of my coroutine?

I've gotten used to using coroutines as a way to ensure a things are done sequentially in my code, i.e. instead of calling method a, method b, and method c on back to back lines I will sometimes yield ...
Kyle34562345's user avatar
0 votes
0 answers
58 views

What is a good way to optimize lighting while keeping it accurate?

I have a lighting shader that currently has two lighting calculation methods. I have a PBR based model and a regular lighting model. I understand that lighting is going to be taxing, but I am getting ...
Landon Harter's user avatar
0 votes
0 answers
45 views

Is there any benefit of combing Instance Meshing with quadtrees LoD?

I would like to know if there would be any benefit of combing Instance Meshing with quadtrees LoD? Besides the obvious performance improvement of only having one mesh I wanted to try and implement ...
Miguel Myers's user avatar
0 votes
1 answer
409 views

Is it possible to calculate a direction vector without sqrt?

I'm not using Unity or any other library for making game logic. I'm making a basic game logic that needs to do basic vector math on the backend side. I just wrote a direction function that needs to do ...
virtouso's user avatar
  • 2,568
7 votes
1 answer
1k views

How are NP-Hard problems managed in game development contexts?

When NP-Hard problems arise in game development, how are such problems dealt with? Through heuristics or solvers or a combination of both?
watchdogs132's user avatar
0 votes
1 answer
189 views

Efficient calculation of billboard sprite transformations

I'm currently adding a billboard mode to animated sprites and static sprites in my 3D engine. The code below works fine, but I want to know if a more optimized solution exists. I've heard about ...
Ra1jin's user avatar
  • 3
0 votes
0 answers
50 views

Balance load between CPU and GPU [duplicate]

I am making a game with Unreal Engine 5, but it takes more GPU power and the CPU is used much less. I want to optimize it to use both CPU and GPU so it can be playable on low-end PCs or laptops. Is ...
Pranav Upadhyay's user avatar
0 votes
1 answer
59 views

Remove 2D images from layer where overlapping layers hide them completely

I'm creating a 2d game (engine written in JavaScript) with layers system. I would like to have some post process to optimize the images and the layers. If there is too many images in one layer it ...
TreantBG's user avatar
  • 147
2 votes
1 answer
361 views

Efficiently find all points within a circle

I am writing code that requires me to find all points within circle on certain parts of the screen hundreds of times per frame. I wrote a quadtree for this and have 1 method called query_circle that ...
Aayush's user avatar
  • 47
0 votes
1 answer
397 views

Splitting large 3D world in additively-loaded Scenes vs using Addressable Prefabs or Bundles

I'm working on a 3D game with a large open world. It will naturally need to stream chunks. When you look at existing streaming solutions in the Asset Store, you can see that their approach is building ...
Saturn's user avatar
  • 1,721
10 votes
3 answers
4k views

How can I shorten the length of time spent on finding a path using my A* pathfinding code?

I am working on a game where the player and enemies move between discreet tiles, with only orthagonal movement (like pokemon). The game also runs on a turn system, so the player makes a move input, ...
Kyle34562345's user avatar
1 vote
0 answers
131 views

What are the limitations or downsides of using Procedural Textures extensively?

Are there negative consequences to making heavy use of 'procedurally generated textures' in Unreal Engine 5, as opposed to normal textures? I found some info in the docs that it 'saves memory', but ...
Candle's user avatar
  • 141
1 vote
1 answer
382 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., ...
Andrew's user avatar
  • 13
0 votes
1 answer
148 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 ...
Gyoo's user avatar
  • 72
0 votes
0 answers
167 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 ...
Ross Lazenby's user avatar
0 votes
0 answers
34 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 ...
philB's user avatar
  • 99
0 votes
0 answers
329 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 ...
ina's user avatar
  • 274
0 votes
1 answer
257 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 ...
Batash's user avatar
  • 3
1 vote
1 answer
261 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 ...
Bálint Juhász's user avatar
-1 votes
1 answer
142 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, ...
Noel's user avatar
  • 1
0 votes
0 answers
258 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 ...
WILO's user avatar
  • 31
0 votes
1 answer
1k 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 ...
mike's user avatar
  • 481
3 votes
1 answer
509 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 ...
JensB's user avatar
  • 147
1 vote
1 answer
241 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!! (╯...
Skelly Astronaut's user avatar
1 vote
1 answer
872 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. ...
WILO's user avatar
  • 31
0 votes
0 answers
56 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 ...
Serg's user avatar
  • 353
1 vote
0 answers
119 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 ...
Dmytro Brazhnyk's user avatar
1 vote
2 answers
82 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 ...
Simone Lungarella's user avatar
0 votes
3 answers
985 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 ...
Martin Fernandez's user avatar
0 votes
1 answer
337 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 ...
xGolden's user avatar
2 votes
1 answer
326 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 ...
Eugene's user avatar
  • 121
0 votes
1 answer
156 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 ...
ElliottV4's user avatar
0 votes
0 answers
112 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 ...
Ryan Peschel's user avatar
0 votes
1 answer
57 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 ...
Free-Man's user avatar
0 votes
0 answers
362 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 ...
Alex CB's user avatar
  • 366
0 votes
1 answer
53 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. ...
Aubrey Champagne's user avatar
0 votes
0 answers
71 views

How to optimize Floor Meshes with different material in unity

I have several meshes (floor tiles) that consist of unique materials as they have different textures. I see that it is taking too many batches and it has around 100m vertexes. Is there any way to ...
Muhammad Faizan Khan's user avatar
0 votes
1 answer
2k views

Batches Count increase when applying GPU instancing

I have camera across a very weird issue where my batches count significantly increase if I enable GPU instancing: Before applying GPU instancing" After Applying Gpu Instanching: I have a pylon ...
Muhammad Faizan Khan's user avatar
0 votes
0 answers
2k 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 ...
姚一帆's user avatar
0 votes
0 answers
75 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 ...
user148279's user avatar
1 vote
2 answers
421 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 ...
Garflington's user avatar
  • 1,055

1
2 3 4 5
9