Algorithms are used for calculation, data processing, and automated reasoning. More precisely, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function.

learn more… | top users | synonyms

10
votes
3answers
458 views

Having a list of rooms with theirs connection to each other, how do I find isolated room groups?

I'm trying to create a small roguelike and went as far as random generating rooms and corridors. Each room is an instanced object and contain an arraylist of the others rooms connected by a corridor. ...
2
votes
3answers
326 views

Polygonal Triangulation - algorithm with O(n log n) complexity

I wish to triangulate a polygon I only have the outline of (p0, p1, p2 ... pn) like described in this question: polygon triangulation algorithm and this webpage: ...
6
votes
2answers
2k views

How can I generate a navigation mesh for a tile grid?

I haven't actually started programming for this one yet, but I wanted to see how I would go about doing this anyway. Say I have a grid of tiles, all of the same size, some traversable and some not. ...
3
votes
2answers
251 views

how to calculate intersection time and place of multiple moving arcs

I have rocks orbiting moons, moons orbiting planets, planets orbiting suns, and suns orbiting black holes, and the current system could have many many layers of orbitage. the position of any object ...
2
votes
2answers
971 views

Data structure for bubble shooter game

I'm starting to make a bubble shooter game for a mobile OS. Assume this is just the basic "three or more same-color bubbles that touch pop" and all bubbles that are separated from their group ...
10
votes
2answers
858 views

Finding shapes in 2D Array, then optimising

I've just been allowed an image...The image below from my game shows some darkened blocks, which have been recognised as being part of a "T" shape. As can be seen, the code has darkened the blocks ...
1
vote
1answer
117 views

Game window systems and internal frames

I don't know if this is a valid question, but: What kind of window manager do games use which have internal frames (Frames inside frames)? Does this differ between the programming languages (Are e.g. ...
6
votes
1answer
732 views

How do I generate a smooth random horizontal 2D tunnel? [duplicate]

I'd like to create a smoother version of the navigable and quite natural-looking random tunnel found in this classic helicopter game. It should ideally be... infinite, so more can be generated as ...
2
votes
1answer
449 views

Object detection in bitmap JavaScript canvas

I want to detect clicks on canvas elements which are drawn using paths. So far I have stored element paths in a JavaScript data structure and then check the coordinates of hits which match the ...
3
votes
1answer
500 views

AI Game Programming : Bayesian Networks, how to make efficient?

We know that AI is one of the most important part of Game Programming. Bayesian networks is one of the core part of AI at Game Programming. Bayesian networks are graphs that compactly represent the ...
1
vote
1answer
346 views

Ideas for 2d fire simulation [closed]

I want to simulate a fire in a flat and non flat* surface (fire spread modelling). I've seen that cellular automata is one of the algorithms that can be used. Are there other algorithms that would be ...
6
votes
2answers
3k views

Diamond-square terrain generation problem

I've implemented a diamond-square algorithm according to this article: http://www.lighthouse3d.com/opengl/terrain/index.php?mpd2 The problem is that I get these steep cliffs all over the map. It ...
1
vote
1answer
369 views

Negamax implementation doesn't appear to work with tic-tac-toe [closed]

I've implemented Negamax as it can be found on wikipedia, which includes alpha/beta pruning. However, it seems to favor a losing move, which should be an invalid result. The game is Tic-Tac-Toe, ...
7
votes
2answers
606 views

Low CPU/Memory/Memory-bandwith Pathfinding (maybe like in Warcraft 1)

Dijkstra and A* are all nice and popular but what kind of algorithm was used in Warcraft 1 for pathfinding? I remember that the enemy could get trapped in bowl-like caverns which means there were ...
1
vote
1answer
1k views

What kind of shader is this?

Cube World uses a pretty good looking shader, I especially like the shading of the characters: Is this soft shading? I'd like to achieve this effect in Unity 3D Free, but since the free version ...
8
votes
2answers
3k views

How to decompose sprite sheet

