Tagged Questions
The algorithm tag has no wiki summary.
0
votes
1answer
99 views
Best Algorithm for attacking in the Risk Game
I apologize in advance for my English.I'll try to explain my problem.
I am working on new version of the Risk game. I want to change the attacking algorithm to make it more similar to real life war. ...
4
votes
3answers
184 views
Generating random Pools or lakes
I have implemented functions that can draw any polygonal shape, however I have been unable to generate a smooth shape that mimics the rounded edges of a lake. I tried generating two circles and ...
7
votes
1answer
242 views
Helicopter game, but waves?
I'm looking into adapting the classic "helicopter" game (i.e. http://www.addictinggames.com/helicopter.html), but I haven't yet figured out how to create the wall-generation engine.
Any pointers into ...
20
votes
4answers
755 views
Is there an algorithm to detect the “mainland” on a 2D map?
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 ...
5
votes
4answers
359 views
What kind of hardware would be required to render an Earth sized minecraft like map?
I have been thinking about this problem. Is it possible with current technology to create a 1:1 replica of the earth in voxel based game? What's the best data structure to store this giant map? Which ...
8
votes
2answers
226 views
Function for sun movement?
So, given a sun sprite set at the horizon (x = 0, y = worldheight/2) I'm trying to devise a function to make the sun rise, then fall.
The best way to do this would be the sin function, but I have no ...
7
votes
2answers
134 views
Quick 2D sight area calculation algorithm?
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 ...
2
votes
2answers
170 views
Is there a known most efficient version of A* search algorithm?
Is there a known 'most efficient' version of the A* search algorithm? I know some people write papers on the most efficient way to compute common operations, has this been done for A*?
3
votes
3answers
236 views
Efficient Tile-based collision detection for a lot of squares?
currently I am working on my own take of a tile-based game (think Terraria, but less fantastical (I think that's a word? Sorry if it isn't)).
Anyway, I currently have collision detection working ...
3
votes
1answer
168 views
Documentation on 2D space partitioning
I am looking for documentation that explains the different kinds of (well the major ones anyway) 2D space partitioning algorithms & data structures.
Any pointers besides 'Google it and sift ...
2
votes
1answer
92 views
How does double dispatch help collision detection?
There are a few specific techniques to test if one object has hit another object in a game. One of them is called "double dispatch." Can someone explain what double dispatch is, and how it can be used ...
13
votes
3answers
662 views
How can I generate floating land masses for a Minecraft-like engine?
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
...
5
votes
2answers
133 views
Tile pair matching algorithm
I'm trying to make a tile matching game. User can select a pair of tiles from a square grid, and if they match, both are removed from the grid.
Tiles are matched if:
they are of the same type ...
4
votes
2answers
144 views
What is the best way to store temporary selected characters and their insertion order?
I'm developing word game similar to word mole. I'm having a hard time determining how to store temporary selected character (and in turn will changed into word).
Here's the situations. Say, I have ...
3
votes
2answers
178 views
How to place objects/entities randomly in JS?
I'm making a game and I have a script (running it with Node) on the server that currently just randomly places things on the map... I'd like to change that. I saw something about Perlin noise but I'm ...
4
votes
1answer
209 views
Generate islands/continents with simplex noise
Managed to get something like this using a simplexnoise port i made from the original javacode to php:
Used some tips from other post:
Understanding Perlin Noise
basically, lowered the frequency ...
2
votes
1answer
122 views
Help me to fine tune my diamond-square algorithm
Check this map i generated:
I seeded a sine wave to act as a mountain range. The lower portion of the sine wave looks fine, but the upper side is thin, the algorithm did not do its magic there ...
2
votes
1answer
134 views
How can I organize code for views efficiently?
I'm making a video game for the Android platform and I need advice on the overall set up of the activities and views in the code. I don't need actual code, psuedocode will do, but actual code always ...
3
votes
2answers
114 views
Balancing a binary tree continuously
In my game I have a tree of objects in 3D space, to which new objects are frequently added.
Over time, the binary tree becomes unbalanced which is a big problem for efficiency as the tree can become ...
2
votes
2answers
124 views
Algorithm to generate small tree-like branches?
I'd like to seed a void map with "branches" of sine waves or any other waveform. Something like:
Know of any algorithm? Has to be one to generate trees or something like that.
3
votes
1answer
87 views
Find sub-graphs in a graph
The initial problem I'm trying to solve is for pac-man, but of course there must be thousands of other situations with the same problem. I consider the pac-man grid to be a graph (two ways of doing ...
2
votes
3answers
127 views
Simple speed deceleration with variable time step?
When you use a fixed time step you can call speed=speed*0.95 to emulate speed deceleration in a simple way.
I want to do the same thing with variable time step.
I wish to have a simple function ...
12
votes
4answers
352 views
Simple noise generation
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:
...
3
votes
1answer
87 views
Math behind simulating a simple light source for rotated rectangle?
Say I have a 2D Rectangle. By offsetting its position by x y and rendering a shadow by an offset, it gives the illusion of a shadow. If I rotate the rectangle Z degrees and try it with the same ...
0
votes
2answers
159 views
Learning C++, algorithms and vectorial algebra [closed]
I need your recommendations for a good study source about videogame orientated C++, algorithms and vectorial algebra.
I will be applying to a videogame programmer course in January so I need to start ...
3
votes
2answers
61 views
Score Based on Game play Time and a Int
I'm trying to do a score that is based on the time taken and number of manipulators used. The faster you do it, with the fewest manipulators, the higher the score. I've managed to get it working with ...
12
votes
2answers
498 views
How can I generate Worms-style terrain?
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 ...
6
votes
3answers
275 views
Algorithm for Randomized Weather
I'm having a hard time modeling weather.
Modeling a single aspect is trivial - some sinusoidal pattern + random noise. However more than 1 is blowing my mind. I cannot have wind, falling leaves, ...
6
votes
5answers
489 views
What rendering techniques would I use to draw a drop shadow effect for cards in a card game?
What type of shading algorithm might be used to create shadows like these?
the one I'm making is similar but it is all done with a 2D drawing API powered by OpenGL so there is no Z coordinate.
In ...
2
votes
1answer
133 views
How can I make a car follow the terrain in a 2D (side-view) game?
I'd like to create a game where a car drives over a 2D terrain.
Which algorithm to use so the car will follow the mountain incline?
6
votes
1answer
120 views
Finding which tiles are intersected by a line, without looping through all of them or skipping any
I've been staring at this problem for a few days now. I rigged up this graphic to help me visualise the issue:
http://i.stack.imgur.com/HxyP9.png
(from the graph, we know that the line intersects ...
0
votes
1answer
138 views
MiniMax function throws null pointer exception
I'm working on a school project, I have to build a tic tac toe game with the AI based on the MiniMax algorithm. The two player mode works like it should.
I followed the code example on ...
2
votes
1answer
124 views
Moving two objects proportionally
I'm trying to move two objects away from each other at a proportional distance, but on different scales. I'm not quite sure how to do this. Object A can go from position 0.1 to 1. Object B has no ...
16
votes
6answers
202 views
Finding direction of travel in a world with wrapped edges
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 ...
9
votes
4answers
238 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
346 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
78 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 ...
2
votes
1answer
120 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 ...
5
votes
2answers
249 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
46 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 ...
4
votes
2answers
163 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 ...
13
votes
6answers
683 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. ...
7
votes
2answers
251 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
344 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 ...
2
votes
1answer
222 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
300 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 ...
9
votes
3answers
638 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 ...
14
votes
2answers
869 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 ...
1
vote
3answers
234 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
265 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 ...