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.
4
votes
1answer
932 views
Significance of Bresenhams Line of Sight algorithm
What is the significance of Bresenhams Line of Sight algorithm in chasing and evading in games?
As far as i know and implemented this algorithm calulates the straight line between two given points. ...
4
votes
2answers
1k views
Control diamond square algorithm to generate islands/pangea
I generated a height map with the diamond square algorithm. The thing is i do not manage to create islands, this is, restrict the height other than water level range to a certain value in the center ...
4
votes
2answers
499 views
How to implement auto-aiming / auto-targeting
We all know how auto-aiming or auto-targeting works in games.
Now, I need to find how to implement it in my game.
In fact I should implement it in UDK and I would be glad if anyone gave me more ...
4
votes
1answer
182 views
In the GJK algorithm, when is a point ever closer to the origin than a line?
The GJK algorithm depends upon a function in its loop that updates the simplex and search direction for the next iteration (which is often called something like DoSimplex() or ProcessSimplex()). In ...
4
votes
2answers
655 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 ...
4
votes
1answer
173 views
Are there any clever methods of regulating bandwidth usage for voice chat payload packets?
For example, suppose my code can determine that upstream bandwidth is unusually limited. And suppose I'm using a fully-connected mesh topology combined with a UDP-like protocol for voice chat. Is ...
4
votes
0answers
241 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 ...
4
votes
2answers
1k views
Bitmap font rendering, UV generation and vertex placement [closed]
I am generating a bitmap, however, I am not sure on how to render the UV's and placement. I had a thread like this once before, but it was too loosely worded as to what I was looking to do.
What I am ...
3
votes
2answers
1k 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 ...
3
votes
2answers
257 views
Algo for narrowing cavern
I'm in a bit of crunch time and I find myself spending way too much time tinkering with an algo, so I would like some help.
In the game I am working on, there are some old-style, pixelated minigames. ...
3
votes
5answers
602 views
In what instances would you want to use path-finding algorithms other than A*?
I am familiar with how the common ones technically work (BFS, DFS, Dijkstra, A*) but as far as their realistic benefits I don't quite see the need for them. Considering that, given the right ...
3
votes
2answers
453 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 ...
3
votes
2answers
768 views
Why would someone chose midpoint displacement over perlin noise for 3D terrain generation?
I myself am creating a terrain generation algorithm and would be interested in knowing why others have chosen midpoint displacement over perlin noise. Minecraft is an example where midpoint ...
3
votes
2answers
537 views
Factors to consider when building an algorithm for gun recoil
What would be a good algorithm for calculating the recoil of a shooting guns cross-hairs?
What I've got now, is something like this:
Define min/max recoil based on weapon size
Generate random ...
3
votes
1answer
439 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 ...
3
votes
1answer
164 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 ...
3
votes
2answers
420 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 ...
3
votes
1answer
1k views
How Can I Improve This Card-Game AI?
Let me get this out there before anything else: this is a learning exercise for me. I am not a game developer by trade or hobby (at least, not seriously) and am purely delving into some AI- and ...
3
votes
2answers
473 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 ...
3
votes
3answers
407 views
What algorithm can I use to detect simple shapes in a 4x4 matrix?
I'm working on a simple multiplayer game that receives a random 4x4 matrix from a server and extracts a shape from it.
For example:
XXOO OXOO
XXOX XXOO
XOOX and XOOO
XXXX OXXX
...
3
votes
1answer
549 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 ...
3
votes
2answers
311 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 ...
3
votes
1answer
334 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 ...
3
votes
1answer
798 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 ...
3
votes
3answers
693 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 ...
3
votes
2answers
558 views
Infinite loop during A* algorithm
The A* algorithm is used by enemies to have a path to the goal. It's working but when sometimes I placed a tower in a grid (randomly) it produces a stack overflow error. The A* algorithm would iterate ...
3
votes
3answers
1k views
Collision detection of convex shapes on voxel terrain
I have some standard convex shapes (cubes, capsules) on a voxel terrain. It is very easy to detect single vertex collisions. However, it becomes computationally expensive when many vertices are ...
3
votes
1answer
373 views
AI Game Programming : Bayesian Networks, how to make efficient?
We know that AI is one of the most important part of Game Programming. Bayesian networks is one of the core part of AI at Game Programming.
Bayesian networks are graphs that compactly represent the ...
3
votes
2answers
85 views
Need the co-ordinates of innerPolygon
Let say I have this diagram,
Given that i have all the co-ordinates of outer polygon and the distance between inner and outer polygon is d is also given. How to calculate the inner polygon ...
3
votes
2answers
345 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 ...
3
votes
3answers
1k views
Which algorithm used in Advance Wars type turn based games
Has anyone tried to develop, or know of an algorithm such as used in a typical turn based game like Advance Wars, where the number of objects and the number of moves per object may be too large to ...
3
votes
1answer
103 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 ...
3
votes
1answer
92 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 ...
3
votes
1answer
78 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 ...
3
votes
1answer
96 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
3answers
765 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. ...
3
votes
2answers
157 views
Load state / continue game based on user input
I'm working on a rather simple 2D game, with a pretty small set of values that will need to be preserved for a user to pick up where they left off last time they played.
Rather than saving/loading ...
3
votes
1answer
212 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
1answer
78 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 ...
3
votes
1answer
59 views
Retrieve outer most points on a 2d graph
G'day everyone,
I have a 2d graph which has some points plotted on it.
What I need to do is get only the outer most points so that I can connect them up (isn't really relevant).
What I can't seem ...
3
votes
1answer
204 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 ...
3
votes
2answers
373 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 ralized that the ...
3
votes
2answers
286 views
Programmatically drawing a “pencil” line or curve
If you look closely (scan it on a computer and zoon in) at a carbon pencil line you can see that there are differing shades of gray. I tried looking on the Internet for any kind of algorithm or ...
3
votes
3answers
267 views
Algorithm for generating levels for shooting game
I have a shooting game made in Java. It's based on time, i.e you have to shoot the objects before the time runs out. Everything is working fine, except that I'm trying to implement an algorithm to ...
3
votes
1answer
534 views
Breakout clone, how to handle/design for collision detection/physics between objects?
I'm working on a breakout clone, and I wish to create some realistic physics effects for collision - angles on the paddle should allow the ball to bounce, as well as doing curve balls etc. I could use ...
3
votes
1answer
136 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 ...
3
votes
2answers
208 views
Syncing game states in a multiplayer RTS game
I'm working in a group with 2 friends on our Gr. 12 final project for programming. We're making a multiplayer RTS game. I've been assigned to the networking section of the game, and none of us have ...
3
votes
2answers
145 views
how to calculate intersection time and place of multiple moving arcs
I have rocks orbiting moons, moons orbiting planets, planets orbiting suns, and suns orbiting black holes, and the current system could have many many layers of orbitage.
the position of any object ...
3
votes
1answer
137 views
Coordinate based travel through multi-line path over elapsed time
I have implemented A* Path finding to decide the course of a sprite through multiple waypoints. I have done this for point A to point B locations but am having trouble with multiple waypoints, because ...
3
votes
3answers
591 views
Algorithm for making sets in a Rummikub game
I'm developing an Okey game (a Turkish version of Rummikub/Rummy). In it, each players has a bunch of tiles. Tiles have a colour and a number, like playing cards. Now, the player needs to make sets of ...