Randomness in games
Moderator: Moderators
Randomness in games
Should games have random values and to what degree?
I've been playing Super Mario Bros. The entire game is pretty much scripted. The enemies and obstacles are entirely predictable. I feel like this gives the designer complete control over the experience.
Games, like my own Forest Glider, use random values to keep the experience "fresh" but suffer from slightly unpredictable behavior.
I had always felt it was a matter of balance, but now I am starting to think there should be no elements outside of the designer's and player's control. What do you think?
I've been playing Super Mario Bros. The entire game is pretty much scripted. The enemies and obstacles are entirely predictable. I feel like this gives the designer complete control over the experience.
Games, like my own Forest Glider, use random values to keep the experience "fresh" but suffer from slightly unpredictable behavior.
I had always felt it was a matter of balance, but now I am starting to think there should be no elements outside of the designer's and player's control. What do you think?
Good question! Personally I prefer games that I can master by learning (like Mario and Doom), when a game has random elements it can easily become unfair or annoying even when you have to wait for a random thing to happen before you can finish the game.
On the other side games like "Poker" REQUIRE an element of chance to make them interesting.
On the other side games like "Poker" REQUIRE an element of chance to make them interesting.
-
- Omega Star Commander
- Posts: 1375
- Joined: Thu Jan 31, 2008 2:12 pm
- Website: https://robert.hurst-ri.us
- Location: Providence, RI
- Occupation: Tech & Innovation
I prefer a little bit of both, something akin to a gourmet mixture.
I love gaming rules enforcing the "boundaries", allowing for that predictability to make for expertise. But, I find there's nothing wrong with entertaining the player by breaking out from the "logic" with a little randomness (and does not necessarily have to come from a die roll either):
- why did the red ghost decide to enter the tunnel?
- why did the mother ship appear immediately again after getting shot?
- why did that ship decide to U-turn now?
One of my favorite "cheap" methods to "do a coin flip" or "in some instances" is to use the jiffy clock and filter off a bit (or bits) to determine if we hit that time to do something "else".
Another "rule" I like to enforce that's not based on randomness is to "punish the player that exploits an apparent weakness" in any game. I have a laundry list of such, "I know what you're doing outside the spirit of the game, so here's a little something else for you to overcome."
I love gaming rules enforcing the "boundaries", allowing for that predictability to make for expertise. But, I find there's nothing wrong with entertaining the player by breaking out from the "logic" with a little randomness (and does not necessarily have to come from a die roll either):
- why did the red ghost decide to enter the tunnel?
- why did the mother ship appear immediately again after getting shot?
- why did that ship decide to U-turn now?
One of my favorite "cheap" methods to "do a coin flip" or "in some instances" is to use the jiffy clock and filter off a bit (or bits) to determine if we hit that time to do something "else".
Another "rule" I like to enforce that's not based on randomness is to "punish the player that exploits an apparent weakness" in any game. I have a laundry list of such, "I know what you're doing outside the spirit of the game, so here's a little something else for you to overcome."

Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
https://robert.hurst-ri.us/rob/retrocomputing
- Kweepa
- Vic 20 Scientist
- Posts: 1303
- Joined: Fri Jan 04, 2008 5:11 pm
- Location: Austin, Texas
- Occupation: Game maker
For some things you may have no choice but to resort to "randomness" to generate data. For example, The Keep has thousands of possible level maps. There's no way that would fit in 3.5k, even if it was just one byte to determine the random seed from which to generate each level.
Games like Doom also rely on randomness for things like scatter for the shotgun and the damage done by each projectile. I was impressed to see though that they tweaked the damage code so that if the player is extremely low on health a bullet is less likely to kill you. There's also some randomness for enemy movement - move in this direction for a random amount of time, then decide randomly whether to zigzag left or right.
Games like Doom also rely on randomness for things like scatter for the shotgun and the damage done by each projectile. I was impressed to see though that they tweaked the damage code so that if the player is extremely low on health a bullet is less likely to kill you. There's also some randomness for enemy movement - move in this direction for a random amount of time, then decide randomly whether to zigzag left or right.
At first I thought using random numbers were more memory efficient, but now I think it might be easier to pull numbers from various sections of ROM. It would be predictable in some ways and probably just as easy as calling RND. Blue Star's maps for example.
Like Super Mario Bros, the players actions alone can alter or change the predictability of the pattern. Omega Race and Fury seem to move in predictable ways with bursts of randomness to enhance the "panic" moments.
Like Super Mario Bros, the players actions alone can alter or change the predictability of the pattern. Omega Race and Fury seem to move in predictable ways with bursts of randomness to enhance the "panic" moments.
-
- Vic 20 Scientist
- Posts: 1189
- Joined: Tue Apr 28, 2009 3:51 pm
Depends on the game. Platformers in the Super Mario mould (lots of levels and secrets to explore) should be fixed otherwise they'd be impossible, but some arcade games and single screen collect-em-ups like Flicky and Chuckie Egg could benefit from being randomised.
One of the games I've been playing recently is the NES version of Paperboy and one of the key things I've noticed about it is that the houses and obstacles are different each time you play. Most versions of PB are fixed and they're a lot easier as a result.
One of the games I've been playing recently is the NES version of Paperboy and one of the key things I've noticed about it is that the houses and obstacles are different each time you play. Most versions of PB are fixed and they're a lot easier as a result.
This is how I generate randomness in anything I write that needs it. It uses the lower 8 bits of the 9-bit VIC raster counter at $9003/9004, combined with an accumulating seed value which is an aggregate of a base value (I start with $73, but anything will do) plus whatever value happens to be in successive Zero Page locations on any given call. The seed value has to be a byte in RAM somewhere as it's updated after each call, and the routine itself is self-modifying so that the ZP location increments on each call too.
Code: Select all
;-------------------------------------------------------------------------------
; RANDOMGEN
; Generate a random number from 0-255
; Notes: Returns value in .A, uses no other registers
randomgen SUBROUTINE
lda $0 ; Get next ZP value
adc .seed ; Add seed value
adc RASTER ; Add current raster count
sta .seed ; Update seed value
inc randomgen+1 ; Increment ZP address in first instruction
rts
.seed DC.B $73 ; Initial seed value
- Mayhem
- High Bidder
- Posts: 3007
- Joined: Mon May 24, 2004 7:03 am
- Website: http://www.mayhem64.co.uk
- Location: London
Re: Randomness in games
Although not quite everything is set... when and how the Hammer Bros jump and switch between platforms is random for example. But I know what you mean, the attack patterns are all set to trigger at always the same points in each level.Jeff-20 wrote:I've been playing Super Mario Bros. The entire game is pretty much scripted. The enemies and obstacles are entirely predictable. I feel like this gives the designer complete control over the experience.
Lie with passion and be forever damned...
-
- Vic 20 Hobbyist
- Posts: 143
- Joined: Thu Aug 25, 2011 10:04 am
Re: Randomness in games
I think that non-random is better for long games (it takes hours to go through Mario) while short games are often random. It could be because of lack of memory to implement a long scenario or just laziness. I really like your idea of relying on ROM for this. Better watch out for differences between versions though (PAL vs NTSC, etc.). Is this an issue on the VIC?Jeff-20 wrote:I've been playing Super Mario Bros. The entire game is pretty much scripted. The enemies and obstacles are entirely predictable. I feel like this gives the designer complete control over the experience.
Phil Ranger
-------------
"Don't eat the trees 2" for the VIC 20 : http://www.box.net/shared/u398kj0nr0lkauzm1k67
on line: http://www.mdawson.net/vic20chrome/vic2 ... otrees.prg
-------------
"Don't eat the trees 2" for the VIC 20 : http://www.box.net/shared/u398kj0nr0lkauzm1k67
on line: http://www.mdawson.net/vic20chrome/vic2 ... otrees.prg
- Mike
- Herr VC
- Posts: 5134
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Re: Randomness in games
The KERNAL ROM is different between PAL and NTSC (VIA Jiffy clock and RS232 register values, and VIC register values), but the BASIC ROM is the same.PhilRanger wrote:Better watch out for differences between versions though (PAL vs NTSC, etc.). Is this an issue on the VIC?
-
- Vic 20 Hobbyist
- Posts: 143
- Joined: Thu Aug 25, 2011 10:04 am
Thanks Mike!
Phil Ranger
-------------
"Don't eat the trees 2" for the VIC 20 : http://www.box.net/shared/u398kj0nr0lkauzm1k67
on line: http://www.mdawson.net/vic20chrome/vic2 ... otrees.prg
-------------
"Don't eat the trees 2" for the VIC 20 : http://www.box.net/shared/u398kj0nr0lkauzm1k67
on line: http://www.mdawson.net/vic20chrome/vic2 ... otrees.prg
Coincidentally, I just read about making a random number generator here (low on the page under "3 Randomness"):
http://www.cl.cam.ac.uk/freshers/raspbe ... een02.html
http://www.cl.cam.ac.uk/freshers/raspbe ... een02.html
We've had several discussion on how the Vic's RND can be a little predictable. For example, if I reset TI$ and the generate a sequence of random numbers, they'll often be the same with each RUN. Most of us are more likely to think of this from the programmer's perspective.
My debate is more about the player's experience. It seems like we, as players, enjoy a bit of memorization and pattern predictability. Look at most side scrolling shooters! They'd probably be awful if completely random.
My debate is more about the player's experience. It seems like we, as players, enjoy a bit of memorization and pattern predictability. Look at most side scrolling shooters! They'd probably be awful if completely random.