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.
0
votes
0answers
28 views
Elo rating system alternative for non competitor vs competitor ladder
I'm working on a ladder system that will have let's say 100 contestants pitted against each other. But these contestants do not battle each other as groups or individually. Instead, they battle each ...
0
votes
0answers
34 views
How to make multiple selected element in a 2D grid move to the empty spaces?
I am trying to make a simple match 3 game where when you pick a Gem-type and you press a direction, ALL gems of that type move toward that direction until they hit an obstacle (another gem) or reach ...
2
votes
2answers
51 views
Using a vector to measure an angle relative to the screen / camera
My game is supposed to have an object that changes it sprite depending on which way the mouse faces. programming this has become a challenge, because I want to calculate the angle relative to the ...
5
votes
2answers
126 views
How to optimize pathfinding on a very large dynamic 2d grid?
I have a large 2d tilemap, ranging anywhere from hundreds to thousands in size. The map is formed by 8x8 chunks. I am currently using A* but it isn't quite efficient because I may have as many as a ...
1
vote
1answer
79 views
How does D* pathfinding work?
I would like to understand on a fundamental level the way in which D* pathfinding works. Any code or psuedo-code implementations as well as visualizations would be helpful.
2
votes
1answer
103 views
Is this a suitable “pathfinding” algorithm for a tower defense game?
Note: I put "pathfinding" in quotes because I'm not sure if it's the proper term for this.
My goal is to create a 2D tower defense game with HTML5/JavaScript. It's mostly for learning purposes, so I'...
3
votes
2answers
113 views
What algorithm can I use to distribute energy between connected nodes?
I'm creating a game where every user has a network of connected nodes that each have a specific amount of energy. The nodes will try to distribute energy evenly amongst themselves. If a node has more ...
4
votes
1answer
877 views
How can I fill the interior of a closed loop on a tile map?
In my game the player can dynamically modify terrain. The map is stored within a 2D array of prefabricated 3D objects. This is working well for now. The player modifies terrain by selecting what ...
5
votes
0answers
26 views
Is there an algorithm to move vertices along a planar mesh to give an area more vertex without destroying the shape too much?
Currently, I am playing around with a terrain technique called Vector-Field terrain as created and used for the game Halo Wars. I have successfully recreated the technique. However, I'm having ...
1
vote
2answers
34 views
Find points inside a closed area
I have a 2D rectangular grid (100x100) with 3 types of cell (Empty, Base and Outline). I need to find cells inside the territory formed by Base and Outline cells.
For example, in this scheme:
I need ...
2
votes
1answer
37 views
Numerical differentiation to calculate size of circular buffer
I'm using Allegro 5 to create a software-generated "motion blur" effect for my 2D sprites. I basically just have a boost::circular_buffer of some length which holds "snapshots" of the sprite going ...
0
votes
0answers
28 views
Smart algorithm to find clusters in matrix of numbers
I´m developing in C, a solver for puzzles like this game Bubble Popper (https://play.google.com/store/apps/details?id=com.bytesequencing.bubble_popper_ads). Fast explanation: we have to find clusters ...
4
votes
1answer
81 views
How to convert a premade mesh into voxels so I can use algorithms such as marching cubes
I have a mesh that was created in a 3D program which is the terrain the player will walk on. I want to allow the terrain to be deformable by the player, but for it to be smooth (not like Minecraft). ...
0
votes
1answer
37 views
How to calculate a projection of 360° equirectangular slides?
My goal is to have a light source inside of a transparent sphere that has an equirectangular texture to act as a 360°-slide. I want to get the projection on arbitrary objects as a texture image on ...
1
vote
0answers
55 views
Letting an Pathfinding Algorithm generate movement paths for all possible Connections in a Starsystem-based Universe
First of all I want you to forgive me when I make mistakes in my writing, english isn't my first language, and also: If this is the wrong place to ask, please direct me to the right place then.
So, ...
0
votes
0answers
21 views
What is the way to find the vertices of an animation frame using a BVH file data?
I read a lot of BVH file specs(this one), but any of it is enough to sucessfully found a vertices for frame in BVH file data.
I build it without the rotations, but this is wrong way.
I've tried ...
4
votes
1answer
232 views
Train like movement in a 2D game
I am developing a 2D game using Cocos2d-X in C++ language. In my game, I need to implement train movement.
Here is the image about the output I want to achieve:
I tried to do the above moment using ...
3
votes
3answers
210 views
How do modern game engines handle many shadow casting lights?
This is a very general question, and not aimed at any particular language or graphics API; I am more interested in the theories & algorithms behind the solutions.
I'm reasonably familiar with the ...
1
vote
0answers
34 views
Generating vertices for group of hexagons
I'm working on the map editor of a game, where you can create a grid of hexagons to paint. An example of a grid of radius 6:
What I want
Once map creation is done, I would like to generate a mesh ...
3
votes
1answer
84 views
Creating a Simple Puzzle resolution Algorithm
I develop a (really) simple puzzle game that asks you to join a point A to a B (enter/exit) using a ball and mechanisms that you can rotate to give the correct direction to the ball in order to join ...
1
vote
2answers
241 views
How does transvoxel algorithm work and how can I implement It?
After wasting over three days of researching on DuckDuckGo/Google, trying to understand transvoxel paper and existing implementation, I come here to clarify the subject for me and made it easier for ...
3
votes
3answers
144 views
Drawing roads on heightmaps
I've been running into walls for the past week or so on my toy project in UE4. My goal is to draw procedural roads on a procedural landscape (eventually getting to intersections and buildings). The ...
0
votes
0answers
23 views
Drawing a possible movement area in a tiled map [duplicate]
I've been developing what's meant to be my first of many Game Maker projects, and here's my biggest problem until now:
I'm trying to draw a grid depending on the "move" variable from a unit (the ...
3
votes
1answer
62 views
Convert 2d generated level to graph or analyze
Do you have any idea how to extract graph data from this type of procedurally generated level?
Well, actually we need to analyze only top level (gray). Background (black) does not matter. What I am ...
0
votes
1answer
128 views
A* Implementation broken?
I tried implementing Wikipedia's version of the A* pathfinding algorithm, but when I run it in Unity the object which the script is applied to does nothing and Unity ends up taking 15% of my CPU. I ...
1
vote
1answer
87 views
Solvable mazes that have contained cells
Is it possible to create a random maze that is solvable and uses a group of cells or single cells that do not depend on the cells around them?
I am using a visual language that uses self contained ...
3
votes
1answer
66 views
Triangle Texture Packing Problem
I'm trying to create a texture atlas where each triangle face is laid separately from each other (i.e. it is not typical mesh parameterization). In order to do this, I would have to pack the triangles ...
7
votes
2answers
183 views
Generate random people with demographics
I would like to have random people with preferences generated for an economic strategy game.
For simplicity, lets say each person has age(number), home area and its type (city,village,...) and ...
0
votes
1answer
97 views
minimax AI code stuck in a loop
Disclaimer: First time trying to implement a AI using minimax approach (its a turn-based game). There are not many good resources available online to learn AI (specifically minimax in C#) so I am ...
0
votes
1answer
85 views
How can I manage weapon recoil?
I have some trouble to do a Recoil routine.
I've a Tank, a turret cannon on it.
I want that after shot, turret fast recoil back, than (slowly) get back to start position.
This is the code I've ...
3
votes
1answer
161 views
How to smooth jagged pixel edges in Unity?
So I am reading an image from a png file into a 2D sprite. This sprite serves as a "province" in my game. Currently, I am getting this:
If you look closely, you will notice that you are seeing the ...
1
vote
1answer
72 views
Path finding: avoid being surrounded by enemies
I'm building a bot that plays a simplified version of Pac-Man. The bot does a pretty good job, but sometimes it chooses a path where it ends up surrounded by enemies.
Here is an example:
...
0
votes
0answers
125 views
Unity quick walk detection
I am making a google cardboard game and want the player in the game to move whenever the person walks. Person can be actually walking or just in place walk, we'll move the player. So I need to detect ...
0
votes
1answer
182 views
A* algorithm works silly with heap
I'm trying to use A* and visualised it, but when i add a heap optimization it start looking in incredeble ways sometimes normal(better then next to be sure), somtimes he looks on few columns.
Normal ...
0
votes
0answers
138 views
Zebra puzzle generator algorithm
I made an open source zebra puzzle generator, also known as an Einstein puzzle.
When I generate a table, I have to obfuscate (make obscure) it, and make some letters hidden with the good indication ...
1
vote
2answers
268 views
HPA* Pathfinding, building the hierarchical graph is too slow
So I have a graph, roughly grid shaped, that is about 300*300 nodes large. Even at this size, however, traditional a star takes 20 seconds to run in some cases. So I implemented an HPA* algorithm to ...
0
votes
1answer
107 views
Möller-Trumbore false positive result in specific point
I copied code from this whitepaper and i can't figure out while it gives me false-positive intersections.
Here's problematic values:
Triangle points: (100.0, 100.0, 100.0), (-100.0, 100.0, 100.0), (-...
1
vote
2answers
60 views
What is the best practice to handle event with order?
When you play card games, you always face some abilities and effects will be triggered at the same time. To resolve this, players relies on the rules. For example, if a minion dies, it triggers ...
0
votes
1answer
61 views
Creating an Array of 1s and 0s (with all 1s touching)
I am a novice programmer trying to add an unnecessary and complicated element to a text adventure! ...and I've run into a question I am not sure how to research further (I suspect due to lack ...
0
votes
1answer
31 views
Recognize that user has traced a path of vector points with mouse
How can I check if a player has traced a closed vector shape from an arbitrary starting point all the way around to the beginning?
Setup
Given are the vector points A through E, which form a closed ...
3
votes
2answers
176 views
Avoid unreachable rooms in duengons
Good evening.
Im currently trying to create a Dungeon Generator . First I place randomly some rooms. Right after that I dig in a randomized maze.
But sometimes it happens that some rooms or even ...
0
votes
0answers
32 views
How to compute forces on objects
Say I have N bodies that moves and potentially collide. I can then compute the net force as
F_net=sum(Normal forces from all objects in contact) + gravity + drag + damping + motor
Which will result ...
2
votes
0answers
53 views
Representing a high-resolution deformable solid in 3D
I am currently working on a design that will incorporate an object that can change size and shape.
For an example, I'll use a brick of clay. It starts out with normal dimensions of 1"x3"x6", but that ...
4
votes
2answers
216 views
How can I make a “paint” effect?
I am wondering how one could implement "paint" in games. As a reference, I have two games I am specifically thinking about which are Super Mario Sunshine with its "goo" and Splatoon.
I'm wondering ...
-2
votes
1answer
59 views
Implementation of A* Algorithm in a 3D Cube Array
I am working on making a program that finds the most efficient way to a goal from a starting point, with a few random debris set around. The entire thing is a 25x25x25 3d array of Cube objects, which ...
4
votes
2answers
188 views
Does anyone know what terrain generation algorithm is used here?
Does anyone know what this terrain generation algorithm is called? I saw it in two places. One was on YouTube, and the other, on Wikimedia.
4
votes
3answers
218 views
Creating a “world” for evolution of programs
I am trying to create a "world" where "copies of programs" are allowed to evolve, proliferate and fight for resources.
Organisms copy information with errors and memorize the results. It seems like ...
1
vote
1answer
108 views
Turn Based AI Algorithm (Small Board, Two Steps)
This is my Game-Board:
-> The Red Balls are the AI-Controlled Actors.
-> The Blue Balls are the Player-Controlled Actors.
-> The Yellow Cells are the locations, from which the Red Balls can attack.
->...
0
votes
2answers
60 views
How to get a smooth path for a vehicle in a 2D top down map?
I am making a 2D tile based game which involves having AI that needs to traverse the map avoiding obstacles in a natural and smooth path (NOT NECESSARY THE SHORTEST)
The orientation of the vehicle is ...
3
votes
2answers
135 views
How to calculate building cost with production per hour?
I know that it may not detailed thread title but I will give more detail about my question.
I'm working on a strategy game, and can't find a solution about building cost or training cost. I spent 1 ...