https://github.com/arthuro555/thnk
An authoritative multiplayer games framework for GDevelop.
https://github.com/arthuro555/thnk
authoritative authoritative-server collaborate framework gamedev gdevelop gdevelop-extension hacktoberfest multiplayer multiplayer-game multiplayer-game-server server typescript
Last synced: 10 months ago
JSON representation
An authoritative multiplayer games framework for GDevelop.
- Host: GitHub
- URL: https://github.com/arthuro555/thnk
- Owner: arthuro555
- License: other
- Created: 2022-07-30T09:30:28.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-04-03T10:21:32.000Z (almost 2 years ago)
- Last Synced: 2024-05-02T04:20:28.703Z (over 1 year ago)
- Topics: authoritative, authoritative-server, collaborate, framework, gamedev, gdevelop, gdevelop-extension, hacktoberfest, multiplayer, multiplayer-game, multiplayer-game-server, server, typescript
- Language: TypeScript
- Homepage: https://thnk.cloud
- Size: 18.7 MB
- Stars: 62
- Watchers: 3
- Forks: 15
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# 🤔 THNK

An authoritative multiplayer games framework for the FLOSS engine GDevelop.
## Links
- [🌐 Website](https://thnk.cloud/)
- [📰 Introduction blog post](https://bit.ly/thnk-introduction)
- [📅 Roadmap](https://bit.ly/thnk-roadmap)
- [💖 Support the project](https://ko-fi.com/arthuro555)
- [📄 Documentation](https://thnk.cloud/docs/getting-started/)
## Contributors
Thanks to all the contributors to THNK! Here is the full list of all contributors of all kinds to the project:
[](#contributors-)

Ko-fi contributors
💵

Arthur Pacaud
🚧 💻 📖 📝

Rinax
🐛

Leo_Red
🎨

Tim
📖

triloute
📖

Emily Lemonly
📖

dartpk
🐛 💻
## Contributing
### Installing
To install all dependencies, run `yarn`. You may use `npm`, but note that only a yarn lockfile will be provided and accepted in PRs.
If you have disabled postinstall scripts, run `yarn generate-protocol` to run the code generator on the flatbuffer files.
### Building
Run `yarn build` to execute the full build pipeline. You can also build individual parts with the other build scripts in package.json:
Building THNK with `yarn build:thnk` and the adapters with `yarn build:adapters` outputs a bundle to the `dist` folder. `yarn build:extensions` automatically inserts those into the THNK extensions in `extensions`.
To test your changes, import the extension with your changes into GDevelop. If you make changes to the extension itself, don't forget to export it back to the `extensions` folder.
### Submitting changes
Before submitting a PR, make sure that your code builds & fully functions within the extension, and that it passes both typescript & jest tests.
Run `yarn ts && yarn test` to run both checks.
Make sure the extensions in `extensions` are properly generated with the latest version of your code. In case of doubts, run `yarn build` again before committing.
### Understanding the file structure
There are a few main folders that you need to keep in mind while contributing:
- `extensions` - Contains the GDevelop extensions files. While most of the important code is in `code`, the extensions themselves need to be modified to add actions, conditions, etc. You also need them to actually use the built THNK code.
- `protocol` - Contains FlatBuffers protocol definitions. Anything that transits between the server and client **must** be defined through a FlatBuffer `ServerMessage` or `ClientMessage`, depending on which side will be sending that message.
- After changing a file there, you need to run `yarn generate-protocol` to run codegen for the FlatBuffers files before using the modified interfaces in `code`
- `types` - GDJS type definitions. They were generated automatically with TSC.
- `docs` - The docusaurus website and documentation.
- `scripts` - A few scripts used for building.
- `code` - Contains all the THNK extension's typescript code. All imports are relative to this directory: `import "server";` would import `code/server`.
- `server` - All the server-relevant code.
- `client` - All the client-relevant code.
- `adapters` - Contains the different adapters' implementations.
- `types` - Useful type definitions: `global.d.ts` defines the `THNK` global namespace and `thnk.d.ts` overrides GDevelop type definitions with the additional properties THNK adds.
- `utils` - Misc. Code that is relevant for both server and client.