1. Universe Sandbox
  2. News

Universe Sandbox News

SPH Fluid Simulation | DevLog


Video: Simulating a planetary collision using a new method called smoothed-particle hydrodynamics (SPH).

Hopefully by now you’ve had time to check out Surface Grids & Lasers | Update 24 of Universe Sandbox. If you haven’t, time to get out from that rock you’ve been living under and start terraforming all those other rocks floating through space.

We plan to continue to add to the Surface Grids feature with even more detailed surface simulation through next year and beyond. Surface Grids is a massive new feature that changes a lot with the core simulation of objects in Universe Sandbox, and so far we’ve just scratched the surface of what it can do. We’re excited to explore its possibilities even more.

But right now, let’s turn our attention to something our physics developer, Alexander, has been working on. Introducing… smoothed-particle hydrodynamic fluid simulation. Let’s just call it SPH for now.

SPH is NOT included in Universe Sandbox yet. This is a behind-the-scenes look at a feature that we are still working on.

 
What is SPH and how does it work?

For a deep dive into the mechanics of SPH, check out this paper from our very own physics developer, written back in 2010 (interestingly, not written in relation to Universe Sandbox, but for another project that was similar in many ways -- there’s a reason why we hired him many years ago to help build this new version of Universe Sandbox, and it had more to do with relevant experience than it did with his propensity for typos… *wink*).

Or if you’re curious about SPH, but perhaps not curious enough to read 35 pages on it, here’s a crash course:

SPH is a computational method commonly used for modeling fluids (though it can also handle solids). That might make you think that we’d use this for simulating something like water flow on a planet’s surface, but “fluid” here actually has more to do with simulating much larger objects.

On an astronomical scale, many of the objects you can simulate, like stars and galaxies, behave like fluids. This is also true for planets, whether it’s a gas giant or a rocky planet with, or even without, a molten core. And even in the case of large chunks of solid rock colliding with each other, there is such intense temperature and pressure that the materials behave more like fluid rather than rigid solids: they’ll stretch and distort and be torn apart, rather than splinter, crack, and shatter.

So in short, SPH will help create more detailed, realistic simulations of collisions, fragmentation, and formation of different types of objects in Universe Sandbox.

How? First, the material, such as a planet, is broken into a number of “particles” that each have properties such as mass, temperature, velocity, and position. You can see these particles clearly in any of the videos in this post.

But the “smoothed” part of “smoothed-particle hydrodynamics” means that these particles are just sample points of what is actually a continuous material, where they each contribute to the properties at a given point based on a weighted, smoothed, average. Together, they describe the properties that exist at any given point in a flow of material, but they themselves are not the material. Think of it like buoys in an ocean: the buoys will each monitor the properties at their location, and they are distinct from the continuous fluid, ie the ocean, that they are monitoring. So for the future of SPH in Universe Sandbox, the current debugging visuals, where you can see individual particles, will ideally be replaced by something that better represents the continuous fluid that is actually being modeled.

By tracking how each of these particles move, and more importantly how they move in relation to their neighbors, you can calculate pressure and viscosity (friction) at any point in
the fluid. And then you can estimate how this will move over time under different forces. Combine this with gravity and you start to see a simulation with emergent behavior that matches what we observe in real life.

 
Why SPH?

Because you get accurate simulation with emergent behavior, rather than disparate modeling of phenomena that needs to be stitched together. For example, with SPH, material will collect under the influence of gravity, but it will not all fall to the center of mass. Instead, as more material collects, the pressure increases and starts pushing out material, preventing a total collapse. The result is a spherical shape, and not because we specifically told it to become a sphere, but because that’s what happens when you simulate physics on a more granular level.

Or look at the case of Roche fragmentation, where a moon may be torn apart from the gravity of its host object “pulling” more on its near side than its far side. In our current simulation, pre-SPH, where we model how single points of mass move purely under the influence of gravity, we need special handling to calculate when and how this should happen, according to analytical models. But with SPH, this phenomenon just happens as the result of forces acting on the moon.

Why SPH specifically and not another method? When simulating space, there is more literal space than there is simulated material. SPH is great for handling cases like this where material is sparse. Other methods instead require simulating each point of space, seeing how each of these points changes (versus tracking only points specifically in a material), which would be very slow for anything like entire star systems.

