tag:blogger.com,1999:blog-5246987755651065286.post8738552366021172350..comments2022-08-24T03:28:17.758-07:00Comments on cbloom rants: 09-06-10 - WeightedDecayRandcbloomhttp://www.blogger.com/profile/10714564834899413045noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-5246987755651065286.post-22354270451992323242010-10-06T01:24:18.603-07:002010-10-06T01:24:18.603-07:00Very interesting. I will implement it in my fighti...Very interesting. I will implement it in my fighting engine. You can follow me at http://kokusaifightingengine.blogspot.com/Anonymoushttps://www.blogger.com/profile/12169849576439283562noreply@blogger.comtag:blogger.com,1999:blog-5246987755651065286.post-18036711761222247242010-09-15T09:20:11.333-07:002010-09-15T09:20:11.333-07:00I hope that's a joke.I hope that's a joke.cbloomhttps://www.blogger.com/profile/10714564834899413045noreply@blogger.comtag:blogger.com,1999:blog-5246987755651065286.post-35951846908644670122010-09-15T09:14:21.415-07:002010-09-15T09:14:21.415-07:00What you want is a Poisson Distribution.What you want is a Poisson Distribution.Stevehttps://www.blogger.com/profile/04808704969162066133noreply@blogger.comtag:blogger.com,1999:blog-5246987755651065286.post-34077566980418083812010-09-10T16:42:47.301-07:002010-09-10T16:42:47.301-07:00"Problem with four and five: people may notic..."Problem with four and five: people may notice that the order repeats, that they'll always hear a given one after another given one. I've never heard that complaint,"<br /><br />Yeah I certainly notice this and there are plenty of cases where it's definitely not okay. Like maybe it's okay for dialogue sequences (because that's sort of weird and gamey anyway, so it's okay if it's just a sequence), but if you used it for gun shot or footstep sounds, the pattern would be very obvious.<br /><br />"Second solution: some complicated scheme where you deprioritize recent ones. Still repeats more than you want, or too hard to tune."<br /><br />This is what I propose here; it's really not that complicated and has no disadvantages that I know of (other than yes, being slightly unintuitive to tweak; probably that could be fixed by exposing the tweak parameters in a more designer-friendly way and doing some math to convert).<br /><br />I think basically all other options have disadvantages or are harder to tweak and implement. (eg. the complicated permutation that you suggest at the end could be made equivalent of course but seems much harder to get right)cbloomhttps://www.blogger.com/profile/10714564834899413045noreply@blogger.comtag:blogger.com,1999:blog-5246987755651065286.post-56194612496954209682010-09-10T16:07:16.857-07:002010-09-10T16:07:16.857-07:00permutation is a bit subtle to do well; if you jus...permutation is a bit subtle to do well; if you just use Quantum's naive implementation, you can still get 2-in-a-row, although it only happens 1 in 1000 times (100 sets of 10), and you can get 18 in a row of misses (also 1 in 100 sets of 10).<br /><br />If those happen to be acceptable rates for those events, then you can use the naive solution, but most likely you don't want that.<br /><br />The non-binary cases are much more interesting and overt to talk about. If you have 10 voice tracks you can play in reaction to event E, and you always have to play them, and you think you want to play them at random...<br /><br />Zeroeth solution: at each event, just play the next recording in order, and then repeat when you run out. "But that's not random!"<br /><br />First solution: pick one at random, it has repeats and sounds dumb<br /><br />Second solution: some complicated scheme where you deprioritize recent ones. Still repeats more than you want, or too hard to tune.<br /><br />Third solution: randomly permute the 10 elements, do 10 events, randomly permute again. Problem: can still get repeats across premutation boundaries.<br /><br />Fourth solution: Randomly choose one permutation once. Just play that permutation over and over forever, guaranteeing it's always 9 events until you hear the same one again.<br /><br />Fifth solution: Randomize the order offline, so everyone always gets the exact same "random" order. This is identical to the 0th solution.<br /><br />Problem with four and five: people may notice that the order repeats, that they'll always hear a given one after another given one. I've never heard that complaint, but that seems to be the only reason to move onto the next solution (although plenty of people have moved onto it):<br /><br />Sixth solution: pick a random permutation. Play through it. Now, do small local swaps on the permutation to build the new permutation, guaranteeing that each event is, say, no less than 7 or 8 distant and no more than 12 or 13 distant from their previous usage.<br /><br />Note that the last solution is very similar in behavior to one where you track "how long has it been since I last used this one" and then you only choose from the ones that have been at least 7 ago and with increasing priority as they get above 10.<br /><br />I've definitely heard of people doing things along the line of these last two solutions.<br /><br />As mentioned, I'm not sure why.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5246987755651065286.post-73853936684703587232010-09-10T11:55:17.866-07:002010-09-10T11:55:17.866-07:00That was @QuantumThat was @Quantumcbloomhttps://www.blogger.com/profile/10714564834899413045noreply@blogger.comtag:blogger.com,1999:blog-5246987755651065286.post-55174405805369940432010-09-10T11:53:11.463-07:002010-09-10T11:53:11.463-07:00Yeah, that's permutation as Ian mentioned. Pe...Yeah, that's permutation as Ian mentioned. Permutation is a good tool to have in the toolbox.cbloomhttps://www.blogger.com/profile/10714564834899413045noreply@blogger.comtag:blogger.com,1999:blog-5246987755651065286.post-25083901030523237182010-09-10T11:50:43.678-07:002010-09-10T11:50:43.678-07:00I built a simpler system (mostly math based) a few...I built a simpler system (mostly math based) a few years back that is based on what Ian said above. The basic concept is that with a 1/5 drop rate, players really expect the first kill to be 1/5 and if they fail, the second to be 1/4 and if they fail again, the third to be 1/3. If you set up your drop rates in fraction form, remove the numerator from the denominator for each attempt, and add the initial denominator to the current denominator on each success you will have a (roughly) guaranteed 1 success for every 5 attempts. It is even easy to scale down, guaranteeing 2 successes for 10 attempts (50% power) or 20 successes for 100 attempts (5% power).<br /><br />There are some more little fiddly things that need to be handled but the implementation is cheap both in storage and processing and is scalable.<br /><br />Relevant posts from my since abandoned blog:<br /><br />http://designdeeply.blogspot.com/2006/09/swayed-random-number-generation.html<br /><br />http://designdeeply.blogspot.com/2006/10/swayed-random-number-implementation.htmlDoughttps://www.blogger.com/profile/06566814912475600615noreply@blogger.comtag:blogger.com,1999:blog-5246987755651065286.post-16556603074979232472010-09-10T09:25:37.040-07:002010-09-10T09:25:37.040-07:00A similar approach is to say:
I want this to happ...A similar approach is to say:<br /><br />I want this to happen 1 in every 10 times. Generate a random number n, from 1 to 10. Return true on the nth time. Return false the other 9 times. After the 10th try, generate a new random number.<br /><br />Thus, the special effect on a weapon or such activates 1 in 10 times, always, but he can't predict WHEN it'll happen (for the most part).Unknownhttps://www.blogger.com/profile/04502466398296792933noreply@blogger.comtag:blogger.com,1999:blog-5246987755651065286.post-79658272135545720632010-09-09T21:23:07.205-07:002010-09-09T21:23:07.205-07:00The formal, signal-processing way to think about i...The formal, signal-processing way to think about it is:<br /><br />http://en.wikipedia.org/wiki/Noise_shapingwon3dhttps://www.blogger.com/profile/09787472194187459747noreply@blogger.comtag:blogger.com,1999:blog-5246987755651065286.post-17763556978691921782010-09-09T19:44:09.685-07:002010-09-09T19:44:09.685-07:00"In particular the biggest difference is that..."In particular the biggest difference is that real random numbers can be very bunchy, which almost always feels bad to the player. " <br /><br />This is why I come here. To read intelligent thoughts. Feels like founding a clear water fountain in the Fallout3 wasteland !Unknownhttps://www.blogger.com/profile/05616779779537929020noreply@blogger.comtag:blogger.com,1999:blog-5246987755651065286.post-244560103349224502010-09-09T18:47:31.342-07:002010-09-09T18:47:31.342-07:00I found that when people ask for a random events, ...I found that when people ask for a random events, what they really want is a permutation of those events happening.<br /><br />So a 1/10 loot drop becomes (literally) one loop drop for every 10 - not an independent 10% chance with each drop.Anonymoushttps://www.blogger.com/profile/01756373388106819852noreply@blogger.com