Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Theory of Everything Simulation  (Read 963 times)

Vactor

  • Bay Watcher
  • ^^ DF 1.0 ^^
    • View Profile
Theory of Everything Simulation
« on: October 21, 2011, 10:05:16 pm »

I'm unlikely to be able to find time to do any programming any time soon, due to a new job and an upcoming wedding, but I have been contemplating a large system challenge.

Namely, how to generate a broad spectrum sandbox arena, that is manipulable at various scales.

The example of this that I contemplate is the generation and simulation of a solar system that works on the interplanetary level, but is also manipulable on the human level, and potentially smaller levels.

Solving this challenge would in my mind include beginning with the formation of a solar system from gasses, and extending to the point where a user could dig a hole in the surface of a planet and have a material that reflects the composition of the material that would be present at that place in the system, and for the absence of the removed material to create a hole on the planet.  I would want to be able to have solids, liquids and gasses that because of their inherent properties create land, seas, and atmospheres. This could be extended to include rudimentary tectonic and erosion cycles.

It seems to me the first step is implementing a system of elements, perhaps an abridged periodic table, or a fictional set.

With that in place I see this being solved by using floating points of "Pseudo-Atoms" that work like fat globules.  A homogeneous mass of a single element would be grouped into one floating point that tracks the mass, which defines it's diameter, as well as vector and spin.  This would allow you to have, for instance an Iron core to your planet that can be tracked as a single point, rather than having to calculate all of the component pieces of iron.

This would of course give an appearance of a bubbly foam to the surface of any object if you drew a surface at each atom's diameter, but a skin could be applied to surfaces to resolve that, and ease up the computational work needed to draw spheres.  Some form of stabilization could be used to know when a collection of atoms do not need to be checked.

What I like about a system based on this is that it lays the groundwork for having some form of working chemistry within the same system that provides day night cycles, and world ending meteor strikes, all functioning off the same system.

This could become a very processor intensive simulation, dependent on the resolution used, but I'd be interested in discussing the potential that a system like this has, and what some of the biggest challenges would be. 
Logged
Wreck of Theseus: My 2D Roguelite Mech Platformer
http://www.bay12forums.com/smf/index.php?topic=141525.0

My AT-ST spore creature http://www.youtube.com/watch?v=0btwvL9CNlA

Virex

  • Bay Watcher
  • Subjects interest attracted. Annalyses pending...
    • View Profile
Re: Theory of Everything Simulation
« Reply #1 on: October 22, 2011, 08:25:43 am »

