Algorithms or methods to produce events or behavior that is random in nature.

learn more… | top users | synonyms

0
votes
2answers
186 views

How do I randomly spawn objects in 2D game?

How do I randomly spawn few different sprites on screen so they're not overlapping or half visible on render. The sprites should immediately start shrinking until they disappear. I've tried to ...
1
vote
2answers
84 views

Client-side dice rolls in turn-based game

I'd like to create a turn-based multiplayer game on Android. I'm thinking of using Google Play Game Services and get rid of any other webservice to create and host games. The problem is the game ...
8
votes
4answers
354 views

Modify random distribution functions :: Make it less likely to get multiple similar values in a sequence

I want to generate a sequence of numbers for procedurally generating planets in a galaxy sector. Each planet should be placed randomly, however it should be very unlikely that two planets are directly ...
0
votes
1answer
33 views

Android Jump&Run - Random map generation [closed]

I'm pretty new to game development but I work on an android app. It's a 2D Jump and Run game. I do it in Eclipse and the map is readed out of a txt file right now. But I want to do a Jump and run ...
2
votes
0answers
65 views

Why do unidentified items seem to solely exist in roguelikes? [closed]

Playing a variety of games I noticed that some concepts are "trapped" in the realm of roguelikes. One of the most intriguing game-play elements in roguelikes is the unidentified item. The unidentified ...
3
votes
1answer
127 views

How to create a grid based on random shapes?

How to create a "grid" using actionscript like the image below? Basically you have an area of 1100x615 which should be filled with shapes that could be rotated and scaled... Collision detection ...
9
votes
2answers
3k views

Random number hlsl

How do you generate a random number in HLSL? I'm asking because I want to try gpu ray tracing. You need to generate random directions in a pixel shader. So I want randFloat(), where the result is a ...
1
vote
1answer
105 views

Unity seperation of prefabs with two dimensional terrain generation

