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
26 views

Libgdx: more efficient way of using Vector 3?

I currently use if(cam.frustum.pointInFrustum(new Vector3((float)posX, (float)posY, 0))) To check if my sprite is in the camera's view. I have to make a new Vector3 every frame wich is very ...
6
votes
1answer
158 views

How can I speed up this HLSL shader?

I have written a lighting shader file that is used as the fragment shader part of a deferred lighting pipeline. Unfortunately, each iteration seems to be adding 0.5ms to my frame time, so any more ...
1
vote
0answers
98 views

Recognize pattern in 3D building environment

I'm currently developing 3rd person building game (as bacheleor thesis). I need to recognize constructed patterns co I can mark corresponding structure as some building (so player can start using that ...
1
vote
2answers
128 views

Can I make this physics simulation any faster?

I've made a little real time physics simulation that solves some bodies. CirclevCircle && CirclevOrientedRect I would like someone to tell me if I'm doing something drastically wrong. I know ...
1
vote
1answer
25 views

How to add images?

I was adding images after reading in the documentation: This means that if you generate a 200x200 image for xhdpi devices, you should generate the same resource in 150x150 for hdpi, 100x100 for ...
0
votes
0answers
42 views

What is the best way to group lots of squares into one VBO?

I'm making my first game in OpenGL, using procedural generation, and it is a similar concept to Terraria. At the moment, I have one, very small VBO for a square ('block') and an EBO for its vertices. ...
8
votes
1answer
108 views

In a 2D physics engine, how do I avoid useless collision resolutions when objects come to a rest?

In a physics engine I'm developing (for learning) using love-2d, I implemented collision resolutions in this way: FixedUpdate(dt) // I use fixed timestep foreach collide c1 in allNotStaticColliders ...
0
votes
0answers
21 views

Different layouts?

I have had trouble in the past with optimizing my game for different layouts, so that the players don't see the game in different ways on different screens. Someone told me that the normal directory ...
0
votes
0answers
27 views

Culling And Optimization in a 2D Orthographic Game

I'm currently developing a 2D top-down space themed RTS game. I'm building the space procedurally from a seed. At the end of generation of all space objects, if i don't apply any optimizations I end ...
1
vote
1answer
81 views

How should I store a procedurally generated grid level of an infinite size?

I have a 2d grid level. It infinitely grows. If it was not of infinite size, a 2D array would be perfect, as I need to constantly have each grid talk to its neighbors. For example, with a 2D ...
1
vote
1answer
64 views

Optimization of Cube-based World

I'm currently working on taking an idea I've been toying with in C++ and bringing it into Unity, but I'm struggling to figure out how to make it performant and how to do things the "Unity way". My ...
1
vote
1answer
187 views

GPU usage below 90% = poorly optimized game [closed]

Ok so not exactly a "development" question but highly related. When I play games I often look at performance numbers, like CPU usage, GPU usage, memory usage and others. Let us talk about GPU usage ...
4
votes
3answers
345 views

Efficiently Handling Entity-Interactions in a Tile-Based World

I've been programming Roguelike games lately and there's a common problem I always run into. I can't seem to find a satisfactory solution for handling Monster-Monster interactions. For the intents ...
1
vote
2answers
98 views

FPS drop when detecting collision (sfml, c++)

So, I have this small class with a collision detection function in it, it's called every frame. When I run the game I get around 8000 FPS, but when the collision function gets called it drops to ...
1
vote
1answer
78 views

How to combine tiles in a procedurally generated level in 2D tile based maps?

I am developing a 2D tile-based top-down game. It is currently instantiating square objects with a sprite renderer to procedurally generate the map. Each floor and wall is a 1-unit wide object. I ...
0
votes
1answer
44 views

Avoiding GC when rebuilding Mesh.uv and Mesh.vertices

Since unity will not allow users to iterate over mesh.uv and mesh.vertices, I am stuck having to use GC intensive calls when applying an array of uvs and vertices to a mesh. I run into high GC ...
1
vote
0answers
50 views

Techniques of graphics rendering with single CPU core? [closed]

