Evolve your Game with Gleam
- Gleam 60.5%
- JavaScript 38.8%
- HTML 0.7%
|
|
||
|---|---|---|
| be | ||
| doc | ||
| integration | ||
| presentation | ||
| shared | ||
| ui | ||
| .gitignore | ||
| README.md | ||
Egg README
After a cool presentation at LangDev'23, I want to recreate Cascade in the BEAM eco system.
Specifically, I am after (im)possibilities and restrictions on live upgrades of running systems. I'm moving towards Event Sourcing, where the model changes and player actions form a linear history, so that game instance can be reconstructed / replayed.
Upon that, the Modeling of game rules is non-trivial, especially as the rules need to be editable.
Content:
doc/, contains documentation, includingdoc/TODO.mdbackend/contains the model server (a web server)shared/contains model definition and conversionsui/contains user interface (web pages obtained from the backend, that also communicate with the backend)integration/contains integration tests: launch the web server and interact with web pagespresentation/contains presentation that uses the system
Egg is the umbrella. It is likely that sub-projects will emerge that are more reusable than Egg as a whole.
Install / Run
$ (cd shared; gleam test --target javascript) # Also runs on Erlang target, but compiles slower
$ (cd ui; gleam test --runtime deno; gleam run -m build)
$ (cd backend; gleam test; gleam run) # http(s)://(local)host:3210/
# spectator: http(s)://(local)host:3030
$ (cd integration; gleam test)
$ (cd presentation; gleam run -m build) # http(s)://(local)host:3000/presentation
The workflow:
- First created user will be admin, and only admin, i.e. who can manage users
- Admin can make a player ModelEditor
- ModelEditor can edit a model
- Anyone can Create and run a game
- Game creator cannot join that game
- All (other) Nonpaying players can join that game
- Any changes to the model made, while a game with that model is running, will receive the changes
- Game creator starts the game, the players play until the game is finished