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

learn more… | top users | synonyms

2
votes
1answer
641 views

Can I randomly generate an endless road?

So suppose we stand on a position(x0, y0) of a map. We can only move on the horizontal plane(no jump and stuff) but we can move forward, left, or right (in a discrete math way, i.e. integer movement). ...
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 ...
0
votes
1answer
167 views

Creating a newspaper that effects the game's economy?

I am writing a game in Objective C/cocos2d where a newspaper is a central part of what controls or rather effects the game's world economy as well as what a city might do (such as increase X, reduce ...
0
votes
2answers
520 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 ...
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 ...
2
votes
2answers
2k views

How do I randomly generate a top-down 2D level with separate sections and is infinite?

I've read many other questions/answers about random level generation but most of them deal with either randomly/proceduraly generating 2D levels viewed from the side or 3D levels. What I'm trying to ...
1
vote
3answers
652 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: ` ...
4
votes
2answers
543 views

Basic procedural generated content works, but how could I do the same in reverse?

My 2D world is made up of blocks. At the moment, I create a block and assign it a number between 1 and 4. The number assigned to the nth block is always the same (i.e if the player walks backwards or ...
-1
votes
3answers
2k views

Trying to generate some unique numbers [closed]

I find impossible to get this code to work! I want to generate 10 numbers that are unique, but despite all I change, I get duplictates of numbers in the array! Would really preciate some help to solve ...
2
votes
2answers
421 views

Simulating probability

Stupid stupid question but here we are.. so, I want to generate some random events for an iPhone game but I guess this could be applied to any game written with a framework that suppports calls to ...
3
votes
3answers
413 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 ...
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 ...
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 ...
2
votes
2answers
518 views

How to create reproducible probability in map generation?

So for my game, I'm using perlin noise to generate regions of my map (water/land, forest/grass) but I'd also like to create some probability based generation too. For instance: if(nextInt(10) > 2 ...
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 ...
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 ...
1
vote
2answers
404 views

How to randomly create stars in the background?

My player flies around the screen in any direction he wants, and the camera follows him. There are stars in the background. I can't figure out how to randomly generate the stars. I made a star ...
3
votes
2answers
173 views

Camera placement sphere for an always fully visible object

Given an object: With the bounds [x, y, z, width, height, depth] And an orthographic projection [left, right, bottom, top, near, far] I want to determine the radius of a sphere which allows me to ...
1
vote
1answer
959 views

Having troubles with LibNoise.XNA and generating tileable maps

Following up on my previous post, I found a wonderful port of LibNoise for XNA. I've been working with it for about 8 hours straight and I'm tearing my hair out - I just can not get maps to tile, I ...
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 ...
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 ...
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?
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 ...
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 ...
0
votes
2answers
2k views

As3 Random movieclips from an array to the stage

For a game with orders and clients I was trying to create the following situation: Every half minute, a client should appear at the counter. In this case I have an array with 4 movieclips (4 ...
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
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.
12
votes
3answers
841 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 ...
0
votes
1answer
827 views

Large Blob of landmass in Minecraft Terrain Engine in XNA

I am creating a Minecraft Terrain engine in XNA, and want to create a large blob/cluster of blocks, in a random sort of blob thing, shaped somewhat like the stuff under the Volume Rendering heading on ...
3
votes
3answers
1k views

Concerning The Minecraft Skybox

I was wondering how does the stars in night time in minecraft work, are they point sprites? And are they placed on a texture or just randomly placed on some far away location. EDIT 1: OK, well, with ...
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, ...
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 ...
3
votes
2answers
358 views

How to place objects/entities randomly in JS?

I'm making a game and I have a script (running it with Node) on the server that currently just randomly places things on the map... I'd like to change that. I saw something about Perlin noise but I'm ...
4
votes
5answers
709 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 ...
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, ...
3
votes
1answer
680 views

Simplest way to generate a random path

What's the simplest way to generate a random "path" for a level in a game? I don't know what search terms I should use to read more. I've looked into maze generation but thats not quite right. The ...
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 ...
7
votes
7answers
580 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 ...
3
votes
3answers
243 views

Generate a range of number with X being returned most of the time

I am attempting to write a RNG which returns a normal-like curve. For example, say I define X to be 4, I would like to generate a range of numbers from 1 to 8, but with 4 being returned most of the ...
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 ...
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 ...
2
votes
6answers
947 views

Random Position between ranges

Does anyone have a good algorithm for generating a random y position for spawning a block, which takes into account a minimum and maximum height, allowing player to to jump on the block. Blocks will ...
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 ...
3
votes
3answers
364 views

How do I get the seed of a randomly generated level?

I intend to use the Mersenne twister to generate a level using a seed , but I also want to make fixed levels, so for now I'm using XML to store data of the level (~40 numbers). However, it would be ...
3
votes
2answers
365 views

Question about Monster Rancher/My Brute generators

I want to build a system based on the idea of Monster Rancher's monster generation system. First, is it legal per se? Obviously, I don't know how they built theirs and I will be generating my own ...
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 ...
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 ...
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 ...
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 ...
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 ...