Skip to main content

Questions tagged [random]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
211 views

How to implement random children selection using a behavior tree framework that doesn't support it? Assuming that I want to select one of three possible actions with equal probability this is the best ...
Kamil Bizoń's user avatar
0 votes
2 answers
112 views

I am trying to generate a set of points distributed in such a way as to give a "rough circle" sort of shape. The points should not deviate too far from neighboring points, with larger jumps ...
Anthony Khodanian's user avatar
0 votes
1 answer
162 views

I'm making an idle game with semi-multiplayer. My game uses Unity as a client and as a server Unity Gaming Services (UGS) C# Cloud Code Modules with UGS Cloud Save, this server is non-persistent, ...
Pascal Claes's user avatar
0 votes
0 answers
106 views

For a game I am finishing, I need a random sequence that can be generated in Wasm and in the server, yielding the same result. This generated 64-bit(or more if supported by WASM) numbers sequence is ...
Kroma's user avatar
  • 111
0 votes
2 answers
272 views

I have a 2D grid of cells in Unity, and each cell can be on or off. I want to randomly generate the on cells, and when I just assign a probability to each cell, the entire grid has the same density, ...
UserUser's user avatar
  • 171
1 vote
1 answer
149 views

I made a character in Godot 4 that enters from one side of the image and exits from the other side, which shows its different modes randomly each time. I have written these codes for it: ...
Nina Monti's user avatar
-1 votes
1 answer
760 views

As you can see, I'm attempting to set the random prey integer to a number within a random range like so: randomPrey= Random.Range(0,10); As I type the code out the .Range doesn't turn yellow and the ...
Gideon Falls's user avatar
0 votes
2 answers
156 views

I need to generate discrete integer variables that each have meaning, so does their sum. I am essentially looking to partition a normal distribution into n bins. You can think of them as stats. The ...
Amilia C's user avatar
19 votes
5 answers
4k views

While in line at Disneyland, my friends and I came up with a 1v1 bartering game. Here's how it works: Two players are negotiating the price of a good. One player is the buyer, one is the seller. ...
harkinian's user avatar
  • 303
0 votes
1 answer
115 views

I am still working on the RTS and have added a system that allows enemies to randomly wander. However, when multiple enemies fight one of my units, they will just clump up Afterwords instead of going ...
Crystalline787's user avatar
0 votes
0 answers
62 views

Suppose I have a game with 6 players, each of which gets a payout on a different side of a D6 roll. The D6 is rolled many times over the course of the game. This yields an even payout in the long run, ...
sdgfsdh's user avatar
  • 295
1 vote
2 answers
250 views

Conceptually, generating item stats is the same as placing balls into buckets. An even distribution of 50 balls into 5 buckets looks like this: [10,10,10,10,10] whereas an uneven distribution might ...
user2108462's user avatar
16 votes
5 answers
4k views

I am working on a RPG that I have implemented spells with status effects that can be applied x% of the time. For instance a fire spell has a 25% chance to apply a burning debuff. Initially I just put ...
TyCobb's user avatar
  • 339
1 vote
1 answer
573 views

The idea is to generate a path with a certain distance m. Currently the generation pseudo code is as follows: ...
EEAH's user avatar
  • 113
0 votes
1 answer
250 views

...
Daniel Lip's user avatar
  • 1,785
0 votes
1 answer
166 views

So iam trying to practice java with a text based adventure game. This code gives out an enemy of an array(random) and then gives it a Randoam health between 0 and 100. What I want to do is give each ...
vampsz's user avatar
  • 15
0 votes
1 answer
1k views

I am stuck on a problem that might be quite simple yet it's getting on my nerves. I want to spawn crops on different plane shapes like in the attached screenshot. So far my progress is that I am able ...
Syed Munim Raza's user avatar
3 votes
2 answers
298 views

Many survival games such as Rimworld will announce when significant events happen in-game. For example, when a raid, a disaster or a significant event occurs, the game will send a notification and ...
caleidon's user avatar
  • 591
0 votes
1 answer
277 views

I have a variable called global.goldchance = irandom(99);. I use it to get a random number from 0 to 99. However, I need to be able to run it again so that the ...
gmlnoob's user avatar
0 votes
1 answer
194 views

I have this code that Change spot angle randomly between 'minAngle' and 'maxAngle' each 'interval' seconds: ...
magdalena molinari's user avatar
1 vote
0 answers
273 views

So I am trying to make random map generation for a game, and right now I am trying to use a raycast to get the height of the spot where a prefab will be generated, I am using a terrain and generating ...
Mason Walker's user avatar
-2 votes
1 answer
2k views

I created an infinite runner game. I need to make random spawning obstacles in 3D. How do I randomly spawn prefabs on the X axis using a C# script?
Саша Ростягай's user avatar
0 votes
1 answer
600 views

I'm making a slot machine game and I need some advice on how to implement the spinning reels or how it's usually done. Right now, I'm thinking about two different approaches that would make sense - if ...
matronator's user avatar
0 votes
1 answer
182 views

I'm interested in designing a game with a randomly-generated world. I'd like the world to be generated from a seed value, so that players could share these seeds among each other and play in the same ...
Evan Kaye's user avatar
1 vote
1 answer
214 views

Taking a casino slot machine for example: How can the probability of a payout TRULY be random with a preset payout rate? If a casino has slots programmed to a specific rate or percentage of payout, ...
Bill's user avatar
  • 11
0 votes
1 answer
256 views