I have the following function: public void Spawn () { GameObject g = ((GameObject)Instantiate (hills [Random.Range (0, hills.Length)], new Vector3 (0.0f, ...
6
votes
3answers
312 views

How can I distribute powerups “fairly”? [closed]

I'm implementing a Bomberman-esque game in which players try to eliminate each other on a square tile-based arena. I'm currently implementing powerups that give the player who collected them a bonus ...
2
votes
1answer
55 views

Get a random vector

I'm trying to make a small pariticle-like simulation, and I'm trying to make each parrticle go a random direction from one point (mouse pos). The problem is I don't know how to get the random vector ...
2
votes
3answers
129 views

How control probability of win-lose in tile-matching games?

In a random puzzle game, such as a match-three game, how can you control the probability of a winnable starting condition?
5
votes
3answers
123 views

Pathfinding Search for Path of Specific Length

I am creating a roguelike. This question applies to random map generation. First, I generate areas using a BSP algorithm, where I randomly divide the map into areas. Then, I generate a graph of the ...
6
votes
3answers
2k views

How do I shuffle cards for a card game?

I am trying to develop an card game for Android Can anyone suggest me how to write code for effectively shuffling the playing cards?
0
votes
2answers
70 views

How can i Randomize Unique Numbers in Java [duplicate]

So i'm making a game where i have to randomize 52 numbers from 1 to 52 so the order has to change i use this class Deck { Random r = new Random(); int[] Card = new int[52]; }
0
votes
1answer
67 views

Implementing a Random Picker by Supplying an Outcome Table (Similar to a Drop Table)

Whilst trying to vary the draw color of some randomly positioned sprites, I really wanted to be able to just supple a table with 2 columns (colour and chance of picking) to some helper function that ...
-1
votes
1answer
34 views

Movieclip to spawn in in a set perimeter

I like to make a movieclip randomly spawn in a set area. But theres a little more to it, usually you'd have something like the X pos set to something like 250 (say the centre) and the Y pos set to be ...
0
votes
1answer
50 views

Whac-A-Mole like

am trying to make a game that have a "whac-A-Mole" game principle The problem that am facing is that i don't want the "enemies" to get out from holes at the same time, not even in a different close ...
0
votes
1answer
84 views

Using a permutation table for simplex noise without storing it

Generating Simplex noise requires a permutation table for randomisation (e.g. see this question or this example). In some applications, we need to persist the state of the permutation table. This can ...
3
votes
2answers
330 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 ...
0
votes
1answer
81 views

How can I ensure reasonably spaced out enemies

I have a simple javascript game and I'm initializing their positions on the y axis using random numbers. How can I ensure that they are reasonably spaced apart? My simple algorithm is: y = ...
7
votes
4answers
213 views

Fair dice over network w/o trusted 3rd party

Though it should be a pretty basic problem, I did not find a solution for it: How to play dice over a network without a trusted third party? The M players shall roll N dice, one player after another. ...
6
votes
3answers
333 views

Need ideas for an algorithm to draw irregular blotchy shapes

I'm looking to draw irregular shapes on an x,y grid, and I'd like to come up with a simple, fast method if possible. My only idea so far is to draw a bunch of circles of random sizes very near each ...
22
votes
2answers
987 views

How do I produce “enjoyably” random, as opposed to pseudo-random?

I'm making a game which presents a number of different kinds of puzzles in sequence. I choose each puzzle with a pseudorandom number. For each puzzle, there are a number of variations. I choose the ...
11
votes
3answers
256 views

How to divide hex grid evenly among n players?

I'm making a simple hex-based game, and I want the map to be divided evenly among the players. The map is created randomly, and I want the players to have about equal amount of cells, with relatively ...
0
votes
2answers
112 views

Is my calculation of chances correct for my AI?

I'm working on a turn based game where one part is pretty much like playing "Memory": remember where a specific card is located in a grid. My AI works like this: If a card is peeked (turned around ...
-3
votes
1answer
132 views

Is there a proper way to come up with random numbers?

In my game I have some powerUps which are gain when enemy is killed. Is there a proper way to come up with random numbers? here is what i am thinking: double rand = Math.random(); if(if (rand < ...
2
votes
3answers
164 views

How should I distribute the values of equipment stats when I know the average value?

I am making a Diablo-like game and I want to randomly generate the stats of the loot that gets dropped. I'll use "damage per second" as an example. I've filled a spreadsheet with two columns of ...
8
votes
7answers
372 views

Make a fake random distribution?

Sometimes a "real" random event seems unfair and makes players frustrated. For instance a enemy has probability of 20% to cause double damage("critical hit"). Thus he could make 4 critical hits in a ...
1
vote
2answers
150 views

Monster attack is not randomising right [closed]

I have a code that I've been messing around with and the monster attack (monster.ma) isn't randomising after the first time it's called upon (elif statement). I've tried to make it a tuple since they ...
-1
votes
1answer
92 views

Advice on developing a random event engine [closed]

I am looking into creating a random event engine like the one found in the Paradox Interactive’s Europa Universalis franchise. They use a ‘mean time to happen’ mechanic that applies various ...
4
votes
6answers
367 views

Data structure for random outcome from a hit probability table

The basic idea of a hit-table is carried over from pen & paper role playing games. You roll a die or a number of dice representing your ability to attack an opponent. Your opponents defense is ...
-1
votes
3answers
1k views

Random Between: using random with the instance_create function in GML

Hopefully this should be a simple one; I want to restrict the points that instances enter the screen from so they don't come in at the edges. In Game Maker I'm using the following code ...
1
vote
0answers
27 views

XNA - Wrap heightmap around sphere [duplicate]

I have an idea for a small game which would generate random 3D planets. I already have found a way to create a random heightmap in XNA ...
5
votes
2answers
164 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 ...
0
votes
1answer
112 views

Problems when randomizing x and y position of a picturebox [closed]

So, I'm making a simple game. It's like snake but the picturebox doesn't grow. In the game, you have to get fruits and other objects. Look at berry's code: public class Berry : PictureBox { ...
3
votes
2answers
339 views

How to zoom randomly generated maps?

I made a Java program which generates a random map based on Perlin Noise + Poisson Algorithm + Voronoi Diagram. Here you can see a generated map. White are caves, black is empty. The problem is ...
1
vote
2answers
74 views

Handling Block Collisions

The title isn't great, but let me try and explain my problem. I'm working on a little game at the moment the gist of which is that you're an entity in this 2-D world and you have to dodge obstacles. ...
3
votes
3answers
388 views

How can multiple clients be out of sync if they use the same RNG seed?

I have been working on a client-server architecture to enable LAN play for my open source game, Aigilas. In its current state, players stay synced in all running instances of the game but enemies and ...
1
vote
3answers
607 views

Randomly placing items script not working - sometimes items spawn in walls, sometimes items spawn in weird locations

EDIT: I changed some code after getting advice from colleagues. However it still has problems occasionally, though the problems aren't as bad or frequent. Here's the new code I'm actually using: ` ...
2
votes
3answers
430 views

Using random numbers with a bias

I appear to be awful at describing the question so I'll try and describe the problem. I want to add a random amount of heads to my creatures but I want to be able to determine several things. a) The ...
15
votes
3answers
1k views

How do history generation algorithms work?

I heard of the game Dwarf Fortress, but only now one of the people I follow on Youtube made a commentary on it... I was more than surprised when I noticed how Dwarf Fortress actually generates a ...
0
votes
2answers
235 views

Generate different types of enemies with different randomness

What I want - I want to have some magic function getEnemyType(currentLevel), which will return, for example, a number. Number is enemy type, let's say, there are ten (10) types. 1 - the easiest, 10 - ...
4
votes
5answers
663 views

Handling random with unique chance in Python

Okay, let's say you have a handful of enemies, each with their own 'rarity' to spawn. For example: monsterlist = [] snake = 'snake', 60 wolf = 'wolf', 80 antlion = 'antlion', 30 ...
8
votes
2answers
651 views

Random Zelda-style map generation

Im trying to randomly generate a map of rooms connected by doors, and I've succeeded in generating one using this code: public void generate(GameContainer gc) { rooms = new ...
5
votes
2answers
968 views

Algorithm for random flight of a fly

I'm new to game development. What is a good algorithm to model the random flight of a fly? I've been looking at path-finding algorithms, but they don't give any interesting random behaviour.
2
votes
2answers
223 views

Looking for an elegant way to represent fixed parts of a randomly generated level map

I'm coding from scratch a small experimental game on a medium-sized random rectangular square tile map. (Say, a map of a dungeon.) There are several types of tiles (for example: floor, wall, monster, ...
-4
votes
4answers
116 views

How to select a random node [closed]

I need to know if it is possible to select a random node or select a node itself because I'm doing a zombie AI and I need him to randomly move, and I wanted to know if it's possible to do it and how.
42
votes
14answers
2k views

How to generate a universe? [closed]

If I wanted to generate a universe/galaxy like that of Elite or Spore, what would be some good programming reference materials and algorithms to take into account?
0
votes
2answers
463 views

Shuffle tiles position in the beginning of the game XNA Csharp

I'm trying to create a puzzle game where you move tiles to certain positions to make a whole image. I need help with randomizing the tiles start position so that they don't create the whole image at ...
1
vote
1answer
438 views

Random Movement for multiple entities

I have this code for a arraylist of entities. All the entities use the same random and so all of them move in the same direction. How can I change it so it generates a new random number for each ...