Skip to content
0:00 / 0:00

#lock-stepsimulation#codeworld#haskell

Lock-step simulation is child’s play

Compose Conference

2.9K subscribers • 30 videos on Hallway

YouTube
  • Recommended by 2 people: 1 on Lobsters and 1 in engineering communities.
  • Presented by Joachim Breitner
  • Linked in the descriptionnomeata/codeworld-talk
  • May be out of date. Uploaded 9 years ago, in an area where tools change fast.

Intermediate. Assumes working knowledge.

8.8K views9 years ago2 recommendations

Game developmentProgramming languagesGame programmingFunctional programming

Joachim Breitner demonstrates how pure functional programming simplifies implementing lock-step simulation with client prediction for multiplayer games.

Joachim Breitner C◦mp◦se :: Conference composeconference.org/2017/ May 18, 2017 Slides: github.com/nomeata/codeworld-talk When implementing a multi-player network game, programmers often choose to implement “lock step simulation with client prediction”, where each client independently calculates the global state of the game, and integrate the other player’s actions as soon as he learns about them, rewinding the state to when the action actually happened. This approach to networking is infamously hard to get right and in general requires great discipline from the game programmer to avoid the clients getting out of sync. Not so with strongly typed pure functional programming On the programming learning platform CodeWorld, even middle school create multi-player games, without having spend a single thought on these issues, and no matter what code they write, they end up with a working networked game. In this talk Joachim explains the interface that CodeWorld provides for this purpose, and show how it pulls this off under the hood.

Why it's here

2 people recommend this

What people say. Recommended as an elegant demonstration of using pure functional programming for multiplayer game networking.

u/mightybytein r/haskell • Recommends

Compose Conference - Lock step simulation is child’s play

mightybyteon Lobsters • Recommends

Lock-step simulation is child’s play

u/cdsmithin r/haskell • Mentions

On “Idea: Multi-computer Gloss!”

> What if someone made something like Gloss, but that could be used over the internet? Indeed, what if! * https://arxiv.org/abs/1705.09704 * link to this video * https://code.world/haskell#P74g4GGxWpWPO-d0F4XMMlA

u/gelisamin r/haskell • Mentions

On “Monthly Hask Anything (August 2019)”

Is there a name for the technique in which a program which performs a lot of side-effects can nevertheless be expressed in terms of pure functions, thanks to a main "run" function which performs all the imperative side-effects but is parameterized by a number of pure functions? If not, I would like to propose "Functional Core, Imperative Runner", to relate but contrast it with the "Functional Core, Imperative Shell" idiom. Here are some examples of the "Functional Core, Imperative Runner" idiom. * `interact :: (String -> String) -> IO ()` Ignore the lazy IO aspect of this function. The important part here is that the `interact` function deals with the side-effects of reading fro…