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

1
vote
1answer
119 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 ...
1
vote
1answer
92 views

Calculating unique ID number from a set of bitmasked tiles

So I write this kind of match3-style game where you as a player need to match tiles with three or more of the same type and I'm thinking what is the best method to recognize the shapes without writing ...
1
vote
0answers
18 views

What's an optimal procedure to create a connected cyclic grid of nodes and edges for A* pathfinding

like the title says, I'm trying to create a grid of nodes that hold edges or connections to each other so I can perform A* algorithm to have objects traverse across them as seen in your standard RTS. ...
1
vote
1answer
50 views

Image-Space coherence of the z-buffer algorithm

I'm reading Hierarchical z-Buffer Visibility by Ned Greene et al. and they state that traditional Z buffering makes reasonably good use of image-space coherence in the course of scan conversion. ...
0
votes
1answer
35 views

Combining lots of small polygons to one (some) big poly(s)

I am looking for algorithm to merge lots of relatively small 2d polygons to one or some big polygons. In case two small polygons are touching or overlapping, they should be merged to one polygon. My ...
0
votes
1answer
54 views

How to fill a canvas with triangles that are seemingly random?

Given a canvas say, 1000 X 1000 unit. I would like to fill the canvas with triangles. The triangles can be of any type right angle, equilateral...etc. To avoid big chunks of triangles lets say all ...
0
votes
1answer
82 views

Isometric scene in SpriteKit

I tried play with spritekit in isometric grid. But i can't understand how to fix level. import SpriteKit import XCPlayground let view:SKView = SKView(frame: CGRectMake(0, 0, 1024, 768)) ...
5
votes
1answer
481 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 ...
0
votes
0answers
14 views

Help developing algorithm based on number of moves, time elapsed, and level difficulty [closed]

