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

0
votes
1answer
192 views

Finding a moving target in a maze

I'm making a game that is a bit of a mix of snake and pacman. Basically, two players go through the maze and each time they pick up a piece of candy, a cube is added to their tail. If one player ...
0
votes
2answers
113 views

finding a path from one point to another with obstacles help

Im building a tile based game and im implementing my path finding algorithm. Currently, it can find a path from point A to point B with no problems. However, if there are obstacles between point A and ...
2
votes
3answers
129 views

How do game engines mitigate CPU cost for many trigger zones & entities? [closed]

It's a rather simple question, but a somewhat fundamental in computing in general. Let's say we have a player controlled character in an open world. The world is large. In this game-world we have a ...
2
votes
1answer
31 views

How does hidden surface removal work?

Lately, I've been learning some OpenGL for fun, and I've been thinking about hidden surface removal. Say you have a high poly count static scene, with nothing that moves, no bones, physics, etc. Just ...
5
votes
2answers
173 views

Determining a sensible gear-like hierarchy for a series of connected objects

I would like a series of objects to behave in similar manner to a series of connected gears. This means that each black object in the diagram below will rotate at a speed based on the ratio of their ...
-2
votes
1answer
56 views

Optimal trajectory of area exploration

I've got next problem. There is three objects: first one, with next characteristics: circular area of view, speed, drag coefficient; wind (or water current, doesn't matter; some sort of resistance) ...
10
votes
1answer
1k views

2D helicopter game, how to create corridor walls?

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 walls-generation engine. Any pointers ...
1
vote
1answer
192 views

Cavity map generation

I am looking for an algorithm how to generate cavity (or curvature) map. There seems to be no refernce to it, only final solutions like xNormal software, but that is not what I want. I am looking for ...
2
votes
1answer
48 views

Short distances from reference point

I would like to compute short distance from reference point in 2d grid. To expose: 0, 0: not penetrable 0, 1: not penetrable ... 1, 1: penetrable ... I search an algorithm who return: 1, 1: 1 ...
-1
votes
0answers
20 views

Looking to get the boundaries of two or more rectangles

I am trying to generate rectangles and then get the outer most bounds of that. I assume I want something like a polygon union library. I see boost has one and there are others: ...
3
votes
3answers
190 views

Getting one-point-collision object to conform to uneven terrain while keeping constant distance covered

This is probably best described by image: I have a character. For floor collision, it uses a single point (the red X). When the character moves, it conforms to the terrain; note how the blue line ...
3
votes
1answer
283 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
1answer
152 views

Separation of axis theorem implementation at normals

This might be more of a math question, but it relates to the development of a simple physics engine I am trying to create. I have been stumped on this for about a week now, and have been unable to ...
6
votes
2answers
142 views

Pathfinding with inertia

I'm currently working for pathfinding for a game where units are moving, but they have inertia. Most typical pathfinding algorithms (A*, Djikastra, etc.) are simply designed to minimize the length of ...
3
votes
2answers
134 views

Algorithm for a smooth weather transitions in game weather system

I've been slowly learning c++ and building up a codebase intending to create a simple first person role playing game. I've coded a time management tool to track time elapsed in game, an inventory and ...
7
votes
2answers
166 views

How to create a map from graph

I want to draw a 2d polygon map based on data provided by another source to ease analysing actions on the map. The data has the following format: 1 ['2', '4', '5', '7', '17', '10'] 2 ['1', '3', '4'] ...
2
votes
3answers
66 views

Get algorithm (Chance-to-Hit) from Input and Output

I am currently working on a chance-to-hit formula for an rpg. It consists of the following parts: AttackSkill: The used Attribute of the Attacker (Range: 1-10) AttackBonus: A Modifier from ...
-2
votes
1answer
55 views

Libgdx array of Vector2 closest point

I have an array of objects. Their position is a Vector2 (x, y). I want to select the closest object, given a (x, y) coordinate (that represents an user touch on screen). Searching on web I found a few ...
0
votes
1answer
82 views

Pathfinding Algorithms [closed]

I am new to game programming I currently am using unity's 2D power to remake an 2D game for sake of practice. So I am just little confuse about one thing, so far every enemy in my game was dumb(they ...
5
votes
2answers
1k views

3D isometric depth sorting

How is it possible to depth sort tiles and objects in an isometric environments without any limitations? I've been researching this for a while now and there seems to be no publicly available answers ...
1
vote
2answers
176 views

What makes Minecraft so CPU intensive, and what could be done to improve it? [closed]

Recently I've been searching for VPSes that allow Minecraft servers to be hosted, and surprisingly very few do. Most allow for games - but Minecraft in specific is disallowed by many. Now it's fairly ...
14
votes
3answers
2k views

How to render infinite universe?

I'm curious what are the best practices in game development industry to render 3d universe? To be more specific: The data points are given and static. Each point has position, color and size; The ...
0
votes
1answer
38 views

How to calculate normal vector of a curve?

How I can calculate the normal vector for tow dimension curve (I have the points of the curve in plane x y)?
3
votes
3answers
288 views

Algorithm for dividing a 2D grid into organic looking plates

the title pretty much says it all: How could one go about segmenting a 2D grid into smaller parts? My goal here is to create tectonic plates for further procedural world generation Details to ...
3
votes
1answer
73 views

Placing an AABB close to a point so that it doesn't intersect any other AABBs

