Thanks, it's free and open-source so please do play with it and I don't mind getting the result maybe I'll add it to the actual system if you created something that is missing here
Hey, very cool video. I just ask myself how icall those functions and implement those. When doing something like GetItemByProbability(); in an IEnumerator or Update-Function it doesn't work. It would really like to know how that would work.
it should be as easy as declaring a new class ProbabilitiesController and then call the function, pm me on Discord if anything is still foggy I'll help you out with it - FadrikAlexander#4323
I hope so much that this will work with what I need... I'm making a marathon timer (2 versions really) where it can add/remove time based off a percentage chance and I could not figure out HOW to apply this type of mechanism using percentages (whether hard-coded or soft-coded)... I've dealt with SOME randomization for games/school projects but that was mainly running if-else if-else statements, random number generation, and objects themselves, all hard-coded of course.
Ok, after some fiddling with it to get the thing working properly, I now have 3 tables (2 of which will eventually be user based and the third for cumulative counting) and selecting the choices based on how often it should occur (.001(or is it .0001?) is happening about 10 times out of 1 million tries) using floats. So thank you very much for these examples Fadrik :)
@@Fadrik right, so if you want to have a 30% chance you need the range(1, 101) because 30/100 = 30%. In your example it's the range(0, 101) so there is also a 0. With the 0 there are 101 Numbers {0, 1, 2 ... 100} and the 30% are in your example 31/101 ~ 30,7%
This is a very good system you came up with, it helps so much with the often-needed random generation required in game creation. Awesome job.
Thanks so much 😍
Added to my must watch unity tuts Playlist. A lot of great probabilities here. Thanks
Thanks
Cool, this is a nice probability system. I'll have to play around with it. Nice work.
Thanks, it's free and open-source so please do play with it and I don't mind getting the result maybe I'll add it to the actual system if you created something that is missing here
Very interesting! Thanks for sharing :)
Thanks for watching
Great job mate.Thanks!👍.Removed hurdle to research on it.
you're welcome my friend
really cool video!
Thanks!
Hey, very cool video. I just ask myself how icall those functions and implement those. When doing something like GetItemByProbability(); in an IEnumerator or Update-Function it doesn't work. It would really like to know how that would work.
it should be as easy as declaring a new class ProbabilitiesController and then call the function, pm me on Discord if anything is still foggy I'll help you out with it - FadrikAlexander#4323
I hope so much that this will work with what I need... I'm making a marathon timer (2 versions really) where it can add/remove time based off a percentage chance and I could not figure out HOW to apply this type of mechanism using percentages (whether hard-coded or soft-coded)... I've dealt with SOME randomization for games/school projects but that was mainly running if-else if-else statements, random number generation, and objects themselves, all hard-coded of course.
Ok, after some fiddling with it to get the thing working properly, I now have 3 tables (2 of which will eventually be user based and the third for cumulative counting) and selecting the choices based on how often it should occur (.001(or is it .0001?) is happening about 10 times out of 1 million tries) using floats.
So thank you very much for these examples Fadrik :)
1:18 Shouldn't you take the range of (1, 101)?
Let's take range(1, 101), then you can get 100 values and since you test
range of (1, 101) Will get you back values from 1 to 100 as the last number is exclusive and not inclusive in the range
@@Fadrik right, so if you want to have a 30% chance you need the range(1, 101) because 30/100 = 30%. In your example it's the range(0, 101) so there is also a 0.
With the 0 there are 101 Numbers {0, 1, 2 ... 100} and the 30% are in your example 31/101 ~ 30,7%
Oh I started the range from 0 my bad you're right
That explains why the first one has 1% more picks and the last has 1% less picks
in case you didn't know you can do things like:
Random.Range(minInclusive: 1, maxInclusive: 100);
u are god tnx so much!!
Good code very useful except I found your video explanation very lacking and difficult to follow.