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

11
votes
4answers
772 views

How do I get AI Agents to move along a curve?

Currently my very basic AI framework has agents that move along a a jagged path made up of a series of points. They do this by simply moving their position from one point to the next. When they ...
11
votes
4answers
441 views

Fastest way to group units that can see each other?

In the 2D game I'm working with, the game engine is able to give me, for each unit, the list of other units that are in its view range. I would like to know if there is an established algorithm to ...
2
votes
1answer
295 views

Dynamically creating astar node map by triangular polygonal map

My game's map format uses a bunch of triangles to make up the platforms and terrain in 2d. Right now I can set up a 2d array of nodes for the astar algorithm that basically is a bunch of rectangles ...
3
votes
1answer
504 views

Better data structure for a game like Bubble Witch

I'm implementing a bubble-witch-like game (http://www.king.com/games/puzzle-games/bubble-witch/), and I was thinking on what's the better way to store the "bubbles" and to work with. I thought of ...
12
votes
2answers
1k views

How to implement an intelligent enemy in a shoot-em-up?

Imagine a very simple shoot-em-up, something we all know: You're the player (green). Your movement is restricted to the X axis. Our enemy (or enemies) is at the top of the screen, his movement is ...
0
votes
1answer
100 views

How do you map a 3D scene to a stero image pair?

I'm a novice. I'm working in XNA studio with simple models. How can I turn a 3D image into two images meant for the left and right eyes respectively? Note: I'm not referring to "magic eye" - I'm ...
5
votes
2answers
211 views

How to evaluate a user against optimal performance?

I have trouble coming up with a system of assigning a rating to player's performance. Well, technically there is is a trivial rating system, but I don't like it because it would mean assigning ...
19
votes
7answers
2k views

Optimizing gravity calculations

I've got a bunch of objects of varying size and velocity which gravitate towards each other. On every update, I have to go over every object and add up the forces due to gravity of every other object. ...
10
votes
2answers
572 views

Evolving a Terrain Generator

I just recently asked this question and the conclusion seems to be that using genetic programming (GP) for Procedural Game Content Creation hasn't really been done. I want to change that. I'm fairly ...
6
votes
3answers
1k views

Evolutionary Procedural Generation

Are there any examples of companies or papers using evolutionary algorithms (EA) or genetic programming (GP) in procedural generation of content for games? Does this exist in the industry? This is ...
3
votes
1answer
1k views

How many moves to think ahead for chess minimax AI?

I am thinking of making a chess game, and I read up on minimax trees. How many moves should the AI think ahead so that the player doesn't have to wait a long time? If there are 25 possible moves ...
5
votes
2answers
556 views

How could I improve this random map?

following my previous post on random world map generation, I used several algorithms and obtained results similar to this: http://i.imgur.com/CKL2R.png (the height values are quantisied for viewing ...
14
votes
3answers
14k views

How can I create a random “world” in a tile engine?

I am designing a game that is working on a classic tile engine, but whose world is generated randomly. Are there existing games or algorithms that do this? The procedural generation algorithms I have ...
22
votes
2answers
10k views

Understanding Perlin Noise

I'm toying with Perlin Noise after some work with Diamond Square. I followed the implementation by Hugo Elias that basically, makes a series of functions with x,y as input to throw each coordinate ...
3
votes
3answers
846 views

tic tac toe computer opponent

I am just starting to do some very very very basic game dev(in java), i'm trying to create a game of tic tac toe but i am having some trouble implementing an a computer opponent.I just wanted to know ...
-1
votes
2answers
653 views

Why is my Diamond-Square implementation producing blocky, banded results?

