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

27
votes
2answers
2k views

Random/Procedural vs. Previously Made Level Generation

What the advantages/disadvantages of using random/procedural generation vs. pre-made levels? There seems to be few that I can think of, other than the fact that items may be a problem to distribute ...
1
vote
1answer
290 views

Rubik's cube array rotation

I'm about to make a 3D Rubik's cube based game in Flash AS3 and Away3d. I don't really know how to manage the 2D arrays of the Rubik's cube. For example, how do I rotate the corresponding arrays if ...
1
vote
1answer
139 views

How do I have an arrow follow different height parabolas depending on how long the player holds down a key?

i'm trying to throw an arrow in my game, but i'm having a hard time trying to realize how to make a good parabola. What I need: The more you hold "enter" stronger the arrow goes. The arrow angle will ...
3
votes
2answers
357 views

What would be the most simple following target and neighbors avoidance algorithm in 2D space on plane?

I have ~20 or more enemies and they need to follow a target and avoid to go on top of themselves. I mean follow a target and avoid to collide with each other. Area, on which they are walking, is just ...
11
votes
2answers
787 views

Auto-organized / smart inventory system?

for the past week I've been working on an inventory system with Unity3D. At first I got help from the guys at Design3 but it wasn't too long till we split path, because I really didn't like the way ...
0
votes
1answer
457 views

Grid Based Lighting in XNA/Monogame

I know that questions like this have been asked many times, but I have not found one exactly like this yes. I have implemented a top-down grid based world in Monogame, and am starting on the lighting ...
3
votes
3answers
385 views

How to deal with objects placed in the root nodes of a quad tree?

I've implemented a quad tree where points and axis aligned rectangles can be put. It works fine, except for one issue that I'll try to describe. When you put a rectangle in the tree and this rectangle ...
3
votes
1answer
463 views

How can I divide a 3D mesh into small pieces?

I'm considering a manufacturing game. A player should assemble parts of an object in given time. The object will be a 3D mesh model. I want to automatically split the 3D mesh into many small pieces to ...
2
votes
1answer
109 views

How to get a cone shape of arbitrary size in an hex board

I'm implementing engine tools for my hex board game and this one is becoming messy. I want to get a list of all the positions that a cone of size N would have, given "caster" origin X,Y and origin in ...
4
votes
3answers
379 views

What techniques make next gen look so realistic [closed]

I have watch several gameplays from upcoming titles for ps4 and xbox one and I must admit that they are breath taking. Of course with new hardware, models will have more polygons and higher texture ...
1
vote
1answer
207 views

Painter algorithm on transparant objects

Why do you have to use the painter's algorithm when drawing transparant objects ? Can't you just use a z-buffer, draw all non transparant/opaque objects, then draw all transparant/opaque objects last? ...
1
vote
1answer
173 views

Line draw on “even-q” vertical flat topped hex grid

I'm trying to implement a Line Draw or Line of Sight algorithm for my hex boardgame. Upon reading several different solutions from most common places like the Hex Bible none of the algorithms adapted ...
0
votes
0answers
268 views

Ideas to create a Best Move in a match 3 game

I'm trying to make a match 3 game in C++ and I want to make a best move method to show the player the ideal position to move to get the most amount of points. The rules of the game are as follows: ...
1
vote
0answers
106 views

Non-smooth noise with optimal performance?

Any suggestions on how to get more 'jagged' results like linear interpolation gives with value noise using a faster algorithm concept like simplex noise? Simplex noise I haven't spent enough time ...
9
votes
2answers
620 views

Algorithm for optimising a match game with known queue

I'm trying to write a solver in C# .NET for a game known as Flowerz. For your reference, you can play it on MSN, here: http://zone.msn.com/gameplayer/gameplayer.aspx?game=flowerz. I'm writing it for ...
6
votes
2answers
230 views

How can I generate Sudoku puzzles?

I'm trying to make a Sudoku puzzle generator. It's a lot harder than I expected and the more I get into it, the harder it gets! My current approach is to split the problem into 2 steps: Generate a ...
4
votes
1answer
371 views

