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.
3
votes
1answer
113 views
Optimizing flood fill algorithm bottleneck?
I'm creating a sprite/animation editor like this one http://darkfunction.com/editor/
Basically I open an image with the different modules that are part of a frame of an animation, and what i do is ...
1
vote
1answer
39 views
Will function-local objects affect my performance over time?
This is a very simple question.
Let's say my render loop runs at 60Hz, in each call to render(), I draw all my game's buildings, characters and scenery to make the current frame ready. Each of these ...
2
votes
2answers
73 views
Triangulating a point mesh at runtime
I'm familiar with various methods of triangulation (eg Delaunay), but since I have hundreds of thousands of regularly spaced points that may need to be revisited like this on each physics frame, I'm ...
2
votes
1answer
76 views
Optimising meshes
The game MegaGlest uses a MD3-like mesh format, which is keyframe-based vertex animation.
One of the challenges moving forward is to continue to support lower-end hardware. We know some users have ...
10
votes
2answers
324 views
How do you prepare for out of memory conditions?
This can be easy for games with well defined scope, but the question is about sandbox games, where the player is allowed to create and build anything.
Possible techniques:
Use memory pools with ...
2
votes
1answer
137 views
XNA mesh.Draw() takes the longest CPU time
We have a problem. Our game steadily slows down as we increase the number of models we draw. When the number reaches 100 - FPS is dead. Our humble tests showed that the reason is not GPU. This is what ...
11
votes
2answers
499 views
What are the common rendering optimization techniques for deferred shading renderer? [closed]
I have been developing a game engine using OpenGL 3 and C++ (and glfw for window management). I have advanced so far, got most of the things done except sound entities and optimizations. The engine ...
3
votes
2answers
171 views
How to optimize my A* algorithm
I'm working on a roguelike, and I think my A* algorithm is insufficient. My general algorithm for building the dungeon is:
Place rooms
Figure out which rooms should connect by a relative ...
1
vote
1answer
92 views
How to generate AABB, OBB & Sphere from polygon soup
How can I generate AABB, OOBB and Sphere from a polygon soup, where the bounding volumes are defined as follows:
AABB should be specified by min(x,y,z) max(x,y,z)
OOBB should be specified by ...
2
votes
2answers
114 views
How can I remove branches from a fragment shader function?
I have a fragment shader, when I've carefully managed to remove most branching decisions, as I have found out through research here that they are bad.
But I have one function that I just can't work ...
0
votes
1answer
181 views
A*, Tile costs and heuristic; How to approach
I'm doing exercises in tile games and AI to improve my programming. I've written a highly unoptimised pathfinder that does the trick and a simple tile class.
The first problem i ran into was that the ...
4
votes
1answer
97 views
Multiple render targets: Output target format performance questions
This is probably API independent (more dependent on hardware implementation), but just in case, I'm using OpenGL.
The question is restricted to PC hardware.
I have a couple of questions concerning ...
0
votes
1answer
77 views
Emulated vector scaling with raster graphics?
this is a fairly loaded question.
I'm looking to develop a Tech Design Document with my programming team and we're now on the fence about a major 2D graphical engine decision.
What we would like to ...
1
vote
3answers
221 views
Ways to make my game world bigger without slowing users CPU
I've been developing my first game for a little while now, but I've found that I want to make the game world MUCH bigger. It's currently about 300*300 tiles, but has creatures and bad guys running ...
4
votes
5answers
429 views
Is Kip R. Irvine's claim of Assembly being practical for game development accurate?
Kip R. Irvine's book, Assembly Language for x86 Processors, sixth edition, begins by comparing the Assembly language against high-level languages. One of the pros for Assembly, was game development:
...
2
votes
1answer
69 views
Level of Detail/Load on Demand for crowds: replace groups of objects instead of individual ones?
I have been thinking of using level of detail to make rendering crowds easier. The idea is to replace a group of meshes with a single one representing a group.
For example, you have 1 individual cube ...
-2
votes
1answer
135 views
Optimization Question about Singleton [closed]
I am using Unity with c#.
I have two objects and one needs to call a function from the other which is a Singleton. For this I have two solutions. But what's the best thing to do :
- Call for :
...
2
votes
1answer
174 views
Early Z-test / depth-test in DirectX 11
As a DirectX noob i'm trying to wrap my head around depth buffers and specifically how pixel shaders are called for obscured pixels.
From what i understand, the rasterizer calls the pixel shader for ...
0
votes
0answers
66 views
Really weird peaks when profiling a simple scene with Unity3D
I need some help optimizing my game. I have spent last 3 days digging around with no luck. I have noticed really odd results in the unity profiler so, I have created a simple scene with just a cube ...
1
vote
1answer
82 views
Optimize a vertex buffer and generate its associated index buffer
I need to generate a 64*64 grid with each cell being 32*32 wide.
The following code works perfectly but I was wondering whether it can be further optimized when creating the index buffer for it.
...
0
votes
1answer
239 views
2D sort for inventory items?
I asked this question some time ago. Now I ended up with just a sorter method that will sort the items based on their bulkiness/nSlotsRequired. Here's what I'm doing:
I store all the items I have in ...
3
votes
1answer
264 views
The most efficent ways for drawing lines all day long with OpenGL
I'd like to put a computer screen that is running an OpenGL programs in a room. It has to run all day long (not in the night).
I'd like to draw lines that are slowly fading in the background. The ...
13
votes
4answers
1k views
Optimizing collision engine bottleneck
If this is your first time on this question, I suggest reading the pre-update part below first, then this part. Here's a synthesis of the problem, though:
Basically, I have a collision detection ...
7
votes
3answers
714 views
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, ...
1
vote
1answer
114 views
SharpDX - How do I write multiple streams to Texture2D?
I'm working on a 3D map that is cut as a simple grid of textures. The idea is to draw only one object with all those textures, instead of having a tile object for each of them. Correct me if I'm ...
2
votes
1answer
122 views
Optimising skeletal animation
I am implementing a skeleton system for my latest game. I am using my own linear algebra classes which already have some optimisations, such as separate transformPoint and transformVector functions ...
7
votes
1answer
285 views
GL ES: Fragment shader optimization
Summary:
I get FPS slowdown as soon as I try to tint the sprites (i.e: multiply texture with color in the fragment shader)
Details:
Hardware: iPod touch 4
I am drawing 700 sprites on the screen ...
-4
votes
1answer
155 views
For loop optimisation [closed]
Here are some variations of for loops:
1) Standard:
for (int i=0; i<limit; i++)
2) Using preincrement
for (int i=0; i<limit; ++i)
3) Inverting the loop
for (int i=limit-1; i>=0; i--)
...
2
votes
1answer
167 views
how to represent a nested menu system?
I'm wondering what would be a clever way of making a layered menu system, in terms of what data structures to use.
An example of what I mean: A unit has the ability to construct buildings, and to ...
0
votes
2answers
306 views
Displaying possible movement tiles
What's the fastest way to highlight all possible movement tiles for a player on a square grid? Players can only move up, down, left, right. Tiles can cost more than one movement, multiple levels are ...
4
votes
3answers
329 views
Are there methods faster than Strings for sending a sprite's state over UDP?
I'm programming a 2.5D networked game in Java. The networking works like this right now:
Create new networked sprite object at the client. Send it to the server. Server distributes and saves it. ...
6
votes
2answers
557 views
In DirectX 11, batching primitives for performance, how does this actually work?
I don't seem to be able to understand this. Microsoft says that one of the possible optimizations of for a Direct3D 11 if to batch primitives draw calls. For example in order to draw say 300 triangles ...
3
votes
1answer
373 views
How to optimise mesh data
So i have some procedurally generated mesh data and i want to reduce it down to its minimum number of verts. In case it matters this is a unity project.
Working on the basis of a simple example, ...
3
votes
3answers
262 views
Javascript board game: looking for optimization
I posted this question on stackoverflow before but received no answers so I decided to post it here and see if someone could suggest me something.
I'm working on a html/javascript game for android. ...
2
votes
1answer
168 views
Optimising out tiles outside of viewport
I am playing around with the HTML5 canvas and have begun implementing a tile engine.
However, it's currently very inefficient: I have a 100x100 2D array and my code loops through the whole thing ...
1
vote
4answers
137 views
How to get a large quantity of photographs in an app while being memory efficient??
There have been a lot of word games (apps) lately and some use graphics but others use photographs and I was hoping that someone could explain how these games manage to get so many photos in an app ...
1
vote
1answer
136 views
Alternative to soundeffect.play()?
I have been using a profiler to optimize my game for the Xbox, my aim is as with any optimization to reduce excess CPU and memory usage. I have managed to cut down a lot of the processor time and ...
0
votes
1answer
202 views
Xna “Game.Run” method appears to be using up a lot of resources in my game, is this normal?
The question really is in the heading, but i have been using the visual studio profiler to optmisie my game, i have noticed that the game.run method is eating through 93.6% of the overall game ...
1
vote
6answers
537 views
Is it good to sort objects list before every rendering?
I need to render a "tile" game, which are like these:
or
or
I don't know how to render them in correct order. I intend to perform a sorting operator before every rendering (depending on their ...
17
votes
3answers
782 views
In modern AAA games with open environment and lot of static content (eg : crysis), how is occlusion culling performed?
Two ideas i have in mind :
1) Scene is rendered to a invisible buffer, using low resolution and low polygon count models (or even using only bounding volumes like cubes or spheres). The buffer is ...
1
vote
0answers
95 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 ...
4
votes
2answers
184 views
Optimizing models & improving performance
I've created a map editor for a game I've been developing. The maps (planets) are made using a form of meta ball editing. Basically, in the end the Marching Cubes algorithm is used to get my final ...
4
votes
3answers
583 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 ...
2
votes
1answer
137 views
Texture prefetching in GLSL
I have a fragment shader which needs lots of semi-random access to 32x32 texture patch. Fortunately, the patch is constant for each poly, so there should be no issue storing the whole thing to the ...
4
votes
2answers
471 views
Why is keeping a constant FPS harder than keeping high FPS?
I've noticed this ever since I started playing games, and now see it in my own experiments. If I don't do any capping my game runs at 200~250 FPS, with random drops to 150FPS, but if I cap the FPS to ...
2
votes
1answer
6k views
Unity3D draw call optimization : static batching VS manually draw mesh with MaterialPropertyBlock
I've read Unity3D draw call batching documentation.
I understood it, and I want to use it (or something similar) in order to optimize my application.
My situation is the following:
I'm drawing ...
1
vote
3answers
191 views
Multithreading for a mixed-genre game in Python?
So here's the situation. I'm making a game that mixes two genres; arcade shooter and puzzler. They don't intertwine TOO much; all the interaction that really goes on is that every time an enemy is ...
5
votes
1answer
284 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 ...
4
votes
2answers
272 views
Space-efficient data structures for broad-phase collision detection
As far as I know, these are three types of data structures that can be used for collision detection broadphase:
Unsorted arrays: Check every object againist every object - O(n^2) time; O(log n) ...
10
votes
1answer
201 views
Good resources for learning about graphics hardware
I'm looking for some good learning resources for graphics hardware (and associated low level software). Basically I want to learn more about what goes on underneath the opengl/direcx API layers in ...