8 years ago

Can a game recreate the universe we live in?


Hi there, I’m Jack Le Hamster. It’s not my actual name, but it’s something I chose for some obscure reason and now that it stuck with me, I do consider that name as mine.

But let’s go back to the past, when I wasn’t yet Jack Le Hamster (not even a game developer).

As a kid, the computer was really just my platform to play games and do art. I did some programming with BASIC, but it was really in college that computer engineering became something serious for me. I remember staying up from night until morning several times, trying to solve computer problems that were not solvable or at least, have never been solved before (I’m talking about NP complete problems, like the travelling salesman or minesweeper). Back then, I was ignorant enough to believe that I could be the genius that solved a problem that generations of computer scientists have never been able to solve, so that’s what I did on a computer: Trying to solve those impossible problems, failing, and believing that I actually succeeded because my code was full of bugs that gave me false positive (perhaps I was a bit dellusional as well).

I’ve lost some of that. I am now much more practical. I take on projects that feel doable. On the upside, I do finish projects that I start. Some projects might look too ambitious at the start, so I dumb them down and still complete them. That’s a good thing.

But I have lost the ambition to try to solve the impossible. I’m starting to come to that realization, and that is why tonight, I am writing this article. Like before, I want to work on an impossible problem: Create a game that replicate our entire universe.
And I’m going to show you my plan.

Let’s start by the actual goal. What does it mean to create a game that replicate our universe? Am I just going to build the matrix all by myself? Well if I lived infinitely, perhaps I could, but it’s not my goal here. I just want to conceptualize how it is possible.
After watching an interesting but deeply confusing video on YouTube called “How to count past infinity” by VSauce, I came to an interesting realization about mathematics. Math allows us to conceptualize, imagine, things that don’t actual exist in our universe. The video talks about infinity, and I guess we can say our universe is infinite. But how is that possible? Infinity is not supposed to end, and when we think about the physical world, it doesn’t make sense. What is beyond infinity?

Let’s stop with this before I start to confuse you, or myself. Getting back to the topic. I had, at some point, imagined that it would be possible to create a game world that has no boundaries. No matter how much time you spent on it, you would never be explore every pieces of it. A bit like our universe.
I sometimes do try to work on creating that game, but then I think back about how crazy that idea would be. What if instead, just like mathematicians, I imagined, conceptualize, and define the way to create it. What if I simply showed that it is actual possible. Even if such game might never exist, it would seriously raise interesting philosophical questions, like whether or not we could currently live in such a game…

So how do we create that world. Right now, we know that it is possible to create a finite world. A room filled with physical rules like gravity, collision, ect… The step to reach an infinite number of room is not so difficult. It is called Procedure Generation.
By simply rearranging the elements in a room using a randomization formula, you can just recreate new rooms. This is not a new concept, it has existed for years in video games.

That doesn’t exactly define the world we live in though. If I go from one room to the next, and back to the previous room, I expect that room to look pretty much the same way I left it. If I come back the next day, I expect that perhaps things could have been moved around, if another person came in and moved a chair or something. If I come back several years later, I expect things to look dramatically different.

If this was a video game, what would be the challenges? First of all, we have to remember every aspect of a room, turn it into data and store it. Storage doesn’t come in abundance, and eventually the game would run out of memory, just like the computer runs out of space if we start dumping in more music.
Here is the thought though. What if we used procedure generation to recreate the room at runtime, as soon as a player enters it. That would solve the storage problem, since we don’t have to remember the room, but then the room would just look random every time and wouldn’t make sense in this world.
However, what if the procedure generation always reproduced the same setup for a particular room. It is actually possible to have a series of random numbers be based on a particular location. We call that a random seed. Each number in a series is created via a mathematical formula that seems random but will always return the exact same series, provided that we started with the exact same number (the seed).
Using this method, we can have a room always look the same, even if we travel several kilometers away and come back, even though we never stored any data about the room aside from its location.

Inside the video game, it could look something like this:
Room [0,0] => [ chair, table, empty, chair ]
Room [0,1] => [ table, table, empty, empty ]
Room [1,0] => [ empty, empty, chair, chair ]

And we can do this infinitely. The setup of Room [0,0] is generated based on the only information we have about the room (That it is at 0,0).
We don’t even have to store 0,0. We just know that 0,0 exists.

You might tell me, but what if there’s no room at [0,0]. Well in that case, the randomization would still take care of it. We can procedurely generate the fact that something exists or does not exist at a particular location. [0,0] could mean there’s a room, or a tree, or desert, depending on what the generation formula gives us.

Now that’s all good and dandy, but that’s still not how the real world works. We can move and rearrange things around. What if you decide to put three chairs on top of each other. You would expect the chairs to remain the same if you live the room and come back. In that case, we have no choice but to store data (that there’s chair A on top of chair B on top of chair C). And we run into the problem of limited memory again.
But how long do we have to store that memory? As I mentionned before, it is always possible that the chairs could have been moved around if you came back the next day, because someone else could have come into the room, and decide to rearrange the chairs differently.

Does it make sense though? You rearrange objects, and it stays like that for a while, but no matter what you do, the next day it would come back to the original position (that’d be very creepy).
In fact, unless you lived alone on this planet, you wouldn’t expect anything to remain the same at all. How can we reflect that in a video game?

Again, procedure generation can solve this, if it is based on time. If I just add one more variable T to the room, we can have something like this:
Room [0,0,day1] => [ chair, table, empty, chair ]
Room [0,0,day2] => [ chair, empty, table, chair ]
Room [0,0,day3] => [ chair, empty, table, chair ]
Room [0,0,day4] => [ empty, table, chair, table ]

