# 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.

195 views

### Checking game objective status in efficient way on each update call

I am creating a 2d mobile game where there are three levels. Each level has 20 objectives. This can increase in the future. Examples: Level 1 Current Objective: 2/20 Objective : Collect 1000 coins ...
384 views

### Scrambling word into least recognizable form

My goal is to present the player with a scrambled word that should be reordered back into the original form: OELHL --> HELLO I want a scrambling algorithm that takes any given word(>3or4 letters, ...
265 views

### Server fixed timestep not running at 30Hz but way way too fast [closed]

I'm trying to make my game's server thread run at a fixed 30Hz but can't figure out how. Basically, before I just had a stupid while(1) { //do everything as fast as you can} which means that for my ...
2k views

### Get ring of tiles in hexagon grid

Thanks to this post I'm able to collect adjacent tiles to a given tile. But I'm pretty much stuck on an algorithm that gives me only a "ring" of tiles specified by an offset. The algorithm given in ...
370 views

### How to trace contour of shapes with holes?

I am experimenting with the RVO2 library for collision avoidance in a 2D simulation. This library supports specifying arbitrary obstacles as a list of vertices. The obstacles must be full shapes, i.e. ...
546 views

### How do you parameterize turn based AI?

I would like to create/find an AI algorithm/process that can be parameterized such that a change in the parameters causes a change in the AI behavior. I am specifically looking to apply this to a turn ...
379 views

### Determining if removal of a voxel will break up a group

I have the following situation: I have a 3d grid of voxels (on/off, the max size is probably 128x128x128). I know in advance that inside the grid, all the voxels that are turned on are interconnected, ...
1k views

### Algorithm to see if two voxels are interconnected

I'm looking for a good algorithms for the following problem: Given a 3D grid of voxels (which may be either empty or filled), if I pick two non-adjacent voxels, I want to know if they are connected to ...
625 views

### Simulating building stress [closed]

I need to simulate the effects of adding supporting materials to a building structure for a genetic algorithm in a block-based world. Essentially I am planning to use a genetic algorithm to optimise ...
537 views

### How to build a math module and simulate a system?

For example, in the classical game SimCity: an economic model to simulate the supply and demand of the city, then calculate how many people live in each building, how many people work there. a ...
429 views

### Collision Resolution: How to avoid Interpenetration/Tunneling Caused by Prior Collision Handling? [duplicate]

My game processes world collisions followed by entity collisions. The problem here is that entities can break through walls the next frame when world checks are run again as a result of the prior ...
275 views

### Create Random Platformer-Gameworld

Evening. I created a xna-game like the iOS Platformer game "Banana Kong". The level-layers are currently saved as XML files. Example: <level> <layer1> <tile type="0" x="...
70 views

### Build a Cube/Prism from other varied Cubes/Prisms [closed]

I'm wondering, are there any algorithms or theories in existence (that aren't patented/proprietary/protected) that would take a series of 3d rectangular prisms (or cubes but a cube is a prism) and ...
497 views

### How to do FoV similiar to Nethack? [duplicate]

I am currently writing a little roguelike and wondered how Nethack/other games do the FoV of the player. I had a look at Nethacks source code, but since it's C it's pretty hard to read. For people ...
3k views

### 3D pathing finding with flying

Does anyone know of a (free or paid) solution that enables 3D path finding? Basically something like: CalculateRoute(input_geometry, start_pos, end_pos, variance) I found a good paper on the topic,...
4k views

### What's the best way of transforming a 2D vector into the closest 8-way compass direction?

If you have a 2D vector expressed as x and y, what's a good way of transforming that into the closest compass direction? e.g. x:+1, y:+1 => NE x:0, y:+3 => N x:+10, y:-2 => E // ...
2k views

### 3D isometric depth sorting

How is it possible to depth sort tiles and objects in an isometric environments without any limitations? I've been researching this for a while now and there seems to be no publicly available answers ...
1k views

### Implementing a color picker [closed]

I'm making a paint program using applets in Java, and I want to create some sort of color palette where the colors blend into each other, similar to this: However, I'm having trouble understanding ...
3k views

### 3-in-a-row or more logic

This is a bit more difficult than it seems and the one other post on here isn't sufficient. You have a row of n items, and each item could be any one of 5 colors. You need to find if there are any ...
481 views

### Smart terrain generation to avoid unconnected tiles

To make this clear from the get go; I'm not looking for HOW To randomly generate a terrain (I know I can use Perlins noise for that). I'm looking for an algorithm that can help with the terrain ...
522 views

### NPC AI articles for walking and fighting? [closed]

I'm looking to learn about NPC AI to solve a problem how an NPC should walk e.g. walking straight and then turn at a wall. Perhaps I can program it to walk along a line but then I still would not know ...
2k views

### Is it good to sort objects list before every rendering?

I need to render a "tile" game, which are like these: or or I don't know how to render them in correct order. I intend to perform a sorting operator before every rendering (depending on their ...
123 views

### How do I avoid obstacles on a predefined path?

I want is a character to walk along a path defined as a waypoint sequence. For example, a soldier patrolling around a castle. However, I want the soldier to avoid (dynamic) obstacles, without ...
729 views

### How to generate houses procedurally in a voxel world?

I am developing a mod for the game Minecraft, a block-based voxel game. As part of the mod, I want to create a procedural house generator that will be generated based on specific needs/desires, such ...
353 views

