RNG Map Seeds
6 years ago
Missouri, USA

I've spent a lot of time trying to figure out how the RNG works to be able to more easily spawn the correct map seed necessary to get the most time effective runs on any category in this game.

I had figured out at first that the value that triggers which seed is based on when you push start on the 3rd intro screen/the credits screen, not the 1st/hockey mask one. Then I went through each individual value in FCEUX, made a spreadsheet, and charted out which value placed the counselors in which cabins, kept testing to make sure that the placement could be recreated from scratch with the right value. Power cycling was seemingly the best way to properly manipulate this, as it would put the values right back at 00, whereas resets would jump the value backwards a varying, inconsistent number. I gotta hand it to the devs, they did not want this RNG to be easily manipulated by the player.

But now I'm realizing that there's much more to this RNG than I originally thought. I built a metronome value that would get me as close to frame perfect 3rd intro start as I could with minimal resets - in theory. All of this on emulator. But put into console, the RNG acts way differently. If I power cycle and use my metronome, I should expect that I get a map seed that is either exactly where it should be, or at least close to it as far as my chart went.

Then I started noticing that SOMETIMES when I would power cycle, it would sometimes give me a map seed that was nowhere close to where my metronome should place me on the chart, or worse yet, a map seed that isn't even on my chart.

I wonder if the game has multiple preset lists of map seeds set for multiple 256 value cycles of RNG, and on console it randomly pulls one list up and you can't manipulate which one it does pull up.