I am interested in methods of 2d and 3d rendering using single thread on an average CPU (e.g. for programming games for old and low-end PCs). While I usually have no performance problems when using ...
2
votes
1answer
67 views

Giving values to uniform in OpenGL

First thing is that I know how to give values to uniforms in OpenGL. Second thing is that it is a question related to optimization and performance. The habit for changing the uniforms, we preferred ...
1
vote
0answers
118 views

Unity Profiler - What would cause PlayerEndOfFrame to have 10-16MB in GC Alloc?

I can't find much documentation on what "PlayerEndOfFrame" does. Sure it is the end of a frame but what would cause the GC Alloc to go so high? This is the profiler results from a debug build on a ...
1
vote
1answer
66 views

Peer to Peer world download

I am creating a multiplayer JavaScript game with a PHP central server. Each user will be able to move around in a 3D world, with other users and NPCs. It came to my attention that SQL is not going to ...
3
votes
2answers
70 views

One big Instance or One instance for every moving entity?

I am creating a multiplayer JavaScript game with a PHP central server. Each user will be able to move around in a 3D world, with other users and NPCs. These NPCs will be controlled by the central ...
8
votes
4answers
542 views

How do I efficiently check if a point is inside a rotated rectangle?

Part for the sake of optimization, part for learning purposes, I will dare to ask: How can I most efficiently check whether a 2D point P is inside a 2D rotated rectangle XYZW, using C# or C++? ...
1
vote
2answers
159 views

How can I minimise memory thrashing when doing vector math in C# or C++?

I'm doing a lot of 3D math in my game engine loop using typical classes like Vector3D, Matrix4x4, Plane3D, etc. Currently every operation causes a new object to be created for the result value. The ...
0
votes
1answer
151 views

How to choose and scale heuristics for A-star on a graph?

I am trying to find the best and scale my cost function for my algorithm. I am following amit blog which explain that ...
1
vote
2answers
167 views

Optimize drawing “different” sprites in OpenGL ES 2.0 (batching?)

I started experimenting with OpenGL ES 2.0, and I'm trying to figure out a way to optimize/batch sprite drawing, where sprites only have the texture in common, but differ in the following properties: ...
2
votes
1answer
68 views

How do I stop off-screen tiles of a 2D tilemap from being rendered?

I am seeing lag because I render all tiles in my map at once. How can I exclude off-screen tiles from being rendered? My tiles are 32×32 and my player is always in the centre of the screen. Here is ...
1
vote
1answer
55 views

Calculating ln (natural logarithm) in games

I am developing a game for tablets using the Marmalade SDK and Cocos 2dX. In my game I have implemented a separation steering behavior in order to keep some of my characters separated from eachother. ...
1
vote
2answers
216 views

How to PRECISELY measure execution time of a code?

In order to compare algorithms speed, I measure execution time of a code part with a method similar to the one described in this question. I am not operating on Windows, but on Linux, so I use ...
4
votes
1answer
442 views

Memory-Efficient, Optimized Terraria-Like 2D Lighting

I am working on a terraria-clone and I am aiming for it to be able to be run on most Android devices. I am able to generate a world, jump around, etc but I am not looking to add in some efficient ...
9
votes
4answers
535 views

How to load a spherical planet and its regions?

I'm designing a game partially composed of planets exploration. I want to use pseudo-random generation for them, regenerating from a defined seed when I have to load them rather than store every ...
5
votes
2answers
179 views

RTS: Unit sight in fog of war

I am making an RTS game, and like most RTSs, you can see what's going on in a part of a map only if you have a unit over there. I have few ideas how to accomplish this, but there are problems with ...
4
votes
3answers
235 views

How do I efficiently fill the background with a tiling image?

I'm learning Unity by developing a 2D game. It's similar to RimWorld and Prison Architect. I have a 32×32-pixel grass tile image that I want to fill the background with. Here's a screenshot from ...
1
vote
1answer
69 views

How do I avoid lag when dynamically loading a map chunk?

I have a procedural 2d game which extends in all directions, on the surface similar to Terraria. When a player moves their camera close to the edge of the currently loaded terrain, I trigger an expand ...
0
votes
2answers
169 views