### Level design algorithm/pattern for Linerunner etc

I am wondering: how does someone make levels for a game like Linerunner or any other game that uses similar patterns? About Linerunner (game) You are a stick man running, you have to jump or crawl ...
407 views

### Algorithm to select all cells inside rooms/regions

I have a 2d game map consisting of several 'rooms' For example, here is a 2D map grid: (Brown cells = wall tiles) If I click on a tile (that isn't brown), I would like to obtain an array of all ...
452 views

### Derive a algorithm to match best position

I have pieces in my game which have stats and cost assigned to them and they can only be placed at a certain location. Lets say I have 50 pieces. e.g. Piece1 = 100 stats, 10 cost, Position A. Piece2 ...
10k views

### Procedural… house with rooms generator

I've been looking at some algorithms and articles about procedurally generating a dungeon. The problem is, I'm trying to generate a house with rooms, and they don't seem to fit my requirements. For ...
322 views

### Scaling 3D furniture while keeping the thickness constant

I am creating a program in WindowsForms and Xna that allows users to create a 3D room. By dragging and customizing different .fbx models, they can "build" a room or whatever and then look at it in 3D. ...
168 views

### Using circles to create a sphere

I've been working on creating spheres in a 3D space recently, and have successfully created cylinders. I've just run into a little problem. For some reason, my "Spheres" end up looking like very thick ...
81 views

### Retrieve outer most points on a 2d graph

G'day everyone, I have a 2d graph which has some points plotted on it. What I need to do is get only the outer most points so that I can connect them up (isn't really relevant). What I can't seem ...
532 views

### Tongue pull effect

I've been searching on the net for several days and can not find nothing about this effect. Even a name for this effect. I want to make a character that can use his tongue to pull objects objects it ...
2k views

### Catmull Rom Spline - Constant Speed

Given the equations found in the answer here: Determine arc-length of a Catmull-Rom spline How would one A) Apply this to a 3D Catmull-Rom Spline, and B) write A out programmatically (for the math ...
1k views

### How should I go about randomizing levels in a “runner” game?

I'm working on a runner type of game (basically it's a never ending run through hordes of enemies and platforms and whatnot). 2d platformer view. Should I random a bit of map every now and then? Few ...
3k views

### Elegant autotiling

I'm looking for information about how people implement autotiling in their tile-based games. So far I have always improvised it with a bunch of hardcoded "if ... else ..." statements, and now I ...
270 views

### simple escape algorithm: enemy escapes when hero approches

I need some clues on a "escape" algorithm. My scene a 2D rectangle (0,0,1000,1000) I have enemy sprites on this scene. They are immobile until distance from hero <100. If distance<100, enemy ...
407 views

### Iterating 1D array and getting 2D tile position

I know I'm missing something very obvious here, but I have a 1D array that contains integers.I have a map that is 30 x 30 and the center coordinate is 0,0 (This is actually 3D, but I'm essentially ...
2k views

### Efficient path-finding on 2D tile-based multilevel map

It's a question I've been thinking about for some time... How do you effiently find a path on a 2D tile-based multilevel map? The map I use, for example, is 2048 on 2048 tiles wide. It has 14 levels ...
2k views

### Storing huge 2D tiled map in a txt file

I'm working on a global startegy game that uses a 2D tiled map. The map is to be 8000x8000 tiles large (this size is fixed, the map stays the way it is throughout the game), since I'm covering a large ...
333 views

### How to do score systems, combos, multipliers, chains, etc

I am designing a game, but I am having some trouble implementing a decent score system. Basically I have nodes with two different possible characteristics: color and shape. Since the player click from ...
800 views

### Syncing game states in a multiplayer RTS game

I'm working in a group with 2 friends on our Gr. 12 final project for programming. We're making a multiplayer RTS game. I've been assigned to the networking section of the game, and none of us have ...
1k views

### Ideas for attack damage algorithm (language irrelevant)

I am working on a game and I need ideas for the damage that will be done to the enemy when your player attacks. The total amount of health that the enemy has is called enemyHealth, and has a value of ...
694 views

### 2D/Isometric map algorithm

First of all, I don't have much experience on game development but I do have experience on development. I do know how to make a map, but I don't know if my solution is a normal or a hacky solution. I ...
774 views

### Matchmaking by user-supplied parameters

I'm looking for matchmaking algorithm for a 1 vs 1 online game. Players must not be matched by their skill level, but instead by some specific filters set by the players. Each player sends a request ...
174 views

### Keeping the meshes “thickness” the same when scaling an object

I've been bashing my head for the past couple of weeks trying to find a way to help me accomplish, on first look very easy task. So, I got this one object currently made out of 5 cuboids (2 sides, 1 ...
4k views

### Reversi/Othello early-game evaluation function

I've written my own Reversi player, based on the MiniMax algorithm, with Alpha-Beta pruning, but in the first 10 moves my evaluation function is too slow. I need a good early-game evaluation function. ...
103 views

### Performance issues with visibility detection and object transparency

I'm working on a 3d game that has a view similar to classic isometric games (diablo, etc.). One of the things I'm trying to implement is the effect of turning walls transparent when the player walks ...
860 views

### Showing range on hexagonal grid

Here is the situation. I have hexagonal board,and a unit on it,with speed or move value 4.Diffrent terrain has a diffrent cost.When i click on the unit,game should show me a move range. My solution ...