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.
40
votes
3answers
7k views
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?
43
votes
17answers
14k views
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 ...
22
votes
10answers
9k views
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.
8
votes
11answers
664 views
In general how often and when should I optimize my code?
In 'normal' business programming optimization step is often left until really needed. Meaning you should not optmize until it is really needed.
Remember what Donald Knuth said "We should forget ...
8
votes
3answers
6k views
Rendering performance for Flash games
I was reading on SO about native flash rendering vs building a custom BitmapData frame buffer and some of the answers were a bit conflicting, so I was wondering:
Is it generally best practice to go ...
2
votes
3answers
898 views
Optimized rendering of a cube mesh world
I want to render a cube-mesh (a.k.a. Minecraft-style) world. If I render each existing cube it will eat up FPS pretty quickly. How can I optimize it? I understand that the point is to not render ...
2
votes
1answer
211 views
Collision Detection Efficiency
I've just written my first successful collision detection code, and it works great for a small scene of actors (player + 4-5 obstacles).
However, I realize that since it checks every possible ...
21
votes
6answers
842 views
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 ...
12
votes
2answers
2k views
“Optimal” game loop for 2D side-scroller
Is it possible to describe an "optimal" (in terms of performance) layout for a 2D side-scroller's game loop? In this context the "game loop" takes user input, updates the states of game objects and ...
2
votes
3answers
646 views
Coarse Collision Detection in highly dynamic environment
I'm currently working a 3D space game with A LOT of dynamic objects that are all moving (there is pretty much no static environment). I have the collision detection and resolution working just fine, ...
6
votes
1answer
772 views
Is the STL efficient enough for mobile devices?
When it comes to mobile game development on iOS and Android NDK, some developers write their own C++ containers, while others claim that STL is more than adequate for mobile game development (For ...
2
votes
2answers
2k views
Effecient tilemap rendering
I have done mostly tile based games, but never really bothered with optimization. I always just rendered all the tiles that convered the viewport.
I am currently working on platformer for a mobile ...
1
vote
5answers
903 views
OpenGL Performance Questions
This subject, as with any optimisation problem, gets hit on a lot, but I just couldn't find what I (think) I want.
A lot of tutorials, and even SO questions have similar tips; generally covering:
...
4
votes
3answers
459 views
why is it faster to draw lots of small arrays than one big array?
This application on-line here has interesting performance characteristics:
Sorting the rectangles to be drawn so it keeps having to change colour is faster than sorting the rectangles by their colour ...
4
votes
0answers
228 views
How to generate portal zones?
I'm developing a portal-based scene manager. Basically all it does is to check the portals against the camera frustum, and render their associated portal zones accordingly.
Is there any way my editor ...
4
votes
4answers
978 views
Smoothing found path on grid
I implemented several approaches such as A* and Potential fields for my tower defense game. But I want smooth paths, first I tried to find path on very small grid ( 5x5 pixels per tile) but it is ...
8
votes
1answer
230 views
Chunking/caching large levels in a singleplayer game
Does it make sense to try to offload a large nonlinear level into file-based chunks, and load those on demand? We've implemented level chunking to improve rendering performance, but still all level ...
6
votes
1answer
324 views
Display Lists in OpenGL
I heard that there was a faster method of displaying vertices, rather than recreating the GL_TRIANGLES, each time the scene is drawn. I thought I read somewhere that this method was obselete. Why ...
4
votes
1answer
134 views
Cheap ways to do scaling ops in shader?
I've got an extensive world terrain that uses vec3 for the vertex position attribute. That's good, because the terrain has endless gradations due to the use of floating point. But I'm thinking about ...
3
votes
3answers
2k views
Object pools for efficient resource management
How can I avoid using default new() to create each object?
My previous demo had very unpleasant framerate hiccups during dynamic memory allocations (usually, when arrays are resized), and creating ...
1
vote
0answers
70 views
OpenWorld SceneGraph management and optimization
I have a SceneGraph class which for now is just a simple list implementation, and the only optimization I've planned so far is a check is something like this:
//GetDistance returns the distance ...
1
vote
2answers
215 views
Boolean checks with a single quadtree, or multiple quadtrees?
I'm currently developing a 2D sidescrolling shooter game for PC (think metroidvania but with a lot more happening at once). Using XNA.
I'm utilising quadtrees for my spatial partitioning system.
All ...
0
votes
2answers
189 views
Scene management for 3D editor
I need a scene graph/management method for a 3D editor (brute force rendering is not really a possibility), where lots of data (geometry) are constantly being modified, it also would need to work ...