# Tagged Questions

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.

84 views

### How to space actors in scene uniformly? [duplicate]

I have a Array data structure right now, which contains 10 soldiers in my army. They can setup initially in various formations - e.g. o o o o o o o o o o The user can move one of the ...
643 views

### How can I maintain a rectangular formation when units are added or removed?

I've got bots in a rectangular formation with rows and columns. A problem arises when a bot is added or removed from the formation. When this happens, the bots have to rearrange themselves so that the ...
1k views

### How do I apply different probability factors in an algorithm for a cricket simulation game?

I am trying to write the algorithm for a cricket simulation game which generates runs on each ball between 0 to 6. The run rate or runs generated changes when these factors come into play like skill ...
8k views

### Procedural river or road generation for infinite terrain

I should say paths, not roads as I'm thinking more medieval-like. Also, not looking for realism. The answer I'm looking for will be to fit into the mold I describe rather than realism. I am looking ...
169 views

### Precalculate the position of a rotating Aircraft

To start honestly, this question is probably mostly handling math. But thats only the road I tried to go and failed miserably, so maybe theres a much more simple way to do. Ok the game situation is ...
372 views

### Image Texture Tracing Algorithm - Cocos2D Box2D

Context: I am working on a 2D Destructible Terrain engine for Cocos2D with Box2D. All images, when a level loads, have their border's traced and cached for the purposes of forming Box2D b2EdgeShape ...
829 views

### Lightweight Simple Fast-Object Collision Detection Algorithm/Logic

I'm making a game where i need to give my objects collision, but i have many fast small objects and normal collision algorithms (Intersection of shapes and such) do not work, because the position+...
582 views

### 2D sort for inventory items?

I asked this question some time ago. Now I ended up with just a sorter method that will sort the items based on their bulkiness/nSlotsRequired. Here's what I'm doing: I store all the items I have in ...
303 views

### Random 2D point in rectangle, but not in a polygon

I have a static rectangle and dynamic polygon. I need to generate a random 2D point in that rectangle, but not in a polygon. This is what I mean: Green is where random point can be generated and ...
2k views

### Multiplayer Network Game - Interpolation and Frame Rate

Consider the following scenario: Let's say, for sake of example and simplicity, that you have an authoritative game server that sends state to its clients every 45ms. The clients are interpolating ...
4k views

### Random/Procedural vs. Previously Made Level Generation

What the advantages/disadvantages of using random/procedural generation vs. pre-made levels? There seems to be few that I can think of, other than the fact that items may be a problem to distribute ...
429 views

### Rubik's cube array rotation

I'm about to make a 3D Rubik's cube based game in Flash AS3 and Away3d. I don't really know how to manage the 2D arrays of the Rubik's cube. For example, how do I rotate the corresponding arrays if ...
177 views

### How do I have an arrow follow different height parabolas depending on how long the player holds down a key?

i'm trying to throw an arrow in my game, but i'm having a hard time trying to realize how to make a good parabola. What I need: The more you hold "enter" stronger the arrow goes. The arrow angle will ...
779 views

### What would be the most simple following target and neighbors avoidance algorithm in 2D space on plane?

I have ~20 or more enemies and they need to follow a target and avoid to go on top of themselves. I mean follow a target and avoid to collide with each other. Area, on which they are walking, is just ...
1k views

### Auto-organized / smart inventory system?

for the past week I've been working on an inventory system with Unity3D. At first I got help from the guys at Design3 but it wasn't too long till we split path, because I really didn't like the way ...
788 views

### Grid Based Lighting in XNA/Monogame

I know that questions like this have been asked many times, but I have not found one exactly like this yes. I have implemented a top-down grid based world in Monogame, and am starting on the lighting ...
1k views

### How to deal with objects placed in the root nodes of a quad tree?

I've implemented a quad tree where points and axis aligned rectangles can be put. It works fine, except for one issue that I'll try to describe. When you put a rectangle in the tree and this rectangle ...
929 views

### How can I divide a 3D mesh into small pieces?

I'm considering a manufacturing game. A player should assemble parts of an object in given time. The object will be a 3D mesh model. I want to automatically split the 3D mesh into many small pieces to ...
142 views

### How to get a cone shape of arbitrary size in an hex board

I'm implementing engine tools for my hex board game and this one is becoming messy. I want to get a list of all the positions that a cone of size N would have, given "caster" origin X,Y and origin in ...
415 views

### What techniques make next gen look so realistic [closed]

I have watch several gameplays from upcoming titles for ps4 and xbox one and I must admit that they are breath taking. Of course with new hardware, models will have more polygons and higher texture ...
351 views

### Painter algorithm on transparant objects

Why do you have to use the painter's algorithm when drawing transparant objects ? Can't you just use a z-buffer, draw all non transparant/opaque objects, then draw all transparant/opaque objects last? ...
376 views

### Line draw on “even-q” vertical flat topped hex grid

I'm trying to implement a Line Draw or Line of Sight algorithm for my hex boardgame. Upon reading several different solutions from most common places like the Hex Bible none of the algorithms adapted ...
292 views

### Ideas to create a Best Move in a match 3 game [duplicate]

I'm trying to make a match 3 game in C++ and I want to make a best move method to show the player the ideal position to move to get the most amount of points. The rules of the game are as follows: ...
138 views

