Xpendable Posted August 10, 2020 Share Posted August 10, 2020 I have my BigBox Attract mode set to spin the wheel within the platform it is current on, and I have set to spin every 60 seconds. I've noticed that it tends to pick the same small set of games over and over again, despite having 1000+ roms on a single platform. For example, in a span of 1 hour, it will hit the same game several times. Statistically that should not be possible if it is supposed to be randomly picking a game. How is the game being selected? I suspect there could be a bug in the implementation. Quote Link to comment Share on other sites More sharing options...
neil9000 Posted August 10, 2020 Share Posted August 10, 2020 9 minutes ago, Xpendable said: Statistically that should not be possible if it is supposed to be randomly picking a game Actually that is exactly what happens if something is completely random, 1 Quote Link to comment Share on other sites More sharing options...
neil9000 Posted August 10, 2020 Share Posted August 10, 2020 Just now, neil9000 said: Actually that is exactly what happens if something is completely random, If it was to be programmed so that the same game wont show twice, then that is categorically not random. Quote Link to comment Share on other sites More sharing options...
Xpendable Posted August 11, 2020 Author Share Posted August 11, 2020 Sorry, but I know a lot more about how random numbers work than you think. I'm not saying no game should ever be repeated. What I'm saying is the same 10 games should not be repeated 5-10 times within 60 samples when the range is 1000+ games. Something is statistically wrong with the number generator if is generating the same sets of numbers over and over and over again. I should only have a 1/1000 chance of seeing the same number on each random number generation. Instead, I'm seeing the same game 1/10 times, consistently, or something like that. That is wrong. If that happened once in awhile, it would be correct, but when it happens 1 out of very 10 random games, and the other games are also happening at the same frequency... there's something wrong. Quote Link to comment Share on other sites More sharing options...
wallmachine Posted August 11, 2020 Share Posted August 11, 2020 I've noticed the cycle sometimes appear on the same game multiple times. Quote Link to comment Share on other sites More sharing options...
neil9000 Posted August 11, 2020 Share Posted August 11, 2020 7 hours ago, Xpendable said: I should only have a 1/1000 chance of seeing the same number on each random number generation. Thats not true though, that would only be accurate if every time Launchbox was rolling a number it was on the same game, but of course it isnt its always rolling a number from a different game (excluding the first roll of course). So it is actually more common than you would think to hit the same game. If you had 1000 games in a platform and on the first roll Launchbox picked 300, you would of course see a different game, but then if the next roll it chose 700 as the number, then you would be back at the same game 300 + 700 = 1000, in that case it still chose two completely random numbers, but because the starting point is different the chance of hitting the same game is higher, If the roll was always starting from zero i could see your point but its choosing a random number roll from a previously random roll position so the chances of hitting a already seen game is actually statistically higher than if every roll started out from a zero position. Im not saying that there isnt potentially something wrong here, just that the very nature of something being random, and started from random points is always going to look somewhat not random as you will hit the same outcomes. Quote Link to comment Share on other sites More sharing options...
polygonslayer Posted August 11, 2020 Share Posted August 11, 2020 I've also noticed that it does tend to pick the same games and platforms to scroll through again and again. I swear some platforms I've never seen it randomly go into at all. I don't have any real data to back it up, but I got 50k+ games and I feel I'm seeing a very small percentage of them during attract mode. Not a massive issue for me though, but I have noticed it and thought I'd add my observations as well. Quote Link to comment Share on other sites More sharing options...
DOS76 Posted August 11, 2020 Share Posted August 11, 2020 I'd say if you consistently see the same games (and I do see this also) when there is a thousand choices then there is something wrong with the randomizer. Quote Link to comment Share on other sites More sharing options...
Xpendable Posted August 11, 2020 Author Share Posted August 11, 2020 I agree with polygonslayer and DOS76. I think something is wrong with the randomizer somehow. It might be worth doing some debugging and logging out the number chosen each time to a file and compare the results. My arcade machine is right next to my office where I work from home, and I often stare at watching it. It's definitely goofy. Quote Link to comment Share on other sites More sharing options...
Xpendable Posted August 11, 2020 Author Share Posted August 11, 2020 (edited) I watched my arcade machine and wrote down every game it spun to for the past 45 minutes. This is what I observed. Platform is set to Atari 2600 (with 577 titles). I've color-coded all the matching repeat entries. Challenge (8:58) Bacherlor Party (8:59) 2600 1.00 Files (9:00) Amidar (9:01) Bachelor Party (9:02) Breakout Atlantis (9:03) Col "N" (9:04) Astro Attack (9:05) Beamrider (9:06) Col "N" (9:07) Bachelor Party (9:07) Breakout (9:08) Centipede (9:09) Bank Heist (9:10) 2-in-1: Frostbite and River Raid (9:11) Atari Video Cube (9:12) 2 Pak Special Blue: Dungeon Master, Creature Strike (9:13) Blueprint (9:13) Blackjack (9:14) 2 Pak Spcial Yellow: Warrior,Frogger (9:15) Bionic Breakthrough (9:16) Bank Heist (9:17) Bridge (9:18) Air Raid (9:19) Berzerk (9:20) Cat Trax (9:18) Boing! (9:19) China Syndrome (9:20) Armor Ambush (9:21) Beamrider (9:22) Cakewalk (9:23) Computer Chess (9:23) Bermuda Triangle (9:24) Communist Mutants From Space (9:25) Chase the Chuck Wagon (9:26) Circus Atari (9:27) 128-in-1 Junior Console (9:28) Chase the Chuck Wagon (9:29) Atlantis (9:30) Bionic Breakthrough (9:31) Climber 5 Berzerk Berenstain Bears Atlantis So BigBox selected 45 entries over 45 minutes, and 19 of those titles repeated, some more than twice. So... 42% of the entries were repeats. It looks like it is picking a random number and using that as an offset to spin the wheel X number of entries forward or X number of entries backward. I noticed that every spin over the this time frame was within the first 98 entries of my 577 titles. It never made it higher than the 98th entry, which is Communist Mutants From Space. This makes sense since the platform is alphabetically sorted by title, and this game is the 98th entry in the Windows folder, also sorted alphabetically. My Attract Mode settings are: Enable Attract Mode (checked) Switch Between Platforms/Filters (unchecked) Wait Time: 1 Minute Time In-Between Movements: 40 seconds Maximum Speed: 20 milliseconds Minimum Speed: 200 milliseconds Edited August 11, 2020 by Xpendable Quote Link to comment Share on other sites More sharing options...
Jason Carr Posted August 11, 2020 Share Posted August 11, 2020 I think that most likely the issues are coming more from the nature of how the wheels spin, rather than a bug in the random number generator. It is true that RNGs are never perfect, and are often not so great at being random, but the issue here is that the wheel doesn't often get all that far past the beginning of the alphabet, because it goes both forwards and backwards. I do have a couple of ideas that might help though: Randomize where in the list the wheel starts when changing between platforms Change the wheel to never (or more rarely) go backwards The wheel is randomized by how many games are jumped through for each move, not by selecting a particular game, so that probably has an effect on the results as well. 2 Quote Link to comment Share on other sites More sharing options...
Jason Carr Posted August 11, 2020 Share Posted August 11, 2020 I've improved this in a few ways for the next beta. Made it less likely to move backwards in the wheel, changed out the random number generator for one that's supposedly improved (just in case that is actually the issue), and tweaked some of the chances. Let me know how it fares for you guys after the beta 12 release. 2 Quote Link to comment Share on other sites More sharing options...
Xpendable Posted August 11, 2020 Author Share Posted August 11, 2020 Thanks, Jason. I'll have a go at it. Another way you could do it which would always ensure that every game has the same odds of appearing next (1/577 in my case) would be to make note of the current position, then randomly select a number between 0 and MAX -1 (567 in my case) and then compute whether you need to go forward or backwards and by how many steps. while (newPos == curPos) { newPos = (get your random number between 0 and Max) if (newPos < curPos) { // Go backwards steps = curPos - newPos; } else if (newPos > curPos) { // Go forward steps = newPos - curPos; } } Now you can calculate how to spin the wheel so that it lands on the chosen game. But I get this a bit more complex, and maybe the tweaks you've made for the next Beta will take care of the problem. Quote Link to comment Share on other sites More sharing options...
Mr.Laor Posted August 11, 2020 Share Posted August 11, 2020 Please. I would love true random and not based on how long I hold down the stick. Quote Link to comment Share on other sites More sharing options...
Jason Carr Posted August 11, 2020 Share Posted August 11, 2020 1 hour ago, Xpendable said: Thanks, Jason. I'll have a go at it. Another way you could do it which would always ensure that every game has the same odds of appearing next (1/577 in my case) would be to make note of the current position, then randomly select a number between 0 and MAX -1 (567 in my case) and then compute whether you need to go forward or backwards and by how many steps. while (newPos == curPos) { newPos = (get your random number between 0 and Max) if (newPos < curPos) { // Go backwards steps = curPos - newPos; } else if (newPos > curPos) { // Go forward steps = newPos - curPos; } } Now you can calculate how to spin the wheel so that it lands on the chosen game. But I get this a bit more complex, and maybe the tweaks you've made for the next Beta will take care of the problem. That would not be a good way to proceed, because the wheel would likely spin for far too long if you had too many games in the wheel. Quote Link to comment Share on other sites More sharing options...
Mr.Laor Posted August 12, 2020 Share Posted August 12, 2020 (edited) Can the spin animation for the wheel just be a visual representation of a true random result and not actually match the time it would take? Even a slight screen blink to end up at the random game would better. Edited August 12, 2020 by Mr.Laor Quote Link to comment Share on other sites More sharing options...
Jason Carr Posted August 12, 2020 Share Posted August 12, 2020 2 hours ago, Mr.Laor said: Can the spin animation for the wheel just be a visual representation of a true random result and not actually match the time it would take? Even a slight screen blink to end up at the random game would better. To be honest, that sounds confusing and I don't think that's a good idea at all. We could add a random feature a lot easier if we just jumped to a random game, but that's not really what this discussion was about. Quote Link to comment Share on other sites More sharing options...
Xpendable Posted August 12, 2020 Author Share Posted August 12, 2020 (edited) 15 hours ago, Jason Carr said: That would not be a good way to proceed, because the wheel would likely spin for far too long if you had too many games in the wheel. Jason, I've got a solution for that. What if you implemented logic to compute a random number that is always within a max spin range of the current position? You can even make it configurable to be +/- 100, +/- 200, etc. That way you will always be randomly picking a title that is within range of the current position and never spinning further than the max "search" range. The beauty of this is it will scale well regardless of whether you have 100 titles, 1000 titles, 10,000 titles. int maxrange = 200; int halfrange = maxrange / 2; // if maxrange = 200, then we are looking for a range that is +/- 100. int minvalue = curPos - halfrange; int maxvalue = curPos + halfrange; if (minvalue < 0) { // Since the minvalue < 0, we need to shift the range to the right. // For example, if curPos = 40, the minvalue would be -10 and maxvalue would be 90. After shifting, // the new range would be minvalue = 0 and maxvalue = 100. maxvalue += Math.abs(minvalue); minvalue = 0; if (maxvalue > maxtitle-1) maxvalue = maxtitle-1; // truncate range if the number of titles is less than your maxrange. } else if (maxvalue > maxtitle-1) { // Since the maxvalue > then the maxtitle-1, we need to shift the range to the left. If maxtitle = 1000 and // maxrange is 1005, we need to shift the entire range to the left by 5 so that the mavalue = maxtitle-1. minvalue -= maxvalue - maxtitle-1; maxvalue = maxtitle-1; if (minvalue < 0) minvalue = 0; // truncate range if the number of titles is less than your maxrange. } int newrandom = Random.Next(minvalue, maxvalue); // random number. For example, if curPos = 300 and maxRange = 200, then range is (300,400) Edited August 12, 2020 by Xpendable Quote Link to comment Share on other sites More sharing options...
Jason Carr Posted August 12, 2020 Share Posted August 12, 2020 @Xpendable That's basically what we do already... Not exactly, but the end result would be the same. Quote Link to comment Share on other sites More sharing options...
Jason Carr Posted August 12, 2020 Share Posted August 12, 2020 Have you guys tested the latest beta? I believe it should solve any prior issues. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.