Archive through October 17, 2025

Star Fleet Universe Discussion Board: Star Fleet Battles: Star Fleet Battles Online: Sapphire Series Tournaments: Sapphire Star 19 (Fall 2025): Archive through October 17, 2025
By Ted Fay (Catwhoeatsphoto) on Monday, October 13, 2025 - 08:24 pm: Edit

AI is not particularly good at generating pseudo-random numbers, at least not any more so than traditional RNG algorithms. Plus, AI is much more computationally intensive, so there's essentially no point to using an AI to generate a RNG.

https://towardsdatascience.com/random-numbers-in-machine-learning-9cb5d83d078e/

The best way to generate numbers that approach truly random is to tie your RNG to a physical process that we THINK truly is random because it depends on a quantum mechanical feature. For example, beta decay appears - as far as we know - to be truly random.

Note algorithmic RNGs - of whatever kind (including AI) - are actually NOT random. They are deterministic. More properly, they're called pseudo-random because (while deterministic) predicting the pattern in the numbers generated is extremely difficult.

Pseudo RNGs are actually pretty good. They emulate true randomness well enough for most computing purposes.

However, like I said, to have true RNG you must tie your number to a quantum mechanical event (like beta decay as I mentioned) and then use that to generate your number according to some algorithm.

Also, most people don't appreciate this, but true randomness does result in occasional weird runs of a series of low or high results, or even repeated appearances of the same number in a row. It boils down to the law of large numbers.

While I truly (and I mean this, I actually do) feel Justin's pain, overall the client's RNG is reasonably good for a pseudo RNG. I have been the victim of rolling 4 "6"s when rolling for overloads at r2. Heck, I once won a RAT over Lin because his LDR missed with 4*OL disr at r2. It happens.

Which makes it no less maddening...

-------------

That being said, is there anything that can be done to improve the client's RNG?

Actually... there *MAY* (and I stress "may"), however, be a way to replace the client's pseudo RNG with a true quantum RNG.

All I did was type the following search string to get the following website.

die roller tied to quantum mechanical random number generator

https://qrandom.io/

@Paul Franz: You might want to look into the possibility of tying the client's RNG (i.e., die) widget to a truly random (quantum mechanical) RNG. I did NOT look into whether the above website would be suitable for doing so.

However, I do know that there are other true (i.e., QM) RNGs out there. I'd like to think that there's a QM RNG that you could access for free and tie in some kind of API call to the QM RNG to start generating absolutely random numbers when a player calls for a die roll.

Let me know if you think the idea has merit.


Anyway. That's my 57 Quatloos.

By Ted Fay (Catwhoeatsphoto) on Monday, October 13, 2025 - 08:26 pm: Edit

P.S. I'd also add that a true RNG (and verified to be such) would end all argument about whether the client's RNG is "fair."

P.P.S. In a sense, the client's pseudo-RNG is entirely fair. Because we all use it and so are all subject to whatever biases it may have. Not that that's any comfort.

P.P.P.S. It would still make one (including me) feel better to know that the client's RNG was a "true" QM RNG.

By Dana Madsen (Madman) on Monday, October 13, 2025 - 08:31 pm: Edit

No, going to excel would likely be too hard, and who knows if its a good rng. I would guess Paul will want a simple call to a library from java. Or a simple call to a website using their API to return him a number or sequence of numbers. We don't really want to wait for seconds though to roll numbers if there is any lag. I'm also guessing he doesn't want to write his own rng.

Looking online again, I see commentary that the default java rng, java.util.random, is designed to be fast, but there are complaints about it's quality of output (maybe these have been fixed since the 10 year old commentary I see). Remember, when Paul started coding this game 20+ years ago computers were slower and sometimes algorithms were setup to provide a quick/good answer rather than taking a longer time to provide a great answer. Computers are faster now, maybe we can find a better algorithm.

Paul, I obviously do not know your code or what you've programmed. I also congratulate you on all your work you've put into this game. I'm not trying to dis the game. Maybe in the last few years you spent time finding a new better rng, or maybe, it's the same code you started with a long time ago. If it is old code that you haven't touched in a while, email me with a description or snip of code of how you are generating dice rolls, and I'll try and see if I can make suggestions. It's been years since I've looked at stuff like this but at one time I was working on a math heavy Comp Sci Master program. Then I dropped out and completely changed careers.

We should probably take this offline and let people get back to talking about sapphire star games.

By Ted Fay (Catwhoeatsphoto) on Monday, October 13, 2025 - 08:53 pm: Edit

@Dana: See above for RNG technical discussion.

And... I agree. Excel is bad. You'd get not better (if not worse) pseudo-random behavior.

By Mike Erickson (Mike_Erickson) on Monday, October 13, 2025 - 09:17 pm: Edit

If the capability doesn't already exist, would it be possible for the SFBOL client to write out the source and outcome of each die roll to a file? Then they could all be analyzed in a structured way later on.

--Mike

By Dana Madsen (Madman) on Monday, October 13, 2025 - 09:28 pm: Edit

yeah, Ted, I agree with your commentary. I was trying not to get too technical. I especially agree with the part about every now and then we will see weird results. You would see it playing live and rolling real dice. The number of times I've seen a guy throw a handful of dice across a room and storm off mad definitely exceeds 10. Whether playing SFB or other games.

By Dana Madsen (Madman) on Monday, October 13, 2025 - 09:44 pm: Edit

Mike, the possibility to output all die rolls to a file and analyze should be doable by Paul. Whether Paul wants to do the work is a different matter. Analyzing a single game may not be as useful as analyzing a log of all the games played online in the course of a month. A single tourney game may only have 50 to 200 die rolls depending on the types of ships played. It would likely be more work for Paul to have every game report back to his server and log all the die rolls.

By Carl-Magnus Carlsson (Hardcore) on Tuesday, October 14, 2025 - 03:50 am: Edit

A technical solution is not needed, unless there is a technical problem caused by, for example latency as Justin mentions.

Justine have my sympathy, really. There are however no technical solutions. Other than "-Shoot when you see the whites of their eyes", or play plasma ships in the future.

I recall, reading somewhere, someone going over pre-rolled dice list to see that there was no extreme results. Could that have been for the PBEM?
In any case I think, while not even a completely random number generator will make people feel better, messing with output would be worse because then people will have someone to blame.

By Ted Fay (Catwhoeatsphoto) on Tuesday, October 14, 2025 - 11:37 am: Edit

Even plasma ships will be subject to the vicissitudes of that evil B****, Lady Luck, just less so. Against some opponents (e.g. Orion) the BP player may have to bolt and get lucky.

If you REALLY hate luck based results, then play a game like Chess. No randomness in the game at all.

Otherwise... one must simply develop a sense of Zen that what goes around comes around.

I say this knowing that I am the pot calling the kettle black. As a redhead (at least, before age turned my hair whitish), I've had my own fair share of temper rants over dice. Heck, I once had a pin-on button I'd wear to FTF tournaments back in the day that said, "Great Strategist, Lousy Dice Roller."

/me shrugs.

Anyhoo. Assuming it's 1) technically easy and 2) free, I still say having a QM RNG tied to the client would be good for peace of mind. After all, that's as absolutely fair as it gets in a game that intrinsically relies on RNG during gameplay.


P.S. Printing reports on pseudo-RNGs would not help. If complete enough they'll just reveal the (very complex) pattern generation algorithm which results in the pseudo-RNG. It will reveal that it is "unfair" (i.e., not truly random, no matter how well it approximates true randomness) and just make feelings worse. I'd say accept the client's reasonably good pseudo-RNG and be content that everyone uses it (and thus is on the same playing field), switch to a QM RNG (and don't be surprised when you get 8*1's in a row with it when rolling phasers every once in a blue moon), or switch to flying Big Plasma (greatly reduced use of the RNG).

YMMV

By Carl-Magnus Carlsson (Hardcore) on Tuesday, October 14, 2025 - 02:33 pm: Edit

