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.
6
votes
1answer
56 views
render text inside countries
I have a map of the world and I want to place text on top of each country. The text can be anywhere from 0 to 1000 symbols long, and can often be changed.
I'm looking for an algorithm to layout text ...
0
votes
0answers
20 views
dominos random placing tiles algorithm
I'm trying to make a game, where board is made from 1x2 (dominos like) tiles.
Do you know, how to implement smart algorithm to initial shuffle board - size NxM - number of tiles = (NxM)/2 , all ...
1
vote
0answers
57 views
“Solve” a game algorithmically — creating bots (and making them smart) [on hold]
EDIT : at first I gave a lot of context for this question, explaining why I wanted to create a bot. I'm sorry it distracted people from my "actual" question.
My question is pretty simple : how does ...
0
votes
1answer
26 views
Algorithm for adding time-bonus to countdown
I'm trying to build an algorithm that adds a time-bonus to a countdown that indicates when the game is over. The time-bonus should obviously be connected to the score the player earns. However, the ...
4
votes
1answer
52 views
how to create an outlined polygon with vector3 coordinates?
I have a set of vector3 coordinates and I use them to draw a polygon in another app, my question is: how can I calculate a second set of coordinates to make it look like the line is outlined.
in ...
4
votes
2answers
63 views
Make a cell's content 'listens' to another cell (the closest cells)
I'm a newbie in programming and in java and I need some lights and help.I'm developing a game in which two players have to play with tokens (say red and blue) by placing them in cells (75x75 grid). ...
2
votes
1answer
74 views
How do I calculate hex coordinates from a ring and index?
I am trying to implement field of view (FOV) in a hex grid. I am using the cube coordinate system from here. Then, I am using shadow casting to find FOV as from here.
I have a system like in the ...
0
votes
2answers
59 views
Best algorithm for different shapes maze
Based off my previous question here Maze or puzzle algorithm for something similar to noodles are there specific algorithms that would be best suited to building a maze with only 1 solution for
A ...
1
vote
2answers
74 views
Calculate 8 different directional input based on arrow keys combinations
Considering I have four variables event binded to each arrow key, that can be 0 or 1
My current approach to this issue is simply 8 nested ifs checking each combination or keys
Is there a more math-y ...
0
votes
0answers
35 views
Algorithm for power and transmission system for vehicles?
I am trying to develop a car racing game and i am looking for some algorithms to implement engine and transmission system of a car realistically. I found this (http://entitycrisis.blogspot.in/2010/12/...
1
vote
1answer
65 views
C# Minesweeper - When cells with no mines nearby gets clicked
I'm currently making a Minesweeper in C#. I've already done the basics (generating minefield, rules and ui) but I don't know how I should implement when the user clicks a cell and the cell has no ...
1
vote
1answer
39 views
Word Puzzle: Less or more difficult
I'm working on an app which is a Word Puzzle. Player has to arrange about 10 words in correct order to solve it.
I have two options to build it:
Give user feedback (right or wrong) when he has put ...
0
votes
0answers
65 views
What is the best way to generate a non-grid, rail-like path from prebuilt pieces?
I'm trying to procedurally generate a path from prebuilt pieces, like one would from a train set (straight piece, 45° turn, 90° turn, etc.). Generating the path randomly is simple enough but I'm ...
0
votes
1answer
42 views
Maze algorithm with field counter
I am new to algorithms but currently creating a little game with the need for some.
I have a 2d grid/board with a start and a finish field. Between those two fields are several platforms which can be ...
2
votes
2answers
23 views
Picking cells which form a completed line between to 2d grid cells
I'm using Bresenham's line algorithm to calculate a "line" of cells between a start and end point on a 2D tile grid.
However, I'm using this during terrain generation to create a visible pathway, ...
4
votes
0answers
48 views
How to generate Bayer matrix of arbitrary size?
In ordered dithering Bayer matrix is used.
How is that matrix generated? What algorithm can be used to generate matrix of arbitrary size?
0
votes
1answer
46 views
Better streaming economy algorithm?
Does anyone here have experience making games with streaming economies? I am working on a game and am looking for a better way to handle the economy. I feel like there must be a better algorithm than ...
1
vote
0answers
50 views
Path finding algorithm for (x,y) coordinates in c++
I am trying to code a path finding function in c++ . It should work like that, you supply the start point (x1,y1) and the end point(x2,y2) and it returns a list of points for the shortest path.
...
6
votes
1answer
97 views
What is the fastest algorithm to check if two cubes intersect (where the cubes are not axis aligned)?
I am looking for an algorithm to check if two cubes intersect. One can check if each of the 6 faces of cube A are intersected by each of 12 edges of cube B, but that is 72 checks. I've heard there is ...
2
votes
1answer
22 views
How does Hierarchical Pathfinding deal with obstructions in the same chunk?
Aigamedev.com provides this visualization of HPA*:
All the nodes within the same chunk connect to each other. What if there was an obstruction between nodes in the same chunk? For example:
What ...
1
vote
2answers
37 views
Board Game Pathfinding - Finding optimum valid path with limited path distance?
I'm building the very earliest stages of piece movement in a digital board game I'm planning to make.
It's a browser based javascript system.
Basically the players roll to move and need to traverse ...
11
votes
2answers
171 views
How is structural analysis done in games (e.g.: bridge building, Dig or Die, and 3D)?
From what I understand a typical interactive truss system would need substantial calculations since every component affects the entire system. I think you could arbitrarily stop at a given number of ...
2
votes
6answers
368 views
Computing chance of winning when dealing with fuzzy numbers
Computing chance of winning in a one player and one enemy battle when using fixed numbers is quite easy; for example if we have these numbers:
Player : Attack : 5 - Health : 30 - Attack Interval : ...
2
votes
2answers
56 views
Given a grid system where some coordinates are marked as impassable, how to find natural-looking car driving path between two locations?
I can compute an A* path, but I get only cardinal directions from that. A 45˚ path would look like "up 1 left 1 up 1 left 1 up 1 left 1..."
My specific question is, given a grid with a pathing ...
8
votes
1answer
265 views
Algorithm for “healing” multiple rectangles into a smaller number of rectangles?
Say I have a grid of rectangles of different shapes and colors and I want to reduce (reasonably close to optimal is fine, optimal is not necessary) the number of rectangles to represent the same ...
0
votes
1answer
39 views
Zobrist Hashing equivalent for Simple Knights Game with only 1 unique piece
I looked over the Zobrist hashing function used for getting a unique hash id of the board state in a chess game. https://en.wikipedia.org/wiki/Zobrist_hashing
Martin Fierz explains it very well in ...
2
votes
2answers
71 views
How to calculate area to fill in this Snake/Qix game variant?
I have a game which is a Snake/Qix variant.
The player controls a line which is moving on an island. Player has possibility to leave the island in order to connect that island to itself. Once the ...
2
votes
1answer
57 views
How to stop diagonally in an event driven input system?
Example scenario:
Assume 2 dimensional top down movement system.
Given that I have 4 directional keys ( UP / DOWN / LEFT / RIGHT ), I am able to move in 8 different directions 4 perpendicular and 4 ...
0
votes
1answer
79 views
How to optimize against wealth loss?
The wealth system in d20 Modern always gives me a slight headache at character creation, because I know there's a better way to buy things, but I don't know exactly how, so I'm coming up with an ...
0
votes
1answer
36 views
How to calculate random new position base on original position on map
I am making a 2D game with HTML5 Canvas. The game has several shapes and I want them to move all over the map randomly.
However, if I just give them a constant angle to follow, they will
all ...
3
votes
2answers
163 views
What algorithm can I use for handling two types of HP, one of which may be undefined?
In my game, each unit has two types of HP: Hard and Soft. Soft represents the human part of the unit, while hard represents anything mechanical. For example, a regular rifleman would have 100 softHP, ...
0
votes
1answer
61 views
How to get connect tiles in hexagonal Grid system
I've been developing a game where a number of tiles can drag into a hexagonal gird background.
But some purpose i need to find the location of same tiles into a array and marge them.
Data Layer
...
0
votes
0answers
17 views
Algorithm for Match making range value
I'm searching for an algorithm where if currentPlayer.matchMakingPoints is low .. then match it would opponents with +- for example 500 .. but as the currentPlayer's matchMakingPoints increases, the ...
1
vote
0answers
78 views
Z-order curve — how to query all nearest neighbors?
TLDR: How to query all nearest neighbors with the least effort? (Iterating over a bigger neighboring area that's continuous and filtering out elements that are not immediate neighbors?)
Suppose the ...
5
votes
2answers
174 views
Level of detail for the map of stars
I have a large list of points (millions) in 2d. Let's say it's a star map. Each star has a radius and position in space.
I want to render this map at different level of details. From a single star to ...
0
votes
0answers
78 views
Algorithm for 2d AI aiming to compensate for gravity
In a 2d side-view scenario I have two riflemen aiming at each other. By normalizing the x and y difference they know the direct path to the enemy.
However, gravity will pull the projectiles downwards,...
3
votes
2answers
78 views
Delay when moving elements
How you can see my mouse goes little bit faster than widget.
My movement algorithm is:
cursorPositionPrev.set(cursorPosition);
cursorPosition.set(getCurrentPos());
...
Vector2f delta = new ...
1
vote
0answers
45 views
Optimize field of vision algorithm in a grid tiled map
I am trying to implement Field of View algorithm in my game and I followed the great tutorial here : sight-and-light and here is what I got so far :
As you can see it works fine for me :)
And then I ...
3
votes
1answer
28 views
Calculating the poly vertices based on the result of Connected Component Labeling
I am making a tile based game.
And now I can find all the connected area using the Connected Component Labeling algorithm.
But now the problem I am having is how to calculate the poly vertices of ...
1
vote
1answer
84 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.
...
0
votes
1answer
71 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
60 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
55 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)?
2
votes
0answers
116 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 ...
0
votes
0answers
21 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
1answer
55 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
1answer
99 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 ...
0
votes
0answers
49 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 least ...
-1
votes
1answer
87 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 ...
3
votes
0answers
32 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:
...