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.

learn more… | top users | synonyms

1
vote
1answer
76 views

For Vertex Buffer Steaming, Multiple glBufferSubData VS Orphaning?

I was learning OpenGL recently. In games, we need to update the position of game objects frequently, and they will come in & out of screen constantly. So it means in rendering we need to update ...
0
votes
1answer
81 views

Location of “units” in Code

So, I've been playing around with the concept of a game, mechanically think of the Civilization games(Tile, turn-based strategy) but I am quite uncertain about where I should store the units location ...
2
votes
1answer
159 views

Avoiding memory allocation in Android game development

For obvious reasons, allocating memory on the fly in Android game development is not recommended. For example: http://developer.android.com/training/articles/perf-tips.html: There are two basic ...
1
vote
1answer
103 views

Swarm Algorithms [closed]

I have been asked to deliver a presentation for my university course on ant, bee and particle swarm algorithms. Therefore I am attempting to learn more about swarm algorithms and their uses within ...
2
votes
2answers
525 views

Store values or calculate values [closed]

We're talking about fairly anal levels of optimisation here that I wouldn't really worry about in anything other than mobile games. Let's say for example you were drawing a texture to the screen in a ...
0
votes
1answer
38 views

Efficiently tracking active instances

I'm creating a game with lots of instances. On each iteration of the game loop, I only want to deal with the ones that are near the player. Currently, I do this by constructing a list of all the ...
3
votes
2answers
204 views

A Star pathfinding algorithm, multiple node set optimization

I'm trying to determine if this is an optimization I should pursue or if this is way to complicated to be worth my time. I've successfully implemented the A Star Algorithm for my video game. I used ...
4
votes
1answer
107 views

Large 2D Arrays Causing Garbage Collection

I've been working on a game in Java that, for this post's sake, looks like Terraria and has random world generation. I've been using Vectors to contain my tile/block objects, but recently due to the ...
0
votes
4answers
149 views

How can I optimize performance when updating tiles?

So I'm making a side-scrolling adventure type game in Java. The worlds are procedurally generated, so I can't manually place tiles. Therefore, I every 20 ticks (1/3 second) I update every block's tile ...
3
votes
1answer
60 views

CSS Sprite position updates slow due to addition of 'px'?

I'm moving fewer than 10 position: absolute elements around the screen. An enormous amount of CPU time (profiled in Chrome as (program) i.e. native code) is used where I do the following: style.left ...
0
votes
1answer
185 views

How to calculate FPS and what factors affect FPS?

In this case, FPS means Frames Per Second and that means the number of frames that graphic hardware render in one second. I'm wondering what kind of stuffs could affect FPS? So, for some tests I ...
11
votes
1answer
467 views

How are entity systems cache-efficient?

Lately I've been doing a lot of reading on entity systems to implement in my game engine (C++/OpenGL). The two key benefits that I constantly hear lauded about entity systems are 1) the easy ...
0
votes
0answers
50 views

Image layer into tile map concept

I'm not really familiar with programming but I wanted to ask if someone could give me some tips. I would like my game maps could be easily designed in some kind of graphics editor. I came with an idea ...
0
votes
1answer
81 views

What is the optimal way to handle matrix internal data storage for interop with native graphics apis?

I'm writing a managed (c#) game engine and have stumbled on a bit of a crossroads in design/implementation regarding matrix types. Matrix types need to be optimized for marshaling to native graphics ...
0
votes
1answer
97 views

Optimizing Draw calls in MonoGame Android platformer

I am working on a 2D platformer that is in the final stages of optimization. I have a few different devices for testing, and I am trying to get the best possible framerate on the weaker ones. On a ...
2
votes
1answer
128 views

Rearranging array for memory efficiency

This is a question about a passage from this article: I suggest having every game object exist within a single giant array. This keeps game objects together in memory, and even though deletion ...
0
votes
0answers
24 views

how do I know what blocks to draw in a lightweight Minecraft style game [duplicate]

I am creating a lightweight minecraft style test game in C++ using opengl es. I have come upon a problem while planning it though - what is the most efficient way to render blocks? I know about back ...
-2
votes
1answer
580 views

Games able to use 4+ core CPUs properly [closed]

Are there any games that can really benefit from use of quad core CPU instead of two-core one like Intel Core i3 4340 vs Intel Core i5 4590 Basically they are quite similar in terms of ...
2
votes
1answer
210 views

How do I efficiently collide and match groups of coloured circles?

I am new to game programming and working on clone of this game in libgdx. The game has some static balls and one ball that moves. I want to check if the moving ball collides with any static ones, but ...
1
vote
2answers
378 views

Fast fullscreen quad rendering in Direct3D 11?

For the last few weeks, I've been trying to port a DX9 implementation of HDR rendering (tone mapping, bloom, stars, etc.) over to DX11. I believe I've got all features working but I'm not getting good ...
1
vote
1answer
68 views

Component-wise GLSL vector branching

I'm aware that it usually is a BAD idea to operate separately on GLSL vec's components separately. For example: //use instrinsic functions, they do the calculation on 4 components at a time. float ...
3
votes
2answers
223 views

How should I choose quadtree depth?

