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.

learn more… | top users | synonyms

2
votes
1answer
238 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 ...
0
votes
1answer
233 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" ...
1
vote
1answer
67 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 ...
1
vote
2answers
314 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 ...
5
votes
3answers
777 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 ...
8
votes
7answers
2k 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 // ...
5
votes
1answer
1k 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 ...
2
votes
2answers
495 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 ...
3
votes
4answers
2k 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 ...
1
vote
3answers
457 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 ...
-1
votes
2answers
383 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 ...
2
votes
6answers
766 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 ...
1
vote
1answer
116 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 ...
2
votes
2answers
577 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 ...
2
votes
1answer
258 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 ...
7
votes
2answers
337 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 ...
3
votes
2answers
442 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 ...
58
votes
4answers
4k 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 ...
2
votes
3answers
273 views

Complex Scaling

I've been trying to figure this thing out for weeks now, but with no luck.So, I am creating this program in WindowsForms and Xna, that allows users to create a 3D room. By draging and customizing ...
1
vote
1answer
155 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 ...
3
votes
1answer
71 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 ...
1
vote
1answer
500 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 ...
4
votes
1answer
667 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 ...
2
votes
1answer
683 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 ...
6
votes
1answer
1k 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 ...
-1
votes
1answer
198 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 ...
0
votes
1answer
277 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 ...
3
votes
4answers
1k 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 ...
0
votes
4answers
961 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 ...
6
votes
1answer
238 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 ...
3
votes
2answers
445 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 ...
6
votes
4answers
925 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 ...
2
votes
1answer
547 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 ...
5
votes
2answers
419 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 ...
1
vote
1answer
164 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 ...
1
vote
2answers
1k 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. ...
1
vote
0answers
85 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 ...
10
votes
2answers
446 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 ...
7
votes
3answers
3k views

isometric drawing order with larger than single tile images - drawing order algorithm?

I have an isometric map over which I place various images. Most images will fit over a single tile, but some images are slightly larger. For example, I have a bed of size 2x3 tiles. This creates a ...
3
votes
2answers
283 views

Basic modelling of radar

I'm currently researching how to model/simulate radar for my naval simulation. Since the emphasis is on modelling ASW or submarines in general, I need only a basic radar model - at least for the ...
0
votes
1answer
210 views

Build a view frustum from angles

I have 4 angles, left, right, top & bottom. These angles are in degrees. They define the angle between the forward vector and the corresponding side. I am trying to use these to calculate the ...
2
votes
2answers
234 views

Prevent collisions between mobs/npcs/units piloted by computer AI : How to avoid mobile obstacles?

Lets says we have character a starting at point A and character b starting at point B. character a is headed to point B and character b is headed to point A. There are several simple ways to find the ...
8
votes
2answers
476 views

How do display a “mucus spreading” effect in a 2D environment?

Here is an example of such a mucus spreading. The substance is spread around the source (in this example, the source would be the main alien building). The game is starcraft, the purple substance ...
5
votes
1answer
136 views

trapped inside a Graph : Find paths along edges that do not cross any edges

This is a graph based platformer level and the round shapes are creatures. I am looking for a path traveling along edges that does not cross other edges(To simulate the creature crawling on the ...
1
vote
1answer
130 views

Help with Collision Resolution?

I'm trying to learn about physics by trying to make a simplified GTA 2 clone. My only problem is collision resolution. Everything else works great. I have a rigid body class and from there cars and ...
0
votes
0answers
555 views

What is the best way to implement collision detection using Bullet physics engine and a track generated from a curve?

I am developing a small racing gam, the track is generated from a curve. As said above, the track is generated, but not infinite. The track of one level could fit with no problem in memory and will ...
1
vote
2answers
404 views

What's wrong with this turn to face algorithm?

I implement a torpedo object that chases a rotating planet. Specifically, it will turn toward the planet each update. Initially my implement was: void move() { vector3<float> to_target ...
1
vote
1answer
364 views

How to correct shooting in touch-screen shooting games?

Assume a shooting game for iPhone that the character shoot toward where player has touched. But as we know, There may be fault in touching screen by player and it conclude to bad game play and low ...
2
votes
4answers
908 views

Detecting long held keys on keyboard

I just want to ask if can I check for "KEY"(keyboard) that is HOLD/PRESSED for a long time, because I am to create a clone of breakout with air hockey for 2 different human players. Here's the ...
1
vote
2answers
562 views

Rotating multiple points at once in 2D

I currently have an editor that creates shapes out of (X, Y) coordinates and then triangulate that to make up a shape of those points. What will I have to do to rotate all of those points ...