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

0
votes
0answers
34 views

A new Picross Game [on hold]

I have been working on Picross Puzzles for a few years. I have drawn lots of puzzles, more than 200, and I can add thousands more thanks to my autosolving algorithm. My project is currently working ...
4
votes
2answers
251 views

Can I use an AI engine written in C++ in my Unity game? If yes, how can I do this?

I am studying some chess and others AI algorithms and the majority of these implementations are made in C and C++, my question is, if I make a chess board and all the graphic thing in Unity, can I ...
0
votes
1answer
27 views

Hash Distance & Angle To Produce Unique Value

I have many vertices drawn on my Unity3d C# application window (thousands). I am attempting to come up with a fast way to detect which vertex has been clicked. My idea is to use a sorted list. The ...
2
votes
1answer
46 views

Detect which object conceals another one

I've searched for a while for a good solution and if I'd have found one I wouldn't be here. So there are the details: I have been working on my 2D game using XNA, and I'm aware of the way XNA renders ...
0
votes
1answer
30 views

Bounds Queries for Simplex Noise Function

How do I construct a Bounds Query for 3D Simplex Noise? [This is more or less a follow-up to my last question] Simply put, for an arbitrary octree node (cube) in my volume (a section of Unity3d ...
2
votes
1answer
75 views

Best practice for organizing the physics of objects?

Apologies because this is a long post and I am inexperienced. I would really appreciate the input from some experienced developers. These are my two goals for this project: To learn the best ...
1
vote
2answers
186 views

Efficiently detecting objects inside multiple radius

I would like to create a game for mobile that require to calculate multiple time by seconds which moving objects are in the radius of moving points. The game is highly inspired from Gratuitous Space ...
0
votes
2answers
200 views

match 3 Shuffling

I'm interested in hearing about to implement similar functionality to Candy Crush's shuffling. I have an algorithm to determine if there are any matches available and if there aren't, I want to ...
2
votes
1answer
169 views

Procedural terrain generation

Currently I have a procedurally generated planet using multiple octaves of perlin noise. The thing is, that I don't generate heightmap, but rather get the values of perlin function and apply them ...
3
votes
1answer
188 views

How can I determine the extreme color values in a texture?

I am looking for a way to determine the most extreme color values for all of the texels in a texture. So for a texture consisting only of black and white texels, the extreme values should be (0,0,0) ...
2
votes
1answer
110 views

Is it more efficient to use an A* algorithm or a line system drawn in pathfinding in C#?

I was recently introduced to the A* algorithm when I asked a friend about making AI/NPC's in video games move to certain points and it sounded very interesting. I am building an FPS and it has AI that ...
1
vote
2answers
86 views

GA - Genetic Algorithm for Enemy

So I'm starting a project which aims to make a good AI for my game monsters. So far I have set up the GA and got some results. There's two genes, with one chromosome each. The monster either ...
0
votes
1answer
26 views

Is there an equation to determine when to invoke extrapolation in response to lag?

I've implemented interpolation to smooth character drawing in my networked game. But now I want to fall back on extrapolation if too much time has passed from a user sending an update and the ...
2
votes
2answers
137 views

How can I simulate the sun's position for 3D lighting?

I'm using a directional light as a light source. It dosn't have a positon, only a direction, represented by a vec3. I'm trying to figure out how to make the light direction to simulate sun movement ...
0
votes
0answers
53 views

Libnoise producing completely random noise

I am using libnoise in C++ taken and I have some problems with getting coherent noise. I mean, the noise produced now are completely random and it doesn't look like a noise. Here's a to the image ...
0
votes
0answers
88 views

Sun & Moon Movement

I'm creating a 2D HTML5 Canvas Game and am stuck on how to go about animating my Sun & Moon. The current setup is basically setting the moon at -1024 on the X-axis and the sun at 0 and animating ...
0
votes
0answers
67 views

Pixel alignment algorithm

I have a set of square blocks, I want to draw them in a window. I am sure the coordinates calculation is correct. But on the screen, some squares' edge overlap with other, some are not. I remember ...
1
vote
1answer
54 views

Creating blur with an alpha channel, incorrect inclusion of black

I'm trying to do a blur on a texture with an alpha channel. Using a typical approach (two-pass, gaussian weighting) I end up with a very dark blur. The reason is because the blurring does not properly ...
2
votes
2answers
171 views

Non-perfect maze generation algorithm

I want to generate a maze with the following properties: The maze is non-perfect. Means it has loops and multiple ways to reach the exit. The maze should be random. The algorithm should output ...
1
vote
1answer
36 views

Draw a rotated rectfill in Allegro 4.2?

I'd like to use Matricies to transform primitive geometric shapes and draw them using the Allegro library using version 4.2 (I can not switch to 5.x just yet). This works fine for non-filled objects ...
1
vote
2answers
52 views

Server side random selection of players

Assuming I have a simple client-server game, where the server picks random players on a very frequent base, I was wondering what is the best way to select a random player (According to the following ...
0
votes
0answers
44 views

How is the “continues road” from 80's games called and done? [duplicate]

i like to test the "continues road" effect from 80's racing games . i call it like this i have no idea how it really called the effect that a car is in front of you , and the road is Approaching to ...
1
vote
0answers
31 views

Any tips on developing an RTS unit movement collision? [duplicate]

so I am developing an RTS and I am a little stuck at this. I am not talking about pathfinding algorithms like A*. The problem is moving units in bulk and their collision along the way. Can anyone give ...
0
votes
1answer
87 views

How to store and use different AI behaviours

I'm coding a space shooter on three.js (WebGL) and since the game I'm doing is rather simple, plus I want to keep controll of the structure, I'm not using a game engine. I'm using oop classes and ...
14
votes
5answers
2k views

Networking for Real Time Strategy games

I'm developing a real time strategy game for a computer science course I'm taking. One of the harder aspects of it seems to be client-server networking and synchronization. I've read up on this topic ...
3
votes
0answers
84 views

Learning game and effect related mathematical tricks [closed]

I'm trying to learn how to code some "effects" more succinctly. For example, I have sprite clouds in my game, and their transparency is determined with the following formula on their update-method, ...
0
votes
1answer
220 views

Random/procedural generation of puzzle-platform levels

I have an idea for a puzzle-platform game where the levels would be randomly generated. Creating a random generation is relatively simple. What's not easy is checking that randomly generated level to ...
2
votes
2answers
94 views

Connecting two arbitrary points with 2 lines

DEFINITIONS: Any "Point (x, y)" mentioned below is really the bottom left coordinates of a 1 unit by 1 unit rectangle. A "Line" is a defined as a rectangle that is either 1 unit tall and 1 unit or ...
1
vote
3answers
64 views

How do I find the intersection of a ray and a cylinder?

I'm looking for the algorithm to find the intersection (or lack of) between a ray and a cylinder. I have rotating coin like objects in my game world and need to check for a collision on that object. I ...
11
votes
2answers
299 views

Axis Aligned Spatial Division : Divide space into random rectangles?

I need a method to divide 3d space into random axis aligned box shapes. For now I am currently dividing the 2d space for testing purposes. The most immediate approach I came up with was to define a ...
0
votes
1answer
78 views

What is the simplest algorithm or pattern to continues ground/Floor

Im beginner in 3d gaming , i have basic question not Language specific. Say i have ground model for example terrain i modeled what is the common way to load the terrain and use it again Or load ...
1
vote
1answer
69 views

Can I use a list sorted by Morton Code for broad phase collision detection?

Until now I used a list of objects sorted by a single axis for limiting the amount of objects that collisions are checked against. The idea is simple: if the x coordinate of two objects differs by ...
6
votes
3answers
194 views

Determine if a set of tiles on a grid forms an enclosed shape

Given a set of tiles on a grid, I want to determine: If the tiles make an enclosed figure If the tiles make an enclosed figure when you count the sides of the board as an edge of the figure If ...
-1
votes
1answer
65 views

Match-3 Shuffle Required?

How can I detect if there are no more potential matches possible and therefore a shuffle is required?
0
votes
2answers
52 views

How do I know when a player has crossed a point threshold?

I’m needing help figuring out logic when adding a time bonus to my game. I only want to reward the player with extra time if they level up. Currently when the player’s score is less than 100 no ...
0
votes
2answers
203 views

best way to implement movement after A* pathfinding? tile-based movement vs pixel-based?

I was able to implement the A* pathfinding algorithm to calculate a path from the enemy to player. After trying to do movement well, I realized I ran into all sorts of problems. I was able to add ...
2
votes
1answer
108 views

How do I convert a partially transparent image into polygons?

I'm using GLEE2D, a level editor allowing me to import images, scale them, rotate them, and position them onto layers and export the data into XML format. However, it does not tell me objects' ...
0
votes
1answer
41 views

What is the actual formula to find the vertices of an animation frame in using a BVH file?

I've read this tutorial and tried many formulas to build the skeleton. I am able to build it without the rotations, but those break everything. This, for example, is a simplified code for one of my ...
2
votes
1answer
184 views

How do I avoid pathfinding characters getting stuck in corners?

I used A* pathfinding to return a list of Tiles to get from an enemy to the player. After that, I wasn't sure how to actually move the enemy. What I ended up doing was get the first Tile in the path. ...
0
votes
0answers
25 views

How to reduce n^2 complexity when checking for collisions and attacks? [duplicate]

I have a snake clone game, but each element can attack enemies and enemies may attack elements in snake. They all have range of attack, and what I do is every time my update loop triggers (60 times ...
0
votes
1answer
297 views

Hearthstone suggest a card algorithm [closed]

Does anyone have an insight of the suggest a card algorithm in hearthstone deckbuilding? I would like to try to see it that same suggestion can be applied in MtG, having for example to choose your ...
3
votes
1answer
67 views

Field of view determination with partially opaque cells

I'm currently implementing the field of view of a player in a 2D-grid based game. I've chosen a standard ray tracing algorithm because he really fits the features needed in my game. However, the ...
2
votes
0answers
77 views

Astar optimalization (A*) [closed]

So I have written own implementation of AStar (A*) algorithm to find paths around my 2d tile based map. My problem is that if I call it each frame (I need to do it) and I'm searching path from corner ...
3
votes
2answers
208 views

How simulate the return effect of the wheel of fortune needle

I am trying to create a spinning wheel which slows down after a specific time. I managed to simulate the slowdown of the wheel but I need also to put a needle which go up and down with an angle of ...
0
votes
0answers
32 views

How to combine vertex, normal, UVW arrays optimally?

In Unity, meshes have multiple arrays for various vertex components (Normal, Position, UV coord, etc), and triangles consist of three indices that define the (same) offset into each array to build the ...
13
votes
2answers
505 views

How can I generate a lightning bolt effect?

Is there an algorithm to generate a lightning bolt? I would like an algorithm that generates a list of segment or point objects specifying where the bolt will land. The method would need a start ...
4
votes
1answer
96 views

Pathfinding avoid a list of polygon

i'm working on a 2D RTS project, no tile-based map. I have a problem on building map data structure & algorithm for that. I already think of a naive algorithm to solve that. Of course it's very ...
7
votes
3answers
236 views

How can I add and subtract convex polygons?

I have two 2D convex polygons overlapping each other. I am looking for an algorithm to subtract and add them. The result must be a single concave polygon or (even better) a set of biggest convex ones ...
-1
votes
1answer
243 views

Tower Defense Search Enemies Efficiently

I had a problem with the build of a TD. I got a slow - non efficient search for towers find targets to shoot. PD: enemies[] got all the active & non-active enemies (death and alive) ->Im using ...
0
votes
0answers
47 views

Java Angle Math: Calculate how near the player looks to an entity [duplicate]

I am programming a Minecraft Bukkit plugin and need a way to calculate an input number from 0 to 360 for displaying a custom compass / radar. So if the player directly looks at the object (shouldn't ...