I'm using a quadtree to prune collision detection pairs in a 2d world. How should I choose to what depth said quadtree is calculated? The world is made mostly of moving objects1, so the cost of ...
4
votes
1answer
99 views

2D Boxes/Vertices merging

I want to optimize my colliders geometry, at the moment is composed by boxes (it's a tile based game) of the same dimensions, i want to remove the inner vertices to have, at the end, only the shell. ...
1
vote
1answer
225 views

How to optimize a box2d simulation in action game?

I'm working on an action game and i use box2d for physics. The game use a tiled map. I have different types of body: Static ones used for tiles Dynamic ones for player and enemies Actually i ...
2
votes
0answers
104 views

Improving effect performance in XNA

I'm making a 2D, top-down platformer, in which four or five layers are rendered each time the game draws. Everything is fairly performant except for the bottom layer, which is the game map. This is ...
0
votes
2answers
449 views

Unity3D Directional lights vs Draw calls

I need 2 light sources looking at a different direction as per my design. This means, I cannot flag one of them as 'not-important'! I found that because I'm using 2 directional lights, drawcalls are ...
0
votes
2answers
214 views

How do I efficiently determine what objects are visible to a camera?

I want to call the rendering methods of only the game objects that are visible. How can I efficiently determine which objects or tiles are within the camera's rendered region?
1
vote
2answers
135 views

Compute world position by walking N units along spline?

My goal is to move ahead along a spline 'x' world units, unfortunately there is no way to map spline points to world points. What I do is I iterate along the spline by a small alpha amount (say ...
5
votes
2answers
190 views

Handle movement with QuadTree

I currently have a QuadTree that contains all my Entities. It works well and I've optimized it pretty decently, but the one thing that hurts is that I am removing from and inserting to it almost ...
1
vote
0answers
235 views

Android and OpenGL, single thread vs double thread

I'm trying to optimize my Android OpenGL ES 2.0 application, and I find myself being CPU bound. After googling, I've found this, which suggest to use a thread for updating objects, and a thread for ...
2
votes
0answers
298 views

OpenGL drawing 500k triangles [closed]

I want to render big, izometric 2d map (using ortho projection). I am using OpenTK and aiming for OpenGL 3.3. Perfect option would be to draw 512x512 map of tiles, which is 262144 blocks -> 524288 ...
0
votes
2answers
154 views

How do I merge quads to simplify a heightmap?

I'm trying to improve my frame rates. My map has an area of 200 * 200 vertices, where each vertex has a height. 200 * 200 = 40000 vertices per frame. I'd like to create a method to simplify the ...
0
votes
1answer
74 views

Run menu in gameloop or as activity?

Currently I am running my menu (with buttons "new game" and "choose level") as an xml view of an activity, that then starts my gameactivity with custom view run on a gameloop. But Im starting to see ...
1
vote
0answers
99 views

Speeding up point-in-polygon for Python

In researching collision detection methods for non-Rect-like objects I came across point-in-polygon -- specifically, the even-odd rule. The one presently on Wikipedia claims it is written in Python, ...
-2
votes
2answers
386 views

Tower Defense Search Enemies Efficiently

I had a problem with the build of a TD. I got a slow - non efficient search for towers find targets to shoot. PD: enemies[] got all the active & non-active enemies (death and alive) ->Im using ...
3
votes
2answers
246 views

HLSL: using “?” operator in Technique section produces branches?

I recently found that you can do this: int AnotherShaderConstant = 0; float4 PixShader(VSOUT input, uniform bool Direction) { float4 color; if (Direction) color = GoLeft(); else ...
0
votes
1answer
168 views

What are the possible techniques to optimize the lighting pass in a deferred shading renderer? [closed]

I am toying around with "modern" OpenGL (this is my first attempt, I am new to this) and I have been developping my own deferred shading renderer as an exercise. I am using an FBO with the following ...
0
votes
1answer
75 views

Integer linear program solver based AI

Is Integer Linear Programming a viable solution for a turn based game AI? My current AI solution uses an ILP solver. If you are unfamiliar with ILP, it uses a collection of Booleans to find most ...
18
votes
6answers
2k views

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 ...
0
votes
2answers
174 views

Is there a way to optimize this 2D lighting effect shader? [duplicate]

I'm doing a little 2D game in C++ with Direct3D 11. In the game I want to render a sort of shadow that covers part of the screen: To do this I am using this pixel shader: float4 PS_Main( PS_Input ...
3
votes
1answer
573 views

How can I optimize this flood fill algorithm?

I'm creating a sprite and animation editor like this one. I'm having performance issues with my flood-fill algorithm. Basically, I open an image with the different modules that are part of a frame of ...
1
vote
1answer
46 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
124 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
96 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 ...
14
votes
2answers
562 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
196 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 ...
5
votes
2answers
320 views

How can I optimize a parallax effect consisting of multiple transparent layers?

I have a parallax effect in MonoGame consisting of multiple semi-transparent layers of textures. The effect is simple, but rendering multiple transparent layers on top of each other is rather slow. ...
14
votes
2answers
1k views

What are the common rendering optimization techniques for the geometry pass in a 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
234 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
329 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 ...