Joachim Breiner, University of Pennsylvania, United States, gives the third presentation in the first panel, Art and Education, in the ICFP 2017 conference. Co-written by Chris Smith Google, USA.
Implementing multi-player networked games by broadcasting the player's input and letting each client calculate the game state -- a scheme known as lock-step simulation -- is an established technique. However, ensuring that every client in this scheme obtains a consistent state is infamously hard and in general requires great discipline from the game programmer. The thesis of this pearl is that in the realm of functional programming -- in particular with Haskell's purity and static pointers -- this hard problem becomes almost trivially easy.
We support this thesis by implementing lock-step simulation under very adverse conditions. We extended the educational programming environment CodeWorld, which is used to teach math and programming to middle school students, with the ability to create and run interactive, networked multi-user games. Despite providing a very abstract and high-level interface, and without requiring any discipline from the programmer, we can provide consistent lock-step simulation with client prediction.
Joachim Breiner, Chuo Kikuu cha Pennsylvania, Marekani, anatoa uwasilishaji wa tatu katika jopo la kwanza, Sanaa na Elimu, katika mkutano wa ICFP 2017. Chris Smith, Google, Marekani Utekelezaji wa michezo ya mtandao ya wachezaji wengi kwa kutangaza pembejeo ya mchezaji na kuruhusu kila mteja kuhesabu hali ya mchezo - mpango unaojulikana kama simulation ya hatua ya kufuli - ni mbinu iliyowekwa. Hata hivyo, kuhakikisha kwamba kila mteja katika mpango huu hupata hali thabiti ni infamously ngumu na kwa ujumla inahitaji nidhamu kubwa kutoka programu ya mchezo. Nadharia ya lulu hii ni kwamba katika ulimwengu wa programu ya kazi - hasa na usafi wa Haskell na pointer static - tatizo hili ngumu inakuwa karibu trivially rahisi. Sisi kusaidia thesis hii kwa kutekeleza lock-hatua simulation chini ya hali mbaya sana. CodeWorld ni mfumo wa programu ya elimu ambayo hutumiwa kufundisha hesabu na programu kwa wanafunzi wa shule ya sekondari, na uwezo wa kuunda na kuendesha michezo ya maingiliano ya watumiaji wengi. Licha ya kutoa interface sana abstract na ngazi ya juu, na bila kuhitaji nidhamu yoyote kutoka programu, tunaweza kutoa thabiti lock-hatua simulation na mteja utabiri.