### Non-smooth noise with optimal performance?

Any suggestions on how to get more 'jagged' results like linear interpolation gives with value noise using a faster algorithm concept like simplex noise? Simplex noise I haven't spent enough time ...
1k views

### Algorithm for optimising a match game with known queue

I'm trying to write a solver in C# .NET for a game known as Flowerz. For your reference, you can play it on MSN, here: http://zone.msn.com/gameplayer/gameplayer.aspx?game=flowerz. I'm writing it for ...
11k views

### How can I generate Sudoku puzzles?

I'm trying to make a Sudoku puzzle generator. It's a lot harder than I expected and the more I get into it, the harder it gets! My current approach is to split the problem into 2 steps: Generate a ...
523 views

### Path finding in games

I am writing my term paper about Path finding algorithms in games, and i've got a couple of questions, hopefully you people could help me out with those ;) So, i've done a little bit of searching ...
677 views

### Help understanding Simplex Noise

Introduction This is less of a "how to" on using 2D simplex noise and more of a quest to understand what is happening both in the math and visually. I would rather not copy and paste the code I've ...
3k views

### Player ranking using ELO with more than two players

I would like to use ELO to track player rankings between matches of a certain game, however the game can be played with up to four players in a match. I have seen games like Carcassonne use ELO with ...
582 views

### How do I approximate the result of battle between two armies with known strengths?

I need a simple algorithm to calculate the outcome of two differently sized armies battling. Each army has 1-100 troops and every troop is the same value on the battlefield. The troops do not have ...
695 views

### Pygame: circular motion with Bresenham's algorithm

I'm trying to figure out a way to move an object in a circular path. I read about Bresenham's circle algorithm, but all the codes available online draw an entire circle. For my game, I want it so ...
282 views

### 2D object move & evade obstacle

Description: Actor{ int x,y,width,height; float speed, angle; } actor is an object that move around the map every frame, actor change position(x,y) according to it’s speed & angle ...
279 views

### Job finding algorithm

My issue seems simple enough to me, but I can't break it down the the bare essentials to be able to program it into my game. First of all different professions requires different skills, these skills ...
347 views

### MiniMax where bots make simultaneous moves .

What is the correct approach for using miminax in a game where bots make simultaneous moves ?
886 views

### Partially observable game map — is A* appropriate?

I know very little about game development and I'm trying to wrap my head around pathfinding algorithms. Consider this setup: an agent is on a 2D map and must find the shortest path to a globally know ...
516 views

### Help me please to choose proper path-finding algorithm

I am new to game development and just want to ask for advice. I need to know which path-finding algoritm will be suitable for my scenario: Units - any shape. But in most cases rectangles of ...
511 views

### Drone targeting

Imagine a "drone" and a target point on a 2d plane. There are eight parameters: P = my position Q = target position V = my velocity I = my moment of inertia w = my angular velocity s = my angular ...
5k views

### Comparing two tree structures

I'm having a hard time trying to describe this in correct terms so I will just give as much detail as possible and hopefully someone knows what I'm trying to do =-) I am trying to compare two node ...
1k views

### What algorithm to use to fill a KenKen square board with cages?

I am working on recreating KenKen, a popular math puzzle involving a blank grid that is divided into "cages". Each cage is just a collection of adjacent squares and has a clue which is generally a ...
797 views

### Pong horizontal movement algorithm

I was just wondering about the horizontal movement of a pong ball? What is the general algorithm used with this? The ball in my pong game just move vertically and I don't know about the algorithms ...
191 views

### How to determine what hexes are in an area bounded by 3 hexes

I've been searching for hex grid algorithms for a while now, but I'm not having much luck. I'm working on a game that will be using hex grids for the board. There seems to be sufficient resources to ...
1k views

### 2D Drag Racing Algorithm

What algorithm can I devise for a 2D drag racing game to simulate a race? The gameplay is 2D and the camera's perspective is from the right side of the cars i.e. cars are seen from their right side ...
492 views

### Path Finding for an Arena based map in 3D using NavMesh

I have a 3D arena map (consider a small island surrounded by water on all sides) for a multiplayer Tank fight game. The moveable areas are marked using a Navigation Mesh made by the Arena designer. ...
976 views

### Time of Day Lighting / Day Cycle

I'm trying to implement a simple "lighting" system that alters a value of light between 0.0-1.0, 1.0 is midday 0.0 is total blackness. Are there any "good" information regarding this particular ...
3k views

### Decomposing a concave mesh into a set of convex meshes

I'd like to be able to decompose a concave mesh into a set of convex meshes for 2 reasons: Transparent rendering Physics shapes Is there an algorithm that takes a set of triangles (concave) as ...
151 views

### Flowfield density conversion

I'm trying to implement flowfield navigation, as described in http://grail.cs.washington.edu/projects/crowd-flows/ but I can't understand how the Density Function in Figure 4 of the paper is supposed ...
1k views

### Interstellar Economic Simulation

I'm designing a game reminiscent of Elite or Escape Velocity, those old space trading games, where you play a traveling merchant in space. I'd like to have the game's economy at least resemble a real ...
398 views

### 100 points between 0-1000 on an increasing scale

Basically, it's for roleplay, I need to generate 100 points along a scale. Level 1 is the starting amount, and is at point 0 on the scale. Level 100 is the highest amount planned at this point, and it ...