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
27 views

which is the best approach or algorithm to calculate real-time ranking

I want to know the fastest and most efficient way to compute points and ranking in real time. I'm doing a betting football game (a game where users try to predict the outcome of a game before it). In ...
0
votes
1answer
52 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 ...
1
vote
1answer
36 views

Implementation of finding an index in a 1D array for a triangular grid

Am using a while loop to find an index within a 1D array, is there an easier, less-time-consuming and/or mathmatical way to find the index? Consider the next grid: 4 o |\ | \ | ...
1
vote
1answer
68 views

How do I model diffusion and heat?

So I'm trying to solve a heat/diffusion equation for a continuous space, but I'm not opposed to a grid solution. I'm a little short on the maths needed but have made it work so far. If I model ...
2
votes
1answer
82 views

Signed Distance Fields: How are different colour channels used to improve output of sharp corners?

The naive approach to implementing signed distance field font rendering suffers quality issues where sharp corners get softened (either outward- or inward-facing corners, i.e. convex or concave ...
0
votes
1answer
57 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 ...
5
votes
3answers
204 views

How can I do optimal pathfinding for a Tetris piece?

Imagine a standard Tetris board (10x20) using the standard set of 7 tetrominos. Given a Tetris game state and a target position, how can I find the optimal sequence of moves that will get the ...
4
votes
3answers
106 views

How can I check if a player-drawn line follows a path?

I want to draw an invisible path that the user must follow. I've stored that path as points. When a player draws a line, how can I test if it follows the path I've stored? Here's an example for ...
22
votes
12answers
3k views

How can I make A* finish faster when the destination is impassable?

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 ...
0
votes
1answer
40 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. ...
1
vote
2answers
49 views

Translating Objects in Worldspace

Given the worldspace coordinates of a collection of arbitrarily positioned objects, how do I translate them while preserving their relative placement? For instance, I have a table and a few bowls that ...
1
vote
1answer
43 views

2d parallax edges

I'm writing a mini 2d game, the scene background is based on two images with parallax effect. I want the right edge of both images, finish at the same time matching the right edge of the canvas. But ...
-1
votes
0answers
110 views

Unity 4.6 GUI C# - How To Dynamically handle events generated by any gui element

Hello thanks for your time! GOAL: What im trying to achieve is to create my own small event system for new ui 4.6 elements so i can manipulate them by code , in this small test project im trying ...
1
vote
1answer
37 views

Checking whether moving object has reached target position

So I have a fast-moving object in my game, let's say a bullet. At each iteration of the main loop I update the object's position based on the delta time value dt and draw it at the new position. I ...
3
votes
1answer
121 views

How can I tell if an object in a tile grid is surrounded?

I'm making a game which uses a 10x20 matrix to store the position of the objects. I have a castle object, represented by a number in a matrix. It is randomly deployed in some cell of the matrix. I ...
0
votes
1answer
35 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: ...
0
votes
1answer
77 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 ...
15
votes
5answers
378 views

How can I detect connected (but logically distinct) bodies of water in a 2D map?

I have a 2D hexagonal grid map. Each hex cell has a height value used to determine if it's water or ocean. I'm trying to think of a good way to determine and label bodies of water. Oceans and inland ...
1
vote
4answers
109 views

How to order points on a 3D grid such that we can connect them in a line loop correctly

I want to recreate an effect as close as possible to X-Com: Enemy Unkown's movement range feedback: The blue line delimits the tiles which the soldier can reach using a single action. We also are ...
1
vote
1answer
49 views

Algorithm that cover one mesh by another mesh

Suppose I have two meshes (Let call me first MeshShirt and second - MeshBody) Meshes are aligned (if i render both MeshShirt "covers" MeshBody). But some parts of the body are not "under" the ...
3
votes
2answers
123 views

Bevel outline algorithm in 2D

I'm writing a program that creates animated blobs in 2D, to simulate cells. In order to beautify these objects, I'd like to give them a 3D look by adding a bevel-effect. How can this be achieved? ...
5
votes
3answers
169 views

How can I ensure a grid can be filled with Tetris-like pieces?

I'm thinking of making a puzzle game where the objective is to fill a grid with shaped puzzle pieces (for example, the classic Tetris shapes). How can I go about generating a set of pieces that can ...
3
votes
1answer
87 views

Fastest way to find closest triangle of mesh from specified point

I have two triangle meshes (let me call them A and B). The meshes may be really big (10.000 - 100.000 polygons). I want to find for every point in A the closest triangle from mesh B. Is there fast ...
1
vote
1answer
73 views

Triangular Mesh Collision/ Resolution

I've been trying some different approaches for collision detection and now I want to try to implement simple Mesh-Mesh collision detection for triangular meshes. I'm wondering if I'm on the right ...
0
votes
0answers
101 views

How manage target selection in a high speed brawler?

I'm thinking of games like Batman Arkham Asylum and the Assassin's Creed series, in which landing the first blow gives you a soft lock that automatically rotates you to continue facing the target as ...
1
vote
1answer
65 views

Chamfered cube geometry generator

I'm trying to create a geometry generator for a "Chamfered Cube". I've got the vertices working, but I'm stuck with creating the faces. I don't really know how I could re-arrange my algorithm to ...
0
votes
2answers
74 views

Maximum Number of Bends - Snake [closed]

A naive Snake game implementation works by using a queue data structure to store the position of every single square that the snake is a part of. You can reduce the amount of memory by only storing ...
0
votes
1answer
96 views

Sweep and prune vs quad tree when all objects are dynamic (moving)

As I understand it there are 3 popular strategies for spatial partitioning: sweep and prune, quad/oct tree and uniform grid. Uniform grid is problematic for me because I have not set an upper limit on ...
1
vote
1answer
52 views

Create player rankings?

I recently created a tournament system that will soon lead into player rankings. Basically, after players are done with the tournament, they are given a rank based on how they did in the tournament. ...
0
votes
1answer
75 views

Given seams, how do I unfold a mesh?

If a user marks a seam on a mesh, how do 3D modelling programs (like Blender or Maya) unfold the mesh on to a 2D surface? I can only find papers trying to automate the seaming for you. Given ...
0
votes
1answer
71 views

Raycast algorithm fails to collide with diagonal walls in specific locations

I'm having a problem with my ray-cast algorithm in a 2D tile-based universe. I feel the situation would be best explained with a picture, so here it is: The ray, represented by the blue line, is ...
0
votes
1answer
32 views

Algorithm/ Logic of identifying a circle in Go game

I'm trying to create a 2 players Go-like game. Unfortunately I can't get the capturing system to act correctly. At the moment the system is half done, however I cannot think of a perfect way for it to ...
1
vote
1answer
46 views

What is the fastest way to know if the current coordinate in screen-space is odd or even in GLSL/GLES2 frag shader?

I want to make a post-effect where every second column of pixels is colored differently, and I want to implement this as a GLSL fragment shader on GLES2. The question is what is the most effective way ...
0
votes
1answer
70 views

Static evaluation function for Checkers using Minimax

I have correctly implemented Minimax for my checkers AI till depth of 3 ( well at least that is what I think ). However I am confused on evaluating my game boards at depth 3 with heuristics. Currently ...
0
votes
0answers
61 views

Collision detection in 3d

what is the simplest algorithm for collision detection that respects the following requirements: The collision is only between cubes that are always aligned with the axis of the world (not rotated). ...
0
votes
1answer
218 views

Finding next AI move using MinMax algorithm for Checkers [duplicate]

I am currently working on a Checkers game using Unity ( human vs computer ) I am done with the base architecture of the game ie defining the rules, moves, jumps etc. I am currently stuck in ...
0
votes
0answers
47 views

Voxel sparse octrees for indirect illumination

I don't understand the use of voxel sparse octrees for indirect illumination calculations. First of all, what exactly is happing? We're rendering the scene as usual with diffuse lighting. In the ...
1
vote
1answer
88 views

Rotate an arrow on a plane?

I'm creating a display for a GPS-based embedded system and would like to have an arrow indicating the current bearing. I'd love the arrow to have a 3d appearance by rotating it on a plane tilted up ...
0
votes
2answers
84 views

How to write an adjacency algorithm that compares position data?

I have a list of indexed triangles for which I need to generate adjacency data. I've already written a brute force algorithm that creates 3 edge data structures for each triangle and then compares the ...
3
votes
1answer
169 views

Fighting Game Camera Positioning in SDL

I'm working on a 2D fighting game (using SDL) much like the original Killer Instinct on SNES. I want the camera to keep both players an equal distance from the left and right sides of the viewport. ...
1
vote
1answer
133 views

Swarm Algorithms [closed]

I have been asked to deliver a presentation for my university course on ant, bee and particle swarm algorithms. Therefore I am attempting to learn more about swarm algorithms and their uses within ...
1
vote
1answer
103 views

How to implement a hint-system for nearby matches (in a Match-3 puzzle game)?

Taking Candy Crush as an example: In a Match-3 game, how would you figure out which nearby tiles are 1 move away from creating a match? Do you basically have to do it by trial-and-error on every ...
0
votes
1answer
34 views

Point to coordinate function

I am working on a game in which I need an enemy ship to point towards the player. Here is the equation I came up with: angle = sin-1(abs(y1 - y2)/√(x1 - x2)2-(y1 - y2)2) This essentially takes ...
1
vote
1answer
69 views

How can I do a weighted cascade down a path in a 3D environment?

I am trying to perform a weighted cascade down a path in a 3D environment. Now, what I am trying to do is have one object(a cube) in the environment scan from its coords 1 in every direction for ...
0
votes
0answers
35 views

Displaying range around a unit [duplicate]

I'm looking to highlight a set of square tiles around a unit to signify its movable range. The concept should be quite familiar to those who have experienced the Fire Emblem series of game. I have ...
3
votes
2answers
283 views

A Star pathfinding algorithm, multiple node set optimization

I'm trying to determine if this is an optimization I should pursue or if this is way to complicated to be worth my time. I've successfully implemented the A Star Algorithm for my video game. I used ...
1
vote
1answer
65 views

Need help with algorithm for generating connected bricks in Pick A Brick clone

I want to make a clone of an Amiga 500 game, Pick A Brick, a 2D game where the goal is to clear a table of bricks by matching them up, following certain rules. I am getting nowhere when it comes to ...
0
votes
2answers
94 views

Quick algorithm to identify undrawn rectangles inside a map

I already have a working algorithm for this but it's home-made and there is some redundancy in the things it checks, so I'm looking for a fast algorithm (or the name of it) that would detect undrawn ...
4
votes
1answer
58 views

How can I find the minimal texture size so the texture requires no pixel interpolation when transformed by a given matrix?

Given a rectangle with width x and height y, and a transformation matrix T: How can I estimate the minimal resolution of the texture (that is, its width and height) such the interpolation of ...
1
vote
1answer
215 views

Algorithm for staying “alive” forever

I am implementing a game where the player is playing(sliding) the little red rectangle and the purpose is to not hit the black rectangles and to not move out of the inner blue rectangle. The black ...