Skip to main content

Questions tagged [algorithm]

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.

Filter by
Sorted by
Tagged with
82 votes
5 answers
39k views

I've been looking at some algorithms and articles about procedurally generating a dungeon. The problem is, I'm trying to generate a house with rooms, and they don't seem to fit my requirements. For ...
pek's user avatar
  • 2,827
69 votes
7 answers
22k views

I would like to understand on a fundamental level the way in which A* pathfinding works. Any code or psuedo-code implementations as well as visualizations would be helpful.
Daniel X Moore's user avatar
62 votes
9 answers
58k views

What is a good texture packing algorithm? Technically, bin packing is NP-hard, so a heuristic is what I'm really after.
deft_code's user avatar
  • 7,642
56 votes
1 answer
41k views

I have been looking at shaders found here shadertoy.com and most of the cool ones have noise and raymarch in common. I do not understand the source code at all but I really want to. How do these ...
jmasterx's user avatar
  • 2,099
52 votes
11 answers
59k views

I'd like to read up on path finding algorithms. Is there a primer available or any material or tutorials on the Internet that would be a good start for me?
49 votes
3 answers
11k views

I'm working on a Worms-styled game and want to generate some terrain procedurally. I've previously done a lot of terrain generation using perlin noise, and this is what I started out using for this ...
Xeon06's user avatar
  • 1,152
49 votes
3 answers
46k views

How would I go about using a random seed to generate a game level? The same seed should always generate the exact same level. For this example it would be a Worms style level. So each level would ...
Adam Harte's user avatar
  • 2,454
40 votes
9 answers
14k views

I'm working on a game which requires players to draw a line from a point A(x1,y1) to the other point B(x2,y2) on the screen of an Android device. I want to find how well that drawing fits to a ...
user3637362's user avatar
38 votes
5 answers
28k views

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 each distance and choose the minimum one, but that ...
ultifinitus's user avatar
  • 1,912
37 votes
5 answers
38k views

I've been working on a 3D procedural world for a while now and am wanting to start adding cave systems. I'm currently using 2D/3D Perlin Noise for the terrain generation in combination with Marching ...
Mythics's user avatar
  • 1,486
34 votes
12 answers
10k views

I am making a simple tile-based 2D game, which uses the A* ("A star") pathfinding algorithm. I've got all working right, but I have a performance problem with the search. Simply put, when I click an ...
user2499946's user avatar
33 votes
7 answers
4k views

Assume you have a game in which there are many (many many) entities serving some functions, not all of which are constantly needed or need to be considered in every frame. The concrete problem I am ...
Marc Müller's user avatar
  • 1,007
32 votes
5 answers
77k views

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 ...
user223150's user avatar
32 votes
2 answers
13k views

Is there an algorithm to generate a lightning bolt? I would like an algorithm that generates a list of segment or point objects specifying where the bolt will land. The method would need a start point ...
Geoffroi's user avatar
  • 485
32 votes
2 answers
30k views

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 ...
Gabriel's user avatar
  • 1,153
32 votes
2 answers
9k views

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 ...
Pip's user avatar
  • 1,454
30 votes
2 answers
25k views

I'm making a 4 player co-op r-type game, and I'm about to implement the collision detection code. I've read a lot of articles and stuff about how to handle collision detection, but I'm having a hard ...
dotminic's user avatar
  • 1,637
30 votes
2 answers
6k views

I'm just starting to learn about path-finding and have been looking into the A* algorithm and my main concern is that it all of the examples I have seen show static obstacles that it computes around. ...
Ethan The Brave's user avatar
30 votes
5 answers
4k views

I'm currently dealing with a multiplayer combat system where the damage dealt by the players is always multiplied by a random factor between 0.8 and 1.2. In theory, a truly random RNG may eventually ...
User not found's user avatar
30 votes
4 answers
24k views

I should say paths, not roads as I'm thinking more medieval-like. Also, not looking for realism. The answer I'm looking for will be to fit into the mold I describe rather than realism. I am looking ...
Mythics's user avatar
  • 1,486
29 votes
4 answers
26k views

I'm looking to generate noise that looks like this: (images courtesy of Understanding Perlin Noise) I'm basically looking for noise with lots of small "ripples". The following is undesirable: Are ...
Xeon06's user avatar
  • 1,152
29 votes
2 answers
7k views

I am somewhat intrigued by the diagram found here representing 1800 years of cultural history in an imaginary world some guy created. This sort of thing would seem to have strong applications for game ...
pdusen's user avatar
  • 389
29 votes
1 answer
13k views

I'm looking to create a simple, "randomly" generated map for a small game. The game consists of a top-down view of a world, with land-mass and ocean areas. Think of a simple outline map of the world ...
Cylindric's user avatar
  • 393
