Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article
Open access

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

Published: 29 August 2017 Publication History

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.

Supplementary Material

Auxiliary Archive (icfp17-main24-s.zip)
Artifact: A virtual machine (VirtualBox/Vagrant box) with a running version of the CodeWorld server.

References

[1]
ECMA International. 2015. ECMAScript Language Specification (6th ed.). Geneva. http://www.ecma-international.org/ ecma-262/6.0/ECMA-262.pdf
[2]
Elijah Emerson. 2009. How to make Box2D more deterministic? (2009). http://www.box2d.org/forum/viewtopic.php?t= 1800&start=10#p16662
[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.
[4]
Ben Lippmeier. 2017. gloss. http://gloss.ouroborus.net/ . (2017).
[5]
Simon Marlow (Ed.). 2010. Haskell 2010 Language Report.
[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-9d8c3e48b2be
[7]
Luite Stegeman and Hamish Mackenzie. 2017. GHCJS. https://github.com/ghcjs/ghcjs . (2017).
[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_.php

Cited By

View all
  • (2022)NetGVTProceedings of the Symposium on SDN Research10.1145/3563647.3563648(16-24)Online publication date: 19-Oct-2022
  • (2021)Towards an Integration of the Multi-role Dimension in the Design of Learning Games: a Review of the LiteratureGames and Learning Alliance10.1007/978-3-030-92182-8_26(258-264)Online publication date: 30-Nov-2021
  • (2020)ROSY: An elegant language to teach the pure reactive nature of robot programming2020 Fourth IEEE International Conference on Robotic Computing (IRC)10.1109/IRC.2020.00045(240-247)Online publication date: Nov-2020
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 1, Issue ICFP
September 2017
1173 pages
EISSN:2475-1421
DOI:10.1145/3136534
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 29 August 2017
Published in PACMPL Volume 1, Issue ICFP

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. distributed computation
  2. lock-step simulation
  3. teaching

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)58
  • Downloads (Last 6 weeks)4
Reflects downloads up to 01 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2022)NetGVTProceedings of the Symposium on SDN Research10.1145/3563647.3563648(16-24)Online publication date: 19-Oct-2022
  • (2021)Towards an Integration of the Multi-role Dimension in the Design of Learning Games: a Review of the LiteratureGames and Learning Alliance10.1007/978-3-030-92182-8_26(258-264)Online publication date: 30-Nov-2021
  • (2020)ROSY: An elegant language to teach the pure reactive nature of robot programming2020 Fourth IEEE International Conference on Robotic Computing (IRC)10.1109/IRC.2020.00045(240-247)Online publication date: Nov-2020
  • (2018)Teaching how to program using automated assessment and functional glossy games (experience report)Proceedings of the ACM on Programming Languages10.1145/32367772:ICFP(1-17)Online publication date: 30-Jul-2018

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media