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

learn more… | top users | synonyms

0
votes
1answer
32 views

Random equidistant points like a tree branch (JS)

I'm working on an algorithm to generate a "graph" like array of points in my game world. See Image Below: Here is what i'm working on so far, which will generate the black line.. but this may not ...
0
votes
1answer
30 views

Using timestamp as a random seed returns identical results

And here is the random number generator again. I work on a game, where a user can create and schedule some levels to player later. For simplicity, let's say I play chess. I create a new game with ...
13
votes
3answers
2k views

What's the difference between UnityEngine.Random and System.Random?

What is the different between this int randomNumber = UnityEngine.Random.Range(0, 10); and this private System.Random _rnd = new System.Random(); // other code int randomNumber = _rnd.Next(0, ...
3
votes
3answers
87 views

Random numbers with a left or right biased skew

Within Java I have a table of objects ranging from horrible (1%) to wonderful (100%) from which one is randomly selected. This is simple enough and appears on a bell curve with a normal distribution ...
0
votes
1answer
26 views

Generate objects on playground on random location

How can I generate an object on my play ground? Note that there are some locations where the new generated item can't be placed. (Click on image to see the real size) I was following a tutorial on ...
-2
votes
2answers
50 views

Randomly changing game scenes in unity c# [closed]

Is there any way that I can randomly change scenes in Unity C# using arrays?
-3
votes
2answers
151 views

Random AI Movement

So I'm creating a zombie game where the zombies are passive and just walk randomly all over the area when player is not near. My question is: how would I make zombies move randomly? I code in C#. ...
2
votes
0answers
91 views

Formula to generate random enemies

In my endless game i need to generate random enemies for each "level". For each level i need to generate the total number of enemies that have to be spawn, and spawn them a few at a time. When they ...
0
votes
1answer
60 views

Choosing random array indexes in Unity C# [closed]

I want to change a string by randomly choosing an index in an array, using the random.range command in unity. Bare in mind that I'm using strings here, not floats or integers. Here is a code ...
1
vote
2answers
165 views

Is there a random command for Boolean variables in Unity C# [closed]