Universe Sandbox is a unique physics simulator because we aim to make it an accessible, real-time, interactive experience. When compared to non-real-time simulations run on supercomputers, this presents a lot of limitations, and SPH is not immune to these. The biggest issue we will need to navigate as we continue development is the resolution of the model -- to be really accurate and demonstrate smaller, local changes, you need a lot of sample points. But each point comes at the cost of a good chunk of computing power. So as with all features in Universe Sandbox, we’ll need to find a balance, with enough points to model things in interesting ways, but not so many that it becomes a slideshow.

 
So... what does it do?

Technical explanations are fun (...did I get that right?), but what you really want to know is what does this SPH thing mean for me and my planets? That’s also answered above: it will help create more detailed, realistic simulations of collisions, fragmentation, and formation of different types of objects in Universe Sandbox. But what you really, really want is a bunch of videos of this is in action. Understandable.

Quick disclaimer: SPH is a feature in its early stages of development. Visuals are for debugging purposes. Anything shown many not be representative of how it’ll appear and behave when included in an official Universe Sandbox update.


Two equal-sized bodies showing pulsating behavior as pressure and gravity tries to find a balance.


Two earths spinning the same direction and colliding. The result is a combined body with non-zero angular momentum from the individual momentums adding together in the same direction.


Increasing the density and speed of Mars before it impacts Earth and shoots right through it.


The existing simulation “Earth & Moon x25 Offset” showing all Earths collapsing and combining.


Results of the Moon fragmenting around Earth.

Want to see more? Check out the full video from our physics developer, Alexander, on YouTube

So in short, SPH will improve or make possible simulations of the following:

  • Total fragmentation
  • Tidal deformation and Roche fragmentation
  • Accretion disks / object formation from debris
  • Giant-impact hypothesis (moon formation!)

And in the longer term, we hope to apply it elsewhere, including more accurate galaxy collisions and star formation.

 
What’s Next

As you can see, SPH is already working pretty well within Universe Sandbox. But you can also see that it’s not exactly integrated with everything else yet. The visuals right now are intended solely for debugging purposes, and the transition from our standard planet visuals to the SPH particles is a little rough. Making visuals that look more like molten planets being torn apart will definitely take time, but we have some ideas in mind that we’re excited to explore.

The visuals are just one component of what we’ll need to work on to integrate SPH with Universe Sandbox. Making it work with other complex aspects of the simulation, like the new Surface Grids feature, will be its own can of worms. But we’re no strangers to technical challenges. And since we think SPH is worth experimenting with on its own, we hope to release an early version of it using the debug visuals and let you turn it on if you’re interested in checking it out. We don’t know when this will happen yet, but hopefully not too long into next year.

And hopefully before then, we’ll have a small update ready that will add some oft-requested color customization…



Surface Grids & Lasers | Update 24



Nov 27: Update 24.0.1 is a small patch that fixes surface simulation on Linux machines (and potentially some Macs) and adds a couple other minor fixes and improvements.

Dec 5: Update 24.0.2 is a small patch that improves lasers, including fixes to Gas Giant heating and lasers sometimes not working.

Surface Grids & Lasers are here! This is a big update that adds new layers to the simulation and new ways to experiment with planets, moons, and entire systems:

Simulate Surfaces
Surface Grids is a huge, complex feature that simulates the surfaces of planets, moons, and other objects. Every one of these objects now has simulated water levels, water and vapor flow, local temperature, material states like snow and ice, and more.

Vaporize Planets with a Giant Laser
Did we mention that there are lasers now? Whether you want to melt some ice caps or vaporize entire planets, the laser is the right tool for the job: Tools > Laser

More to Come
This is the first version of Surface Grids; we hope to release many improvements to surface simulation over the coming months.

Check out a full list of What's New in Update 24

Surface Grids & Lasers | DevLog #12


Video: Saving an object and its Surface Grids data then adding it to the simulation.

Surface Grids & Lasers are not yet available in any official Universe Sandbox releases. But they are now available in the experimental version of Universe Sandbox! Learn how to take an early look at Surface Grids & Lasers.

If you haven’t seen them yet, check out the previous Surface Grids DevLogs in our News. Keep in mind these DevLogs document a work-in-progress feature. Anything discussed or shown may not be representative of future versions of Surface Grids.

