Representing real resources in a virtual world

In a virtual world with self replicating or easily constructible complex objects, there is a certain conflict of resource usage between the virtual world and the real world. Something that is easy and cheap to construct in the simulated world can bring the real world computer system simulating it to a crawl.

A way to restrict unlimited growth is to introduce environmental resistance in the virtual world. For example, building things could require resources, and running them could require energy, both of which could be in limited supply.

However, if a reasonable approximation of the real world is simulated, the resources and energy requirements will be quite hard to balance so that the simulating computer is not either overburdened or clearly underused.

A solution to this could be to introduce tokens in the virtual world that correspond to real world constraints and resources. For example, to construct a new object would require an object token, which approximately represents the amount of memory used by one object, and the amount of processor power required to simulate its interaction with the environment. To run some scripts / AI routines in the virtual world would require a token that represents the approximate CPU time used by a script (loops and recursion would be either disabled, or done on subsequent execution callbacks, to keep the CPU usage of a single script each world update more or less constant).

The tokens would be initially placed in a free pool. To create a new object / script in the simulated world, free tokens would be needed. Tokens could be requested from the pool and divided randomly between the requesters (or just dropped into random places in the simulated world). Tokens could also be exchanged between objects within the simulated world (for example by destroying an object and taking its tokens, or trading tokens for virtual money, depending on the type of simulation).

The object and CPU tokens could either completely replace other simulated resources (for a Tierra style abstract simulation), or used together with, or embedded in, conventional resources in more complex simulations (e.g. require lumber, metal, and an entity-crystal to craft an item in a fantasy themed gameworld).

The total amount of tokens in the simulation could be kept constant, or the amount adjusted based on memory and CPU load by adding or removing tokens from the free pool.