Hardcore vs Cadet_Stimpy, Oct 25th 8am PST

By Mike Erickson (Mike_Erickson) on Tuesday, October 14, 2025 - 03:23 pm: Edit

O Fortuna, velut luna

By Ted Fay (Catwhoeatsphoto) on Tuesday, October 14, 2025 - 03:48 pm: Edit

O Fortuna, velut luna, statu variabilis.

Semper crescis aut decrescis; vita detestabilis nuc obdurat et tuc curat ludo mentis aciem; egestatem, potestatem, dissolvit ut glaciem.

Sors immanis et inanis, rota tu volubilis, status malus, vana salus semper dissolubilis, obumbrata et velata mihi quoque niteris; nunc per ludum dorsum nudum fero tui sceleris.

Sors salutis et virtutis mihi nunc contraria; est affectus et defectus semper in angaria. Hac in hora sine mora cordae pulsum tangite; quod per sortem sternit fortem, mecum omnes plangite!

--------------

English:

O Fortune, like the moon you are changeable, ever waxing and waning; hateful life first oppresses and then soothes as fancy takes it; poverty, power, it melts them like ice.

Fate, savage and empty, you are a turning wheel, your position malevolent, vain health always dissolves, shadowed and veiled you plague me too; now through the game my naked back I bring to your villainy.

Fate, in health and in virtue, is now against me, affection and defeat always enslaved. So at this hour without delay pluck the vibrating string; since Fate strikes down the strong, everyone weep with me!


https://www.had2know.org/arts/o-fortuna-translation-lyrics-orff.html
© 2010-2025 had2know.org

------------------

I once had the great privilege of performing Carmina Burana. I was one of the tenors. We performed in the downtown Denver performance hall, together with a full symphony orchestra and a children's choir. It was 1996 or 1997 - can't remember which.

That first wall of sound hits you like a ton of bricks in a live performance. GLORIOUS!

By Paul Franz (Andromedan) on Wednesday, October 15, 2025 - 09:55 am: Edit

Justin,
When it comes to the internal die roller having lag, I have a question for you, what OS are you running? I have seen issues in the past with Linux and Java and the random number generator that has a lag. There is a fix for that. But it requires an updated installer and then either you will need to reinstall the client (I am assuming you are using Linux) or update the launcher script to add the java command-line option.

I don't use the SecureRandom object for random numbers for the internal number generator. But I can look into changing that.

As mentioned, true random number generators are truly random which means that things might get skewed for small number of rolls. And any random number generator that makes sure that the number of each roll is the same for a specific data set (i.e. 6 - 1s, 6 - 2s, 6 - 3s, 6 - 4s, 6 -5s, 6-6s for 36 rolls) is not truly random.

By Mike Erickson (Mike_Erickson) on Wednesday, October 15, 2025 - 12:35 pm: Edit

One thing you might consider, if there is lag associated with RNG on some platforms, is to pre-roll a bunch of values and save them internally.

So, if a D7 need 4xd6 rolls to resolve 4x disruptor firings, rather than calling java.util.random (or whatever) at the time of firing, have a pool of say 30 d6 rolls already rolled and ready to go and stored in a local object, so the disruptor resolution isn't affected by RNG lag.

I don't know how the sfbol code is structured so that may or may not be simple.

Generally speaking, you make a good point that Java implementations will be different on different platforms. So, specific methods (like random) may ultimately be implemented by calling different library functions that are native to the platform, be that Linux/Windows/Mac, or any of the different revision levels of those platforms. So the behavior of different platforms could be quite different even though the Java abstraction is the same.

--Mike

By Carl-Magnus Carlsson (Hardcore) on Wednesday, October 15, 2025 - 02:18 pm: Edit

Mike, I had the same idea, but i forgot to post it!:D

By Justin Royter (Metaldog) on Wednesday, October 15, 2025 - 03:17 pm: Edit

the internal roller seems to be ok, though i suspect the logic is poor. Random.org is not random it is much closer to avg 4, again, the logic is bad.

