<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.gmail-
        {mso-style-name:gmail-;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FR" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US">In a somewhat related topic (large-scale discrete event simulation in Erlang) - and even it is a shameless plug, sorry
 for that - there is also Sim-Diasca (<a href="http://sim-diasca.com/">http://sim-diasca.com/</a>), a discrete event simulation engine released as free software. The goal is to perform the simulation of complex systems in a multi-agent way, with scalability
 in mind (thus in a parallel and distributed manner); of course simulation and game engines share quite a lot of architectural and software traits.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US">As for us, we used (and are still using) plain Erlang (not OTP, whether or not it is a good choice) and a lightweight
 layer above it to provide the object-oriented constructs we needed (multiple inheritance, polymorphism, etc.), on top of which the engine as such was built (to perform time synchronisation, support interactions and provide relevant properties like the respect
 of causality and reproducibility). <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US">In this setting each model instance is represented by exactly one Erlang process, and it proved to be quite scalable
 (of course synchronisation has a cost, and surely one shall not expect perfect speed-up with this kind of simulations). Back in 2010, we already exceeded 1 million interacting model instances in a single simulation (and the models involved were not specifically
 lightweight…). Recently this work received a bit of third-party positive feedback [1].
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US">So IMHO such use of Erlang seems to be a very good solution to cover the needs you mentioned (moreover using it for
 that did not inflict much headache). <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US">Hope this helps,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US">Olivier.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US">[1] http://sbrc2016.ufba.br/downloads/Salao_Ferramentas/154234.pdf<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Olivier Boudeville<br>
EDF R&D, Département SINETICS, Groupe ASICS, Bureau O2-E10<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D">7, Boulevard Gaspard Monge, 91120 Palaiseau, France<br>
<br>
Tél. : +33 (0)1 78 19 43 63<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Tél. mobile : +33 (0)6 16 83 37 22<br>
<br>
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">De :</span></b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif""> erlang-questions-bounces@erlang.org [mailto:erlang-questions-bounces@erlang.org]
<br>
<b>Envoyé :</b> mardi 20 septembre 2016 12:14<br>
<b>À :</b> mfidelman@meetinghouse.net<br>
<b>Cc :</b> erlang-questions@erlang.org<br>
<b>Objet :</b> Re: [erlang-questions] game engines?<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">2016-09-19 17:55 GMT+02:00 Miles Fidelman <<a href="mailto:mfidelman@meetinghouse.net" target="_blank">mfidelman@meetinghouse.net</a>><o:p></o:p></p>
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal">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.<o:p></o:p></p>
</div>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Back in the day, there was the Sim94 troop simulation project, which was pretty successful - and way before Erlang got multicore support:<br>
<a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.52.6023">http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.52.6023</a>
<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">This related master's thesis might also be of interest (oops, turns out I was the examiner):<br>
<a href="https://www.scribd.com/document/184935294/Design-Patterns-for-Simulations-in-Erlang">https://www.scribd.com/document/184935294/Design-Patterns-for-Simulations-in-Erlang</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">I also found this newer work while searching, but I haven't read it myself:<br>
<a href="https://www.researchgate.net/publication/233985869_Parallel_Discrete_Event_Simulation_with_Erlang">https://www.researchgate.net/publication/233985869_Parallel_Discrete_Event_Simulation_with_Erlang</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Finally, I found this, which made me double-check that I wasn't answering a post from 2012 :-)
<a href="http://erlang.org/pipermail/erlang-questions/2012-March/065136.html">http://erlang.org/pipermail/erlang-questions/2012-March/065136.html</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">    /Richard<o:p></o:p></p>
</div>
</div>
</div>
<p></p>

<p><br>
Ce message et toutes les pièces jointes (ci-après le 'Message') sont établis à l'intention exclusive des destinataires et les informations qui y figurent sont strictement confidentielles. Toute utilisation de ce Message non conforme à sa destination, toute diffusion ou toute publication totale ou partielle, est interdite sauf autorisation expresse.</p>

<p>Si vous n'êtes pas le destinataire de ce Message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez reçu ce Message par erreur, merci de le supprimer de votre système, ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support que ce soit. Nous vous remercions également d'en avertir immédiatement l'expéditeur par retour du message.</p>

<p>Il est impossible de garantir que les communications par messagerie électronique arrivent en temps utile, sont sécurisées ou dénuées de toute erreur ou virus.<br>
____________________________________________________</p>

<p>This message and any attachments (the 'Message') are intended solely for the addressees. The information contained in this Message is confidential. Any use of information contained in this Message not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval.</p>

<p>If you are not the addressee, you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return message.</p>

<p>E-mail communication cannot be guaranteed to be timely secure, error or virus-free.</p></body>
</html>