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.
2
votes
1answer
23 views
How can I calculate an octree node's depth from its location code?
The article Advanced Octrees 2: node representations states:
The AABB (axis-aligned bounding box) of the node can be stored explicitly as before, or it can be computed from the node’s tree depth ...
2
votes
2answers
102 views
Best 2d AI movement system
I'm creating a top-down rpg (no tile-based) using libgdx. Now I need to make enemies move on map with obstacles. What is the best approach to realize that? A*(I think, if enemy see player, he should ...
0
votes
0answers
37 views
How to get a difference of angles in one mathematical expression? [duplicate]
I need to do this for AI and also range calculation over a curved surface.
I have two angles, a1 and a2, which can be in the range from 0 to 359. I need to calculate the difference between them, and ...
0
votes
1answer
49 views
A* Pathfinding math for 2D, oblique style game
I'm making a 2D, oblique-styled RPG game and am implementing A* pathfinding for NPCs. The game is on canvas, using melonJS engine and sprites not confined to a 'grid'. I'm having a hard time ...
0
votes
1answer
33 views
A Star pathfinding on oblique map
I'm making an RPG and want to make npc ai to navigate the city. I am using polylines for collision detection, and my map is 2D, but oblique styled. I am considering using the A* algorithm to help them ...
3
votes
4answers
107 views
Special Pathfinding Algorithm
I need help with following pathfinding Task:
I have a grid (7x7 squares) and the starting square is always on the far left side (column 0) and its target is to reach the far right side (column 6).
...
0
votes
1answer
29 views
traversing the area
i want to move point along spiral like hexagon for example i want to traverse the whole area and my player (point) is standing where i have placed it manually. now i want to start from this point and ...
0
votes
1answer
82 views
Pathing for 2D, sprite-based game
I'm making a 2D, oblique-styled sprite based RPG. My game does not live in a 2D matrix (like Tetris), rather it's sprites animating over a tilemap. I am trying to set pathing rules for NPCs. I've ...
0
votes
1answer
35 views
Calculating the illumination level of an object
In my (UE4) scene I have an object and several (point) light sources. The object can move around, getting closer and away from all those light sources. Now I need to calculate for each light source ...
1
vote
1answer
129 views
What are the disadvantages of R-Trees in collision detection?
I was poking around in SQLite and discovered R-trees. A little digging revealed that R-trees are really just fancy AABB-trees.
Then I realize that the state of the art in collision detection (often ...
1
vote
1answer
44 views
Efficient dynamic character shadows [SW Rasterizer]
I am working on a SW rasterizer for a quarter-century old console (think sub-100 MHz RISC CPU, no dedicated 3D HW, couple megs of RAM) and am approaching a stage where I will be adding dynamic ...
1
vote
2answers
74 views
How can check a collision between 2 non-axis aligned boxes?
I'm making a simple and easy game and I need to detect the collision between 2 boxes. It only needs to return trueor false, no physics involved.
I started working and couldn't find an algorithm that ...
0
votes
0answers
46 views
How do I efficiently generate all valid configuration spaces of a Tetronimo in Tetris?
This question is relevant to How can I do optimal pathfinding for a tetris piece, which assumes we already have a start and end state.
How we can efficiently generate all those valid configuration ...
1
vote
3answers
77 views
Best collision algorithm for Axis Aligned Bouding Boxes [duplicate]
I have a number of quads (suppose like 20-40) and i want to quickly check the collisions between any of them. I would like to know if there's a quick algorithm to do that 60 times per second without ...
0
votes
0answers
32 views
Grid board fill with special cells - predicting movement
I have to create an algorithm which will fill a board, which is made of square cells, with elements. Board can have different sizes and it doesn't have to be a square. Elements fall from top to ...
0
votes
1answer
48 views
Algorithm to fill a shape defined by 4 pixel points?
I'm developing an application in Unity3D where a user can define 4 pixel points on screen, and what I would like to do is fill this shape with pixels using Unity's SetPixel.
While I can do this ...
2
votes
1answer
35 views
How does hidden surface removal work?
Lately, I've been learning some OpenGL for fun, and I've been thinking about hidden surface removal.
Say you have a high poly count static scene, with nothing that moves, no bones, physics, etc. Just ...
2
votes
3answers
150 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 ...
-2
votes
1answer
60 views
Optimal trajectory of area exploration
I've got next problem. There is three objects:
first one, with next characteristics: circular area of view, speed, drag coefficient;
wind (or water current, doesn't matter; some sort of resistance) ...
2
votes
1answer
63 views
Short distances from reference point
I would like to compute short distance from reference point in 2d grid. To expose:
0, 0: not penetrable
0, 1: not penetrable
...
1, 1: penetrable
...
I search an algorithm who return:
1, 1: 1
...
6
votes
2answers
158 views
Pathfinding with inertia
I'm currently working for pathfinding for a game where units are moving, but they have inertia. Most typical pathfinding algorithms (A*, Djikastra, etc.) are simply designed to minimize the length of ...
3
votes
2answers
146 views
Algorithm for a smooth weather transitions in game weather system
I've been slowly learning c++ and building up a codebase intending to create a simple first person role playing game.
I've coded a time management tool to track time elapsed in game, an inventory and ...
-2
votes
1answer
74 views
Libgdx array of Vector2 closest point
I have an array of objects. Their position is a Vector2 (x, y). I want to select the closest object, given a (x, y) coordinate (that represents an user touch on screen). Searching on web I found a few ...
2
votes
3answers
77 views
Get algorithm (Chance-to-Hit) from Input and Output
I am currently working on a chance-to-hit formula for an rpg. It consists of the following parts:
AttackSkill: The used Attribute of the Attacker (Range: 1-10)
AttackBonus: A Modifier from ...
0
votes
1answer
94 views
Pathfinding Algorithms [closed]
I am new to game programming I currently am using unity's 2D power to remake an 2D game for sake of practice. So I am just little confuse about one thing, so far every enemy in my game was dumb(they ...
1
vote
2answers
237 views
What makes Minecraft so CPU intensive, and what could be done to improve it? [closed]
Recently I've been searching for VPSes that allow Minecraft servers to be hosted, and surprisingly very few do. Most allow for games - but Minecraft in specific is disallowed by many.
Now it's fairly ...
7
votes
2answers
190 views
How to create a map from graph
I want to draw a 2d polygon map based on data provided by another source to ease analysing actions on the map. The data has the following format:
1 ['2', '4', '5', '7', '17', '10']
2 ['1', '3', '4']
...
14
votes
3answers
2k views
How to render infinite universe?
I'm curious what are the best practices in game development industry to render 3d universe?
To be more specific:
The data points are given and static. Each point has position, color and size;
The ...
0
votes
1answer
40 views
How to calculate normal vector of a curve?
How I can calculate the normal vector for tow dimension curve (I have the points of the curve in plane x y)?
3
votes
3answers
338 views
Algorithm for dividing a 2D grid into organic looking plates
the title pretty much says it all:
How could one go about segmenting a 2D grid into smaller parts?
My goal here is to create tectonic plates for further procedural world generation
Details to ...
3
votes
1answer
77 views
Placing an AABB close to a point so that it doesn't intersect any other AABBs
Give a 2D space with a bunch of non-intersecting AABBs, and a point in this space (that may or may not be inside an AABB), how can I find the closest place where I can place a new AABB of a given ...
-1
votes
1answer
49 views
Java libgdx get clicked square without iter
I would like to detect which square is clicked without iterating over all elements!
i don't want to do this anymore for all elements.
if( x >= this.getAnchorX()-HalfWidth && x <= ...
0
votes
2answers
282 views
Map Generation Algorithm [BOMBERMAN]
I'm looking for some wise tips concerning a specific game development : Bomberman-like.
I am currently implementing a "random map" generation for the game, but I feel like I'm not doing in the best ...
1
vote
2answers
35 views
MiniMax strategy - What is the context of the numbers?
I've watched a new videos about the MiniMax concept and invariably the lecturer will say that the computer has 2 parties, Min and Max; Min always takes lower number and Max takes higher number.
The ...
0
votes
2answers
152 views
finding a path from one point to another with obstacles help
Im building a tile based game and im implementing my path finding algorithm. Currently, it can find a path from point A to point B with no problems. However, if there are obstacles between point A and ...
3
votes
3answers
191 views
Getting one-point-collision object to conform to uneven terrain while keeping constant distance covered
This is probably best described by image:
I have a character. For floor collision, it uses a single point (the red X). When the character moves, it conforms to the terrain; note how the blue line ...
3
votes
2answers
434 views
Pathfinding in 3d voxel: waypoints?
I have an application where I have a 3d collision voxel space (passable or non-passable at each point) and I want to plot a short unobstructed path between two points. There are no gravity ...
1
vote
1answer
85 views
Best way to calculate city influence maps similar to civilisation?
As the title says, imagine you want to generate the influence mask for a city, given that the map is a 2D grid rather than hex. An extra bit is that different points on the map might have different ...
1
vote
0answers
45 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
votes
1answer
92 views
How can i fix my Ground detection code?
My ground detection works by checking if the player's x position is between the range of a sprite xpos+16 and xpos-16 if it is,then it uses a separate axis theorem on the y axis to see if the player ...
0
votes
2answers
73 views
Is there any easy way to understand the Alpha Beta for Othello?
I'm stuck with coding the Alpha Beta algorithm for a console-based game I'm developping at the moment. I tried to understand how it works for a week but still no idea how to get started with it.
Here ...
2
votes
1answer
265 views
Pathfinding in a 2D “sidescrolling” strategy game
I've been thinking up a real-time strategy game that plays on a platformer type of map. The collidable portion of these maps will be made up of square tiles. I've done A* pathfinding in top down tile ...
33
votes
9answers
6k views
How can I quantify a drawn line's straightness?
I'm working on a game which requires players to draw a line from a point A(x1,y1) to the other point B(x2,y2) on the screen of an Android device.
I want to find how well that drawing fits to a ...
0
votes
1answer
37 views
Texture to Painted Vertex Algorithm
I want to generate some game textures into coloured vertex arrays.
Is there a known algorithm to transform texture/bitmap data into an optimised vertex array. Much like how the Homeworld skyboxes ...
1
vote
0answers
134 views
Recursive backtracking sometimes missing a tile?
I have a basic recursive backtracking alghorithm for a maze. It pretty much works but ocasionally leaves some tiles in the corners untouched. This is the recursive function:
void ...
-2
votes
2answers
110 views
Minesweeper number placement [closed]
My professor gave us a project: make a minesweeper clone. However, he said that he will give bonus points for the 3 fastest algorithms for board generation. I'm currently doing the algorithm that ...
0
votes
1answer
76 views
A* pathfinding not finding shortest path with weird behavior [closed]
NOTE I have read through this thread and have tried the implemented answer
The A* pathfinding algorithm works fine most of the time but in some specific cases, it seems to not use the shortest path.
...
-1
votes
1answer
133 views
Tile map optimization algorithm
I've read this artical on tilemap optimization https://www.scirra.com/blog/ashley/3/tech-blog-tilemap-tidbits and wondering what algorithm is used to achieve something like this.
I'm wondering ...
0
votes
2answers
169 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 ...
0
votes
2answers
191 views
Space invader barrier implementation algorithm
I've been struggling with implementing the space invader bullet to barriers. I wanted right now to blast a circle around, when the bullet hits the barrier and modifies the circle. As shown in the ...