I have a lot of spritesheets that are poorly formatted that I want to decompose, or split out into many small images, one for each sprite. If I can do that, I can use my custom texture packer tool to ...
6
votes
1answer
428 views

Action-oriented AI: evasion-algorithm takes much time

Evasion, the process of evading, is the opposite of chasing. Instead of trying to decrease the distance to the target we try to maximize it. It takes much time while evading multiple objects ...
2
votes
2answers
312 views

Updating “Inactive” Chunks

In my game, the only chunks (4x4 areas of tiles) in memory are the ones that the player is in. However, chunks need to have updates applied to them over time. A (likely) well-known example would be ...
2
votes
1answer
187 views

background animation algorithm for single screen

I’m writing simple strategy game (in xna), and would like to have an animated background. In my game all the actions happens inside one screen and thus standard parallax effect does not look ...
6
votes
1answer
697 views

Farseer Physics: Ways to create a Body?

I want to create something similar to this using farsser and Kinect: https://vimeo.com/33500649 This is my implementation until now: http://www.youtube.com/watch?v=GlIvJRhco4U I have the outline ...
0
votes
2answers
156 views

Algorithm for querying linearly through a non-linear list of questions

For a multiplayers trivia game, I need to supply my users with a new quizz in a desired subject (Science, Maths, Litt. and such) at the start of every game. I've generated about 5K quizzes for each ...
4
votes
2answers
780 views

How to implement auto-aiming / auto-targeting

We all know how auto-aiming or auto-targeting works in games. Now, I need to find how to implement it in my game. In fact I should implement it in UDK and I would be glad if anyone gave me more ...
2
votes
1answer
723 views

Radiosity lightmap generation

Is there any working C++ source code for a lightmap generation algorithm using Radiosity or any other GI system? I've found technical papers only, but I can't really find any implementation.
0
votes
2answers
887 views

Order array of points in counter clockwise

I happened to see an answer to "Sort array of points in clockwise", could you please elaborate the 4th point of that answer: sort points relative to their a value, using qsort for instance. How do ...
4
votes
4answers
466 views

Recursive or linear gameobjects update?

