Improbable Icon

SpatialOS Discourse Forums

Open world space simulators and SpatialOS


We’ve been evaluating UnrealxSpatialOS for the solution to our networking problem in building a semi open world space simulator.

Our initial prototype is focused around group PVP encounters, and we have the mechanics pretty well worked out. SpatialOS to a degree seems to provide exactly what we need for the fights, but we’re struggling to imagine the architecture for the surrounding space.

Take for example - a solar system. There is a space station that many players visit. Elsewhere in the system there is a ship wreck that players may fight over. Somewhere in between is a wormhole that can be visited. These are all obvious instances.

In an open world scenario, the distances between them are small on the ground, but gigantic in space. These can obviously be scaled down and use some trickery to give the illusion of scale while travelling between, but for an open, persistent universe in-between the points of interest, I’m struggling to work out how to create that architecture using SpatialOS. We want players to be able to move in and out of these areas without obvious loading, and if the architecture permits, to be able to have encounters of their own by intercepting each other at random points in the surrounding space. The solar system itself will exist as a horizontal plane, with z-axis available to a limit, so this is just skyrim with much much larger areas of void between points of interest.

So aside from employing 1000 instances zoned up against each other which would obviously not be economically viable if some only have a player move through them once an hour, what other options to we have for creating such a network on SpatialOS?

I’ve had some experience with this, but not with SpatialOS. The principles are the same though. The basic issue is that space is huge. Even with a relatively small space, you quickly run into floating point precision issues. For example, we did a small demo of space centered on earth out to about geosynchronous orbit – a cube 90K kilometers on a side with earth at the center. This reduced our minimum unit distance to tens of meters. That’s not too bad if you’re dealing with space ships, but you won’t be able to do, say, facial expressions or explosions at specific locations.

One solution is to create a waypoint graph system with physical space only defined around certain points of interest (the nodes in a graph). Each area has its own origin point, so you don’t run into floating point problems. Each also has its own skybox, so there is a limit, but the players never see that. Between those space is faked, though you could if you wanted define and carry a local space around the player ships, so they could stop in the middle of space if they wanted and get out and look around. From their POV space would be entirely continuous, and you wouldn’t have separate zones or anything. All the players are still in the same world, but you’re not carrying the load for the 99% of it that’s just empty space. It’s not trivial to do, but it is doable.

Yep, this is exactly the issue.

I was exploring the options for carrying a bubble of space with the player, but was getting lost on the complexities of multiple other players converging on a non defined location. Again, not something that I can easily imagine using spatial. Anyone know of examples where this system has been successfully used?

EVE did it with procedural grid generation, but that caused all kinds of nightmares that the players ultimately ended up manipulating, and the universe is still sharded by location.

I haven’t seen this done in any system; those who have played with it have backed away slowly.

I think you could make this work by having each ship or POI have its own coordinate origin, and then translating between them as needed. That way you could combine any number of ships (etc) without running into precision issues. But this would not be trivial, and would eat up a lot of processing time in translating between local coordinate systems.

I can’t see trying this without a server system like SpatialOS, unless you went to something like 128-bit floats. That would mean redoing all the math libraries, etc., yourself, and even that might not be enough (I haven’t done the math for that).

That doesn’t seem like a viable option at this stage, in part due to the work load required to then rebuild the combat system on top.

As you identified, the frustrating challenge is just the incredible scale. SpatialOS’s layers, zoning and offloading precisely solve the problems of the world’s persistence between the encounters and points of interest. Unit distance is critical for the combat element, so scaling down too hard would disrupt the core mechanics (although that would still not get us anywhere near solar system scale).

I was contemplating the option to generate instances surrounding random point locations that a player was en route to and use the game world to generate the assets that should exist there. Other players would then be able to travel to that location and land in the same instance. The instance could be shut down upon the last player leaving. Travel could be faked to a degree, but there would still be the issue of interaction between players (Location scanning for example), and whether SpatialOS can deal with location separated instances or zones under a singular game world.

I thought of that too. The problem is if you have players strung together: A is within range of B to create or inhabit the same instance, but B is also in range of C, who isn’t in range of A. You get a “string of pearls” effect that would cause endless headaches. That’s why I was thinking of having each ship have its own local origin and translating between them. I haven’t prototyped this, but I think it’s doable in Unity given the way it handles transforms already. I don’t know about he CPU load though.

Good luck with this! I have a solar system-ish game in mind too. :wink:


Headaches is becoming the theme of space!

Having discussed this with a few other developer buddies, it’s starting to seem like many have tried to find solutions to some degree or another.

Does anyone from Improbable have any thoughts or wisdom to share about this?