What is Surface Grids? It’s a big, complex feature still in development. It simulates the surfaces of planets, moons, and other objects, adding much more detailed, dynamic, and accurate visuals. And as a bonus, it makes it possible to add tools like lasers, which are essentially just a fun way of heating up localized areas of a surface.

Improving the Experiment

Since we released the first experimental version that included Surface Grids, we’ve released a few updates that have made a lot of improvements and bug fixes. Below are some highlights from the three major areas of the new Surface Grids feature: the interface, simulation, and visuals.
 
1. Interface improvements



• Better design for map interface
• New map legend

We moved around some buttons, turned others into drop-down menus, cleaned up some settings, and added a brand new color legend for all that wonderful data.


2. Simulation improvements

• Reimplemented tidal heating
• More stable heat diffusion (& new Thermal Diffusivity slider to adjust rate)
• Better water initialization for random planets
• Improved water flow

A lot of the individual simulation improvements, tweaks, and fixes can be harder to notice, because if everything’s working well, then they don’t draw much attention to themselves. Instead, they just work. But if you’ve been following along, hopefully you’ll notice that the surface simulation has been getting smoother and smoother.

 
3. Visual improvements



• Improved coastlines
• Improved lighting
• Improved terrain and vegetation rendering
• Improved visual noise (randomness) on ice edges
• Reduced texture seams
• Shallow water no longer fully opaque

Isn’t Earth looking georgeous? (...that’s what we call gorgeous things created by our graphics developer, Georg) On top of all of the visual beautification, which you can see with random planets as well, we’re pretty happy with how coastlines are now looking (these latest changes are not yet in the experimental build). They may not be as accurate as our real life home planet itself, but after lots and lots of tweaking and experimenting, we now have coastlines that are fairly accurate and work well with changing water levels.



Beyond the changes we’ve listed above, we’ve also added support for saving & loading objects, including retaining all of the Grids data (see video at top of post), performance improvements, and dozens of tweaks and bug fixes.

In the last update we also added a short, 15-second performance test that you’ll see pop up when you first run this version of the experimental build. Please run this test so we can learn more about how Surface Grids performs on different hardware!

If you want to stay up to date on the latest changes to the experimental version, join our Discord and check out the #experimental-build channel. We make announcements there whenever there’s an update.

 
What's Next


As we continue to update the experimental build, we get closer to the official release of Surface Grids. Like before, this part of development is about balancing our work between continuing with all the other improvements and fixes we’ve had in mind and addressing community feedback as more and more people check it out — please let us know what you think!

Above are screenshots of some of Brendan’s newly generated heightmaps (detailed in DevLog #10) partially implemented in-game. There’s still more work to do on these, but we should hopefully have them in an experimental build soon.

We also are working on a tutorial about terraforming Mars. We’ve seen multiple users point out that terraforming is a lot more complex now, and that’s certainly true. This is easily seen when attempting to terraform Mars, which, it turns out, is a bit more involved than just spraying some water at it. Figuring out how to do it is part of the fun, but there are some tips and tricks that are good to know.

We’re super excited with how Grids is shaping up, and we hope that if you’ve been following along, you can see all the progress we’ve made. We look forward to sharing more. See you in the next DevLog!

Saturn’s New Moons | Update 23.2



Introducing the new Moon Champion of the Solar System, with a total of 82 known moons, it’s the great ringed gas giant Saturn!

Take a tour through the discoveries of Saturn’s moons, from the first discovered moon, Titan, in 1655, to the latest discovery of 20 new moons in October 2019:

Home > Guides > Science > History of Saturn’s Moons

With 82 moons, Saturn now has the most known moons, surpassing the previous record holder Jupiter and its 79 known moons.

This update also includes a refresh of our database and Saturn simulations to add its new moons, plus a few smaller fixes and improvements.

Check out a full list of What's New in Update 23.2



We're still hard at work on the next big features, Surface Grids & Lasers. Interested in trying them out? Take a sneak peek!

Daily Deal - Universe Sandbox , 33% Off

Today's Deal: Save 33% on Universe Sandbox !*

Look for the deals each day on the front page of Steam. Or follow us on twitter or Facebook for instant notifications wherever you are!

*Offer ends Tuesday at 10AM Pacific Time