Also wonder if there are actually multiple versions/builds of this game made and no one's ever realized it. The biggest RNG factor of running this game is undoubtedly for map seed. Right now I'm just quickly doing soft resets and hoping for the best until it actually potentially gives me the map seed I want (Mark NW Lake Road cabin + Paul at far South Main Road cabin immediately attacked by Jason) - but sometimes what I think may be that map seed (I don't stop to check in advance, it wastes time from a potential PB run), it might be a map seed where Jason starts at the Cave Road, or a map seed where Jason starts at the NE Main Road cabin and I don't know until I get to the far South cabin and find no one there.

This RNG feels pretty unique in a way that makes this game hard to run for any sort of records.

Chimp, Lazarus_DS and 2 others like this
Japan

Would you care to share your findings with us? It might help someone else crack this nonsense.

And yeah, I realized that there was a big difference in RNG between emulator and console. I specifically bought an Everdrive so I could do runs on console (I'm in Japan, where the game was never released, so that was my only option) and then found that my methods for getting optimal RNG weren't working anymore. So I haven't done any runs since, and it's sad. The game is really fun, and I'd love to keep doing it. But going for a competitive time means needing to somehow manipulate the RNG.

i just get really stoned and mash buttons and scream fuck alot because i never get the cabin i want... big props to the deep studies

California, USA

Hey, I know the answer to this.

The RNG in the game is based on the global timer, which is initialized by adding together all the memory addresses in the range 0x000-0x7FF. On emulator, these have a constant value at power-on, so the starting global timer will always be the same from a hard reset. However, on console, memory addresses are not constant, they actually vary on power-on until they are written over. As a result, the global timer will be initialized at a "random" value even from a hard reset on console.

I think this was intentional on the part of the programmers to make the RNG functionally impossible to predict.

More info: http://tasvideos.org/forum/viewtopic.php?t=14564

Chimp likes this
Minnesota, USA

Verified Dugongue's findings on the RNG seed at boot and he's 100% right. The initial global timer starts as a sum of the memory addresses from $000 - $7FF. It's a byte value though, so its only a 'checksum' byte of sorts that gets shoved in as the initial global timer value at boot.

Furthermore, the global timer ticks up and finally locks in RNG for counselor spawn at the black screen right before you see the map. I'm working out how the game picks out the counselor start locations.

Looks like counselors can only exist in 10 of the cabins. Not sure if this is true during gameplay (maybe someone else can verify?) I'll post findings when I know more.

Chimp likes this
United States

The small cabins are where the counselors can spawn at the start of the game, and where they can stay while you are doing actual gameplay with whichever counselor you've selected. There are 10 small cabins. A counselor you are using can enter and search a big cabin, but cannot stay in them

Michigan, USA

I am really happy and excited you are working on this game Slush.Filter. Thank you.

Minnesota, USA

Indeed, I'm having lots of fun in the code! :) It's a bit messy, and somewhat brilliant at the same time.

I found the counselor placement mechanism; The basics go like this :

  • Use the global timer to pick a memory address from $0000 - $FFFF
  • Use that selected memory address and read forward to pick a cabin for Counselor 0 (George)
  • If the cabin is occupied, do run a loop until we find an empty cabin.
  • Place the counselor in the cabin.
  • Step forward in memory from the last selected memory address to prep for the next placement.
  • Repeat this process for each Counselor

At the end of the process you have 6 cabins occupied and 4 unoccupied. There is also a "failover" cabin if this process couldn't find a good spot for some reason.

Minnesota, USA

More progress on this - I've been able to get a grip on how the map seed and Jason spawn algorithm works.

Lately I've been hammering on Jason's spawn and behaviors during the game while he's not on screen : Jason takes an Action ever so often. His actions are driven by a script that is running on a loop, I'll refer to this as Jason's Action Table.

Each entry in the Action Table sets 4 properties of Jason to determine what he's doing. The four properties of an entry are:

  • Jason's current area (Outer Loop, Inner Loop, Forest, Cave, etc. etc.)
  • Jason's approximate progress on the path. ( how far along the path he is )
  • The number of seconds where Jason will stay at this location.
  • Whether or not he's visiting a cabin, and if so, what cabin number he's in.

During map setup, Jason can start on one of three positions in his Action Table, I'll call these positions Route A, B and C. This is governed by the global timer during the randomization screen (the black screen between title and counselor selection)

Due to the way the game selects his starting position, he will have a 50% chance to be on Route A (spawn outside of caves), a 25% chance to be on Route B (spawn on outer loop, heading to woods), and a 25% chance to be on Route C (spawn on outer loop, heading to cave loop)

I've pulled a ton of data from the Rom and compiled some tables, but there are a few more things I need to verify before posting to make sure it's all accurate.

SqueekJ and PGHGuitarGuy like this
United States

Interesting, so there is a 50% chance he will start by the caves and only 25% for the other two? I assume any 3 routes can be applied to any cabin combination. Interesting data, I always thought it was more or less 50/50 between route A and B, but I never looked inside the rom years back when I was figuring stuff out. This makes a lot of sense, I noticed he would always start by the cave most often, especially with the "default" cabins

Missouri, USA

That was one thing I found interesting in learning what sort of seed setups were possible a few years ago is that of those 3 routes Jason spawns in, it is indeed 50% in 1, 25% at another, and 25% in the 3rd.

The chance of spawning the perfect seed is I think 3 or 4 possible frames of a 256 frame roll, and none of those frames are in segment. Getting the seed is frame perfect at the screen just before the map. And since it’s long been confirmed that the RNG begins at a random value on console, you pretty much just have to power cycle any time you don’t get the correct seed. No visual timer. I even tried to create a click track before I submitted my first console run and that’s what made me start this thread. Results were varied.

I do remember finding that resets push the RNG value back a certain number of frames, which is why it seemed to me like power cycling was possibly a better option than resetting - as if you get a bad seed your odds of continuing to get bad seeds might be higher. I imagine a few of you guys who have snagged sub 3s that I haven’t put the time into doing have had your own results that create the better preference there.

Missouri, USA

That was one thing I found interesting in learning what sort of seed setups were possible a few years ago is that of those 3 routes Jason spawns in, it is indeed 50% in 1, 25% at another, and 25% in the 3rd.

The chance of spawning the perfect seed is I think 3 or 4 possible frames of a 256 frame roll, and none of those frames are in segment. Getting the seed is frame perfect at the screen just before the map. And since it’s long been confirmed that the RNG begins at a random value on console, you pretty much just have to power cycle any time you don’t get the correct seed. No visual timer. I even tried to create a click track before I submitted my first console run and that’s what made me start this thread. Results were varied.

I do remember finding that resets push the RNG value back a certain number of frames, which is why it seemed to me like power cycling was possibly a better option than resetting - as if you get a bad seed your odds of continuing to get bad seeds might be higher. I imagine a few of you guys who have snagged sub 3s that I haven’t put the time into doing have had your own results that create the better preference there.