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

1
vote
2answers
68 views

What makes Minecraft so CPU intensive, and what could be done to improve it? [on hold]

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 ...
6
votes
2answers
98 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
33 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)?
-1
votes
0answers
9 views

Gamemaker radius argument and any 'selectors'?

I have the following two questions: Is there a radius of other object argument for the 'if' statement? I'll be using 'cow' for the example. if (instance_number(cow) == 2 && ...
-2
votes
0answers
47 views

approach for Indie game development [closed]

I really want to develop indie games. I have beginner's programming skills. I am learning c# also. But how do i approach game development? What should i learn more ? Which books can help me to be a ...
-1
votes
0answers
35 views

In 3D, how do I raycast to check for bullet hits?

I am developing a simple jet fighter game. I have x, y and z coordinates for both the shooter and target. How do I determine if a shot hits or misses an enemy object?
2
votes
3answers
215 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
70 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
36 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
181 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
29 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
1answer
44 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 ...
0
votes
0answers
14 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
345 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
71 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
25 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
79 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 ...
-1
votes
2answers
58 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
181 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 ...
31
votes
9answers
5k 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
34 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
91 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
86 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
69 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
113 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
82 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
157 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 ...
0
votes
2answers
74 views

In a grid based system, where users can build their own walls to create buildings, how do you determine which parts are indoors? [duplicate]

I've looked around for an algorithm to solve this problem, but I can't seem to find anything. In a game I am working on, data is held in a grid. Certain squares within that grid can be set as walls, ...
0
votes
1answer
68 views

How to invert a damage formula?

I have created simple damage formula based on source percent, which return fixed percent of damage. DAMAGE_PERCENT = Exp(Log(100) * (1 - (100 - SOURCE_PERCENT) / 150) Here is the result: ...
0
votes
1answer
89 views

Collision Detection algorithm using Line Detection

For a 2D physics sandbox I am working on, I need a way of detecting detecting a collision using lines. This sandbox uses a class called Particle, which has a x and a y (stored as a struct called ...
0
votes
0answers
74 views

Isometric staggered multi tile buildings

I'm writing a isometric staggered rpg engine and i am at loss to how to make the buildings placement diamond show up. What I mean is i have tile2screen and screen2tile functions and it works ok. I ...
0
votes
1answer
61 views

Paint game level algorithm

I have a game, and I have a level editor where you can build your level from blocks. Blocks positioned in cells. So blocks can have no neighbours or have one or few neighbours. My problem is that I ...
1
vote
2answers
106 views

Bubble shooter clone, structure for storing/adding of bubbles

Im having a few issues trying to figure out what the best data structure to use for storing bubbles on the grid, and how to connect new bubbles to the grid when a moving ball collides with a ball on ...
0
votes
1answer
77 views

How to calculate a score algorithm based on elapsed time?

I'm trying to calculate an alogirthm based on elapsed time to calculate score based on a music beat. I have the music beat divided into 4 because that's the time measure of that beat. So If the user ...
0
votes
0answers
15 views

Smoothly scaling positions of GraphicsItems on a 2D GraphicsScene

I layout a bunch of nodes on a QGraphicsScene(A 2D Canvas). The nodes are basic ellipses. It works reasonably well. However I would like to know how to better size the ellipses. Currently I have a ...
1
vote
1answer
74 views

Planar scene graph

Suppose there are many line segments on a plane (2D scene) and I would like to redraw only small portion ("window") of the whole scene. The scene is dynamic, meaning one can add/remove/transform ...
0
votes
1answer
41 views

Most efficient way to hide out of bounds object in tile based environment [duplicate]

I am working on a desktop game in C#, with Monogame framework. I am storing the tile instances in a 2D Array, for the sake of easy collision detection. But the levels are big (often 100x100 or bigger) ...
0
votes
0answers
37 views

2D Platformer Pathfinding [duplicate]

First of all, I'm sorry, I know this is a really broad topic, but I've been trying to do this for days, I've looked at about a hundred different Google links, and I'm just not having any luck. ...
2
votes
2answers
310 views

How can I generate a 2D mountain landscape procedurally?

Every level in my game needs to have a different mountain landscape background generated automatically (but the landscape must be the same for each level). How could I generate such a landscape ...
0
votes
1answer
66 views

Backtracking in A Star

Hello, can anyone tell me how can i implement backtracking in a a star search algorithm? I've implemented the a star search according to wiki, but it does not backtrack, what i mean by backtrack is ...
0
votes
1answer
92 views

Trying to add a feature to my (basic) level parsing algorithm - not sure how to (JAVA)

Right now this method goes through a list of GameObjects (e.g. JetPack, Platform) with their respective x and y positions in a text file called level1.txt: platform 840 280 platform 1130 280 coin ...
0
votes
1answer
52 views

which is the best approach or algorithm to calculate real-time ranking

I want to know the fastest and most efficient way to compute points and ranking in real time. I'm doing a betting football game (a game where users try to predict the outcome of a game before it). In ...
0
votes
1answer
166 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
1answer
52 views

Implementation of finding an index in a 1D array for a triangular grid

Am using a while loop to find an index within a 1D array, is there an easier, less-time-consuming and/or mathmatical way to find the index? Consider the next grid: 4 o |\ | \ | ...
2
votes
2answers
98 views

How do I model diffusion and heat?

So I'm trying to solve a heat/diffusion equation for a continuous space, but I'm not opposed to a grid solution. I'm a little short on the maths needed but have made it work so far. If I model ...
2
votes
1answer
188 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
1answer
143 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 ...
5
votes
3answers
250 views

How can I do optimal pathfinding for a Tetris piece?

Imagine a standard Tetris board (10x20) using the standard set of 7 tetrominos. Given a Tetris game state and a target position, how can I find the optimal sequence of moves that will get the ...
6
votes
3answers
343 views

How can I check if a player-drawn line follows a path?

I want to draw an invisible path that the user must follow. I've stored that path as points. When a player draws a line, how can I test if it follows the path I've stored? Here's an example for ...