Unused nametable RAM showing garbage on real hardware

You can talk about almost anything that you want to on this board.

Moderator: Moderators

niconii
Posts: 219
Joined: Sun Mar 27, 2016 7:56 pm

Re: Unused nametable RAM showing garbage on real hardware

Post by niconii »

Is it even worth it? Most players will never notice, since input will become less predictable after regular gameplay begins, meaning it's only really going to affect the very beginning of a play session.

As for the ones who are trying to figure out how to manipulate the RNG... hell, isn't that a good thing? When you hear about RNG manipulation tricks in Mario or Pokémon or whatever else, do you think "wow, what a shoddy game"? No, of course not! You think, "Wow, what a cool trick!" or "I wonder how that works..." or "I wanna try doing that myself!" People love figuring out tricks like that. Little exploits in the player's favor can add to the charm of a game. On the other hand, not many people are going to notice or appreciate a hard-to-exploit RNG. That's just something people take for granted.

(Of course, there's a difference between an RNG you can exploit if you're clever, and an RNG that's so bad it's blatantly obvious. The quality of the game it's in matters too. Exploits in Sonic Mania can be a boon to the game. Exploits in Sonic 06... not so much.)
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Unused nametable RAM showing garbage on real hardware

Post by rainwarrior »

Sumez wrote:
pwnskar wrote: My starting seed right now is a frame counter taken when the player first hits start but I wonder if it would be a good idea to combine it somehow with an uninitialized value. Maybe something like adding one to the value and multiplying it with my frame counter. That way I would always at least get the frame counter by itself as a starting seed but then have the extra mystery of the uninitialized value added on real hardware. Perhaps even a simple add would suffice.
.. as long as you aren't planning on something like TASbot ever playing your game :P
I mad my game TASbot compatible by letting the RNG seed be reset by holding Left + Right when starting the game.

Otherwise the starting entropy came from waiting on the title screen for the button press. Was checking it in a loop, not just once per frame, so it was maybe 100x finer on hardware than on an emulator (which will normally only check input once per frame anyway), plus from leaving the RNG seed intact across resets.

You can do like a RAM checksum for entropy at startup maybe, but this only really works on power-on, and not from PowerPak/Everdrive, and not on emulators, and of course on a reset most of this will be in a predictable state depending on when the player reset the game. The OAM is more volatile/random than SRAM, but again not usable on emulators. So... fine to supplement I guess, but shouldn't be the only thing you rely on.
Sumez wrote:Btw, does anyone know if powerpak/everdrive manually clears all RAM before loading in a new game
Sort of. It uses parts of RAM for its menu. The startup values will be consistent for a given person playing the same game, I think, but the actual values depend on e.g. filenames seen in the menu, etc.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Unused nametable RAM showing garbage on real hardware

Post by tepples »

Nicole wrote:Is it even worth it? Most players will never notice, since input will become less predictable after regular gameplay begins, meaning it's only really going to affect the very beginning of a play session.
Such as the layout of the first floor of the dungeon, or the deal of the cards in solitaire.
niconii
Posts: 219
Joined: Sun Mar 27, 2016 7:56 pm

Re: Unused nametable RAM showing garbage on real hardware

Post by niconii »

tepples wrote:Such as the layout of the first floor of the dungeon, or the deal of the cards in solitaire.
I imagine quite a few games on the NES would have this problem. How often have you noticed it in practice?

EDIT: Okay, let me put it another way, since I don't really like my own argument here:

Not a lot of game genres rely on randomness to that degree; in fact, a number of games go without randomness entirely. Typically, RNG is used for things like enemy behaviors or damage values. So if we're talking about a dungeon crawler or solitaire game here, where a lot of generation is done up-front, the effort to prevent accidental RNG manipulation is probably worth it. For a platformer or RPG with fixed maps, perhaps not. It's a trade-off that depends on the type of game you're making.
pwnskar
Posts: 119
Joined: Tue Oct 16, 2018 5:46 am
Location: Gothenburg, Sweden

Re: Unused nametable RAM showing garbage on real hardware

Post by pwnskar »

Nicole wrote:Is it even worth it? Most players will never notice, since input will become less predictable after regular gameplay begins, meaning it's only really going to affect the very beginning of a play session.
Well I'm actually using the result from my first RNG as the seed for the next, so the only place I throw in any real randomness is the very first time I create the seed value. The RNG would technically be predictable after that but you'd end up in a random spot of a pattern that would not loop until thousands of iterations, so for a human it would at least seem random. Although I guess you can only end up in any of 256 spots in that pattern, but if you can memorize 256 different patterns I think you've earned it. :D
Is it worth it? Maybe not. But it's fun to think about small problems like this. :)
Nicole wrote:Not a lot of game genres rely on randomness to that degree; in fact, a number of games go without randomness entirely. Typically, RNG is used for things like enemy behaviors or damage values. So if we're talking about a dungeon crawler or solitaire game here, where a lot of generation is done up-front, the effort to prevent accidental RNG manipulation is probably worth it. For a platformer or RPG with fixed maps, perhaps not. It's a trade-off that depends on the type of game you're making.
I get what you're saying. It's fun to play games where you eventually learn it inside out (espicially platformers, I'd say) and in that case too much RNG could ruin that aspect. In my case it's a 2-player vs kind of game with weapon pickups, so to make it fair for both players I'm trying to make some aspects of that as random as possible.
rainwarrior wrote:I mad my game TASbot compatible by letting the RNG seed be reset by holding Left + Right when starting the game.
Hah! I had the exact same idea earlier in the thread! I'll take it as a good sign.
tepples wrote:By constantly checking the joypad registers in a 100% CPU loop, a DPCM interrupt handler, or a mapper-generated timer interrupt handler. If your game uses a discrete mapper or MMC1, and your title screen plays music with DPCM, the technique may not be as applicable.
So let's say I make a loop at the end of my game logic for the title screen. Each iteration it would increment my seed and the loop would only break when the desired button is hit. Would that be enough? It should, right?
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Unused nametable RAM showing garbage on real hardware

Post by tepples »

You'd need to intersperse the rereads with the rest of your logic. Otherwise, if your title screen loop alternates (say) 4 ms of logic and 12.4 ms of waiting while reading the controller, a press during the logic (and thus detected on the first read of the waiting) would be dramatically more common than a press during the waiting.
Post Reply