I have a tree of gameobjects, so every node contains a list of children. In update function: Is it better to do recursive or linear walking through game objects. update() { update self; ...
17
votes
1answer
4k views

How to convert mouse coordinates to isometric indexes?

I draw isometric map with tile 64x32: const Offset = 160; int X, Y; for (int a=0; a < 6; a++) for (int b=0; b < 6; b++) { X = a * 32 - b * 32 + Offset; Y = a * 16 + b * 16; ...
12
votes
2answers
469 views

Fades in older games. Need some help figuring out how the algorithm was derived

Sorry, this question is a bit esoteric, but I just can't get it out of my head! I'm looking at the fade algorithm used in the arcade game DoDonPachi (as well as many other older games): I wrote a ...
2
votes
2answers
593 views

What algorithm is mostly used to interpolate animations?

Because DCC tools supports very many options, we resample the animation curve splines, but I think it still need to be interpolated. I think there's some de facto standard for this animation ...
0
votes
1answer
192 views

Algorithm to generate multifaced cube?

Are there any elegant soloution to generate a simple-six sided cube, where each cube is made out of more than one face? The method I have used ended up a horrible and complicated mess of logic that is ...
-2
votes
3answers
280 views

There is something like the BigO notation for the GPU world and the programmable pipeline?

I find difficult to study the performance of a shader or a series of statement probably because the OpenGL is a state machine and also the execution is in parallel and not serialized like a standard ...
4
votes
1answer
95 views

Finding line of best fit demarcating national borders

Per title, what algorithms are available for defining borders for states (or other entities) based on certain nodes in the world (eg. cities or armies) with varying weights? For example, there are ...
4
votes
1answer
238 views

Create shape from points / lines in editor and mathematically calculate nearest points within shape

If I want an editor that accepts "points" of a minimum of three (a triangle) and I just add some points first, like this: how can I mathematically connect these corners (points) into an object of ...
4
votes
3answers
165 views

Determine inventory item position shape

Not a great title but couldnt think of a shorter way to describe it. I am trying to think of the best way to determine the shape of items placed in the players inventory. I guess the best examples ...
2
votes
2answers
109 views

Repetition of move in Draughts game

I am having a little problem in my draughts game. Lets say my red piece (moving through AI) has arrived at the border of black pieces and now it has become a king, lets assume it is at index 2. Now ...
6
votes
2answers
1k views

How to remove floating terrain when generated with 3D Perlin Noise?

I'm currently using 3D Perlin Noise to generate random terrain in combination with Marching Cubes. My issue seems to lie in scaling the noise function to get reasonable heights in my terrain. If ...
14
votes
4answers
582 views

Algorithm for creating adjacent triangles

I have a system where you can click once to place a node in a scene. When you place 3 nodes, it forms a triangle. When you place any future nodes, it creates a new triangle by joining that node to the ...
5
votes
2answers
351 views

What's the reason behind collision-boxes?

I was surprised that some games use extra models called collision-boxes for collision. What is the benefit of doing so? Can't we calculate collisions between the vertices of any game model? Is this ...
2
votes
1answer
1k views

Mafia kill algorithm

I'm making an Omerta clone/mafia game and trying to work out a kill algorithm. Just a basic formula to decide how many bullets player A needs to kill player B. The inputs are: players rank (out of ...
4
votes
2answers
490 views

Generate random starting points at same distance between them

Is there an algorithm to generate random 2D points that are at the same distance between each other? Useful for starting points. Check map: Don't be picky, I know in the image points are not at the ...
2
votes
0answers
313 views

Cubic to equirectangular projection algorithm

I have a cube map texture which defines a surrounding, however I need to pass it to a program which only works with latitude/longitude maps. I am really at lost here on how to do the translation. Any ...
-1
votes
1answer
584 views

Hover Craft Algorithm

I have a hover craft and I would like to implement it but I don't know what the algorithm or equation of how the physics work is. The variables I think would be the falling speed, the aircraft ...
2
votes
1answer
729 views

How can I develop a Lights Out solving algorithm?

I am programming the game that named Lights Out. The purpose of this game is turning all the lights out. There's a flash version of the game here. I want to develop a way of solving the game. How can ...
0
votes
1answer
126 views

How to properly simulate object aproximation towards camera in 2D?

I'm trying to make some objects come towards the camera but it just doesn't feel right... you can check the progress here: http://testing.fyrastudio.com/lab/tweetOlympics/v0.005/ You run by ...
3
votes
1answer
267 views

Efficient visualization of a large voxelized volume

Lets consider a large voxelized volume stored in an oct-tree or any other convenient structure. This volume represents, for instance, a landscape, where each block is either empty (air), or it has an ...
5
votes
2answers
3k views

Best algorithm for recursive adjacent tiles?

In my game I have a set of tiles placed in a 2D array marked by their Xs and Zs ([1,1],[1,2], etc). Now, I want a sort of "Paint Bucket" mechanism: Selecting a tile will destroy all adjacent tiles ...
0
votes
1answer
197 views

How can I locate empty space next to polygon regions?

Let's say I have the following area in a top-down map: The circle is the player, the black square is an obstacle, and the grey polygons with red borders are walk-able areas that will be used as a ...
15
votes
3answers
2k views

How do history generation algorithms work?

I heard of the game Dwarf Fortress, but only now one of the people I follow on Youtube made a commentary on it... I was more than surprised when I noticed how Dwarf Fortress actually generates a ...
3
votes
4answers
3k views

2D Collision in Canvas - Balls Overlapping When Velocity is High

I am doing a simple experiment in canvas using Javascript in which some balls will be thrown on the screen with some initial velocity and then they will bounce on colliding with each other or with the ...
1
vote
2answers
211 views

How can I run and jump at the same time?

I'm having some trouble with the game I started. http://testing.fyrastudio.com/lab/tweetOlympics/v0.002/ The thing is that i have an athlete running and he must jump at the same time. A race with ...
5
votes
2answers
601 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 ...