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

learn more… | top users | synonyms

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?
37
votes
3answers
12k views

How to generate random level from a seed? [closed]

How would I go about using a random seed to generate a game level? The same seed should always generate the exact same level. For this example it would be a Worms style level. So each level would ...
34
votes
6answers
2k views

Why use random numbers when it comes to rewards and stats?

Many games use random numbers for things like attack damage, gold loot, or monster type being spawned. It is obvious that random numbers allow you to generate content to make games more re-playable, ...
25
votes
6answers
1k views

Have any video game designs used non-uniform random numbers in interesting ways?

A variety of video games use uniformly distributed numbers to decide the outcome of an event, such as a "50% chance to hit" almost always means to check if a random floating point number from 0-1 is ...
23
votes
3answers
3k views

Random seed function for map generation?

I am looking for a function to generate a random tile-based map as the visual boundaries of the map change (by going through the map). I want the map to be infinitely large, and have maze-like ...
22
votes
4answers
1k views

Randomly generated story

I'm developing a game at the moment and I had an idea where the game's story line would randomly generate as the player progressed and their actions would affect the story. Would this be a bad idea ...
22
votes
2answers
1k 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 ...
21
votes
5answers
1k views

How do I avoid “too” lucky / unlucky streaks in random number generation?

I'm currently dealing with a multiplayer combat system where the damage dealt by the players is always multiplied by a random factor between 0.8 and 1.2. In theory, a truly random RNG may eventually ...
16
votes
3answers
2k views

How can I generate floating land masses for a Minecraft-like engine?

I am creating a Minecraft-like engine in XNA. What I want to do is create floating islands similar to the one shown in this video: http://www.youtube.com/watch?v=gqHVOEPQK5g&feature=related ...
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 ...
12
votes
6answers
1k views

Weighted Random Distribution

I am currently contributing to a particle system for our game and developing some emitter shapes. My uniform random distribution along a line or along a rectangular area works fine - no problem. But ...
12
votes
2answers
2k views

Random numbers on C++

Recently I got used to modern languages which include a stock good random generator, which usually is the Mersenne Twister; now that I got back to C++ I have to decide what to use. I searched for ...
12
votes
3answers
840 views

Biased, conservative random walk

I have a sprite which has Velocity and Position, either stored as Vector2. At each Update cycle, velocity is added to the position. I would like to give the sprite a third vector, Target. New targets ...
11
votes
4answers
1k views

Generating tile map

I am programming a tile based game and I have some basic tiles (grass, dirt, etc..), but I can't figure out how to make good random map generation, because when I do some really random selection, if ...
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 ...
11
votes
3answers
278 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 ...
10
votes
8answers
1k views

Best solution for “level string”?

I have a game that generates a random level map at the start of the level. I want to implement some way to save and load the level. I was thinking maybe XML would be a good option for saving all the ...
10
votes
3answers
2k views

Algorithm for determining random events

I'm struggling with coming up with an elegant solution to generating random events in the game that I'm working on. Say there are 4 classes of events that can happen, with varying events in those ...
10
votes
3answers
762 views

Random map generation - strategies for scattering/clustering random nodes

I am doing a simple 4X strategy game in space where each node is a point-of-interest (a planet, an asteroid and etc.). To randomly generate a map, I would follow the steps below Decide how many ...
10
votes
4answers
806 views

How do I make NPC pathfinding look believable?

Is there an "academic" way to have NPC walking randomly on a map, but having a believable comportment ? The obvious scenario is a armed guard who is walking around a basement to secure it. It's quite ...
10
votes
4answers
2k views

Procedural terrains in 3D: what has been done ? Are there common algo and/or theories about it? [closed]

Besides programming, modeling an environment takes a great deal of time. I don't know about the work time involved, for example, in a WoW dungeon level, or other beautiful city-like, future ...
9
votes
2answers
881 views

What is a good method to randomly generate edges between graph nodes?

I am doing a random map generator for a 4X space game. Each node in the game is place at a random (x,y) coordinate on a 2d grid. A node can have one or more bi-directional edges to another node ...
9
votes
2answers
4k 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 ...
9
votes
3answers
976 views