In my game level, you have to cross a busy road to buy something and then cross back again. The general gameplay mechanics are now set up and playable. But I wanted to know if this routine I used to ...
I_Keep_Trying's user avatar
5 votes
2 answers
3k views

First off, I know almost nothing about game development/rng but I will learn. So apologies for sounding uninformed. I want to make a sandbox ios game with several activities to do within, one of which ...
Toddd's user avatar
  • 51
0 votes
1 answer
2k views

I'm currently having trouble getting my head around how Random.Range() and Array[].Length are working in the script below. ...
Meireles's user avatar
1 vote
0 answers
2k views

I'm working on a game, in Unity3D, where the player picks up trash from Trash cans, and dumps the trash from the Trash cans into a Trash Truck. The world of the game itself is randomly generated, with ...
Fox GAMING_NTF's user avatar
2 votes
1 answer
2k views

I'm trying to generate a random path on a 2D grid given that: The width and height of the grid are given The length of the path to generate is given The path can't move "back" The path ...
Oro Portaluri's user avatar
1 vote
1 answer
506 views

I am making a rogue-like game in Godot. Currently, I am stuck with the world generation. I know how to add children, but I am wondering if there is a way to add those children in a specific position. ...
TheWorldSpins's user avatar
0 votes
1 answer
133 views

For modelling a simple game of cricket, Considering a batsman has a single attribute rating. I can go about deciding run chances by weighted probabilities. ...
SomeTypeFoo's user avatar
1 vote
0 answers
155 views

How do you create a random grid where the lines aren't orthogonal (and cells aren't a perfect square), but are warped? Here's an example of what I mean: (Credit: screenshot taken from a video by ...
Pandaqi's user avatar
  • 113
2 votes
1 answer
1k views

I'm coding a chunk-based 2D game. I generate chunks as the player explores the world. Chunks follow a procedural generation algorithm (with only one biome implemented at the minute, but I'll ...
Featherball's user avatar
0 votes
1 answer
511 views

I created a random direction in x and y-axis at where to move, then my problem is when I tried to randomize it sometimes I get the same value at the same time on both x and y-axis. How do I not let ...
Saidus's user avatar
  • 91
0 votes
1 answer
965 views

I'm trying to do it so when I have an instantiated an item upon the game starting, it is random as to whether it actually instantiates or not. Here's the code I have so far: ...
BroCodeNode's user avatar
0 votes
1 answer
239 views

I've been working on a program for my friends to use for a homebrewed roleplay system that we all use for our campaigns that can generate random enemy statlines with certain constraints. The program ...
lumamaster's user avatar
2 votes
3 answers
1k views

AFAIK it is a consensus within esports that randomness should be reduced? League of Legends has little RNG, Dota has more but both games employ rng smoothing algorithms (details for Dota, LoL). The ...
gaazkam's user avatar
  • 977
0 votes
0 answers
325 views

I'm doing tree placement in the geometry shader in GLSL. I've made a seeded random vec3 function based on gold noise that looks like this: ...
Figwig's user avatar
  • 196
0 votes
3 answers
4k views

In my current situation I have a game world, in that game world I want to place loads of tree models. It is a waste of time for me to actually explicitly define the x y and z values of each tree model,...
Kyle_Pearce's user avatar
3 votes
1 answer
599 views

My game consists of 'waves' of objects called 'spawners', which once every certain amount of time (their firetime), move to a new place on the screen and spawn an enemy. Each wave has 4 important ...
NipIsTrue's user avatar
0 votes
2 answers
3k views

I have a flat 10x10 surface (floor) made out of cubes of 1x1x1. I am spawning objects from the "sky" and I want them to fall on random points of the surface without exceeding the surface limits. Is ...
Thorvald's user avatar
  • 103
0 votes
1 answer
546 views

I'm currently entertaining an idea I've had about procedurally generating a world. I would like the entire world to be procedurally generated on the fly. So when a chunk is loaded, it uses a seeded ...
Joe Fioti's user avatar
  • 123
1 vote
2 answers
234 views

I'm making a minigame where up to 5 players have to race against AI or another player(the "enemy"). The race consists of prompts, the current player is asked to press a key in a given amount of time ...
Daniel's user avatar
  • 111
1 vote
1 answer
2k views

I'm working on a top-down rogue-like in Unity3D, and I already have some kind of dungeon generation. The next feature I'd like to implement, is to predesign some kind of "event rooms" (i.e. boss ...
Tudvari's user avatar
  • 801
2 votes
1 answer
185 views

I'm doing some procgen stuff and I need a truncated gaussian distribution. Basically, I need a way to get the same thing as this: ...
Schilcote's user avatar
  • 296
4 votes
1 answer
467 views

I am trying to create random characters in my game. Each character has 33 abilities and one of 6 jobs. For each job you need to skill/increase other abilities. I am calculating an overall skill (...
basti12354's user avatar
0 votes
1 answer
173 views

My problem is the value I get from Random.Range is not stored, but I get another value instead. In level 1 I press the "claim" button to store a randomly-chosen score In level 2 I retrieve the level 1 ...
Rahul Patil's user avatar
3 votes
2 answers
689 views

I'm trying to create a Tetris like game in C# (Unity) and I've run into quite a problem on how I can generate 7 cards (tetrominoes) of which none are the same and when I run out of cards, I regenerate ...
Victor Raduca's user avatar
0 votes
0 answers
135 views

I'm trying to write an easy-to-use random event system that has certain conditions and effects in Unity. It's a simulation game that contains multiple Person, City, Country, Faction elements. I have ...
Doğa Can Kılıç's user avatar

1
2 3 4 5 6