Improbable Icon

General questions in regards to development

general

#1

Good evening all,

We have recently been asking a number of questions of Improbable to become more familiar with the product and how best to design/architect a solution for in our case a fantasy based MMORPG.

In talking with them they felt it was best to post some of the main questions here for discussion as well as letting them publicly post responses for everyone to view as some of these questions may be relevant to others starting out.

These questions were meant to try and get a better overall understanding of the spatial environment as we have been learning the system. Some may sound a bit naive but we felt important to get Improbable’s take on them

Would love others feedback as well.

Thanks,

Chris Eisnaugle
Coyote Black Studios, LLC

Questions:

  1. At the moment SpatialOS really views the world as one giant scene. While this can be great for above ground that is extremely large it can be problematic for dungeons and locked areas. We have our world mapped out and have been building assets with the assumption that some areas are not part of the main scene but are separate scenes. How can something like zoning into a dungeon be handled? I was reading in “Forsaken Legends” they were planning on instances, procedurally generated (Our world has no instances). Another example of the reason on how to handle this is alternate planes. We plan on having completely different planes of existence that you can visit. In our discussions your idea of placing prefabs that represent terrain/scenes within the large Spatial scene but separated enough from other areas to give the illusion they are not connected could work.

  2. We are thinking of moving from streaming terrain scenes like MapMagic generates to a voxel based landscape (similar to Voxel Farm does). This will alleviate some of the needs for separate scenes as we can build caves and such deep underground with appropriate occlusion. Since worlds like this are procedurally generated, how does this work in SpatialOS. Obviously the player only sees what is generated within their field of view, but how does SpatialOS handle the fact there could be 10’s of thousands of mobs and other players running around in other sections/tiles of the map? Independent of Voxel versus standard terrain, does every tile need to be pre-generated and loaded server side for all the path-finding and other things to work?

  3. When it comes to player data. We store player profiles in a SQL database at the moment, is this still the way in Spatial? I have noticed people referring to 3rd party products like Playfab for login scenes for example. I was also reading that SpatialOS has persistent state but cannot find documentation on this. What exactly is state in Spatial? We break up the world by what is active and playing versus what is stored (aka a player that has logged out is no longer in the game) where should all his info stored?

  4. In regards to things like Inventory, these inventories and their item information has to be stored somewhere when a character offline. Is this a SQL server as well or something like it, or is this state in Spatial? Items in an Inventory, are they entities or just represented information to display when a player is logged in?

  5. We also use some complex flag setup for inventory so we know what item fits in what slot etc. How complex can component definitions be? Can they handle bit flags?

  6. In regards to assets, I saw people stating that assets are streamed and others saying they don’t have to be. Obviously giant worlds with lots of assets would not easily be stream-able, could you provide a little information on streaming assets and why they would be used?

  7. In regards to schema items such as List and Map containers. If these containers are relatively large, 100+ items for example. When Spatial wants to sync data with the client is it smart enough to only send the changed elements, or does it always send the entire data set? (This could come into play with things like Inventory or values associated with how you look if using things like UMA or Morph3D)

  8. When setting up read access on the Unity client for component values, does it reads from the local copy. In the pirates demo for example there are constant checks for health. If this was sending a packet back to the server it would cause way to much bandwidth. So I assume it knows to read from the local copy that is synced with the server side?

  9. Are there any examples that use a larger world with for example a 5x5 or 10x10 set of tiles and how best to set something like this up. Obviously the Unity client would have to stream in data or know when to change scenes. On the Spatial side all these terrain zones if you like have to be pre-loaded I assume. An example of this would be fantastic.


#2

Hi @ceisnaugle,

lots of questions you have :slight_smile: I try to answer some of them:

For v8 there was a tutorial to integrate external data sources: https://spatialos.improbable.io/docs/reference/8.0/tutorials/mini-tutorials/external-data-source I haven’t found this for v9.
Persistent state means you should take snapshots regurarely and they contain all the spawned entities and their states.

As mentioned in 3. you can use a database or webservice or something like that. I think it might be possible to data in entities, but i don’t know if that makes sense. Depends on your application i would say. Inventory items are normally just information with links to prefabs.

You can implement your own EntityTemplateProvider and load the assets from local instead of streaming them.

There are no incremental changes right now :frowning:

You can work with the local copy, it is only synced to the backend if you manually send state updates.


#3

I’ll see If I can answer the others!

  1. This is a really good question! There are a few ways that we think you can do this sort of thing. It sounds like you’ve discussed it already, but we like the idea of having a “dungeon grid” area off in an inaccessible part of the world. When the player moves into a different plane, they are actually just teleporting to one of the dungeon grids. Parties could then teleport to the same grid, and others could teleport to other grids. You could create a fixed number when the world starts or create them on demand as players enter and leave. We’re working on adding better support for multiple scene loading unity, which should make this a lot easier.

  2. Again, great question. You don’t need to generate every tile beforehand, no, although you may want to. But the other way of doing it is by generating tiles wherever entities are currently located. You could have a process running on each worker that is given a seed for the world and then makes sure that for every entity it cares about, there is a suitable tile around it, with enough of a buffer to do pathfinding etc. You can choose if you want these tiles to be entities or not. If they don’t change at all (i.e. can be created deterministically at any time) then they don’t need to be entities at all - just as long as each worker has a consistent view.

  3. Spatial OS uses snapshots for persistence between deployments. There are some docs here: https://spatialos.improbable.io/docs/reference/9.0-alpha/tools/snapshots
    It’s also perfectly possible to connect to external databases for user data etc if you like - several games are already taking this approach.

  4. components use google protobuffs under the hood - and we support all the same things. https://spatialos.improbable.io/docs/reference/9.0-alpha/entities/schema/reference should give you all the details.

  5. We do, although it looks like it hasn’t been upgraded to SpatialOS 9 yet, it’s still on 8. You can take a look though, hopefully it will still be helpful. https://github.com/improbable-public/Procedural-Generation

Cheers,
Chris