28 votes
4 answers
5k views

On this map, the "mainland" is all the land that can be connected to the center of the map in the four cardinal directions (north, south, east, west -- not diagonally). I would like to detect the ...
Gabriel's user avatar
  • 1,153
28 votes
7 answers
30k views

What algorithm have you used in the past to generate a simple 2d maze?
dontsellmydata's user avatar
28 votes
3 answers
35k views

I want to understand how navmeshes work, how to implement them and why it is better than other types of pathing systems.
Fire's user avatar
  • 742
27 votes
2 answers
3k views

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 ...
Hilton Campbell's user avatar
26 votes
2 answers
2k views

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 ...
mac's user avatar
  • 1,375
24 votes
11 answers
4k views

I'll start off with John Carmack's the Fast Inverse Square Root in Quake III: ...
24 votes
3 answers
46k views

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 ...
lezebulon's user avatar
  • 1,422
24 votes
3 answers
13k views

I have a matrix of tiles, on some of that tiles there are objects. I want to calculate which tiles are visible to player, and which are not, and I need to do it quite efficiently (so it would compute ...
Rogach's user avatar
  • 343
24 votes
1 answer
3k views

Tetris-Tiles are stored as a 4x4 boolean matrix. Each rotation step has it's own matrix, the representation of the T-Block would look like this: ...
bummzack's user avatar
  • 22.7k
23 votes
3 answers
10k views

I'm working on trying to improve the pathfinding for my game's enemies. Right now, they basically just constantly move towards the player's exact position by calculating the angle between themselves ...
Darin Beaudreau's user avatar
23 votes
7 answers
5k views

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. ...
Carson Myers's user avatar
23 votes
6 answers
22k views

What is the simplest method to generate smooth terrain for a 2d game like "Moon Buggy" or "Route 960"? I got an answer at stackoverflow.com about generate an array of random heights and blur them ...
astropanic's user avatar
23 votes
6 answers
5k views

I'm creating a demo of 20 balls bouncing each other, with a background filled with a solid color. Color for each ball is chosen randomly with randint(0, 255) for ...
MestreLion's user avatar
23 votes
2 answers
17k views

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. ...
Ross Hays's user avatar
  • 497
23 votes
6 answers
2k views

Imagine we have a wizard that knows a few spells. Each spell has 3 attributes: Damage, cool down time, and a cast time. Pretty standard RPG stuff. Cooldown time: the amount of time (t) it takes ...
aaronfarr's user avatar
  • 468
21 votes
3 answers
37k views

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 m ...
Solid Soft's user avatar
21 votes
8 answers
14k views

If you have a 2D vector expressed as x and y, what's a good way of transforming that into the closest compass direction? e.g. ...
izb's user avatar
  • 890
21 votes
4 answers
23k views

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?
James's user avatar
  • 453
21 votes
1 answer
11k views

I draw isometric map with tile 64x32: ...
Alexan-Dwer's user avatar
20 votes
5 answers
13k views

I have an image that contains a circles at a specific location, and of a specific diameter. What I need to do is to be able to calculate random points within the circle, and then manipulate the pixels ...
DMills's user avatar
  • 303
20 votes
3 answers
9k views

I have a room object defined by a collection of looping line segments that I need to calculate the area for. The classes can be described as follows (in pseudo-code): ...
user avatar
20 votes
3 answers
10k views

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 ...
jcora's user avatar
  • 7,917
20 votes
6 answers
2k views

I need to find the shortest distance direction from one point in my 2D world to another point where the edges are wrapped (like asteroids etc). I know how to find the shortest distance but am ...
crazy's user avatar
  • 301
19 votes
3 answers
6k views

I am creating a Minecraft-like engine in XNA. What I want to do is create floating islands similar to the one shown in this video: http://www.youtube.com/watch?v=gqHVOEPQK5g&feature=related ...
Darestium's user avatar
  • 1,154
19 votes
3 answers
18k views

I'm currently doing some pathfinding research and my simulation is the following: I have a 3d scene with a start and end point represented, I'm capable of creating navigational meshes, waypoints and ...
Andrei's user avatar
  • 191
18 votes
14 answers
4k views

In academia worst case Big O is taught over everything else. Compared to space complexity, normal case analysis, simplicity over complexity, etc. In particular to game programming and industry, what ...
David Young's user avatar
  • 3,330
18 votes
3 answers
4k views

Have you read The Chronicles of Amber by Roger Zelazny? Imagine yourself playing in 3rd person MMO game. You spawn in the world and start to wander around. After some time, when you think, that you'...
netaholic's user avatar
  • 281

1
2 3 4 5
24