<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Thanks to all for your responses.</p>
<p>Re. a couple of points here, might I ask a few follow-up
questions:<br>
</p>
<p><br>
</p>
<p>On 9/18/16 1:37 PM, Lutz Behnke wrote:<br>
</p>
<blockquote
cite="mid:740e5ed0-7c20-ec9e-6c1e-8e13e30d9bbc@informatik.haw-hamburg.de"
type="cite">Hello,
<br>
<br>
assigning each object in the game gets difficult for a number of
reasons, when trying to do this for an MMO, especially MMORPGs
(characterized by a very large number of objects, and active
entities):
<br>
<br>
You waste resources (CPU, RAM) when an object is currently not
being referenced by an active entity (e.g. a client connection,
thus and avatar or alternatively a Mob/NPC), since there is no
other process that will send any messages.
<br>
</blockquote>
<br>
Well yes, but is that not where Erlang shines - being able to
maintain huge numbers of processes (or, in this case, little state
machines)?<br>
<br>
<blockquote
cite="mid:740e5ed0-7c20-ec9e-6c1e-8e13e30d9bbc@informatik.haw-hamburg.de"
type="cite">
<br>
More importantly, should you scale your engine to multiple hosts,
you either have to enforce a single process, requiring all updates
and query messages to be routed to this proc. Or you will have to
build some master/slave or peer to peer logic, which will ensure
consistency in the face of CAP.
<br>
</blockquote>
<br>
I'm actually thinking about military simulation - where the model is
essentially:<br>
<br>
- every simulator (e.g., a flight sim, or a tank) is running on its
own machine, complete with local world model and image generation
(necessary to keep up with jitter-free image generation during
high-g turns - you don't want pilots to puke all over the
simulators)<br>
<br>
- there's a lot of dead reckoning going on locally - the only things
that cross the network are deltas and events, generally sent by
multicast<br>
<br>
- everything is synchronized by GPS time-stamp<br>
<br>
I discovered Erlang when I realized that we (the company I worked
for) took a very different approach for simulating "virtual forces"
(think non-player characters) - when we simulated 1000 tanks, on one
machine, each tank would be an object, and we had 4 threads winding
their way through every object, 20 time a second. Turns out that
the main loops are real spaghetti code that breaks every time a new
property gets added to an object.<br>
<br>
I started wondering why we didn't just have a process per simulated
object - essentially the way we treated the person-in-the-loop
simulators. The answer, of course, being context switching
overhead.<br>
<br>
Then, I discovered Erlang. And I started thinking - why not just
have a process per object.<br>
<br>
<blockquote
cite="mid:740e5ed0-7c20-ec9e-6c1e-8e13e30d9bbc@informatik.haw-hamburg.de"
type="cite">
<br>
Separating into a) the state of instances, which you can store in
a KV-store and have b) a pool of generic procs, that will process
the state with c) a set of modules that provides the logic for a
particular object allows to push the state to the appropriate
host. With a separate KV-store that can handle net-partition and
node failure, you gain even a good amount of fault-resilience.
<br>
<br>
Please excuse me beating my own drum, but I have implemented a
prototype of such an engine
(<a class="moz-txt-link-freetext" href="http://dl.acm.org/citation.cfm?id=2577389&CFID=787355984&CFTOKEN=91169762">http://dl.acm.org/citation.cfm?id=2577389&CFID=787355984&CFTOKEN=91169762</a>).
Unfortunately, for legal reason, I cannot make the code publicly
available yet.
<br>
</blockquote>
<br>
Any chance of arranging a copy that's not behind a paywall?<br>
<br>
<br>
Thanks,<br>
<br>
Miles<br>
<br>
<br>
<blockquote
cite="mid:740e5ed0-7c20-ec9e-6c1e-8e13e30d9bbc@informatik.haw-hamburg.de"
type="cite">
<br>
mfg lutz
<br>
<br>
Am 18.09.2016 um 04:11 schrieb Miles Fidelman:
<br>
<blockquote type="cite">Hi Folks,
<br>
<br>
I'm curious, has anybody written an Erlang-based game engine
that
<br>
implements a process per game entity?
<br>
<br>
I've been been finding various examples of Erlang being used to
manage
<br>
user sessions, and other aspects of MMORPGs - but nothing that
simply
<br>
does the obvious - treating each object, player, etc. as an
Erlang process.
<br>
<br>
Am I missing something?
<br>
<br>
Thanks,
<br>
<br>
Miles Fidelman
<br>
<br>
<br>
</blockquote>
<br>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
erlang-questions mailing list
<a class="moz-txt-link-abbreviated" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>
<a class="moz-txt-link-freetext" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
In theory, there is no difference between theory and practice.
In practice, there is. .... Yogi Berra</pre>
</body>
</html>