Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Golang based game using the principle fleshed out in this repo. #118

Open
gedw99 opened this issue Mar 22, 2023 · 3 comments
Open

Golang based game using the principle fleshed out in this repo. #118

gedw99 opened this issue Mar 22, 2023 · 3 comments

Comments

@gedw99
Copy link

gedw99 commented Mar 22, 2023

Hope it’s ok to ask an open ended question here but the Readme did encourage others to explore doing a game in another language.

I guess the API is not worked out but would like sone tips about implementing a game in golang using the architectural concepts in this repo.

I like how simple the API is !

I can do all the rendering using wasm for web.

the backend can also be done in golang using , I assume the golang pdk ?

the transport between the frontend gui and the backend can use web sockets I presume.

so the glue in between with that API is what I am missing. Would it require going through this code based and building a golang equivalent ?

@gedw99 gedw99 changed the title Golang pdf based game. Golang based game using the principle fleshed out in this repo. Mar 22, 2023
@gedw99
Copy link
Author

gedw99 commented Mar 22, 2023

I read the blog post and it’s very erlang ish

https://github.com/ergo-services/ergo might be a way to do the game in golang with extism ?

Ergo has the same primitive like genserver , actors, etc

another one is Nola which is virtual actors. Also in golang

https://github.com/richardartoul/nola

@nilslice
Copy link
Member

nilslice commented Apr 2, 2023

Hey @gedw99 - the team has been traveling and some out on vacation - sorry for the delay! We will get back to you next week with some support here.

@bhelx
Copy link
Contributor

bhelx commented Apr 3, 2023

@gedw99 I don't have a high level doc yet, but some pieces exist. I'll try to explain and link to those pieces where i can.

First, a game is just a state machine that takes input events and operates on the state of the machine. It also emits HTML views when the engine asks for it.

Creating a game is the process of creating an Extism plugin that implements the API described in the readme: https://github.com/extism/game_box#game-api

The best way to understand it right now is to read that doc along with looking at the reference implementation (tictactoe):
https://github.com/extism/game_box/tree/main/games/tictactoe

This is probably the best implementation to study, but if you don't know rust, the other examples here are in JavaScript and TypeScript https://github.com/extism/game_box/tree/main/games

One word of warning is there is not yet an easy way to test the games. I'd recommend leaning on unit testing as much as possible. The strategy I've used is to separate the Extism entry points into their own small file, create a separate interface for your game logic, then write unit tests against that game logic interface.

Feel free to post more questions here for reach out to me on Discord if you want some help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants