skip to main content
research-article
Open Access
Artifacts Available
Artifacts Evaluated & Functional

Lock-step simulation is child's play (experience report)

Published:29 August 2017Publication History
Skip Abstract Section

Abstract

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.

Skip Supplemental Material Section

Supplemental Material

References

  1. ECMA International. 2015. ECMAScript Language Specification (6th ed.). Geneva. http://www.ecma-international.org/ ecma-262/6.0/ECMA-262.pdfGoogle ScholarGoogle Scholar
  2. Elijah Emerson. 2009. How to make Box2D more deterministic? (2009). http://www.box2d.org/forum/viewtopic.php?t= 1800&start=10#p16662Google ScholarGoogle Scholar
  3. Jeff Epstein, Andrew P. Black, and Simon L. Peyton Jones. 2011. Towards Haskell in the cloud. In Proceedings of the 4th ACM SIGPLAN Symposium on Haskell, Haskell 2011, Tokyo, Japan, 22 September 2011, Koen Claessen (Ed.). ACM, 118–129. DOI: Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Ben Lippmeier. 2017. gloss. http://gloss.ouroborus.net/ . (2017).Google ScholarGoogle Scholar
  5. Simon Marlow (Ed.). 2010. Haskell 2010 Language Report.Google ScholarGoogle Scholar
  6. Forrest Smith. 2011. Synchronous RTS Engines and a Tale of Desyncs. (2011). https://blog.forrestthewoods.com/ synchronous-rts-engines-and-a-tale-of-desyncs-9d8c3e48b2beGoogle ScholarGoogle Scholar
  7. Luite Stegeman and Hamish Mackenzie. 2017. GHCJS. https://github.com/ghcjs/ghcjs . (2017).Google ScholarGoogle Scholar
  8. Mark Terrano and Paul Bettner. 2001. 1500 Archers on a 28.8: Network Programming in Age of Empires and Beyond. In Proceedings of the 15th Games Developers Conference. http://www.gamasutra.com/view/feature/3094/1500_archers_on_a_ 288_network_.phpGoogle ScholarGoogle Scholar

Index Terms

  1. Lock-step simulation is child's play (experience report)

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader