# Tagged Questions

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.

288 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 ...
839 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 ...
855 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 ...
553 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 ...
283 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 ...
212 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 ...
331 views

### Which code is faster to convert -1 to 0 and 1 to 1?

I'm writing a shader for rendering the sides of triangles with different colors. I have a value mediump float back = dot(V, N) which is positive if the normal faces away from the camera and negative ...
349 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 ...
555 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: ...
124 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 ...
190 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 : ...
602 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 ...
297 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 ...
247 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. ...
514 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 ...
705 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 ...
2k 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 ...
2k 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, ...
244 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 ...
238 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 ...
1k 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 ...
465 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 ...
1k 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 ...
507 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. ...
2k 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 ...
2k 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, ...
359 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. ...
274 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 ...
160 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 ...
305 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 ...
272 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 ...
1k 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 ...
1k 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 ...
172 views

### OpenWorld SceneGraph management and optimization [closed]

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 ...
288 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 ...
1k 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 ...
265 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 ...
911 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 ...
18k 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 ...
304 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 ...
695 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 ...
678 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) ...
265 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 ...
656 views

### Fast software color interpolating triangle rasterization technique

I'm implementing a software renderer with this rasterization method, however, I was wondering if there is a possibility to improve it, or if there exists an alternative technique that is much faster. ...
448 views

### Help w/ iPad 1 performance for tile-based DOM Javascript game

I've made a 2D tile-based game with DOM/Javascript. For each level, the map data is loaded and parsed, then lots of tiles ( elements) are drawn onto a larger "map" element. The map is inside of a ...
1k views

### Speed up lighting in deferred shading

I implemented a simple deferred shading renderer. I use 3 G-Buffer for storing position (R32F), normal (G16R16F) and albedo (ARGB8). I use sphere map algorithm to store normals in world space. ...
186 views

### GPU optimization question: pre-computed or procedural?

I'm learning shader program and need some general direction. I want to add noise to my laser beam. Which is the best way to handle it? I could pre-compute an image and pass it to the shader. I ...
224 views

### Game has noticeable frame drops but when through a profiler it always runs smooth

I'm trying to optimize my PC game but I can find the bottleneck since every time I run it through a profiler (gDEBugger) it runs smooths. When running outside gDEBugger I get these annoying hiccups. ...