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
29 views

`textSubImage2D` inconsistent performance

I have a problem when creating a texture with WebGL. The thing that I do not understand is that the first call with texSubImage2D with a canvas leads to the ...
hoangphatmonter's user avatar
0 votes
3 answers
54 views

Reduce processing time of image to shape

I'm making a simple game engine using Java and have found a major issue. To create accurate collision detection I decided to convert a transparent image into a ...
Grinding For Reputation's user avatar
0 votes
1 answer
34 views

How do I go about Mesh Simplifcation in generating multiple LODs?

I have been recently looking for any information on creating multiple LODs (level of detail) for an inputted mesh. However, there does not appear a lot of articles or pseudo code on how to go about ...
Noah Williams's user avatar
0 votes
1 answer
133 views

Minecraft-like simulation optimization

I am working on a voxel game similar to Minecraft. The goal would be to handle more entities but also offer a more immersive experience by the fact that the player does not need to worry about loading ...
Daniel123455's user avatar
0 votes
0 answers
133 views

How Virtual Textures work?

I'm trying to understand how Virtual Textures work. After coming across this post: https://discourse.threejs.org/t/virtual-textures/53353 And more research here: https://docs.unity3d.com/Manual/...
Miguel Myers's user avatar
1 vote
0 answers
134 views

How to implement MLAA (like SIMD-based approach by Intel)?

I'm looking for previously available public source code sample what was originally posted here https://www.intel.com/content/www/us/en/developer/articles/code-sample/morphological-antialiasing-mlaa-...
Tim's user avatar
  • 11
1 vote
0 answers
42 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
272 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
671 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
208 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
4 votes
2 answers
1k 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
261 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
912 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
59 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
149 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
708 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
62 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
721 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,608
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
272 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
69 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
516 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
614 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,771
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
161 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
584 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
415 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
  • 176
0 votes
0 answers
242 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
44 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
  • 129
0 votes
0 answers
473 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
  • 294
0 votes
1 answer
376 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
382 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
163 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
318 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
2k 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
4 votes
1 answer
726 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
  • 157
1 vote
1 answer
324 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
1k 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
59 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
  • 383
1 vote
0 answers
173 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
84 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
1k 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
390 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
442 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
213 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
155 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
73 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
471 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
  • 376
0 votes
1 answer
55 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

1
2 3 4 5
9