TheHoboInYourRoom Posted September 8, 2016 Share Posted September 8, 2016 I have a concept for a VCS game that would rely on an RNG in at least a couple crucial ways. I know from using Omegamatrix's startup values program that the Harmony ROM selection menu will repeatably leave the RAM in a certain state, which I'm sure depends on where a particular ROM happens to be in the file system, but it's still deterministic. Maze Craze will also more often than not produce one particular first maze, and this can change based on how I traverse the file menu before selecting it. So I'm wondering what the best source for a random seed would be to ensure good RNG performance no matter if a game is running on a Harmony with the menu BIOS, a Harmony in single-image mode, or (possibly in the future) a dedicated cartridge. My first guess would be to almost immediately sample INTIM and store the value, say, at the top of RAM and skip over that byte in the init routine. Is the latency of ROM loading unpredictable enough to make that a viable strategy? Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted September 8, 2016 Share Posted September 8, 2016 step 10 - "Random Numbers" One thing that helps when using an LFSR is to keep reading values at a regular rate, even if you don't need the value. What this does is impose an element outside of the Atari's control - namely the time it takes the human to do things: hit the RESET switch to start a game, collect the next box, etc. I've added this to VerticalBlank VerticalBlank: jsr Random ... Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted September 8, 2016 Share Posted September 8, 2016 Check Berserk. I know for sure that it does the initial sampling of INTIM as you plan it. Probably you should additionally update the RNG every frame. Then its state depends on the player when he starts the game. With Harmony, the RAM area is completely used for the stall code, displaying the Yin-Yang symbol. So that's not random at all. Quote Link to comment Share on other sites More sharing options...
enthusi Posted September 8, 2016 Share Posted September 8, 2016 depending on how many different states you want, simply counting frames since reset and using those as seed or pointer into a seed-table or even an sbox table if you have 256 spare bytes. Quote Link to comment Share on other sites More sharing options...
TheHoboInYourRoom Posted September 8, 2016 Author Share Posted September 8, 2016 Thanks for your help, everyone. I'm almost certainly going to use an LFSR. With Harmony, the RAM area is completely used for the stall code, displaying the Yin-Yang symbol.That's weird, my Harmony has never shown the yin-yang. The loading latency, though, is unpredictable, right? Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted September 8, 2016 Share Posted September 8, 2016 Yes. It much depends on your SD cart speed, and, when paging in the menu, the size of the directory (slower when paging backward) or the size of the game loading. 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.
Note: Your post will require moderator approval before it will be visible.