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

0
votes
1answer
49 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
24 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
102 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
18 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 ...
1
vote
2answers
89 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 ...
5
votes
1answer
246 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. ...
-2
votes
1answer
140 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 ...
43
votes
7answers
9k views

How to improve Minecraft-esque voxel world performance?

After playing Minecraft I marveled a bit at its large worlds but at the same time I found them extremely slow to navigate, even with a quad core and meaty graphics card. Now I assume Minecraft is ...
1
vote
1answer
198 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
1answer
50 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
189 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
80 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
94 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
87 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
141 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 ...
3
votes
2answers
168 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
163 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
2answers
121 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
160 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 ...
2
votes
1answer
108 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 ...
1
vote
0answers
155 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 ...
0
votes
2answers
129 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 ...
2
votes
0answers
219 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 ...
14
votes
2answers
507 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 ...
0
votes
1answer
67 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
79 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, ...
-1
votes
1answer
244 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 ...
0
votes
2answers
241 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 ...
0
votes
1answer
114 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 ...
12
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 ...
0
votes
1answer
67 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
141 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
397 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 ...
4
votes
2answers
1k views

Rendering a lot of Models at once with XNA

In an hexgrid based game, I render all terrain tiles as a separate model, reusing the same texture objects on all similar tiles. The tiles is a pretty simple model. When the terrain is set to be at ...
1
vote
1answer
45 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
109 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
88 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 ...
45
votes
3answers
10k 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?
2
votes
1answer
184 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 ...
3
votes
2answers
213 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
229 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
259 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
260 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 ...
1
vote
2answers
489 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
1answer
160 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 ...
5
votes
2answers
573 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 ...
0
votes
1answer
116 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 ...
29
votes
9answers
24k 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.
2
votes
1answer
9k 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 ...