Game designer's best way to control randomness

  Рет қаралды 2,478

candlesan

candlesan

Жыл бұрын

The best way to control randomness in your games is the “Marble Bag” technique. It is very flexible and adaptable to a wide variety of situations. Game Dev. Includes Unity and C# Examples
The primary drawback is the memory footprint may not allow it to scale in situations where you need to track millions of instances of the marble bag. However, for any single player experience this is my de facto go-to.
-----
You can play Piggy Pileup here: www.wyattcheng.com/games/Piggy...
You can talk about game development on my discord server / discord
I stream gam jams on twitch / candlesan
Twitter: / candlesan
-----
In my day job I serve as Game Director at Blizzard Entertainment. This channel is an independent endeavor and not related to my employer in any way. The opinions expressed are my own and do not necessarily reflect those of my employer.

Пікірлер: 26
@RedOctober2226
@RedOctober2226 Жыл бұрын
I love the visuals to show the functional probability. The "nested bags" was a very good implementation, I enjoyed the story. I come from a pure mathematics background, and probably would have done some weighted matrix, but the "how it works" isn't as clean as your visual. I enjoy the peaks behind the curtain that this series, and LD offer, to a Dev process that doesn't get a lot of coverage.
@candlesan
@candlesan Жыл бұрын
I'm glad to be able to provide some insight. Here's to hoping to more content like it.
@runrajrun
@runrajrun Жыл бұрын
I'd love more game design videos like this! Your explanation and visuals made this concept so easy to understand! I can't wait to try it!
@undermask1111
@undermask1111 Жыл бұрын
Great video and channel! In my work I prefer to work with floating probability: after each iteration, I increase the weights of not-chosen elements by a certain value, I decrease the weight of chosen elements by another value. The values for increasing and decreasing are set separately for each item in the set. Thus we get a self-balancing system, in which we can not only guarantee that the player will get M results in N trials, but we can also manage the number of identical results in a row.
@Phazer25
@Phazer25 Жыл бұрын
here from the chatgpt video, i rly enjoy your clean style! it surprised me that NES tetris wasn’t brought up in this video, as its 100% random piece drops allow extreme behaviors to happen. this caused later tetris games to use a 7-bag, in the same way you described in this vid. this leads to competitive NES tetris having a nice risk/reward balance, as players need to play somewhat defensively against bad luck.
@FBNL
@FBNL Жыл бұрын
Informative video and really well explained, thanks :)
@davidz037
@davidz037 Жыл бұрын
It sounds similar to the way old (mechanical) slot machines worked in a sense that you can control the chance using "par sheets", but on the other side it differs in the fact that distribution in not changing with each drawn marble, of course. In case of slots machine clearly each following attempt is decoupled from the previous ones. Thank you for making these videos!
@candlesan
@candlesan Жыл бұрын
Glad you enjoyed the video. I'm not familiar with the old (mechanical) slot machines - something I'll have to read and learn more about.
@davidz037
@davidz037 Жыл бұрын
@@candlesan Absolutely! I am extremely happy to find your videos, they are pure gold :) Regarding the slot machines, I had to refresh a bit on that, it is actually "electromechanical" ones, but regardless, interesting part are those "par sheets". Still not a fan of the whole gambling context in which they are used, but it is an interesting concept nonetheless.
@Mr.Knubbles
@Mr.Knubbles Жыл бұрын
I've got an idle crafting game called Craftsmith and I think this system would be helpful for my quest system. It could really help control the pool of quests, especially the rare ones.
@GustavoSilva-ny8jc
@GustavoSilva-ny8jc 7 ай бұрын
WOOOOOW, the bag analogy is one of the most brilliant things i ever seen in my life!!! Such a GREAT way to express how probability actually work!!! Those who complain about 3 misses in a 97% chance would finally understand.
@candlesan
@candlesan 7 ай бұрын
Thank you! I'm glad you found the approach useful.
@christarbill2493
@christarbill2493 Жыл бұрын
I enjoyed this topic a lot. I love RPGs and randomness is usually a big part of that. In the game I'm planning out, I feel this could be used for combat, loot, and power up distribution, and randomized event outcomes.
@candlesan
@candlesan Жыл бұрын
I'm glad! I'd love to do more design-topic videos but I'm not sure what topics people want to know more about. If you have any ideas - please let me know!
@christarbill2493
@christarbill2493 Жыл бұрын
@@candlesan 1) do you do anything on the art side of things? I'd like to know how art decisions are made in a collaborative group. 2) Game Design document. - Do you have a formula or a bare minimum check list you use when you're at the start of a project? I just started this process with a friend, we have tasks and such set up on Trello for PM. I think it would be interested to see your point of view on the bare minimum things people need to think about when they set out to make a game.
@candlesan
@candlesan Жыл бұрын
@@christarbill2493 I am not a great artist. Normally on a high-functioning team everybody is open to feedback from other people - so I give my opinion as a player, but I am not good at giving any sort of art direction and you definitely shouldn't take art advice from me. I'll try to put together some thoughts on what the process is for a game design at the start of a project and work on putting something together! Thanks for the inquiry!
@christarbill2493
@christarbill2493 Жыл бұрын
@@candlesan Awesome! I think that's kind of where a lot of people get stuck "I have this really amazing idea but... I'm not sure how to organize it." Would be an awesome building point for any of your other Game Jam vids going forward I think. Looking forward to seeing what you come up with!
@rmast
@rmast Жыл бұрын
One idea that came to mind for reducing memory usage in the case of a large number of marbles but a limited number of outcomes is storing the number remaining of each “type” of marble, instead of creating a new entry for each marble. So for 3 in 100 chance of finding a rare item, store two numbers: the rare item marble count = 3, and the normal item marble count = 97. Then to pick one, choose a random number in the range 1-(total marbles remaining), if the random number is the rare item count, give a normal item and decrement the number of remaining normal items by 1. Memory use would then scale according to the number of outcome types rather than number of outcomes. A downside to this is that the memory required for a bool is in theory 1 bit, while the counters will require more than 1 bit, so memory use may be higher until a larger number of total marbles is reached.
@candlesan
@candlesan Жыл бұрын
Oh yeah that's an interesting idea! You might be able to cap the number of bits allocated to the integers. If you were using 32-bit ints then I'd start to wonder why you're using a marble bag at all. (If you're producing billions of outputs then the difference between a marble bag and simply doing Random.value would be indistinguishable) If you were, say, simulating a coin flip you could probably do a marble bag that has 15 heads and 15 tails to start. That would be 4 bits + 4 bits which you could pack into a single byte and then decrement those counts accordingly as you were evaluating the marble bag.
@westomopresto
@westomopresto Жыл бұрын
I've done randomess the normal way for awhile math.random(1, 99) etc But I've never done it this way, and it seems perfect for your word game
@Terms-and-Conditions
@Terms-and-Conditions Жыл бұрын
have mixed feelings about this because some of the greatest moments in video games happened because of not controlled randomness for example if a person is lucky enough to land 5 low chance crits in a row, i dont want to take this joy and his amazing luck away from him other than that the marble bag is an amazing n useful tool
@MisterJang0
@MisterJang0 Жыл бұрын
Where’s the link to Piggy Pileup? The only links in the description are to your Discord, Twitch, and Twitter pages.
@candlesan
@candlesan Жыл бұрын
Oh thanks for asking! You can play it here: www.wyattcheng.com/games/PiggyPileup/index.html I'll add that link to my description to, thanks for the suggestion!
@m2svirtual384
@m2svirtual384 Жыл бұрын
What about a dynamic approach to solving too many items in a row - or never getting one of them? Let's say you had to create a decision between two items to award. You set a percentage chance. Let's say at default white is 80% and blue is 20%. You win and blue is awarded. Now we exchange 5% (or whatever grain you wanted). White is now 85% and blue is 15%. Leaves us a chance that blue could be awarded again, but weights it heavier to white. It would be interesting to run this through millions of iterations and see what the actual chance for white or blue became. Ever since I programmed a Commodore 64 and 128, I always thought that was the proper way to create 'fair randomness' ala Marble Bag. But I went web code and SQL instead of gaming. Cheers, thanks for the vid
@candlesan
@candlesan Жыл бұрын
Yes that method could work too. I would check out my other video on "4 ways to control randomness" I describe a similar technique called "progressive probability" which is a bit similar to what you describe.
@m2svirtual384
@m2svirtual384 Жыл бұрын
@@candlesan Thanks, watched it, and the emotional impact was clearly understood. Good to have some logic attached to the method(s). Be well and continued success on your content channel. 👍
Game Design - Four ways to control randomness
8:51
candlesan
Рет қаралды 3,3 М.
Dear Game Developers, Stop Messing This Up!
22:19
Jonas Tyroller
Рет қаралды 682 М.
UFC 302 : Махачев VS Порье
02:54
Setanta Sports UFC
Рет қаралды 1,4 МЛН
Omega Boy Past 3 #funny #viral #comedy
00:22
CRAZY GREAPA
Рет қаралды 37 МЛН
Каха инструкция по шашлыку
01:00
К-Media
Рет қаралды 8 МЛН
Can AI code Flappy Bird? Watch ChatGPT try
7:26
candlesan
Рет қаралды 9 МЛН
Randomness is Random - Numberphile
13:31
Numberphile
Рет қаралды 862 М.
Why games feel grindy and 4 ways to fix it
11:05
candlesan
Рет қаралды 8 М.
How I would approach gamedev (if I had to start over)
18:34
BiteMe Games
Рет қаралды 69 М.
This Problem Changes Your Perspective On Game Dev
25:51
Jonas Tyroller
Рет қаралды 345 М.
I Made a Neural Network with just Redstone!
17:23
mattbatwings
Рет қаралды 552 М.
Making a Music Rhythm Runner - Game Jam Recap
13:50
candlesan
Рет қаралды 2,5 М.
Starting a game company with beginners?
8:22
candlesan
Рет қаралды 8 М.
The Art of Game Optimization
10:18
Worlds In Motion
Рет қаралды 251 М.
Hamster Kombat for New Players: Easy Start Guide ⚡️ Hamster Academy
2:09
ЗАХОТЕЛА В ТУАЛЕТ НА УРОКЕ в ROBLOX!
21:40
Family Play TV
Рет қаралды 483 М.
НАСТОЯЩАЯ ЖИЗНЬ КОТА В ВР ( I Am Cat )
22:48
perpetuumworld
Рет қаралды 264 М.