Can you randomly choose a Boolean's value in Unity C#. I tried random.range, but it only works with floats. Here is an example of what I'm trying to do: Boolean = (random boolean value ...
1
vote
1answer
75 views

My attempt at a drunkard walk algorithm seems to generate large groups instead of more linear paths

...and I'm not sure if that's normal due to the random nature of the algorithm or am I doing something wrong. What I'm doing is: Set a random point within map boundaries (which I called a sandbox). ...
0
votes
1answer
144 views

Generating objects randomly from prefabs in Unity2D

I am developing an infinite runner using Unity. I have already figured out how to loop a set of backgrounds randomly but I am having problems doing the same for the objects. So, I have a few objects ...
6
votes
3answers
112 views

How do I make hit damage a Gaussian distribution centered around a value?

I'd like my character's attacks to on average 10 damage, but to vary anywhere from 0 to 20. Instead of a linear spread, I would like a normal distribution, so most of their hits are between 10-15, ...
1
vote
3answers
243 views

AI Random Path Genenrating

I would like to make an enemy walk randomly around a map I have made and if the player is in his zone of sight the enemy to change state to attacking/following. So how would I accomplish something ...
0
votes
3answers
145 views

Löve2D: Making a random map/city generator [closed]

So I'm making a game using love2d where the player will find himself in an zombie infested city but I don't want the city/map to be just the same all the time, so I want to create a random map/city ...
14
votes
3answers
980 views

What is the difference between “dynamic generation” and “procedural generation”?

When I think of a dynamically generated game, I think of things like Diablo with randomly generated levels. When I think of a procedurally generated game, I think of things like Flappy Bird and other ...
0
votes
0answers
92 views

How do I create tile based world generation

I was planning on making a tile based 2D game that has a random world generation. The game world itself is made out of several floating islands and the later half of the game world is generated as a ...
1
vote
4answers
111 views

How to load and unload objects at a certain radius from the player?

I am making a procedurally generated space exploration game in unity. I'm currently generating 5000 stars in a cube of a fixed size. Each star just gets a random 3d coordinate. What I would like to do ...
2
votes
2answers
226 views

Manually creating cycles in planar, procedural trees?

I am creating a procedural map using delaunay triangulation and an MST. I'd like to have a bit more control over my final graph. Like when i was looking looking at the MST I wondered how I can connect ...
2
votes
2answers
390 views

How to randomly spawn obstacles for infinite runner?

I am trying to create randomly generated path properly? Think of flappy bird (its not really) but my code/algorithm is all wrong. If I make BarMax, BarMin too large, then player can cheat cos in ...
0
votes
1answer
116 views

Random Y Axis Movement Within Set Limits (C#)

I've searched everywhere for this answer but everything I find is in Javascript and a lot of it doesn't help/work in my situation since most of it is Vector3's and using each axis, and my game is 2D. ...
1
vote
2answers
173 views

How to get this type of movement in LibGDX?

I want objects in my game to move randomly but always from right side of the screen to the left side. The movement must be as smooth and natural as possible, like they are following a path. Can i ...
3
votes
3answers
447 views

Algorithm for dividing a 2D grid into organic looking plates

the title pretty much says it all: How could one go about segmenting a 2D grid into smaller parts? My goal here is to create tectonic plates for further procedural world generation Details to ...
3
votes
1answer
261 views

Filling a room with random furniture

This is a rather complex question and I'm more hoping for general algorithms anyone might have heard of. I wish to generate randomly sized rooms. Each of these rooms has a type and a corresponding ...
0
votes
1answer
61 views

Randomised Path from A to B for cursor movement simulation

I'm trying to simulate the movement of the mousecursor, by creating a path from point A to B that has random variation. The algorithm I'm using at the moment is very basic, and is limited in that ...
0
votes
1answer
160 views

AS3 random events using a timer

I'm making a game for an assignment at university. The game I am making requires random household appliances around a house to "turn on" at random times. The player must run around the house turning ...
0
votes
2answers
167 views

(Efficiently) Generate Unique Random Numbers [duplicate]

Sorry my terminology is somewhat limited so I'll have to use more words to explain what I mean. In games that require critical hits, I've heard it's not good to generate a random number but instead ...
2
votes
2answers
199 views

Algorithm that always returns the same pseudorandom output if given the same input of seed, x and y?

I've been trying to find an algorithm that will take in an x value, a y value, and a seed value and then spit out a number between 0 and 255 (or an int that I can cut up into bytes). I want to be able ...
1
vote
1answer
80 views

How to change chance of spawn based on distance?

I am trying to make a cellular automate cave but want to keep the middle empty. How should I change the chance based on the distance from the middle? I don't want to completely deny it just want a ...
34
votes
9answers
6k views

How can I make a “random” generator that is biased by prior events?

I am looking to implement a chance based system which is biased by prior event. Background: Some years back, I remember an update for World of Warcraft announcing that they implemented a new chance ...
1
vote
2answers
97 views

Non deterministic dice rolls [closed]

Are there any algorithms out there for non deterministic dice rolls? For example, I'd like to make a small mini-game: Liars dice. But the biggest issue here is dice rolling. When the cups are turned ...
3
votes
1answer
467 views

How do “procedural” and “random” generation differ?

To my understanding, everything that isn't directly created by a human is called "procedural". Procedural generation systems have different complexities and may consist of various algorithmic ...
1
vote
1answer
123 views

change the position of f3d objects randomly in action script

I have a f3d object and have different boxes to place the parts of the f3d objects.When i click on the button change the position of the boxes randomly. How it possible?This is the code for random ...
1
vote
1answer
439 views

Random Placement of Objects on a Tilemap

I have read many topics on random world generation on this site and others, and I roughly understand most of it. What I can't see is how to randomly place objects on the generated tile map I get. Say ...
0
votes
1answer
194 views

Tiling 2D textures in random order

I am wondering what the best way to make a random set of 2D textures. Currently I have tried the follow code but I am aware that when this comes to collisions that would be an issue. Therefore I would ...
-1
votes
1answer
136 views

Are random generated mazes a nuisance? [closed]

To me, random generated maps such as in Diablo2 were often a nuisance. Many times, you find yourself in a dead end and have to find another way. However, Diablo2 became a very popular and addictive ...
2
votes
3answers
273 views

Persistence of Random

Sorry if this is such a simple thing, but for some reason I can't get my head around it. Imagine you have a world, that you have "seeded" with a value. You base all your randomisations off this ...
1
vote
1answer
81 views

What does the “random element” do in Cellular Automata

I'm reading this post on TutsPlus regarding procedural level generation using cellular automata. My question arises in this code snippet: float chanceToStartAlive = 0.45f; public boolean[][] ...
20
votes
2answers
3k views

Algorithm for procedureral 2D map with connected paths

Problem to solve: Generate a random 2D dungeon map for a tile-based game where all rooms are connected. I am looking for better solutions than what I currently have. My current solution is that I ...
0
votes
1answer
254 views

Enabling Unity GUI drawtexture permanently?

I'm trying to get an image to show in Unity based on a certain criteria. I would like the position of the image to be randomized every time on play. However since GUI.DrawTexture shows the image for ...
0
votes
1answer
84 views

How to simulate random scope movement?

I want to simulate that random and soft movement that lot of games got (like BF3) when you use the scope of a sniper gun, so the question is how to achieve that.
0
votes
3answers
529 views

Ensuring that a randomly generated galaxy wont place stars inside one another?

I'm attempting to build a game with a spiral galaxy design. In doing so I followed a short guide on making the rough layout of the galaxy. My code works, but the "stars" (I'm bad with variable names, ...
1
vote
2answers
180 views

How do I make a daily challenge on a game with randomly generated levels?

I am currently making a game with randomly made levels, but I have an interest in making everyone play the same level in a daily challenge section, like Spelunky. At first I thought about letting the ...
0
votes
2answers
216 views

How can I make a power-up spawn system semi-random?

Basically I'm working on a similar game to achtung die kurve (http://curvefever.com). I'm almost done with the game, however I'm not completely fine with the way power up spawning works. As for now, I ...
17
votes
4answers
5k 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 ...
0
votes
2answers
714 views

Make objects slide across the screen in random positions

I want to make an object appear randomly at the right hand side of the screen and then slide across the screen and disapear at the left hand side. I am working with libgdx. I have this bit of code but ...
5
votes
3answers
3k 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 ...
1
vote
2answers
70 views

Server side random selection of players

Assuming I have a simple client-server game, where the server picks random players on a very frequent base, I was wondering what is the best way to select a random player (According to the following ...
0
votes
1answer
2k views

How to randomly spawn object using instantiate

I'm trying to spawn objects which move in one direction until they hit a player or the barrier. The spawner is a cube which moves between two points to spawn the object at different locations. The ...
1
vote
1answer
6k views

Unity Move sprite from point A to point B

Pretty new to Unity and i'm trying to make a very simple iphone game. , I'd like to know how to move a sprite (2D) move from random point A to random Point B not just that, but i want it to change ...