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

3
votes
3answers
388 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
170 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 ...
1
vote
1answer
103 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 ...
0
votes
0answers
8 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
66 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 ...
0
votes
1answer
85 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 ...
0
votes
1answer
41 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 ...
1
vote
1answer
49 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. ...
3
votes
0answers
18 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: ...
-3
votes
0answers
19 views

How to round 2 Straight lines

Never mind the programming langughe im trying to find way to take 2 Separate straight lines and to convert the intersection to round line For example if i have this 2 straight lines (1) i want to be ...
1
vote
1answer
71 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
60 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 ...
0
votes
2answers
96 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
97 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 ...
5
votes
1answer
453 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
0answers
36 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
37 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
46 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
448 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 ...
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
51 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 ...
0
votes
1answer
79 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, ...
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 ...
4
votes
2answers
154 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 ...
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 ...
7
votes
2answers
145 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 ...
3
votes
1answer
120 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
80 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
71 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
155 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
45 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
54 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
348 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: ...
3
votes
2answers
565 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 ...
1
vote
1answer
46 views

Circular fighter motion algorithm

Is there an algorithm to make ships take semi-circular patterns? I need something like the below image: Big Blue- Command Ship Small blues - fighters Red lines - path of movement I want the ...
3
votes
1answer
64 views

Locust Swarm algorithm for path finding (devour and move on)

I need to model a locust swarm that devour food stacks and move on to next stacks. I searched for articles and found few articles. These papers is about optimization applications but I want to convert ...
1
vote
0answers
32 views

Dynamic Mesh Generation Algorithm

I was recently given an assignment to generate a mesh from code, in Unity. At runtime, the player will click at random positions on the screen. An array will store all these points. There must ...
1
vote
3answers
133 views

Finding dead ends in maze

I am creating a maze type puzzle game where there is a grid and the user can create their own maze but I need help in writing an algorithm which finds the following things: How many dead ends are ...
1
vote
1answer
66 views

How do I correctly shift arrays on a Tetris line clear?

I'm writing a Tetris clone in C++ and I am at the last stage, I need to delete a row when it is full. Once a piece falls it is stored in a boolean array grid[20][10]. For example I check which row is ...
0
votes
1answer
60 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)) ...
1
vote
1answer
91 views

Pathfinding to unknown destination point

Usually you need path finding algorithms to find one or the best path between two points. Do you know if path finding algorithm where you don't know the destination point exists? I have a graph made ...
0
votes
0answers
26 views

How do I turn a vector map into a nav mesh?

I have the following path finding problem: I have a map that is described as a set of polygons that are traversable and need to somehow write path finding for the system. The current data is that the ...
1
vote
0answers
30 views

How to find grid cells not seen by an object

I am writing a VB.NET program. I have a grid view which is made of multiple small cells called grid cell. On the grid view, I have placed an obstacle (red box) and an observer (blue box). My task ...
0
votes
0answers
21 views

Ads are loading, but not showing?

TL;DR: My interstitial ads in my game are successfully loading, but when I call .show() on them, they don't show up! I have followed these directions, and the ads load succesfully, but don't show ...
2
votes
2answers
132 views

Funnel algorithm

I'm implementing the funnel algorithm for pathfinding. After searching many resources I found those : https://skatgame.net/mburo/ps/thesis_demyen_2006.pdf ...
5
votes
2answers
183 views

Are hard coded “rooms” better than dynamically generated on a smart phone, from performance point of view

This question pertains to a type of platform/maze game (made with Unity 5) for typical smartphones (iOS/Android). This game has following characteristics: 1. an upper limit (about 100) on the amount ...
16
votes
1answer
184 views

Flowing GPU compute water

I have a civil engineering background and perform hydraulic and hydrologic analysis' regularly. They sell degrees for that sort of thing, but it's really not rocket science. I recently got it in my ...