I have 100 levels, ordered from easy to hard. Each level gives a score based on time elapsed and number of moves achieved. However, I do not have an algorithm to figure out minimum move counts (nor ...
0
votes
2answers
68 views

How do I reference one gameObject with script attached to other?

this is all in Unity 3D with C#. Thing is, I have attached a script to my player that should Destroy TreeGroup (as in forest) whenever I press 'Q' and Instantiate them when I press 'E'. Here is the ...
4
votes
2answers
302 views

How to calculate delta time with SDL?

I have heard that you can calculate delta time with two functions called SDL_GetPerformanceCounter and SDL_GetPerformanceFrequency. I'm not sure how they work completely, but I heard it is a bit ...
1
vote
1answer
51 views

How to combine dynamic asset reload and texture atlases? (rectangle packing with removal)

Usually texture atlases are built either: as a seperate content pre-processing step or once when the game starts What I want to do is create and update atlases on the fly when: A new texture ...
3
votes
1answer
458 views

Verify which bubble is connected to top using DFS

I am working on a bubble shooter game in this game i have implemented searching using DFS as suggested in this link, and this is working fine. Update Here is my code for DFS -(void)callDfs:(int)...
2
votes
0answers
98 views

Texture Mapping to procedurally generated geometry

How can I calculate texture coordinates of such geometry? The angle shown in the image (89.90 degree) may vary, therefore the geometry figure is changing and is not always such uniform.(maybe like ...
4
votes
2answers
165 views

Graph search with a high number of actions

I have implemented A* to reach a goal state from a start state. My state is position X,Y, angle and others state variable. I have a number of actions. What I call actions is : A* on a grid has 4/8 ...
0
votes
1answer
40 views

AI parameters for Tetris like game

I am building an AI to play a variation of Tetris. The rules are changed in that there are 19 different types of pieces, rotation is not allowed, and the pieces can be placed anywhere in a 10X10 grid. ...
0
votes
1answer
93 views

What's the best way to deal with platformer tile collisions?

I am starting with game development and creating a basic platformer game. I already have searched a lot and found some ways to implement the platformer aspect to the game, like apply a gravity, ...
0
votes
1answer
48 views

Evaluate 2D point in a 3D triangle?

Given three points, (x1, y1, z1) (x2, y2, z2) (x3, y3, z3) and given a point "A" at (x, y), how would I find "A'", at (x, y, z)?
1
vote
1answer
44 views

midpoint displacement algorithm in sdl

I am trying to implement moving random hills in SDL. I am using midpoint displacement algorithm to create some random terrain and I have also accomplished to move the terrain too. But the problem is ...
0
votes
0answers
18 views

rendering moving terrain using midpoint displacement algorithm in sdl

This is in addition to the question I asked over here. midpoint displacement algorithm in sdl. The answer there helped me but I am facing another problem regarding the moving part. The terrain ...
1
vote
0answers
1k views

2D Drag Racing Algorithm

What algorithm can I devise for a 2D drag racing game to simulate a race? The gameplay is 2D and the camera's perspective is from the right side of the cars i.e. cars are seen from their right side ...
8
votes
3answers
175 views

How do I calculate paths for objects with limited acceleration?

For example, say I have a car and a car has a specific minimum turning radius and I want to drive that car from point a to point b, but the car isn't facing point b. How do I compute a path to point ...
0
votes
1answer
96 views

Is there a way to make this better? [closed]

So was experimenting in making a rotating ring puzzle like the one to get into the mechanical age in Myst. I came up with a solution that will rotate the rings and when the button is released it ...
5
votes
3answers
1k 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 ...
9
votes
3answers
10k views

How can I generate Sudoku puzzles?

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

How do I generate solar systems for a 2d universe map, but still look random

I need to generate 64 systems separated into 16 sectors, each with 4 systems. Each system must have another system within 10 units in it's own sector, but no closer than 3. One system in a sector ...
2
votes
3answers
171 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 ...
0
votes
0answers
24 views

AI: Turn-Based Movement with 2 actions per Unit

I am currently building a turnbased tactics game. The Board is a small (about 4*6) tiled grid. The AI plans all moves of its units, each unit can move 2 times move and attack or attack at ...
3
votes
1answer
82 views

How to create a believable swimming fish animated Sprite in 2d?

I want to create a fishing game in which fish needs to be swam across in the ocean. I put static fish which just progresses across ocean but it does not look very realistic and interesting to attract ...
3
votes
0answers
24 views

Automatic audio segmentation and find the most energetic segments

What algorithm can be used for audio segmentation? I want to divide song to segments and find the most energetic segments (begin and end in seconds). It is needed for the rhythm-game. Examples: ...
1
vote
1answer
90 views

C++ Data structure pattern preferability?

So im looking at ways of handling large amounts of data in situations such as an entity manager or particle system. So i have concluded to use an object pool, and there are two things that I could do ...
0
votes
2answers
106 views

Java, spawn algorithm that gets harder each level

I am currently in the process of making my 3rd Java game (everything I have learned is from YouTube videos, so I may be doing some things wrong) named "Blocked". But I have run into a problem: how do ...
2
votes
1answer
98 views

How can I remove unnecessary nodes from my path?

How do I remove the unnecessary nodes from the path to make it as short as possible? Idealy I'd like the result path to look like the green line. The red thingy is not walkable. var ...
1
vote
0answers
38 views

Algorithm to propagate internal Physics force in a structure of building

Scenario: A floating structure composes of many nodes (or in more visual meaning - a cubic block). Every node is snapped to the same 3D grid. (similar to a minecraft castle) There are external ...
1
vote
0answers
40 views

How can I make cars drive navigate an intersection without colliding?

I'm trying to create a 2D game with a traffic intersection: My car game-objects need to pass through the intersection without colliding with each other, and without stopping, if possible. How can ...
1
vote
1answer
1k views

How can I develop a Lights Out solving algorithm?

I am programming the game that named Lights Out. The purpose of this game is turning all the lights out. There's a flash version of the game here. I want to develop a way of solving the game. How can ...
-1
votes
1answer
57 views

How to constraint random spawn points to a road? [closed]

I have a terrain and a road. I would like for spawn points to randomly appear on the road, and not outside on the terrain. How to assign the spawn points to only be between the road and in random ...
5
votes
1answer
1k views

Algorithm to make groups of units

In Age of Mythology and some other strategy games, when you select multiple units and order them to move to some place, they make a "group" when they reach the desired location: I have a Vector ...
1
vote
1answer
528 views

Tongue pull effect

I've been searching on the net for several days and can not find nothing about this effect. Even a name for this effect. I want to make a character that can use his tongue to pull objects objects it ...
42
votes
11answers
19k views

What path finding algorithms are there? [closed]

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?
4
votes
1answer
370 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 ...
3
votes
1answer
121 views

Transparency sorting in 3D world with different render types

I am rendering a world, object, and models from an older game format. The world is presented in a BSP tree so I can quickly iterate through. The opaque surfaces are rendered front to back. Then ...
2
votes
1answer
101 views

2D infinite grid data structure

I'm currently developing a game, and I'm in a process of experimenting with various data structures to support my game model and simulation. Here are some of the requirements: Grid structure where ...
4
votes
0answers
80 views

Depth of Field Blur - Weighted sampling?

I've been studying Intel's fantastic article titled "An investigation of fast real-time GPU-based image blur algorithms" (here), where-in they state that Gaussian blur would need to be customized for ...
13
votes
3answers
160 views

How do you handle loss aversion in probability-based games?

The psychological phenomenon of loss aversion refers to how players feel losses twice as powerfully as victories. For example, Bite Fight's PvP is a simulation based on probabilities related on ...
0
votes
2answers
48 views

Fastest way to neutralize scale in the transform matrix?

Let's assume we have 4x4 3D transformation matrix, that is the result of scale, rotation, and translation transforms. How to set its scale to (1,1,1) in the fastest way? Assume also that the matrix is ...
1
vote
1answer
70 views

Procedural generation of evenly distributed random points (2d)

I am coming here because I've have a performance problem with my current implementation of an algorithm. I am the idea of Voronoi diagrams to distribute patches on an infinte 2d layer. For a Voronoi ...
6
votes
1answer
399 views

How is Signed Distance Field Ray Marching implemented for a dynamic world?

I think I understand the basics of Signed Distance Field Ray Marching. You model your scene with a bunch of distance fields (such as these: http://iquilezles.org/www/articles/distfunctions/...
3
votes
2answers
635 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
0answers
33 views

Defining camera/view space

Im working on expanding my camera class, but having trouble defining camera/view space in the manner of this diagram: What Im trying to achieve is to define the camera as a true object much like a ...