LotteMakesStuff

Hi im Lotte and i make stuff.

🏳️‍🌈gay useless lesbian🏳️‍🌈
💖yuri subtext💖
👩‍💻gamedev👩‍💻
💤absolutely tired, always💤
🎮VIDEOGAMES🎮
🩷famed pink-haired anime girl appreciator🩷
🥇worlds #1 Bidoof fan🥇

 


 

working on Demonschool @NecrosoftGames

 


 

source: The Villainess Who Steals the Heroine's HeartSleepy-girl representation is important

 


Discord
lottemakesstuff
BSky - Ill probably be posting here.
bsky.app/profile/lottemakesstuff.pink
Twitter - DEFUNCT (i am no longer able to log into it lol - consider it archival)
twitter.com/lottemakesstuff
Blog/RSS - cohost mirror and new posts
lottemakesstuff.pink/

celechii
@celechii

Learning about Slay the Spire correlated RNG and whoops shit, I made this mistake too.
TLDR: Initialize all of your generators with seeds generated by a generator initialized with the game seed lmfao

I've set up my RNG system like Slay the Spire's, where you use a bunch of independent random number generators that you use to keep track of independent parts of the game/run's generation. You have a generator for deciding what enemies appear in a fight, what encounters happen in what order, and what items get dropped, etc. This is really handy for debugging when you want to re-roll only specific parts of the game without having the cascading effects of changing the rolls for everything else in the game. If I find an interesting seed that produces some interesting results but want to see what a given encounter would look like if it had rolled differently for enemies, I can just step forward the enemy random number generator, rebuild the encounter with those enemies, and still get the same room order afterwards.

The ISSUE with this, is in how you set all your independent generators up. The fast and easy way that it seems both Mega Crit and I did, was just create a bunch of generators, and give them all the game/run seed and call it a day. Unfortunately, this means that there's now some correlation between each generator's sequence of generated values.

The enemy spawn generator is going to generate 1, 2, 6, 1, 6, 8, 9 in that order, and the encounter type generator is ALSO going to generate 1, 2, 6, 1, 6, 8, 9 in that order. If the check I use to generate Big Scary Monster is value < 3, and the check I use to generate a shop for an encounter is value < 2, seeing a shop first thing means that you can be certain that Big Scary Monster is going to show up in the first combat encounter and that can affect what you buy from the shop.

At first, the way around this felt like just adding some offset to generator's internal state/position, but that just means the generators are going to overlap at a different number of rolls instead of the first several. Instead I think you've gotta have a one-off generator that's initialized with the game/run's seed, and use it to generate new seeds for each individual generator and nothing else. Your game stays deterministic (assuming your generators are), but the first rolls of each generator are going to be no easier to guess than any independent value from your pseudo-random number generator, no matter how many rolls you observe from other generators :)


You must log in to comment.

in reply to @celechii's post:

stacked generators... (head boggles slightly for a moment)

I've never worked with seeds before but I'm going to soon, so this is super helpful! I hadn't even considered it, and it especially seems like one of those things that you'd be able to notice but would be REALLY hard to pinpoint

yeah! ive seen jorbs alluding to it in slay the spire every once in a while and i've had that "hmmm that sounds like it makes intuitive sense but idk why...." feeling for months now and i finally clued in to what it was and how to fix it like 1:30 into his video about Not Talking About It since it's not gonna be patched out and once you notice what it looks like if you're playing the game at that level, it's really hard to ignore. but from the dev side i'm like damn i never even thought about that side effect more people should talk about it lmfao

aw, are they patching it out? "mistakes" like these add some nice texture; e.g. if wind waker didn't use a single set seed then this video wouldn't exist, and that would be sad: https://m.youtube.com/watch?v=1hs451PfFzQ

(although, I'm not deep enough in StS to have an opinion on whether the extra texture is good or bad. I just think it's not obvious that it should be changed, even if it's the result of a mathematical/programming oversight)

as a separate thought, here's some neat alternate suggestions to avoid correlation:

how un-forgettable is it? simple correlations can be impossible to forget, sure, but I can't imagine playing the first 6 floors for literal hours (like he said in the video) if I had already decided to not focus on rng info leaks.

the stuff jorbs said in the Not Talking About It video (thanks for the link!) about social power/competition is hard to argue against... I dunno, it's just weird to me seeing people unable to enjoy a game on their own terms. Modding it out is a good compromise -- I support it. But I also like unintended mechanics; I like seeing the universe stick its fingers in and do some bizarre game design of its own. I guess I just wish people framed these sort of things as "deciding to play on my own terms", rather than "fixing an obvious mistake".

this is all a bit of a tangent to your post, sorry! and thanks for the squirrelhash talk link -- this looks interesting!

yeah it is ultimately all just preference and definitely depends a lot on the skill level you're playing at! im also a huge fan of these kinda things cause as a systems programmer it's like one of the coolest most juicy things to me! there's def a degree to which "gamers will optimize the fun out of your game" that is bound to happen especially from the most skilled (and visible) players, but i think maybe the degree to which that's a common experience is hard to say given that group of players is also more likely to be more vocal about it lmao