Note that we can decide whether changes are large or small. If this was the company where you work, would you find it strange that the layout sometimes changes, sometimes not, depending on the day? Probably not, because that’s really just what’s happening in real life.

It does raise an interesting fact about life though. If we truly don’t store any kind of information forever, it means that no matter what you do, the world will rearrange itself the way it’s programmed to do. Even if you took out all the chairs and tables from Room [0,0] on day1, after some time has ellapsed (when we cannot afford to store the data any longer), perhaps on day100, the arrangement would come back to the way it was programmed to be. This means that in the long run, your actions have no effect on the world whatsover. I find it to be actually true for the real world to a certain extent. In a million years, there will be little to no trace of your existence on this earth. Your effect on this world would no longer be significant, and therefore, would not need to be stored.

So this seems like a simple idea, but it wouldn’t come close to make a world as interesting as the universe. The world is hardly composed of just furnitures in a room. There are plants that grow, animals, people.
Could procedure generation still work on people?
Well, if we can procedurely generate room rearrangements, why not use the same technique to generate entire lives?
Let’s see:
[Martha, day1] => [ go to Room[0,0], go to Room[3,0], go home ]
[Martha, day2] => [ go to Room[1,0], go to Room[3,0], go to Room[0,0], go home ]

But then do we need to store one seed per people. Well let’s say that each person in the current world was assigned a number from 1 to 7 billions. We don’t actually have to store all 7 billion numbers, we just have to know that they exist.
In fact, all we would need to do is come up with a formula that provides us with a set of numbers, defining the people that we would encounter on a daily basis. Then using each person’s number as the seed, we would procedurely generate what happens to them throughout the whole day.

Now here comes another problem. You do affect people.
If you tell someone your name, you expect that person to remember it and repeat it to you the next time you meet them. In which case, you would need to store all that data.
Now is that really a problem?
Like everything in life, we know that people don’t live forever, and at some point, when the person dies, all the information would be discarded. So the storage is only temporary. Eventually, all information about that person can be discarded. The only thing that remains is the number, but that doesn’t even need to be stored. All we know is that a number, representing a person, existed at some point in time.
Would we run out of number eventually?
Well, perhaps if we only used one integer to define each person we could, but the seed doesn’t have to be just one number. If we simply combine the exact location and time a person was born, we can ensure that the combination is unique for every person that ever existed on this earth.

At this point, it is still hard to conceive a video game world that would feel as real as the universe we live in, but we seem to have solved some critical issues about the storage of information: Only some temporary information needs to be stored, which can be dissipated over time.

While the amount of information that needs to be stored is not infinite, it still does seem huge, given how many objects we rearrange during the day, and how many people we affect by telling them our name. But is it really that huge? How much do we really affect people in this world?

  • Perhaps we are massively changing this world, by causing a ripple effect that starts by our small actions and gets propagated endlessly.

  • Or perhaps the world is just flowing on its own, our actions have little effect and we have the illusion that we are causing a great impact, while in fact, the world is just taking us through its own flow, just so that it doesn’t have to store too much data.

Wait… now this whole video game idea still sounds impossible. There are too many parameters that affect each other. One person moves a chair, another person moves it back. This needs to be replicated over millions of people and the amount of storage would simply explode!
But what if the game is simply single player?
You could ask: “Then how does it even replicate real life?”

What if real life… was single player?

In fact, let’s imagine for a second that the game was actually created, and that you started playing it. Would it be a big problem to store only the data for your player? After all, the amount of data that currently stores the internet is largely enough to save all the information that you pass into this game I created.
You would think that I don’t have the money and resource to have the entire internet all by myself, just for my stupid game… right?
But think about it… If you really were the only person on this Earth, then yeah… all the resource required to store the entire internet, can be simply devoted to the game that you are playing.

I guess this is an interesting though experiment. Basically what I’m saying is that IF the world was a single player simulation of some sort, then recreating a game to simulate that world would actually be quite possible.

… Now I know that I do exist. So perhaps, does it mean that nobody else exist?
… Or am I lying when I say that I exist, when in fact, the only person that exists, is you.

There are things in life that you would think are impossible to replicate in the game. What if you decided specifically to spend the entire game with one person, pouring all your information on them. (Your soulmate perhaps). It seems like the amount of stored data required for the game to make sense would surely be enormous.

Now what if I simply told you… well it’s not a single player game. It’s a two player game.

It seems now that I’m just making up rules as we go… Actually, if I’m starting to not make much sense, it’s because this is around 4am in the morning, I’m not really trying to prove anything, I’m just rambling as I go, spending the whole night writing an article about how to create a game that’s impossible to create.

Kinda like what I used when I was younger.
And I have to admit, I kinda like it.



24 comments

Loading...

Next up

How Animation Can Save You from Programming Sometimes, you can put more focus on animation to lighten the load on programming.

Get ready for World of Turtle releasing soon on Steam:

https://store.steampowered.com/app/2258040/World_of_Turtle

You can start with playing the demo on GameJolt: https://gamejolt.com/games/world-of-turtle/770029

Break the Curse of Making Multiplayer Games Why is it so difficult to make an indie multiplayer game?

#AwesomeMusicJam: a jam that loves music Collaborate as a team of developers, artists, writers and composers to produce a game with awesome music!

That time I chose to leave my gamedev passion on the side of the road A story about my love and hate relationship with game programming

There are only 100 of us in this world

O merciless overlords A poetic look at gaming

Today I was setting up the location of the first boss. His name is "Father" and he is the first of the Patagonians. His task is to guard the road to the House.🛡🗡 Bookmark pre-launch page🔖🔖🔖

https://www.kickstarter.com/projects/rdvindiegame/the-patagonian…

What do you think guys in my robot?Just a beginner in 3d modeling..

My instagram https://www.instagram.com/rojhonbb/