The other rollers do not work, they are laggy and unusable, the other algos.

enough said, you all went the expected route and explained it away instead of just offering a new, surely simple solution 25 years later. Ok, np.

By Ted Fay (Catwhoeatsphoto) on Wednesday, October 15, 2025 - 04:59 pm: Edit


Quote:

enough said, you all went the expected route and explained it away instead of just offering a new, surely simple solution 25 years later. Ok, np.


Huh? There is a simple solution. A QM RNG I described above. I just don't know how to tie it in to the client - that would be for Paul Franz to do.


Quote:

As mentioned, true random number generators are truly random which means that things might get skewed for small number of rolls.


@Paul: Why is this a problem? If what we want is a truly random number generator, then there's no particular skew for a large or small number of rolls. By definition. Because each number generated is truly random. Yes?

Have you looked into tying the client into a QM RNG? There seem to be several free ones on the net.

By Paul Franz (Andromedan) on Wednesday, October 15, 2025 - 09:20 pm: Edit

Ted,
Do you know of a service that offers QM RNG?

By Ted Fay (Catwhoeatsphoto) on Wednesday, October 15, 2025 - 09:29 pm: Edit

Paul,

I do not, other than the one website I posted (which I doubt is suitable). I'd have to research that. Want me to give it a shot later this week?

On the other hand, you intimately know how the client works. While I'm willing to help, I'd say you'd be a lot better at technically evaluating whether this service or that would be better.

Let me know if you want a hand trolling the net for QM RNG services.

-T

By Justin Royter (Metaldog) on Thursday, October 16, 2025 - 11:16 am: Edit

If I call it an alternative instead of a solution, does that help? :)

I am going to try the internal roller *shrug*.

Can we get a new alternative roller, something new to try just to contrast the current rollers?

By Ted Fay (Catwhoeatsphoto) on Thursday, October 16, 2025 - 11:50 am: Edit

Justin, I have no say on the answer to your question. However, AFAIC I'd be happy to use a QMRNG that simultaneously reports to two emails. I suppose you could do that with any player who agrees.

However, hopefully Paul (maybe with my help) can find a way to integrate a QMRNG into the client.

As for contrasting PRNGs (pseudo RNG) rollers... I'll leave that task to someone else! :)

T

By Paul Franz (Andromedan) on Thursday, October 16, 2025 - 07:47 pm: Edit

Looks like I can use the qrandom.io website. Looks like the API is free (at least for the moment) and it will roll dice. I can add that to the next release of the client

By Justin Royter (Metaldog) on Thursday, October 16, 2025 - 09:47 pm: Edit

ty paul, ty ty!! Much appreciated!!

By Ted Fay (Catwhoeatsphoto) on Friday, October 17, 2025 - 09:43 am: Edit

Hopefully the latency of qrandom.io isn't too bad.

By David Cheng (Davec) on Friday, October 17, 2025 - 01:22 pm: Edit

There is nothing new under the sun.

The topic of “the random generator in SFBOL is broken” has come up many times in the past. If ADB ran a BBS system that didn’t have to purge the older discussions on a regular basis, you could search for it.

Many years ago, a regular player complained very loudly that he always got screwed. Then, someone else suggested that everyone go to Tools > Dice Monitor and post their results. It turned out that Mr Complainer’s logged results had a higher ratio of 1s and 2s than practically anyone else. The Dice Monitor showed with real data that his rolls were (ever so slightly) better than average.

Here is what Dice Monitor says about my logged history.

# # of Rolls
1 47
2 50
3 52
4 46
5 63
6 41
Total (Avg Roll) 299 (3.5050167224080266(

I don’t know how far back in time this goes. I’m sure I’ve had more than 299 rolls in SFBOL over the years.

It also seems like I’m getting far more than my fair share of 5s.
The fix is in!!!!
;-)

-DC

Administrator's Control Panel -- Board Moderators Only
Administer Page | Delete Conversation | Close Conversation | Move Conversation