|
H The Infinite Maze |
How to get a game with 79,228,162,514,264,337,593,543,950,336 locations.
I’ve been thinking about this for 25 years so it’s obvious that I’m not actually going to get round to writing it myself. Although I'm having fun with Blitz 3D so who knows!
Techie bit
Programming languages allow you to define the size and type of your numbers. One of the common types is an Integer (whole numbers e.g. 42). The size is the number of bits allocated (e.g. 32 bits). A 32-bit Integer can range from 0 to maximum of 4,294,967,296.
Now consider a Chessboard with 4,294,967,296 squares along each side. This board has 18,446,744,073,709,551,616 locations. Extend this to three dimensions and the number of location rises to 79,228,162,514,264,337,593,543,950,336. Within this grid three numbers can define any location.
Now the fun bit.
Use these numbers to seed a pseudo random number generator. This means that the random number generator will always return the same random number for each location. Use this number to determine the properties of the location. This means that not even the programmer can predict what properties a location will have (although they could calculate them).
Example One: The Infinite Maze
Assume the pseudo random number generator returns a number between 0 and 1. Each location has a random number. You can then use the difference between the numbers of adjoining locations to determine if or how a player can move from one location to another. For example: A difference between two adjoining locations of less than 0.2 means there is wall in the way and a player cannot move from one location to the other. It need not stop there, a difference of greater then 0.9 could mean a door. The state of the door, locked, etc. could also be determined.
I spent some time in the 80’s developing this on a BBC computer so I know it works. I also spent far too much time looking for the deepest hole instead of developing the program. More details.
Example Two: Space, a Completely New Frontier
Consider the 3D grid described above. If a location had a pseudo random number of less then 0.000001 (one in a million) then it contains a solar system. This would still leave 79,228,162,514,264,337,593,543 stars to explore. The pseudo random number could also be used to determine the properties of the solar system, number and type of planets, their position, … Make this program communicate over the internet and we all can become galactic emperors. More details.
Example Three: A Test Bed
Consider a railway system mapped on to two dimensions of a grid. Each significant part of the rail system (points, signal, station), would have its own location. The third dimension could then be used to generate random events like a single failures. The main advantage of this is that user could move up and down the third dimension and the same random events would always occur in the same order.
If anyone uses these ideas I would be every upset if I did not get an acknowledgement, although being British I would not make a fuss. More Details.
A few demonstrations to illustrate what I am talking about.
Comments greatly appreciated.
Lastly a links page (remember when every one had these).
79228162514264337593543950336 18446744073709551616 4294967296 maze infinite infinite maze infinite maze game many labyrinth infinite labyrinth infinite labyrinth locations vast locations pseudo random number generator.