Path finding in games

I am writing my term paper about Path finding algorithms in games, and i've got a couple of questions, hopefully you people could help me out with those ;) So, i've done a little bit of searching ...
4
votes
1answer
422 views

Help understanding Simplex Noise

Introduction This is less of a "how to" on using 2D simplex noise and more of a quest to understand what is happening both in the math and visually. I would rather not copy and paste the code I've ...
4
votes
1answer
369 views

Player ranking using ELO with more than two players

I would like to use ELO to track player rankings between matches of a certain game, however the game can be played with up to four players in a match. I have seen games like Carcassonne use ELO with ...
2
votes
4answers
463 views

How do I approximate the result of battle between two armies with known strengths?

I need a simple algorithm to calculate the outcome of two differently sized armies battling. Each army has 1-100 troops and every troop is the same value on the battlefield. The troops do not have ...
3
votes
1answer
349 views

Pygame: circular motion with Bresenham's algorithm

I'm trying to figure out a way to move an object in a circular path. I read about Bresenham's circle algorithm, but all the codes available online draw an entire circle. For my game, I want it so ...
0
votes
1answer
207 views

2D object move & evade obstacle

Description: Actor{ int x,y,width,height; float speed, angle; } actor is an object that move around the map every frame, actor change position(x,y) according to it’s speed & angle ...
0
votes
2answers
274 views

Job finding algorithm

My issue seems simple enough to me, but I can't break it down the the bare essentials to be able to program it into my game. First of all different professions requires different skills, these skills ...
1
vote
1answer
130 views

MiniMax where bots make simultaneous moves .

What is the correct approach for using miminax in a game where bots make simultaneous moves ?
13
votes
2answers
814 views

Partially observable game map — is A* appropriate?

I know very little about game development and I'm trying to wrap my head around pathfinding algorithms. Consider this setup: an agent is on a 2D map and must find the shortest path to a globally know ...
4
votes
1answer
348 views

Help me please to choose proper path-finding algorithm

I am new to game development and just want to ask for advice. I need to know which path-finding algoritm will be suitable for my scenario: Units - any shape. But in most cases rectangles of ...
8
votes
2answers
395 views

Drone targeting

Imagine a "drone" and a target point on a 2d plane. There are eight parameters: P = my position Q = target position V = my velocity I = my moment of inertia w = my angular velocity s = my angular ...
7
votes
2answers
1k views

Comparing two tree structures

I'm having a hard time trying to describe this in correct terms so I will just give as much detail as possible and hopefully someone knows what I'm trying to do =-) I am trying to compare two node ...
3
votes
2answers
460 views

What algorithm to use to fill a KenKen square board with cages?

I am working on recreating KenKen, a popular math puzzle involving a blank grid that is divided into "cages". Each cage is just a collection of adjacent squares and has a clue which is generally a ...
0
votes
1answer
415 views

Pong horizontal movement algorithm

I was just wondering about the horizontal movement of a pong ball? What is the general algorithm used with this? The ball in my pong game just move vertically and I don't know about the algorithms ...
5
votes
1answer
166 views

How to determine what hexes are in an area bounded by 3 hexes

I've been searching for hex grid algorithms for a while now, but I'm not having much luck. I'm working on a game that will be using hex grids for the board. There seems to be sufficient resources to ...
1
vote
1answer
738 views

2D Drag Racing Algorithm

What algorithm can I devise for a 2D drag racing game to simulate a race? The gameplay is 2D and the camera's perspective is from the right side of the cars i.e. cars are seen from their right side ...
7
votes
1answer
290 views

Path Finding for an Arena based map in 3D using NavMesh

I have a 3D arena map (consider a small island surrounded by water on all sides) for a multiplayer Tank fight game. The moveable areas are marked using a Navigation Mesh made by the Arena designer. ...
3
votes
3answers
694 views

Time of Day Lighting / Day Cycle

I'm trying to implement a simple "lighting" system that alters a value of light between 0.0-1.0, 1.0 is midday 0.0 is total blackness. Are there any "good" information regarding this particular ...
2
votes
1answer
482 views