The biggest problem here is the lifetime of a human. To do a little calculation, the mass of the solar system is about 1030 kg. Assuming for the moment that the average weight of an atom is about 2 u (it's probably less, there is a LOT of hydrogen in the solar system), which is roughly 3 * 10-27 kg, you're looking at an approximate 1057 atoms to track. Now, from my own experience with molecular simulations, simulating 500 molecules takes about 5 minutes per picosecond on a decent computer core (the kind used as the central computing cluster for my university's chemistry department). If you neglect long-range interactions, gravity and magnetism, the growth rate is roughly linear so you're looking at a simulation rate of 1055 minutes per picosecond, or 1076 minutes per year. A human life lasts for about 4.2 * 107 minutes. To perform a simulation of about a year in a human lifetime, we would need to increase the lifetime of a human by roughly a factor 1070, give or take a few billion.


However, that is a simulation using only molecular dynamics. Imposing gravity upon that would have a negligible effect. However, the nuclear fusion occurring within the star and the effects of magnetism are long-range quantum mechanics events, which first of all require quantum mechanical computations and secondly, they grow exponentially with the amount of atoms instead of linearely. I cannot make a good estimation for them, but you could easely be looking at an additional factor of 1010 to 1020 that has to be added to the final value I calculated.
« Last Edit: October 22, 2011, 08:29:27 am by Virex »
Logged

Vactor

  • Bay Watcher
  • ^^ DF 1.0 ^^
    • View Profile
Re: Theory of Everything Simulation
« Reply #2 on: October 22, 2011, 08:49:21 am »

The Title may be a bit misleading, My goal is to work around the massive amounts of calculations necessary for a 1:1 atomic simulation of the solar system, by decreasing unnecessary resolution and abstracting away redundant data to the point where you have a working system that can still be run at a reasonable rate.  The idea would be to have resolution increased only when it is needed in specific locations.

An example would be working with a system where an "atom" is a 50 mile diameter glob of material, calculated in 1 hour increments
Logged
Wreck of Theseus: My 2D Roguelite Mech Platformer
http://www.bay12forums.com/smf/index.php?topic=141525.0

My AT-ST spore creature http://www.youtube.com/watch?v=0btwvL9CNlA

LordBucket

  • Bay Watcher
    • View Profile
Re: Theory of Everything Simulation
« Reply #3 on: October 23, 2011, 02:26:48 pm »

manipulable at various scales

I think this is the key to doing this. There's no need to be tracking individual atoms when the player is focused on a larger scale. By all means, allow the player to zoom in to a molecular scale to add, remove and recombine elements, but the purpose of this level of zoom would primarily be to allow the player to determine what's available at larger scales.

Allow a player to view and modify the composition of each celestial object broadly. For example, player clicks on a cloud in space and sees that it has a certain mass and volume and it contains 60% hydroygen and 40% helium. So, the player chooses to add a significant volume of water vapor. So it's now 54% hydrogen, 36% helium and 10% water vapor. Next he adds a large mass of sodium aluminosilicates, and his cloud has become a planet.

The player can continue at the molecular scale, adding and removing materials as he pleases, or he can zoom out to the planetary scale where he can alter terrain. At this scale, he's primarily creating land masses. Adjusting elevation, adding or rearranging liquids, etc. To change the basic composition of the object he has to zoom back in to the molecular level. Or he can zoom out to the interplanetary scale where he can add or remove planets. Etc.

Which each change your program examines the various materials of each state within the object, compares to local stellar radiation and comes up with numbers for temperature density. If he creates a sufficiently hot sun nearby, that sodium aluminosilicate planet he made with a hydrogen-helium-water vapor atmosphere might heat up and become a ball of silicon with an aluminum ocean and a sodium-hydrogen-helium-water vapor atmosphere.

Quote
work around the massive amounts of calculations necessary for a 1:1 atomic simulation of the solar system, by decreasing unnecessary resolution and abstracting away redundant data to the point

Abstract away all materials for each celestial object to simple mass, temperature and density measurements for each of its solid, liquid and gaseous portions. A player might want to alter what materials are or are not present and adjust percentages. And a player might want to rearrange terrain, alter elevation, create mountains and lakes, etc. But within any particular object a player is unlikely to care if that mountain over there is made of AlSi3O8 and the mountain to its left is made of NaAlSi3O8.

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: Theory of Everything Simulation
« Reply #4 on: October 24, 2011, 04:47:27 am »

Hey, I'm already doing that! ;)

Problems: How do you get a planet from a discus of gas? Or even something resembling earth? Or even something that can sustain life? Can your elements and their corresponding rules of physics create life or even a stable universe?
And "trying parameters out" isn't going to work very well, I think. There's so many of them...

So my solution is to take the human standard as a vantage point, and to move up and down from there. So there's a world, with human-sized stuff, and from there I go up and down, depending on how far you zoom in or out, using procedural techniques unique to the subject. So I will be defining "tree" and maybe some sub-species of "tree", but the actual species are calculated. I will be defining a "planet" and even some terrain properties like DF does, but the actual terrain will be calculated, I'll define "quadruped" and "mammal" and even "canine" properties, but the actual dog species properties will be calculated. From there, I'd be able to zoom in to a single hair in the fur of my imaginary dog. I'm unsure if I want to go further than that, though.

It's hard to do stuff procedurally, and still end up with something recognisable for humans.

Oh, and congrats on the wedding :)
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

DrPoo

  • Bay Watcher
  • In Russia Putin strikes meteor
    • View Profile
Re: Theory of Everything Simulation
« Reply #5 on: December 14, 2011, 03:55:45 am »

I posted a thread about that before, its apparently impossible.
I have tried, dont try because you reach anywhere with it.
Logged
Would the owner of an ounce of dignity please contact the mall security?

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: Theory of Everything Simulation
« Reply #6 on: December 15, 2011, 05:36:03 am »

I had similar but different idea. It's based on precomputing. First you define few "atoms" (in a sense they can't be split) and forces then some magic (a lot of simulation) happens and program indentifies reactions, stable systems, unstable systems. E.g. define proton and electron and after some simulations it should find they are a stable system. Then next scale point would be interaction of those systems (forming chemical reactions). And finally celestial mechanics - using first step's output (including energy calculations) would be used for star fusion (or something else) reactions, some sort of abstracted aggregation simulation (been working on those some time ago) to form new object and so on. The most interesting idea for me is not simulating real world, but making what-if worlds. E.g. what if all things are connected with magical force (very small, but with logarithmic decay) and repulsed by so other force(huge but exponental decay).
Logged