Do you know why my diamond square algorithm is giving me this such "ragged" results? I used to render it in a way that concealed the roughness (basically asigning color ranges instead of fractional ...
10
votes
5answers
627 views

How would one determine the length of a path?

I have a game that requires each player to move along one specified path. I draw the path using Bézier curves. How can I determine the total real (not linear) length of the path and the distance that ...
4
votes
3answers
621 views

Implementing recoil in a realistic and balanced way?

To clarify, I've seen this post already I really like the idea that the chosen answer suggests, yet when I go to implement it the recoil still doesn't "feel" right. The problem is mainly the fact ...
7
votes
2answers
224 views

Determining if player-created structure matches a template in a 3D block-based game

Disclaimer: this is one of those dreaded Minecraft-style questions, but I feel it's more a data structures and algorithms question I'm really new to 3D data structures and am wondering what the best ...
7
votes
7answers
591 views

Random looking item placement that's deterministic?

I'm working on a sidescrolling game and I want to generate a forest for the background. I want the background to be the same for every one to make sure the quality is the same. I don't have access ...
8
votes
4answers
4k views

Calculating velocity needed to hit target in parabolic arc

If I have a point which I want to hit at the end or during a parabolic arc, how would I calculate the needed x and y velocity?
6
votes
1answer
567 views

Linking nodes algoritm for Visual Design

I'm developing an editor for my game, and now it's time to make a visual scripting system to let designer modify behaviours. This video shows what i have done and the problem to resolve the link ...
2
votes
1answer
399 views

All Pairs Shortest Paths in Weighted Undirected Graph

I'm currently working on path-finding for my game and need help with finding an efficient algorithm to calculating the all-pairs shortest paths in a weighted undirected graph (each vertex in the graph ...
4
votes
2answers
760 views

How can I implement shader lookups for my material system?

I have been working on a material system and for the most part everything works just fine, however, I hard code the shader that will be used. Obviously this causes a problem when I want to have the ...
2
votes
2answers
268 views

How can I animate a recursive algorithm?

Say I have a recursive algorithm, for example one that generates a random tree: // Pseudocode, just a simple algorithm: it isn't perfect. function generate_branch(angle, length, current_depth, ...
4
votes
2answers
450 views

Enemy mathematical behavior

I'm really trying to up my game in game mathematics and now I'm working on enemy movement and a bit of AI. I have an enemy with two modes attack and avoid, based on an integer avoid variable that's ...
2
votes
1answer
2k views

How do I generate a torus mesh?

I'm trying to programmatically generate vertices and indices for a torus. I found this piece of code somewhere, and it looks like it works, but I'm not certain it is correct. With my little knowledge ...
10
votes
1answer
666 views

Algorithm for a tool to theorycraft stats based on a game(league of legends)

I would like to create a simulator(basically for testing purposes) for a game(League of legends). The basics of the game: you have a hero which has some stats: Health Point Attack Damage Attack ...
-2
votes
1answer
554 views

Dungeon map generator not working in javascript

I am trying to convert this dungeon algorithm from java into javascript, however, my script works 70% of the time. When it works, the rooms are missing a wall on one side, and when it does not work, ...
9
votes
3answers
2k views

Networking in real-time strategy games

What is the current state-of-the-art to network real-time strategy games? I seem to recall that a few years ago, some AAA titles only transmitted the player inputs (Starcraft 1, Age of Empires). ...
0
votes
1answer
568 views

What is the difference between the marching cubes algorithm and metaballs?

After doing some research, I found out about the marching cubes algorithm and "metaballs". How exactly do they differ?
6
votes
2answers
433 views

Is it possible to have concurrent collision detection where every entity acts at exactly the same time?

There are many algorithms that can be used for collision detection. In many cases we check for an overlap in coordinates of an entity. If we make a triangle a,b and c. We have 2 entities at a and b ...
11
votes
3answers
8k views

How to implement A.I. for checkers/draughts?

I saw this checkers game and I wondered how the A.I. was implemented. How should I implement an A.I. for checkers (draughts, dama, dame)? Are there any known algorithms? Very thnaks full to all. I ...
1
vote
2answers
685 views

Why isn't my player movement code working properly?

I'm making a text-based RPG. One thing I've been trying to implement for a long time now is the ability for the player to move North, South, East, or West. I have my code placed in a MoveBehavior ...
12
votes
1answer
322 views

Detecting a sequence of nodes in a grid

Given the image below, I need to detect the most optimal sequence on the board (the green line). The blue/red lines represent possible, but not the best moves. Here are the rules: You can move to ...
4
votes
1answer
708 views

Issue with implemented Minesweeper algorithm

So I'm attempting to learn Python by way of Minesweeper. I've got experience with SDL, so I figured playing around with PyGame sounded like a fun way to learn the syntax of the language. Anywho, I'm ...
4
votes
2answers
349 views

How do I find the contour points of a png?

In my game, I need a way to produce convex polygons from pngs of objects. For example, a maple leaf would result like this: Essentially right now, the way my algorithm works is by putting all ...
5
votes
3answers
2k views

How can I generate a terrain heightmap from the perlin algorithm?

How can I generate a terrain heightmap from the perlin algorithm? I am trying to make a terrain generator (like World Machine). This is the source code I have for the perlin. The only thing that I ...
9
votes
6answers
724 views

Solving maze without return ability

I need to write a program that will solve maze. Maze has graph structure, where each node - some room, and edges - exits to other rooms: Specification: We start from a random room. Maze has ...
23
votes
2answers
824 views

Algorithm for spreading labels in a visually appealing and intuitive way

Short version Is there a design pattern for distributing vehicle labels in a non-overlapping fashion, placing them as close as possible to the vehicle they refer to? If not, is any of the method I ...
8
votes
2answers
422 views

Manage a large number of independent actors in real-time

I am working on a large scale real-time strategy game - ideally with thousands of units active at once - but I am having trouble managing all of the units at once without it becoming astonishingly ...
3
votes
2answers
524 views

How does Half Life's covering work?

Enemies in this game take cover. AFAIK HL uses some logical decisions for enemy to start searching for cover and to abandon cover, and I am able so far to find them; but how does he find a cover ...
49
votes
2answers
3k views

How can I get textures on edge of walls like in Super Metroid and Aquaria?

Games like Super Metroid and Aquaria present the terrain with the other facing parts having rocks and stuff while deeper behind them (i.e. underground) there's different detail or just black. I ...
2
votes
2answers
491 views

Best way to traverse triangles in a mesh

I'm implementing non-projective decals. As described in many places (ie: lengyel in the gpg2) I first need to detect all triangles that lie within some sort of frustum. Besides obvious brute-force ...
1
vote
2answers
2k views

AI for solving a Match 3 game

Is there a known good way to have a "computer" opponent play a Match 3 game? It doesn't have to be fancy, or even considered fair. If the AI always takes the best move on the board that would be OK ...
11
votes
4answers
13k views

Logic behind a bejeweled-like game

In a prototype I am doing, there is a minigame similar to bejeweled. Using a grid that is a 2d array (int[,]) how can I go about know when the user formed a match? I only care about horizontally and ...
9
votes
1answer
717 views

Are there well-known algorithms for fitting a polygon to an arbitrary shape?

I'm using the Chipmunk physics engine to make the levels for a 2D C game. I'd like to be able to fit a polygon to an arbitrary shape to serve as the collision mask. Given a black and white collision ...
24
votes
4answers
3k views

Finding the nearest object

I have a sizable game engine and I'd like a feature for finding the nearest of a list of points. I could simply use the Pythagorean theorem to find the distances. I know I can't simply add x and y, ...
11
votes
5answers
1k views

How could you parallelise a 2D boids simulation

How could you program a 2D boids simulation in such a way that it could use processing power from different sources (clusters, gpu). In the above example, the non-coloured particles move around ...
11
votes
1answer
1k views

How to gain accurate results with Painter's algorithm?

A while ago I asked how to determine when a face is overlapping another. The advice was to use a Z-buffer. However, I cannot use a Z-buffer in my current project and hence I would like to use the ...