How do I dynamically grow a voxel world in all directions with chunks?

I've organized a Voxel world already but the problem is that it can only "grow" outwards. As a result, there is a single corner where it grows from, then outwards from there on. I want to be able to ...
0
votes
1answer
206 views

SerializeField vs GetComponent Efficiency

As far as I know, there are two built in ways to get an instance of a component in Unity. 1 - Serialize the field and drag in the component manually in the editor [SerializeField] private MyScript ...
0
votes
0answers
160 views

Speed up the DirectX game - how else can I boost the fps with typical triangle drawing?

I am writing my own c++/DirectX engine. I've made the basic framework and here comes the time for optimizations. I don't want to focus on optimizing the resources themselves right now (meshes, ...
1
vote
2answers
63 views

How to handle (0,0) in 2D game quad tree?

I am not sure how to handle situation when out objects (player) is in center (0,0) point of game which is crossing of four quads. How to handle that case? This image shows problem: Red rectangle is ...
0
votes
1answer
52 views

Best approach for level specific textures

TL;DR: Best way to handle level-specific textures without overkilling memory usage and killing performance and keeping things clean in OpenGL for mobile (also lower-end devices) and desktop using ...
8
votes
1answer
232 views

(Unity) Optimised networking solution for many moving objects

I've currently undertaking quite an ambitious project. In short, it's a real time multiplayer strategy game which has bacteria mechanics. Essentially, I have two remote players in the environment, ...
2
votes
1answer
427 views

Unity Grid Layout causing multiple draw calls

We are developing a game in Unity 4.6.6 for both Android and iOS. Currently I am building the game UI with the new Unity UI system. In particular I am building a button list to create kind of ...
1
vote
2answers
139 views

Optimization for lots of UV coordinates update for tilemap animation

In my game, I procedurally generate tile map mesh and modify it when travelling around the "world". Each tile is a quad. So they each, have their own UV points. (Obviously) I am using Unity for this, ...
3
votes
2answers
84 views

What does D3DXOptimizeFaces function do?

I know that this function generates an optimized face remapping for a triangle list, but what actually this optimized remapping is? The triangle faces are remapped, but based on what?
1
vote
1answer
957 views

Unity 2D Graphics Optimization For Mobile Devices

I want some advices on how to create graphical assets for mobile devices so that the game will have a good performance and not lag on mobile devices. I had 3 issues with my games and that is they ...
0
votes
1answer
103 views

Using Java on mobile, should I avoid object construction to reduce GC overhead?

I new to both Java and game development and working on my first LibGDX game targeting mobile systems. How problematic is the garbage collector in a mobile environment? Should I try to reuse as many ...
0
votes
1answer
43 views

Determine whether an object is 'visible' at a given distance automatically?

I am creating an environment using procedural content. To optimise performance, I am batching small meshes ahead of time. For efficiency's sake, I don't want to batch objects that make only an ...
1
vote
0answers
194 views

Implementing a Render queue [closed]

I am currently in the process of re-writing my 3d engine, and I am looking at improving the renderer. I have read that organizing objects into a "render queue" and sorting is the best method. The ...
3
votes
1answer
174 views

Endless Running Game - Changing Lane Function in JAVA

I am developing a kind of vertical endless running game, where the character has 4 possible lanes to be in. I am using libGDX and want the character to change lanes by adding a horizontal velocity to ...
0
votes
1answer
84 views

how change branching logic to math equivalent glsl? [closed]

im totally newbie and this just for fun afaik lot of best practice suggest to minimize usage of branching. can you help me optimize below glsl especially on branch part? ( target 120 ) the bgcolor ...
5
votes
2answers
234 views

How do I optimize 2D visibility cone calculations?

I'm creating a simple 2D game and got a little bit stuck with a visibility cone algorithm, influenced by walls and other obstacles on the map. The only issue I'm currently having, is that it's very ...
4
votes
1answer
128 views

Optimization for Normal maps with lots of wasted space?

I'm working on level/character assets where I'm finding that I use only very little amounts of normal mapping on them, resulting in 2048x2048 textures that are mostly blue/purple. Is there any method ...