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

0
votes
1answer
207 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
283 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
99 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
241 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
111 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
590 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
353 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
497 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
338 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
629 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
810 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
271 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
203 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
1answer
621 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 ...
1
vote
1answer
562 views

What algorithms can I use for bullet movement toward the enemy?

I'm developing 2D strategy game. There are weapons that shoot at enemies. From what I've read in this, this, this and this post I think that I need linear algebra, but I don't really understand what ...
5
votes
4answers
765 views

Find nearest tile of type x

I currently have an array of tiles which makes up the tilemap (stored as an int array) and I want an NPC to be able to move itself to the nearest tile of type X (ie find the nearest tree and chop it ...
3
votes
2answers
2k views

C# XNA: Effecient mesh building algorithm for voxel based terrain (“top” outside layer only, non-destructible)

To put this bluntly, for non-destructible/non-constructible voxel style terrain, are generated meshes handled much better than instancing? Is there another method to achieve millions of visible quad ...
-1
votes
1answer
1k views

MiniMax not working properly(for checkers game)

I am creating a checkers game but My miniMax is not functioning properly,it is always switching between two positions for its move(index 20 and 17).Here is my code: public double MiniMax(int[] ...
4
votes
1answer
868 views

AABB Sweeping, algorithm to solve “stacking box” problem

I'm currently working on a simple AABB collision system and after some fiddling the sweeping of a single box vs. another and the calculation of the response velocity needed to push them apart works ...
8
votes
3answers
4k views

Road / river generation on 2d grid map

This is a newbie question, but here it goes: My map is a 2d grid, and I want to generate roads and rivers. The route from the starting to ending point must not be the optimal route in number of ...
2
votes
1answer
3k views

How to utilize miniMax algorithm in Checkers game

I am sorry...as there are too many articles about it.But I can't simple get this. I am confused in the implementation of AI. I have generated all possible moves of computer's type pieces. Now I can't ...
6
votes
2answers
424 views

Algorithm to reduce a bitmap mask to a list of rectangles?

Before I go spend an afternoon writing this myself, I thought I'd ask if there was an implementation already available --even just as a reference. The first image is an example of a bitmap mask that I ...
6
votes
3answers
789 views

Is it better to hard code data or find an algorithm?

I've been working on a boardgame that has a hex grid as this board: Since the board will never change and the spaces on the board will always be linked to the same other spaces around it, should I ...
10
votes
4answers
629 views

Circular motion on low powered hardware

I was thinking about platforms and enemies moving in circles in old 2D games, and I was wondering how that was done. I understand parametric equations, and it's trivial to use sin and cos to do it, ...
3
votes
2answers
634 views

What is the appropriate way of placing game objects in a 2d game?

I'm developing a 2d game for Android.It will be an endless game.I have some items like coins ,plants and other special items.How can i place them effectively?Are there any algorithm or any suggestion ...
5
votes
3answers
909 views

Is there a repository of game logic algorithms?

I'm writing my first 2D game, and I'm writing some tracking logic for the computer enemies. Basic follow-the-player tracking was easy, but ineffectual. Too easy to escape. So I'm trying to implement ...
3
votes
1answer
670 views

Drawing an outline around an arbitrary group of hexagons

Is there an algorithm for drawing an outline around around an arbitrary group of hexagons? The polygon outline drawn may be concave. See the images below, the green line is what I am trying to ...
5
votes
1answer
5k views

Checkers AI Algorithm

I am making an AI for my checkers game and I'm trying to make it as hard as possible. Here is the current criteria for a move on the hardest difficulty: 1: Look For A Block: This is when a piece is ...
5
votes
2answers
561 views

How to place rooms proceduraly (rule based) on in a game word

I am trying to design the algorithm for my level generation which is a rule driven system. I have created all the rules for the system. I have taken care to insure that all rooms make sense in a grid ...
1
vote
1answer
810 views

Pathfinding using nodes/waypoints without connecting them?

I've been doing some research on pathfinding lately because I want to code a game modification for a game (won't say which exactly) and what I've done is defined a huge list of 3D vectors where a ...
23
votes
2answers
1k views

How do I produce “enjoyably” random, as opposed to pseudo-random?

I'm making a game which presents a number of different kinds of puzzles in sequence. I choose each puzzle with a pseudorandom number. For each puzzle, there are a number of variations. I choose the ...
5
votes
2answers
261 views

Randomly generated track

I would like to create randomly generated track from one point to another with specified length of that track (it can be 2 more or less as a result of that function) in matrix. I have function called ...
5
votes
1answer
517 views

Algorithm for constructing the corners of a regular, n-sided polygon

I've googled this using a lot of keyword combinations, but to my great surprise I could not find an algorithm for constructing a regular, n-sided polygon into a given circle, i.e., finding the ...
7
votes
2answers
1k views

Choose tile based on adjacent tiles

I am working on a tiled map editor, and I need to choose tiles automatically, based on the adjacent tiles. For example, when placing a road tile, next to another road tile, the two need to be oriented ...
3
votes
1answer
111 views

Resource transportation network

I've been writing a game in my free time, and I'm planning to add a transportation network based on a buildings demands and production. However, I'm not sure how to manage this efficiently, and most ...
-3
votes
1answer
645 views

match-3, 4, 5, 6? Algorithm for a puzzle match game that will change the number of matches required

I was wondering if someone had an idea or had some thoughts behind creating a match-3, match-4, match-5... all the way to match-10 just by changing a variable. I think it is easy to do a match 3 or ...
0
votes
2answers
1k views

3D: First Person Movement

I've searched and searched for a solution today but haven't found one. I have a Camera with Vector3 and also the camera has an angle. If I use this: hero.position.x += speedX; hero.position.z += ...
2
votes
4answers
406 views

Acceleration based on current speed?

The faster an object goes, the slower it will accelerate, going from 0 to 50 takes a lot less time then going from 50 to 100, How do I calculate that, though? EDIT: Extra details, This specific ...
5
votes
2answers
955 views

How do I implement a field of vision for AI entities?

I am considering how to implement a field of vision system for my AI entities, but am not sure on the order of steps to take. The thought process that I had was to use a combination of radial distance ...
3
votes
3answers
600 views

AI algorithm for avoiding bullets in a shoot-em-up game

I am working on a shoot-up-game in XNA, it is going to be my final project in school. I was thinking of utilizing the minimax algorithm for AI agents for making tactics. However, I realized that the ...
2
votes
2answers
2k views

Match-3 game level generator

I made match-3 game and now i trying to add level generator. Now I generate level by filling random cells with random blocks, but I want to create generator which for given number of moves and number ...
4
votes
3answers
1k views

Bubble shooter falling algorithm

To complete this question about the same color search algorithm, I would like to know if someone knows which is the best implementation for making other bubbles fall when they are no longer attached. ...