Improbable Icon

Absolutely new to Spatialos! Some questions


#1

Hello,
I I’m looking into SOS for about 12 hours now so I am absolutely beginners
I would happy if someone can explain me how server side logic is handled an SOS I have worked with frameworks like Photon and Darkrift in these handled through plugins which we code in C sharp for example login and npc spawn and everything is calculated on the server side and then it is sent to the client when client login we make plugin for each of them
How we code those things on the server side for SOS


#3

Hello @Deepankar,

Welcome to SpatialOS and to our forums, love to see you so excited to get started! The best way to get going, and to understand in what way SpatialOS differs from the other frameworks you mention, is to start having a look at the documentation that explains all the high-level concepts that are involved.

Once you have read through those pages and to get a more hands-on experience you should take on the Pirates tutorial as it shows you all the important concepts that you have just read about in the docs, and how they can be used to create your game.

Those two steps should give you enough information to get started with the first steps for your own project. Be aware though that we are still in beta status so there is a lot of changing and breaking going on between the releases of our SDK.

If more technical questions arise while you work on your project (and they likely will because of the beta status) there are plenty of other devs and people from Improbable here that will be more than happy to answer them and share their own experience with you.

Best regards,
Duco


#4

As my project in on 2017.1 and while install of setup it gave error that 2017.1 is not supported yet need to use 5.6 so I will wait before going practical and keep digging through docs till then
I don’t think I saw it… Anyway
Does pirates tutorials also contains example of MySQL DB connection?


#5

The Pirates tutorial does not contain anything related to that and in my opinion you should hold off on going that far before you have started to understand how SpatialOS works and what kind of features it offers.

To be clear: nothing withholds you from making a MySQL DB connection from one of your workers, but SpatialOS will be completely unaware of that anyway. If there is any kind of specific game logic that needs to be triggered on DB updates, etc. or vice-versa than that is entirely up to you to implement that.

Usually the best question to ask yourself at this point is: what are you trying to achieve? And then, once you have read the docs, you can see whether you still need your MySQL DB to get to your goal or if SpatialOS offers enough out-of-the-box.

Best regards,
Duco


#6

@Deepankar, for what it’s worth, I’m using 2017.1 and despite the warning, everything works fine for me.

@dvanamst, so that I don’t start another topic exactly like this one, I have some really stupid questions that I’d appreciate some information about (before I go off and make a test project):

  1. Am I correct in thinking that the physics engine is provided by Unity or Unreal (depending on the project), meaning I’d have to do my own solution if using the C++ SDK?

  2. Are the physics deterministic? After a wall explodes, will both players see the same layout automagically, or will I have to make each segment an entity and replicate it?

  3. If I have a wall built out of blocks and it crosses server boundaries, how are the rigid body interactions handled across those boundaries? (I’m wondering if the wall would collapse across the boundary in the case where the two areas can’t interact with the bits that overlap).

Thanks!


#7

Hey @NoshBar,

To answer your questions:

  1. The physics engine is the one you choose. If your project is in Unity you will very likely go with their physics engine. Likewise for Unreal. But nothing theoretically stops you from mixing them up. Nothing stops you either from choosing yet a completely different engine of your own liking (or making). The one thing underlying that is really important to understand here is that SpatialOS is not a game or physics engine, but rather a platform to make many different pieces of software (rendering engine, physics engine, AI logic, …) work and scale together to simulate worlds way beyond what you can achieve with other existing tools.

  2. Physics are deterministic if the engine is deterministic and the involved physical elements are always simulated by the same physics worker. Once you start using multiple physics (engine) workers, which is kind-of the point of SpatialOS, everything becomes indeterministic. So you should really never rely on the assumption of things being deterministic. However this only addresses the deterministic character of what happens when rerunning the same scenario multiple times (i.e outcomes might differ).

    In your case what you wonder about is if multiple clients / workers that observe the same run of a scenario will see the same thing; and yes they will (with caveats). As long as the elements that they observe are each represented by a SpatialOS entity then they will see the same outcome: this is because only one worker (i.e the authoritative physics worker) will be able to update the entity’s state (e.g position, orientation, …) which is then shared among the observers via state updates. On the other hand, if something is for example only a graphical animation without a physical presence or backing entity, then each observer will probably see its own version of it.

  3. The wall can definitely collapse across worker boundaries although our load-balancing will probably try to assign the whole wall to a single worker for better performance. But even if it crosses a worker boundary then it should still behave as expected.

Hope this helps!

Best regards,
Duco


#8

Absolutely awesome feedback, everything I wanted to know.
Thank you kindly.