Super Regions and Expanded Simulation Time


This weekend I started adding super regions, which will are just regions that are composed of other regions, or subregions. This is in part needed to be able to partition the bigger biome regions into smaller sub-regions without erasing the original region altogether. This will also help in the future to build regions around entire subcontinents or continents.

A big problem reared its head while implementing super regions though. Because now regions and subregions can share cells, there's a big chance they could also end up sharing IDs, which is not good because IDs are supposed to be non-random, non-sequential, and  also unique. So, I started brainstorming for a better way to define region IDs that comply with all of those characteristics even two regions share the same "space". Although the solution I came with requires revamping the game's entire ID generation system...

One detail of the game that a few players have noticed is that it can only run a simulation for 9,223,372,036 days. which is roughly 25 million years. This seems like a huge number. But the game can easily reach that number in less than an hour if there's little activity in the world (a common occurrence on wasteland and desert worlds). And the whole reason that time limit exists is because the in-game entity database uses dates, along with IDs, to generate 64 bit database keys. I use 28 of those bits for IDs, which means I'm left with only 36 bits for dates. But the new mechanism I want to use to generate IDs would require me to use even more bits for them, and less bits for dates. Meaning I would be left with a way shorter maximum date span for simulating worlds.

To avoid this issue altogether, I'm modifying the database keys to use two 64 bit values instead of one. With one of those values being used exclusively for dates. This will push the simulation time limit to 9,223,372,036,854,775,807 days, or 2.5e+16 years. This is such a huge limit, I could even introduce evolution and plate tectonic mechanics into the game. Not that I'm planning to do so... but I could, if I wanted.

So, yeah. I dedicated part of my weekend to this database revamp just so that I can generate better IDs for regions. I plan to spend a couple of extra days on it, but no more than that.

Get Worlds - History Simulator

Comments

Log in with itch.io to leave a comment.

(+1)

25 million years is already the timescale of evolution and even plate tectonics.  If I got this right, the new limit of 25 quadrillion years would be about 2 million times the current age of our the universe, when all the stars have burned out and the planets stopped orbiting. Better get on that solar simulation!

(+1)

add plate tectonic to the game it would be awasome XD i actually learned this recently before my school closed so i know what it means

I take it you are no more than 14 years old, right? Sorry for asking this, but if you want, could you please tell me why you chose the current image as your avatar? I doubt that you have any idea of the structure to which this emblem belongs, and therefore it throws me into a stupor. Not that I have contracted the leftist tendencies of the West — I’m not writing because this is “unacceptable” —but out of curiosity.

men shill its just an image and i like the KGB theyre are one of the best intelligence agency in the world

Given what you said, a dubious statement. However, I learned what is required of you, thank you.