Decomposing a concave mesh into a set of convex meshes

I'd like to be able to decompose a concave mesh into a set of convex meshes for 2 reasons: Transparent rendering Physics shapes Is there an algorithm that takes a set of triangles (concave) as ...
8
votes
1answer
142 views

Flowfield density conversion

I'm trying to implement flowfield navigation, as described in http://grail.cs.washington.edu/projects/crowd-flows/ but I can't understand how the Density Function in Figure 4 of the paper is supposed ...
7
votes
4answers
522 views

Interstellar Economic Simulation

I'm designing a game reminiscent of Elite or Escape Velocity, those old space trading games, where you play a traveling merchant in space. I'd like to have the game's economy at least resemble a real ...
8
votes
2answers
342 views

100 points between 0-1000 on an increasing scale

Basically, it's for roleplay, I need to generate 100 points along a scale. Level 1 is the starting amount, and is at point 0 on the scale. Level 100 is the highest amount planned at this point, and it ...
15
votes
2answers
636 views

Why is my sky color calculation in Mathematica incorrect?

I'm trying to implement an algorithm to calculate sky color based on this paper (Perez' model). Before I start programming the shader I wanted to test the concept in Mathematica. There are already ...
1
vote
4answers
175 views

Checking game objective status in efficient way on each update call

I am creating a 2d mobile game where there are three levels. Each level has 20 objectives. This can increase in the future. Examples: Level 1 Current Objective: 2/20 Objective : Collect 1000 coins ...
13
votes
2answers
365 views

Scrambling word into least recognizable form

My goal is to present the player with a scrambled word that should be reordered back into the original form: OELHL --> HELLO I want a scrambling algorithm that takes any given word(>3or4 letters, ...
-1
votes
1answer
187 views

Server fixed timestep not running at 30Hz but way way too fast [closed]

I'm trying to make my game's server thread run at a fixed 30Hz but can't figure out how. Basically, before I just had a stupid while(1) { //do everything as fast as you can} which means that for my ...
13
votes
1answer
1k views

Get ring of tiles in hexagon grid

Thanks to this post I'm able to collect adjacent tiles to a given tile. But I'm pretty much stuck on an algorithm that gives me only a "ring" of tiles specified by an offset. The algorithm given in ...
2
votes
0answers
158 views

How to trace contour of shapes with holes?

I am experimenting with the RVO2 library for collision avoidance in a 2D simulation. This library supports specifying arbitrary obstacles as a list of vertices. The obstacles must be full shapes, i.e. ...
5
votes
1answer
420 views

How do you parameterize turn based AI?

I would like to create/find an AI algorithm/process that can be parameterized such that a change in the parameters causes a change in the AI behavior. I am specifically looking to apply this to a turn ...
8
votes
2answers
240 views

Determining if removal of a voxel will break up a group

I have the following situation: I have a 3d grid of voxels (on/off, the max size is probably 128x128x128). I know in advance that inside the grid, all the voxels that are turned on are interconnected, ...
11
votes
3answers
859 views

Algorithm to see if two voxels are interconnected

I'm looking for a good algorithms for the following problem: Given a 3D grid of voxels (which may be either empty or filled), if I pick two non-adjacent voxels, I want to know if they are connected to ...
0
votes
1answer
148 views

Simulating building stress [closed]

I need to simulate the effects of adding supporting materials to a building structure for a genetic algorithm in a block-based world. Essentially I am planning to use a genetic algorithm to optimise ...
0
votes
2answers
313 views

How to build a math module and simulate a system?

For example, in the classical game SimCity: an economic model to simulate the supply and demand of the city, then calculate how many people live in each building, how many people work there. a ...
2
votes
1answer
237 views

Collision Resolution: How to avoid Interpenetration/Tunneling Caused by Prior Collision Handling? [duplicate]

My game processes world collisions followed by entity collisions. The problem here is that entities can break through walls the next frame when world checks are run again as a result of the prior ...