Asynchronous Simulation - RyanBabij/WorldSim GitHub Wiki

Apparently it's not just a word I made up 5 minutes ago.

In order to simulate such a large amount of... world... I will need to make use of many different techniques. In addition to multi-threading and file swapping, I'll need to also develop algorithms which allow for asynchronous simulation of the world.

It is not possible to hold all of the world in memory at once, therefore local maps will need to be loaded into memory and then simulated for a certain duration, then unloaded, then another map must be loaded in and simulated. So what happens if an NPC moves from one tile to another? Special algorithms must be developed to handle this.

Multithreading

Multithreading will also be important. It is important to develop a multithreading plan soon in development. Fortunately the idea of swapping files in and out of memory should also work very well with multithreading. I won't need to multithread algorithms for individual maps, instead I can just simulate multiple local maps in their own threads.

Note: Perhaps adjacent tiles should not be simulated at the same time.