Reduce the number of edges of a graph, keeping it connected

I'm designing a game with random generated dungeons. I'd like to view this as a connected, undirected graph in which nodes are rooms and edges are doors or corridors. Then I choose a "side" node as ...
9
votes
6answers
422 views

Is there a (family of) monotonically non-decreasing noise function(s)?

I'd like a function to animate an object moving from point A to point B over time, such that it reaches B at some fixed time, but its position at any time is randomly perturbed in a continuous ...
8
votes
7answers
380 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 ...
8
votes
4answers
383 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 ...
8
votes
2answers
707 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 ...
7
votes
7answers
578 views

Random looking item placement that's deterministic?

I'm working on a sidescrolling game and I want to generate a forest for the background. I want the background to be the same for every one to make sure the quality is the same. I don't have access ...
7
votes
3answers
3k views

Random enemy placement on a 2d grid

I want to place my items and enemies randomly (or as randomly as possible). At the moment I use XNA's Random class to generate a number between 800 for X and 600 for Y. It feels like enemies spawn ...
7
votes
4answers
240 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. ...
7
votes
3answers
1k views

Pathfinding with multiple random paths in a Tower Defense game

I thought about random pathfinding for my Tower Defense game. A* would not work for my puposes, because I specifically need random pathfinding. Imagine a map with routes, a starting point and a ...
7
votes
2answers
279 views

Can adversarial agents flip coins?

I was thinking about peer-to-peer games by considering a simple coin tossing game. You open up your version of P2PCoinFlipping Beta 2.3 and it displays a list of player name servers. After ...
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?
6
votes
2answers
2k views

Random World Generation [duplicate]

Possible Duplicate: How are voxel terrain engines made? I'm making a game like minecraft (although a different idea) but I need a random world generator for a 1024 block wide and 256 block ...
6
votes
3answers
481 views

Algorithm for Randomized Weather

I'm having a hard time modeling weather. Modeling a single aspect is trivial - some sinusoidal pattern + random noise. However more than 1 is blowing my mind. I cannot have wind, falling leaves, ...
6
votes
3answers
348 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 ...
6
votes
3answers
409 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 ...
5
votes
6answers
412 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 ...
5
votes
3answers
342 views

Generating random values, keep trying till value within bounds are generated

Sorry for the strange topic name, couldn´t think of a good way to describe it. I´m basically trying to achieve the following: I'm placing items randomly on the screen, but these items shouldn't be ...
5
votes
1answer
659 views

How do I generate a smooth random horizontal 2D tunnel? [duplicate]

I'd like to create a smoother version of the navigable and quite natural-looking random tunnel found in this classic helicopter game. It should ideally be... infinite, so more can be generated as ...
5
votes
2answers
184 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 ...
5
votes
1answer
2k views

Should I use procedural animation? [closed]

I have started to make a fantasy 3d fps swordplay game and I want to add animations. I don't want to animate everything by hand because it would take a lot of time, so I decided to use procedural ...
5
votes
3answers
470 views

Is Unity's Random seeded automatically?

I seem to recall Unity's Random is automatically seeded; checking the documentation it doesn't say it outright, but a certain interpretation of their words might seem to imply it. The seed is ...
5
votes
2answers
351 views

How to generate random points on the surface of a quadrilateral

Alright, I'm sure there has to be a simple way to do this but it eludes me at the moment. I want to be able to generate random points on the surface of a quadrilateral in 3D space. (Defined simply as ...
5
votes
3answers
535 views

Random monsters move in-sync instead of individually

I am making a game in which monsters spawn randomly and begin to move around randomly. I am fairly new at programming but not at game development. Through using a few tutorials I was able to make 1 ...
5
votes
2answers
1k 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.
5
votes
1answer
834 views

Random generation of interesting puzzle levels?

I'm making a Sokoban-like game i.e. there's a grid that has some crates on it you can push and you have to get the crates on crosses to win the level (although I'm going to add some extra elements to ...
5
votes
3answers
145 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 ...
5
votes
2answers
248 views

Randomly generated track

I would like to create randomly generated track from one point to another with specified length of that track (it can be 2 more or less as a result of that function) in matrix. I have function called ...