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

3
votes
1answer
98 views

How do you construct a node map for pathfinding in a non-tiled 2D environment? [duplicate]

A* and Dijkstra's pathfinding algorithms work by navigating a node map. In a tile-based 2D environment, these nodes could easily be inferred to be the literal x,y positions of the map. For example, ...
-1
votes
0answers
41 views

odd man out rules for a 9 boxes having 1 odd man [closed]

i'm building a html game , in which i have 9 boxes showing some sort of sequences of images in which i have to find the odd one pattern and click on that box,..i want rules to generate those patterns ...
3
votes
1answer
76 views

Symmetry preserving path simplification

I'm using the Douglas peucker (DP) algorithm to simplify some (2d) closed paths forming a shape. This works pretty good, but not so much for closed paths that have some symmetry. Take for example a ...
1
vote
1answer
65 views

Locating point on a closed path to maximize sum of distances to a sample of weighted points

I'm doing AI for a simple puzzled game and need to solve the following problem efficiently (less than 1 sec for the range specified since I need to do many iterations in a game). A sample of N (1 ...
0
votes
1answer
159 views

What's wrong with reversing an action like this?

I'm working on an undo and redo system map editor and have come across a major issue. If I place a tile down, move right a tile, and then move back to that tile I previously placed everything works ...
0
votes
1answer
52 views

Square collision: Detect which side of the wall it collided [duplicate]

I'm using a standard square collision in my 2D game. The player shoots little balls, and when they hit any wall it should bounce. The problem is that I know when it hits a wall but I don't know if ...
5
votes
1answer
213 views

Triangulating a partially triangulated mesh (2D)

Referring to the above exhibits, this is the scenario I am working with: starting with a planar graph (in my case, a 2D mesh) with a given triangulation, based on a certain criterion, the graph ...
10
votes
3answers
298 views

How do I make something I flash/blink more frequently as it gets closer to disappearing?

In my game when you kill an enemy they may drop something like a health pack or gold. I want this to have a time limit so that it eventually disappears if you don't pick it up. I want the item to ...
0
votes
1answer
70 views

Tangent basis calculation problem

I have the problem with seams with calculating a tangent basis in my application. I'm using a seems to be right algorithm, but it gives wrong result on the seams. What am I doing wrong? Is there a ...
0
votes
1answer
85 views

Enumerating full game tree for small board game

I am trying to list all the possible positions in a small board game (nannon) (using C++) So far I have decided to split it into two parts, the pieces that are in home positions and end positions ...
1
vote
1answer
111 views

AI discover algorithm

I am curious as to what algorithm/logic game AI/NPCs would use when discovering information about their environment. There are two scenarios that I could envision. The NPCs are all knowing in ...
-2
votes
0answers
35 views

Move from A to B in a straight line algorithm [duplicate]

Im developing a 2D game in JavaScript where someone can aim and shoot. The player can aim with the mouse where he wants to shoot and then fire. The bullet will have to travel from the player to the ...
1
vote
0answers
53 views

How to space actors in scene uniformly?

I have a Array data structure right now, which contains 10 soldiers in my army. They can setup initially in various formations - e.g. o o o o o o o o o o The user can move one of the ...
17
votes
3answers
449 views

How can I maintain a rectangular formation when units are added or removed?

I've got bots in a rectangular formation with rows and columns. A problem arises when a bot is added or removed from the formation. When this happens, the bots have to rearrange themselves so that the ...
1
vote
2answers
150 views

How do I apply different probability factors in an algorithm for a cricket simulation game?

I am trying to write the algorithm for a cricket simulation game which generates runs on each ball between 0 to 6. The run rate or runs generated changes when these factors come into play like skill ...

1 2 3 4 5 29
15 30 50 per page