Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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
1answer
76 views

To split or not to split large 3D objects?

I have a fairly simple question for which I'm seeking guidance: Should large 3D objects be splitted into smaller ones? By wide, I mean an object that would be as wide as a game level is, below is ...
3
votes
1answer
103 views

Quadtree for AABB collision boxes

I have a whole bunch of entities constantly being processed and testing for collisions. I've tried to optimize this by stopping certain entity types from checking each other, dead entities not being ...
3
votes
2answers
129 views

C++ Object management/deletion

I am working on a game with a lot of bullets, currently every second it loops through a vector of bullet objects and checks if its marked for erasure or not. ...
0
votes
0answers
37 views

What are the pros and cons of using larger tiles in a 2d game with freely placed entities?

I am working on a 2d game with the Godot Engine and I'm about to start drawing the tiles for the ground tileset. These will be used solely for the purpose of painting the ground because the trees, ...
26
votes
7answers
8k views

Is the Microsoft recommendation to use C# properties applicable to game development?

I get that sometimes you need properties, like: public int[] Transitions { get; set; } or: ...
0
votes
0answers
29 views

Text Pooling Optimizations

In my game I have created popup text for gained points when enemies are killed. it pops up wherever the enemy was and will say something like "+32" float up a bit and fade away at the same time. ...
0
votes
0answers
24 views

Is it efficient to use colliders on UI canvas in Unity?

Basically I have a task where the player will be able to drag an object (as UI Image), and place it inside a bag (another UI image). What's the best optimized way to do so? As I researched, I do not ...
0
votes
0answers
26 views

Optimizing large number of ModelRenderable cubes with ARCore?

I am creating an ARCore Android app that involves rendering up to thousands of cubes, of course using a Node and ModelRenderable object for each. Understandably, I'm unable to do that without running ...
0
votes
0answers
21 views

How can I reduce memory use when implementing an animation in UE4?

We've already made a tank's track spline animation but it's using a lot of memory because it's implemented inside a tick function. So, it needs to check every second but as you may know it requires a ...
2
votes
1answer
99 views

Why is my openGL rendering faster when I time it with GL_TIME_ELAPSED

I have some code that was rendering too slowly, as in there was a noticeable lag in when updating the screen in response to user input. I tried profiling the CPU side code, but that did not seem to be ...
1
vote
0answers
73 views

How to make effective permament rubble in a voxel game made in Unity3D?

I'm working on a semi-voxel game, and I already optimized the voxel structures' meshes by combining and chunking them. When I destroy a voxel, I spawn a low poly voxel fragment, with a rigidbody and ...
0
votes
1answer
96 views

Using Burst Compile attribute on methods

Can we use BurstCompile attribute without using any Jobs or ECS System in Unity? does adding [BurstCompile] attribute before ...
2
votes
1answer
46 views

On changing a voxel, don't recombine everything again, only modify the changed parts?

I'm working on a voxel based game, where destructible structures are made out of cubes. (Some of them has 3000 voxels) I solved the framerate issues by combining them, but after making it able to ...
0
votes
0answers
48 views

Remove nested if statements

I have been learning a new method of programming. I have been programming many years and am recently finding out there is a better method in general via abstract classes. My question is how to ...
2
votes
2answers
360 views

Most efficient way to get the closest point to a 3d rectangle

I have a 3D rectangle, with 4 points (x,y,z) And I have a player, who can be anywere (inside the rectangle, outside, not even in the plane, in the corner...). I would like to get the closest point in ...
0
votes
0answers
54 views

Overdrawn pixels vs many polygons, which affects performance the most?

I know that having overdrawn pixels is not desirable as well as having many polygons since they can decrease performance. Often when I model I have an option to decrease the number of polygons by ...
0
votes
1answer
116 views

Unity using 40% GPU for just a UI interface on ultra but 90 on low?

So I made some software using unity for my FRC team. All this application is, is just a User Interface with labels, input fields, buttons, etc... When I choose the quality to be on Ultra, I will get ...
1
vote
0answers
28 views

Optimization of linear solving for small matrices (10x10)

How to optimize the hell out of linear system solving for small matrices (10x10)? This would be used in an AR engine for a few games, but has to be done very fast. This solver is to be executed in ...
0
votes
1answer
112 views

Too many objects to update in db too often

We are creating a RTS mobile game and we face some problem dealing with updating a lot of object in db too often. Our game is a RTS in which players can attack enemies cities an take them. The world ...
0
votes
1answer
40 views

Simplify Matrix math code- Sun billboarding

If was trying to set the correct position of my sun billboard in my 3d game. I tried long until it worked correctly, but I wonder why this code must be so complicated: ...
1
vote
1answer
93 views

Avoid useless copies of buffers