Give a 2D space with a bunch of non-intersecting AABBs, and a point in this space (that may or may not be inside an AABB), how can I find the closest place where I can place a new AABB of a given ...
0
votes
2answers
239 views

Map Generation Algorithm [BOMBERMAN]

I'm looking for some wise tips concerning a specific game development : Bomberman-like. I am currently implementing a "random map" generation for the game, but I feel like I'm not doing in the best ...
1
vote
1answer
78 views

Planar scene graph

Suppose there are many line segments on a plane (2D scene) and I would like to redraw only small portion ("window") of the whole scene. The scene is dynamic, meaning one can add/remove/transform ...
-1
votes
1answer
44 views

Java libgdx get clicked square without iter

I would like to detect which square is clicked without iterating over all elements! i don't want to do this anymore for all elements. if( x >= this.getAnchorX()-HalfWidth && x <= ...
7
votes
3answers
2k views

How would one determine the position of a participant in a racing game?

Now, for the record, I'm currently not implementing any racing game whatsoever, but this problem just popped into my mind and now I'm curious. So how would one go about finding out which participant ...
4
votes
2answers
1k views

What is an efficient packing algorithm for packing rectangles into a polygon?

I need to put as many rectangle of same size as possible inside a polygon. The algorithm can put rectangles in different orientation(angle). But they cannot overlap. This is image is an example of the ...
1
vote
2answers
32 views

MiniMax strategy - What is the context of the numbers?

I've watched a new videos about the MiniMax concept and invariably the lecturer will say that the computer has 2 parties, Min and Max; Min always takes lower number and Max takes higher number. The ...
16
votes
2answers
2k views

How can I generate a lightning bolt effect?

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 ...
7
votes
5answers
18k views

Match-three puzzle games algorithm

I am trying to write a match-three puzzle game like 'call of Atlantis' myself. The most important algorithm is to find out all possible match-three possibilities. Is there any open source projects ...
0
votes
2answers
67 views

Is there any easy way to understand the Alpha Beta for Othello?

I'm stuck with coding the Alpha Beta algorithm for a console-based game I'm developping at the moment. I tried to understand how it works for a week but still no idea how to get started with it. Here ...
3
votes
2answers
378 views

Pathfinding in 3d voxel: waypoints?

I have an application where I have a 3d collision voxel space (passable or non-passable at each point) and I want to plot a short unobstructed path between two points. There are no gravity ...
1
vote
1answer
77 views

Best way to calculate city influence maps similar to civilisation?

As the title says, imagine you want to generate the influence mask for a city, given that the map is a 2D grid rather than hex. An extra bit is that different points on the map might have different ...
14
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 ...
1
vote
0answers
33 views

Integrating specular, diffuse reflection and refraction

I am implementing an MLT bidirectional path tracer. I have a problem integrating diffuse, specular reflection and refraction. 1) The first problem is diffuse and specular reflection. Diffuse ...
26
votes
5answers
4k views

In 2D, how do I efficiently find the nearest object to a point?

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 ...
-1
votes
1answer
83 views

How can i fix my Ground detection code?

My ground detection works by checking if the player's x position is between the range of a sprite xpos+16 and xpos-16 if it is,then it uses a separate axis theorem on the y axis to see if the player ...
7
votes
2answers
2k views

Choose tile based on adjacent tiles

I am working on a tiled map editor, and I need to choose tiles automatically, based on the adjacent tiles. For example, when placing a road tile, next to another road tile, the two need to be oriented ...
0
votes
1answer
62 views

Need help creating points in an array

I'm creating a lightning geometry shader using hlsl that creates an array of points based on an arbitrary number of generations. The gist of what I want to accomplish is here: ...
1
vote
2answers
121 views

Bubble shooter clone, structure for storing/adding of bubbles

Im having a few issues trying to figure out what the best data structure to use for storing bubbles on the grid, and how to connect new bubbles to the grid when a moving ball collides with a ball on ...
32
votes
9answers
6k views

How can I quantify a drawn line's straightness?

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 ...
7
votes
3answers
719 views

Determine if a set of tiles on a grid forms an enclosed shape

Given a set of tiles on a grid, I want to determine: If the tiles make an enclosed figure If the tiles make an enclosed figure when you count the sides of the board as an edge of the figure If ...
1
vote
1answer
68 views

Paint game level algorithm

I have a game, and I have a level editor where you can build your level from blocks. Blocks positioned in cells. So blocks can have no neighbours or have one or few neighbours. My problem is that I ...
2
votes
1answer
225 views

Pathfinding in a 2D “sidescrolling” strategy game

I've been thinking up a real-time strategy game that plays on a platformer type of map. The collidable portion of these maps will be made up of square tiles. I've done A* pathfinding in top down tile ...
0
votes
1answer
94 views

Trying to add a feature to my (basic) level parsing algorithm - not sure how to (JAVA)

Right now this method goes through a list of GameObjects (e.g. JetPack, Platform) with their respective x and y positions in a text file called level1.txt: platform 840 280 platform 1130 280 coin ...
8
votes
4answers
6k views

How do I shuffle cards for a card game?

I am trying to develop an card game for Android Can anyone suggest me how to write code for effectively shuffling the playing cards?
1
vote
2answers
86 views

Algo for Minimum no of solving in a level like Bubble Blast2

Is their any way to make a algo to know minimum no of way to solve in Bubble Blast 2. I am trying to make a clone of it. My real problem is only to determine the minimum no of tap to finish the game. ...