Algorithmic world building the Elite way 2005-03-09

Ever since I realised how Elite worked, the concept of using algorithms seeded by pseudo-random number generator have fascinated me.

In Elite, the whole "universe" was formed by seeding a simple pseudo random number generator with a fixed value and following fixed steps to generate "galaxies", and then seeding the same generator with a number chosen per planet to generate a sequence of values that made up the planets characteristics.

This approach is in direct opposition to the traditional idea of designing levels. However it also differs from a similar branch, of which one early example is Sim City where a basic map is generated based on a seed (possibly provided by the user) and where the same map can be regenerated by the same seed.

Where Elite and Sim City differ is that in Sim City the number generator is used to create the basic state of the game, and other algorithms are then used to mutate that state as time passes.

What really makes Elite different is that the universe is 100% built via the random number generator: The map can be derived from the generator algorithm and a seed. The planets characteristics can be derived from the planets seeds. The trading prices can be derived from the planets characteristics plus a "random" adjustment recalculated on each hyperspace jump. The presence of police and other ships is all entirely based on "random" numbers.

Nothing really changes, it's just randomly perturbed, and no state needs to be stored.

Long after Elite stops being appealing as a game, this idea very much remains a major contribution that few games take heed of today.

One of my dreams is to one day have the time and the cash to take this idea to its extreme: Due to limitations of the computers of its day, Elite made limited use of the algorithmic generation of its world. The planets had some descriptions and a technology level, for instance, but not much more.

It also stuck to just an algorithm that was made to look relatively random. However there is no reason to be limited to that. The main lesson of Elite is that a compelling game world can be created by hierarchically structuring algorithms that can a) be seeded by a value, and b) will generate the same sequence of values when given the same seed.

Another lesson can be drawn from Elite: The illusion of a dynamic universe can be achieved by perturbing the staticly generated values. In Elite the trading prices change. The changes are random. However there are still seeming logic to it, logic that's important to the game - planets with low technology levels have high prices on computers for instance. But this is all achieved by applying semi-random changes to data generated based on the planets techology level and seed.

However the prices will never keep diverging further from the static values

This can be taken further. Things like scripted storylines in games can be combined with seeming full freedom without forcing a gamers hand. Many scripted games will force the storyline through by making it impossible to deviate, creating what seems like arbitrary limitations that quickly make the game boring.

An alternative is to establish algorithms that set the parameters of the world where one of the argument to the algorithm is the time, but allow a "fudge factor". Say a war is ongoing between two factions, and one is meant to win for the story to move forward. If a gamer starts interfering, something needs to be done.

The "Elite-like" approach could be to apply random perturbations to the forces relative strengths and to political and economical events that could affect the outcome, but with the addition that the result from the number generator gets weighted more towards the opponent the more a gamer upsets the balance.

This DOES allow a player to upset the balance temporarily, but the longer and more the player interferes, the harder it will become by virtue of the weighting - suddenly the opponent will get reinforcement, nearby governments will get overthrown by movements supporting the opponent etc.

A lot of events that are NOT scripted may have to be generated "randomly", but due simply to the complexity of the scenario a "random" sequence of events will often be interpreted by humans as having more meaning than it does, and will seem more natural than a situation where one sides forces keep losing no matter what the relative strengths are to start with.

In other words: Script only what you absolutely need, leave the rest to a pure, side-effect free algorithm combined with random perturbations.

Incidentally this is what Elite does with its missions: Once you meet the criteria, only a few triggers are present to decide whether or not you get a mission and whether or not you meet the ships you're sent after - everything else is left to chance, and given your incomplete information it looks like you're on a search while you're aimlessly moving about waiting for the number generator to decide it's your time...

More later...

blog comments powered by Disqus