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.

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.

472 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
80
votes
17 answers

C++ low-level optimization tips

Assuming you already have the best-choice algorithm, what low-level solutions can you offer for squeezing the last few drops of sweet sweet frame rate out of C++ code? It goes without saying that these tips only apply to that critical code section…
tenpn
  • 5,524
  • 3
  • 35
  • 45
75
votes
13 answers

What is the fastest way to work out 2D bounding box intersection?

Assume that each Box object has the properties x, y, width, height and have their origin at their center, and that neither the objects nor the bounding boxes rotate.
Iain
  • 6,568
  • 3
  • 36
  • 47
75
votes
6 answers

How can I optimise a Minecraft-esque voxel world?

I found Minecraft's marvelous large worlds extremely slow to navigate, even with a quad core and meaty graphics card. I assume Minecraft's slowness comes from: Java, as spatial partitioning and memory management are faster in native C++. Weak world…
58
votes
3 answers

Optimizing an XNA 2D game

Does it make sense to implement the logic to skip rendering objects outside the viewport or should I not care about it and let the Framework do it?
smnbss
  • 701
  • 1
  • 6
  • 7
46
votes
1 answer

How are entity systems cache-efficient?

Lately, I've been doing a lot of reading on entity systems to implement in my C++/OpenGL game engine. The two key benefits that I constantly hear lauded about entity systems are the easy construction of new kinds of entities, due to not having to…
Haydn V. Harach
  • 643
  • 1
  • 6
  • 6
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
26
votes
9 answers

OpenGL optimization tips

What tips or tricks do you have when it comes to making the OpenGL more efficient?
thyrgle
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
5 answers

How can I make huge terrains in Unity?

How can I make extremely huge terrains in Unity? It seems like I can set width and length to large values. But the Heightmap resolution only goes up to 4097 and the Detail resolution only goes up to 4048. Any ideas?
Daniel
  • 3,491
  • 9
  • 38
  • 55
23
votes
6 answers

Spell casting - How to optimize damage per second

Imagine we have a wizard that knows a few spells. Each spell has 3 attributes: Damage, cool down time, and a cast time. Pretty standard RPG stuff. Cooldown time: the amount of time (t) it takes before being able to cast that spell again. A spell…
aaronfarr
  • 468
  • 2
  • 8
23
votes
7 answers

Optimizing gravity calculations

I've got a bunch of objects of varying size and velocity which gravitate towards each other. On every update, I have to go over every object and add up the forces due to gravity of every other object. It doesn't scale very well, is one of two big…
Carson Myers
  • 365
  • 2
  • 7
23
votes
1 answer

Optimization of rendering of cube world

I have a world made of many cubes (like in Minecraft), they have only color (not texture). I am rendering them using OpenGL 3.3 core profile (GLFW3, GLAD, GLM). I am already have done some optimizations: not rendering internal faces backface culling…
galaxy001
  • 369
  • 2
  • 11
21
votes
5 answers

Learning to optimize with Assembly

I am a second year student of Computer Games Technology. I recently finished my first prototype of my "kind" of own pathfinder (that doesn't use A* instead a geometrical approach/pattern recognition, the pathfinder just needs the knowledge about the…
niktehpui
  • 313
  • 3
  • 7
20
votes
3 answers

Are collision detection always O(n^2)?

Are physics engine able to decrease that complexity, for example by grouping objects who are near each other and check for collisions inside this group instead of against all objects ? (for example, far objects can be removed from a group by looking…
jokoon
  • 4,801
  • 9
  • 43
  • 61
1
2 3
…
31 32