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.

High performance is a big goal of any quality game. Performing low by having extensive load times, poor framerate, or other issues in the resolution of actions will result in a poor gaming experience. See also: Computer Performance on Wikipedia.

Like any software, the performance of a game is affected by a myriad of elements, such as throughput, loading speed, and bandwidth. With that comes a myriad of things that can hamper the performance. Questions with this tag deal with all of the different elements that influence the performance of a game, and how one should optimize things such as data storage, calculations, and scalability in order to provide a quality gaming experience.

773 questions
173
votes
10 answers

Why is it so bad to optimize too early?

After looking into optimization a bit, I have discovered (literally everywhere) that it seems to be a universally recognized sin to optimize a game too early. I really don't understand this, would it not be incredibly difficult to change some of the…
mr-matt
  • 2,779
  • 7
  • 39
  • 55
93
votes
3 answers

How can I clean up excessive player-created rubble?

In my latest game I'm making, you can slice a 2D object arbitrarily, demonstrated in this gif: You can continuously cut it into hundreds or thousands of pieces. This doesn't create a lot of lag, because they're always in a sleeping physics state,…
Garflington
  • 137
  • 2
  • 10
  • 25
88
votes
8 answers

How many threads should I have, and for what?

Should I have separate threads for rendering and logic, or even more? I'm aware of the immense performance drop caused by data synchronization (let alone any mutex locks). I've been thinking of taking this to the extreme and doing threads for…
j riv
  • 1,013
  • 1
  • 8
  • 7
65
votes
6 answers

How do bullets work in video games?

I came across this question when I was designing a video game in C#. If we consider games such as Battlefield or Call of Duty , hundreds or even thousands of bullets are flying at the same time. Events are triggered constantly, and from what I know,…
Eric
  • 773
  • 1
  • 7
  • 14
49
votes
5 answers

Should I use textures not sized to a power of 2?

In the early days of OpenGL and DirectX, texture sizes were required to be powers of two. This meant interpolation of float values could be done very quickly, using shifting and such. Since OpenGL 2.0 (and preceding that, via an extension)…
Will
  • 7,057
  • 4
  • 40
  • 59
43
votes
6 answers

When is the best time to consider performance?

I am coming from software development background. During the software development cycle, we usually focus on functionalities and the working product. At the end of development, we start optimizing the code and improving performance. Now the question…
42
votes
7 answers

What are the performance difference between unsigned and signed integers?

I am aware of the performance hit when mixing signed ints with floats. Is it any worse to mix unsigned ints with floats? Is there any hit when mixing signed/unsigned without floats? Do the different sizes (u32, u16, u8, i32, i16, i8) have any effect…
Luis
  • 521
  • 2
  • 5
  • 8
35
votes
7 answers

How can I improve rendering speeds of a Voxel/Minecraft type game?

I'm writing my own clone of Minecraft (also written in Java). It works great right now. With a viewing distance of 40 meters I can easily hit 60 FPS on my MacBook Pro 8,1. (Intel i5 + Intel HD Graphics 3000). But if I put the viewing distance on 70…
Martijn Courteaux
  • 1,812
  • 1
  • 14
  • 21
34
votes
12 answers

How can I make A* finish faster when the destination is impassable?

I am making a simple tile-based 2D game, which uses the A* ("A star") pathfinding algorithm. I've got all working right, but I have a performance problem with the search. Simply put, when I click an impassable tile, the algorithm apparently goes…
user2499946
  • 559
  • 2
  • 5
  • 9
28
votes
2 answers

How can I reduce the performance impact of rendering trees?

I'm making a low poly stylized kind of game. I have a terrain with some water, and I want lots and lots of trees; I have 10,000 trees mass placed, at the moment. Each tree consists of no more than 200 triangles, so they aren't too taxing. The main…
mr-matt
  • 2,779
  • 7
  • 39
  • 55
27
votes
3 answers

How to handle a large number of pickups in a MMO game

How do games like Minecraft, or really any MMO game that has pickups, handle them? Say terrain spawns 3 pickup drops of "dirt" everytime you dig said terrain. Say every item has a rotation animation computed every frame. If the number of pickups in…
Alakanu
  • 705
  • 5
  • 18
26
votes
7 answers

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: [SerializeField] private int[] m_Transitions; public int[] Transitions { get { return m_Transitions; } set { m_Transitions = value; } } But my impression is…
piojo
  • 602
  • 5
  • 10
25
votes
2 answers

How do OpenGL's texelFetch and texture differ?

I understand the main differences between texelFetch and texture , but have some questions about the details: Does texelFetch involve a performance penalty? Such as not using a cache or such? Are texelFetch and texture interchangeable when using…
Martin Perry
  • 1,136
  • 1
  • 15
  • 29
24
votes
6 answers

How to optimize the distance function?

While developing a reasonably simple RTS-like game, I noticed my distance calculations were causing an impact in performance. At all times, there are distance checks to know if a unit is in range to its target, if the projectile has reached its…
Grimshaw
  • 3,131
  • 4
  • 30
  • 47
24
votes
3 answers

Is it normal for a game to use 100% CPU?

I just implemented multi-threaded input handling in my game engine where the code that polls the OS to gather input from it and time stamps them is in a separate thread and each frame in the main thread I just eat up the gathered input up to a…
The Light Spark
  • 1,492
  • 11
  • 24
1
2 3
…
51 52