As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [performance]

The quality, efficiency, and speed of running gameplay as a result of several factors in the design and structure of the game and its architecture.

Filter by
Sorted by
Tagged with
1 vote
0 answers
91 views

Whats the least expensive way to play video in unity?

Alright, Ive asked this various ways but my situation is I have several (over 100) objects that have screens that need to play animated videos on them. There does not need to be sound, but this is for ...
blue's user avatar
  • 131
0 votes
0 answers
47 views

Easily get several materials from different objects onto 1 UV map/material?

Im trying to improve performance, and I found an asset called https://forum.unity.com/threads/one-batch-combine-hundreds-of-materials-into-one-draw-call.555643/ that claims to do what I need - which ...
blue's user avatar
  • 131
2 votes
2 answers
3k views

How can I improve performance when looping and comparing values on dictionaries?

On my quest to creating 0 garbage when procedurally generating points I've stumbled upon a performance issue when comparing values to another values stored inside Dictionaries. Initially I used ...
MadLed's user avatar
  • 23
0 votes
0 answers
706 views

Is a simple PolygonCollider2D really worse than several BoxCollider2Ds?

In my scene I have very simple quadrilateral blocks, which I'm considering using PolygonCollider2D for. These blocks will be the building blocks of the scenery so ...
Eärendil Baggins's user avatar
1 vote
1 answer
260 views

Why is there a difference in frame rate between my fps calculation and Unity's calculation

So I wrote my own script for calculating framerate but it consistently comes out with a different value than Unitys idea of current framerate. This is my implementation ...
unknownSPY's user avatar
0 votes
1 answer
46 views

Object pooling of different tpyes of agents (Mobile Game) in Unity

The mobile game I am developing consists of one to four players and different agents that are being spawned and act in their own way. All those Agents (Car, Animal and Powerup) derive from the same ...
Roman Stadlhuber's user avatar
13 votes
2 answers
8k views

Why does Unity use reflection to get the update method?

Why does Unity use reflection in order to access MonoBehaviour message methods like Awake, ...
Emad's user avatar
  • 1,126
2 votes
2 answers
13k views

Have VSync on or off while do a game profiling

I'm trying to profile the game using Unity Profiler in order to catch any potential performance issues. The graphics settings support VSync feature. However, I am not sure which one is the best ...
Emad's user avatar
  • 1,126
0 votes
1 answer
592 views

GLSL - Efficient Point inside Box Check

I'm attempting to improve the performance of a shader that changes the colour of a region of the world that is inside a "zone". I am using a deferred lighting system, so the colour and world-space ...
Vercidium's user avatar
1 vote
1 answer
603 views

Unexpectedly fast rotation after refactoring OpenGL code to add more abstraction

I've been working on an OpenGL program that simply renders a square that rotates in 3D space. The square also has a texture applied to both sides. Here you can see an example screenshot of the program ...
user avatar
0 votes
1 answer
42 views

How to get 60fps animation in terms of rounding/truncating position/alpha floats

I am wondering what gives the best animation performance running at 60fps with lots of objects. I have seen in a few places such as this that you should round or truncate your values so you don't get <...
Lance's user avatar
  • 177
2 votes
2 answers
2k views

Event queue: tell or ask?

I'm working my way through a lot of game development resources, coming from a completely different field of software development, I'm interested in learning what patterns are frequently used in game ...
JeanMertz's user avatar
  • 123
1 vote
2 answers
407 views

Efficiently determining which buildings are connected by roads

I have a question about the most effective way to detect road connection in a tile based world. Some time ago I already asked for "How to improve performance for expensive functions in 2d city builder"...
Yheeky's user avatar
  • 305
0 votes
1 answer
970 views

Unity run-time creating material has performance impact?

Just found creating a material in a script for the first time would have performance impact. (Using Unity 5.6.5f) A very simple script for testing is to create a game object with MeshRenderer in ...
Arxz's user avatar
  • 85
0 votes
1 answer
90 views

Multiple image objects extracted from spritesheets or one-two object for all?

Let's say I want to make a 2D game and I'll use a spritesheet containing all of the animation frames and a texture-atlas for static sprites such as walls, non-animated decorations...etc. Should I ...
atanii's user avatar
  • 137
2 votes
1 answer
845 views

Frustum culling with a single large object

I am helping to optimize performance in a mobile game. The artists who built a particular scene added a wall around the scene. The wall is a single mesh with 100k triangles. Because it goes around the ...
user45623's user avatar
  • 741
