So this:

On Fri, Oct 7, 2016 at 11:28 AM, Steve Winfield <
[email protected]> wrote:

> I want everything to be synchronized
>

is something you basically have to give up -- global synchronization is
fundamentally contradictory to the Actors view of the world.  Mind, though,
it doesn't scale well in any architecture: this approach works for simple
single-player games, but when you're trying to build multi-player servers,
and especially multi-node (necessary for scale), you always want to have a
more nuanced approach.

There are ways to deal with this in an Actor architecture, but it's all
about slicing off responsibilities and ownership.  For example, for a
situation like this I would probably try using an Actor for each Player,
and an Actor for each moderate-sized spatial region.  (Probably not every
single possible step, but quite likely one per "room", or one per chunk of
the world divided up into an octtree or something like that.)  When the
player wants to move, the Player Actor sends an "I'd like to move to X"
message to the Space Actor responsible for that location, and the Space
returns either a "yes, go ahead, you now own that position" or "nope,
somebody's already there".

Something like that, anyway.  The key is that you have to stop thinking
about a single game loop, and instead consider the elements of the
simulated world, which Actors are the official source of truth for which
bits of information, and how they need to communicate in order to achieve a
reasonable simulation.

(Disclaimer: my game-coding experience is *way* in the past, if somewhat
relevant -- I wrote most of the peer-to-peer multi-player code for System
Shock II, way back when, long before Actors became mainstream.  So I'm
speaking somewhat hypothetically here.)

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to