The other day I was looking at a opensource engine, basically it was uploading the image from a file to a RAM buffer adding some decoding while streaming (I assume this is done "in-cache" so I can't ...
0
votes
0answers
149 views

Greedy Meshing : Slow to rebuild when updating chunk

I've a problem with my voxel based game. The game is sliced into chunks (Like Minecraft), each chunk is 16x256x16 blocks. When I started the project, I used a basic culling system when hidden blocks ...
1
vote
1answer
89 views

GPU (render time) increase if screen size increase

i create a simple 2d scene in unity 2017.3.1f1 I changed the size (height and width) in the Game View and proflie to see how it affects the rendering.. (below photo) I saw that the rendering time ...
0
votes
1answer
199 views

low FPS when battery is low ( unity android )

i make a simple 2d scene in unity 2017.3.1f1 (only 5 sprite renderer). I realized that when my Android device's battery is under 20 %, the frame rate will be 60 to 30. I did all the optimizations I ...
0
votes
1answer
142 views

Most efficient way to remove a Rectangle ? Monogame/XNA

I have a project in which I'm trying to remove the "collision box" (Rectangle class) of one of my enemy. My game logic basically is: ...
0
votes
1answer
149 views

OpenGL scene performance optimization

I am writing my 3D engine for Linux, and I ran into a performance problem. What was included at the time of testing: Bloom DOF (Depth Of Field) Soft shadows Point light source 1k, 2k textures (...
1
vote
1answer
346 views

Unity - SpriteAtlas memory consumption

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 ...
0
votes
1answer
51 views

Logic at a low framerate with interpolated rendering at higher framerate

It takes too much processing power to do game logic on every rendered frame (60fps), so what if I made my game save frames? It would actually calculate important stuff 20 times a second, and the ...
5
votes
1answer
755 views

How do I reduce overdraw in a forest scene with lots of foliage?

Unity comes with an overdraw view that looks something like this: We've probably all seen it, and have probably been advised to check for overdraw. How do you go about actually doing anything about ...
3
votes
0answers
118 views

Are GPU drivers hand optimized for specific games using low-level APIs?

The GPU drivers often have slightly different behavior depending on game or program, which is using them. It optimizes performance, bypasses bugs and improves overall experience in popular games, ...
0
votes
3answers
850 views

How to optimize collisions

I'm building a 2D MORPG using JavaScript, Node JS and socket.io To prevent cheating, I have to run all collisions for all players on my server. I'm currently doing fairly simple square collisions ...
0
votes
0answers
861 views

Amplify Shader for mobile

I'm recently learning Amplify Shader to make shader more easily. It's visual shader editor for Unity that allows to create shader by connecting nodes. Right now I need a shader for Android project ...
3
votes
0answers
165 views

Pre-Hash Input Strings in Unity

So with the new Animator system, Unity has smartly allowed us to pre-hash the strings for looking up variables within the Animator state machine, using the Animator.StringToHash static method. This ...
0
votes
1answer
42 views

Optimizing expensive calculation for calculating touch of side of cube

I have this code: ...
0
votes
0answers
27 views

Unity, Replace or modify camera with own script

I am making an RTS game which has a slowdown when many units are on screen at once. I have a plan to write my own camera script to speed this up. Since I have an efficient way to find where units are ...
0
votes
2answers
51 views

Most effective way to perform dynamic list of actions?

I have a huge list of predefined game objects with different actions they do. What is the best (in terms of code simplicity and runtime performance) way to store, dynamically refresh and execute their ...
0
votes
1answer
139 views

UNITY - Huge amount of GRAPHICS in RTS Tiled game

after year of development and week of unsuccessful optimization I turn for a help from you, guys. So, my game is turn-based strategy with hexagon map. One hexagon consists of one texture for hexagon ...
0
votes
2answers
552 views

Using std::threads to optimize drawing

I'm currently developing a 3D game with its own engine. I have some performance issues in the function that orders all the draw events and sends them to the GPU. I've heard about threads, and I ...
0
votes
0answers
68 views

Optimization for end-to-end multiplayer pong-like game

I've developing a small pong-like game for educational purposes and I've reached the point where I'm looking at implementing network gameplay. The idea is that a player can either wait for someone to ...
0
votes
2answers
134 views

Optimize polygons renderization

I'm developing a game (in Ogre3D) that, in short, consist in a vehicle that moves along a terrain and leaves a colored trail behind it. The trails are basically quads (a), these quads changes their ...
2
votes
2answers
854 views

Objects' coordinates and scale adjustment according to different devices resolution and aspect ration in Unity

E.g I have a bunch of objects which are generated in specific coordinates. Let's say in a range of - 5 to + 5 on X axis. I came app with these numbers because of camera size I have in Unity editor. ...
1
vote
1answer
122 views

How to balance GPU compute usage against render usage?

The GPU's primary purpose, obviously, is to render the scene. However, if we use compute capabilities on the very same GPU, how do we partitition and control these calls such that they do not ...
0
votes
2answers
124 views

Code optimization

I'm making Space shooter game in Unity, in which I want to place boss. I have script in which I wrote how boss should move and it works but... I know i can do better. Any ideas how can I improve that ...
9
votes
3answers
2k views

How to reduce the time taken to path-find to an unreachable location? [duplicate]

I have a 2048x2048 map and if I path-find to an unreachable location, it makes the pathfinder go through every node on the map which freezes the thread for 4 seconds. How can I reduce that time? I'm ...
1
vote
0answers
34 views

string[] preallocation to prevent using ToString() and save memory

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 <...
3
votes
0answers
148 views

MeshMemory causing constant spikes

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 ...
1
vote
1answer
550 views

How can I improve my rendering performance in Java?

How can I improve the performance of my rendering? Currently, I'm rendering with java.awt.Graphics, but it seems to be starting to slow down since I'm adding new stuff to render. My rendering setup: ...
1
vote
1answer
43 views

Unity: Render only select objects but show previously rendered objects

I am making an RTS game which is having performance issues. Is it possible to render the ground and units separately so I can only render the ground when the camera moves but keep the result ...
1
vote
1answer
58 views

How to optimize two-pass operations on an array with Unity Coroutines

I am working on simulating vacuum decompression in a 2D top down environment. I have 2 2-dimensional arrays: one that stores the pressure at a location, and one that stores the vector of fluid flow. ...