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

10
votes
2answers
93 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
1answer
74 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
1answer
92 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
2answers
44 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
40 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
288 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
509 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 ...
-1
votes
0answers
57 views

Which algorithm should i chose for the AI of this game?

I've made a game where player have to places white or black circles on a line horizontally or vertically or diagonally. Possible path (circles can move) are marked as black line. So if player ...
0
votes
0answers
28 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 ...
3
votes
1answer
40 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
40 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. ...
1
vote
1answer
43 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
59 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
29 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
132 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
52 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 ...
5
votes
1answer
427 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
1answer
34 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 ...
2
votes
1answer
83 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 ...
0
votes
1answer
40 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)) ...
3
votes
1answer
428 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
82 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 ...
-2
votes
0answers
39 views

Is it possible to determine the impact on the player Score of having “Item X” equipped?

Let's imagine a game in which the player can run through a level using Item1 through Item10 in any combination. We collect data after each run like this: score (int) Item1 equipped (bool) Item2 ...
0
votes
0answers
21 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 ...
0
votes
1answer
68 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, ...
3
votes
1answer
130 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
0answers
26 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 ...
4
votes
2answers
358 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
0answers
20 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
1answer
109 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
2answers
127 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
182 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 ...
0
votes
2answers
84 views

Dijkstra's Algorithm - Infinite loop

While running Dijkstra's Algorithm to assign a direction to every tile and when an object land on the tile, follow the direction to a goal. I encountered an infinite loop (or I think it is). The ...
3
votes
3answers
137 views

Increasing chance of good loot after multiple tries

I'm looking for a way to make chances of getting better loot increase the more you've looted. I do not want it to be possible to get a rare item the first 5 times and not being able to get an epic ...
8
votes
3answers
10k views

How to decompose sprite sheet

I have a lot of spritesheets that are poorly formatted that I want to decompose, or split out into many small images, one for each sprite. If I can do that, I can use my custom texture packer tool to ...
2
votes
1answer
48 views

Forward A-star pathfinding vs Reverse A-star pathfinding

Under what condition does doing Forward path finding or Reverse pathfinding get better result? Most tutorials for open grid tower defence games says to pathfind from the Goal to the monster. Why is it ...
-3
votes
1answer
784 views

match-3, 4, 5, 6? Algorithm for a puzzle match game that will change the number of matches required

I was wondering if someone had an idea or had some thoughts behind creating a match-3, match-4, match-5... all the way to match-10 just by changing a variable. I think it is easy to do a match 3 or ...
0
votes
1answer
56 views

Why is my bullet disappearing after I release the shoot button?

I'm making a game using DirectXTK for my university project. When I press space bullet moves forward like I wanted, but when I let go it stops my bullet from moving. How do I keep the bullet moving ...
4
votes
1answer
197 views

How do I generate random mountains in a sidescroller?

So I'm trying to make a simplified Terraria style world using Perlin noise. I got that working and the terrain is randomized. However the terrain always looks like like a weird cosines curve. Hills ...
2
votes
1answer
232 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 ...
17
votes
3answers
25k views

How can I create a random “world” in a tile engine?

I am designing a game that is working on a classic tile engine, but whose world is generated randomly. Are there existing games or algorithms that do this? The procedural generation algorithms I have ...
4
votes
1answer
85 views

How to solve Sweep and prune false positives concerning large floor plane

I am developing a 3d sweep and prune module for a project, and it is producing false positives. The pair generation code is as follows: for (unsigned int i = 0; i < mXExtents.size(); i +=2) ...
0
votes
1answer
26 views

Why do KD trees put the median split exactly on a point?

I've understood that KD tree split points using the median while cycling on each axis. I've also understood that at each node traversal, a nearest search must use a sphere to store to nearest neighbor ...
1
vote
1answer
43 views

Programatically placing musical notes on a stave

I'm trying to program a musical stave and have come against the problem of where to place a note, given its index. The index of a note is defined from a model created from the table in the following: ...
4
votes
1answer
183 views

Creating a Roguelike game in C

I'm trying to create a simple rogue-like game in ncurses in a C program. The idea here is that, I'd parse a file like this: 10X10 ds2 de2 dw5 12X12 ds3 de2 dw1 14X14 ds5 de1 dw5 10X10 ds5 de3 dw5 ...
1
vote
0answers
60 views

Efficient pathfinding for flying actors through connected AABB volumes

I have created a concise graph of AABB volumes to use as the navigation volume for flying AI. They span the empty space around geometry: Here is a preview for one of the nodes - the central node ...
0
votes
2answers
62 views

Efficiently calculating best nearest sphere from a point in 3D space

I have a point in 3D space and a number of spheres (anywhere from 0 to thousands) at random locations in said space. Each sphere has a property that falls off in a smooth gradient from the centre to ...
0
votes
3answers
1k views

Fast Ray Sphere collision code

I am looking at here and while it's well organized a lot of links are broken: http://www.realtimerendering.com/intersections.html I am trying to find fast code that will give me the hit point and the ...
1
vote
0answers
55 views

What are vornoi diagrams used for in game development

I see vornoi diagrams talked about from time to time in the context of game development and graphics, and have seen them used a bit in procedural textures as well as talked about in relation to path ...