3 votes
1 answer
1k views

Should LOD models be used in mobile games?

LOD models are widely used in PC and console games, to optimize performance by reducing the vertex count and texture size for distant objects. However, I'm having a harder time finding out if they are ...
user45623's user avatar
  • 741
0 votes
0 answers
245 views

Cache friendliness of AABB-Tree: binary vs N>2

I found that state-of-the-art physics engines like Bullet and Box2D all use binary AABB-Tree for broad-phase collision detection. I wonder, did anybody tested AABB-tree with >2 branches per node ? ...
Prokop Hapala's user avatar
0 votes
1 answer
114 views

Open world game state saving Android

As a hobby project I'm building a 2D game with a custom game engine in Android. Currently I can render a json map, and let the user interact with objects on the map. The game should be an open world ...
Mizzcoollizz's user avatar
0 votes
3 answers
2k 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 ...
Pascal Claes's user avatar
0 votes
1 answer
110 views

Do i lose performance doing this

...
Zdrav's user avatar
  • 3
1 vote
0 answers
311 views

Performance problems with scrolling html5 canvas for large tile-based game

I try programming a splix.io clone as an electron app and do the visualization via the html5 canvas. The movement across the tiles should look fluent like the original, so I target 60 frames a second. ...
Medolie's user avatar
  • 11
0 votes
3 answers
187 views

What are the differences between random encounters and permanent mobile enemies?

Random Encounter: A player has a 10% chance to encounter an enemy. while moving through a 5x5 grid. Permanent Mobile Enemies: There is one enemy that constantly moves through the 5x5 grid and only ...
Hyrial's user avatar
  • 101
1 vote
1 answer
300 views

Unity3d - Cast dynamic shadows without processing multiple lights

Back Story I've built a game with a friend and all goes well until there are too many spheres under a group of 5 lights, then things start getting choppy. Troubleshooting I've found that by turning ...
Jacksonkr's user avatar
  • 203
2 votes
1 answer
177 views

Does abstraction influence performance?

Say I have a GameObject class that is being extended by all of the objects in the game that are moving around. (This class provides basic stuff like a sprite, draw ...
purpule's user avatar
  • 113
1 vote
0 answers
1k views

ParticleSystem, performance behind the technique on batching with different materials

I found that guide: https://thinhhb.wordpress.com/2016/03/27/unity3d-optimization-make-atlas-textures-for-particlesystem-reduce-drawcall-why-not/ which is quite clever. As far as I know, we can't ...
Jacob's user avatar
  • 2,522
1 vote
3 answers
186 views

How do i retrieve individual Tile Information from a tilebased procedural World fast?

I am concerned about performance with my current setup; as I want to expand on it i need to figure out if I might need to change it. Current Setup: The Game/Prototype is similar to Dwarf Fortress or ...
GRASBOCK's user avatar
  • 186
2 votes
3 answers
269 views

Are there recursive variants for trigonometric functions to potentially improve performance?

This is perhaps a better question for mathematics SE, however, this deals more with the performance side of gaming, and software in general. When I say recursive function, I mean recurrence relation. ...
AMDG's user avatar
  • 121
0 votes
1 answer
275 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 ...
Pepa Gazdoš's user avatar
1 vote
1 answer
1k views

Why is creating my sprites so slow?

My 2D Unity game has tiles and layers. It creates one game object per tile, anywhere from 100 to 10,000. To create 3,000 game objects takes 68 msec, which is just fine. But setting up the sprite and ...
david.pfx's user avatar
  • 191
2 votes
1 answer
241 views

Calculating the difference between two numbers using exponential growth

I think this is a very basic game programming question, but I am bad with math and new to programming & game programming so I'm looking for some advice. I'm making a 2D sprite game for iOS. Every ...
peacetype's user avatar
  • 145
4 votes
2 answers
5k views

Why do separate loops run faster than one loop that does multiple things?

My game had some lag, so I tried to improve the performance. I found that if I write my loops separately like this: ...
Han Programer's user avatar
2 votes
1 answer
1k views

How to render a large tile-based 2D world efficiently (using JavaFX/ScalaFX or more generally)

I have a file tileset.png containing a dozen 32*32 tiles. When my game starts, it generates the world randomly with the available tiles and the size of the world ...
Yksuh's user avatar
  • 21
1 vote
2 answers
464 views

Unity: Hiding Game Objects vs Creating them

My game project involves collecting items that will be displayed in trophy cases of sorts. There could be several hundred objects as the scale of the project increases, each with their own position, ...
bumble's user avatar
  • 47
1 vote
2 answers
1k views

How to render many tiles fast if zoomed out? (Monogame/xna)

I'm currently trying to optimize my tile engine. I used monogame with the spritebatch first, but that doesn’t works well. I have read many articles how I could optimize my rendering code. I moved ...
EnemyArea's user avatar
  • 118
3 votes
0 answers
210 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 ...
Jacob's user avatar
  • 2,522
4 votes
1 answer
2k views

Why does an emulator use more RAM than the original system?

Why does an emulator use more RAM than the original system? What are emulators doing that requires so much more power? For example, when using the PSP emulator PPSSPP I'm experiencing lag on a modern ...
A.k.'s user avatar
  • 53
2 votes
1 answer
683 views

How to get time since frame start in Unity for loading purposes

I am building a big world (1000+ game objects). It takes 2s on the device. I am doing it in the background (the world is hidden until fully loaded). I have figured out that I can maintain the FPS of ...
Seagull's user avatar
  • 135
0 votes
1 answer
143 views

Hardcode model data into geometry shader

I have this idea for creating a point cloud and passing an integer into geometry shader to determine which model to draw, each model has the same amount of vertices etc and it would be hardcoded into ...
Werem's user avatar
  • 148
4 votes
1 answer
2k views

Efficient minimum distance between two axis aligned squares?

I have two 2D arbitrarily-positioned axis-aligned squares. I need to find the minimum distance between those squares – i.e. if you were to draw them, what's the length of the shortest line you could ...
Max's user avatar
  • 143
0 votes
1 answer
832 views

Camera and multiple shaders

What is the best way to handle a moving camera inside many shader programs? I believe most games need to have one common projection matrix inside all shader programs to use a moving camera. Currently ...
Felix's user avatar
  • 123
1 vote
2 answers
1k views

Mesh complexity vs Texture Size (Performance)

From a performance view, which is preferable: A higher detailed meshes with small textures (like 32x32 pixels) or A less detailed mesh with a bigger texture (like 1024x1024 pixels)? Additional info. ...
Ommadawn's user avatar
3 votes
2 answers
2k views

How does layer based collision affect performance

In Unity3D, and others, there are Layer Based Collision System which makes collisions only happen between specified Layers. It defaults to all layers colliding with all others. Does making use of ...
Jethro's user avatar
  • 309
4 votes
2 answers
842 views

How do I implement Pokemon-style moves?

I'm developing a Pokémon/classic Final Fantasy inspired game, in the sense that game play consists in many creatures, possessing many moves with different effects (attacking, healing, buffing, ...
FFN's user avatar
  • 181
1 vote
1 answer
1k views

No performance gain from instanced rendering?

I recently worked through this tutorial about instanced rendering. At the end it promises to draw a huge amount of instances of one model without performance drops. So I tried some simple instanced ...
mrdlink's user avatar
  • 323
3 votes
0 answers
208 views

Generating color for mesh in Texture3D or shader?

In Unity, I'm trying to choose between two ways of procedurally colorizing meshes (with vertex color). The main concern here is performance, knowing that my software is already GPU bound (more ...
David's user avatar
  • 93
2 votes
3 answers
123 views

Does the size/distance of a single object affect performance?

I have a moon that I would like to place in the sky, which will likely be anywhere from 1000-5000 triangles. Will I experience any performance degradation if I choose to place this sphere several ...
Gigazelle's user avatar
  • 185
2 votes
1 answer
416 views

Save game on server side

I'm working on a small management game. The player manage his hospital where he can collect items and new characters. Each player can visit others players hospital and gives collected entities. I ...
Colmapidre's user avatar
2 votes
0 answers
487 views

Optimal solution to render sprites with transparent edges in Unity

Since I'm currently developing a 2D game for mobiles, overdraw and drawcall count is my first priority in the design of the application I've thought initially to split each sprite in two parts: one ...
Row Rebel's user avatar
1 vote
1 answer
2k views

Efficient way to load chunks of a 2d level to prevent game from loading stutters

I am building a 2D sidescroller game in Unity3D. It's tile-based. To get better performance I divided the level into chunks. I activate these chunks when the player enters 2D Triggers and deactivate ...
OneManOnMars's user avatar

1 2 3
4
5
15