https://github.com/ryleu/simple-vtt
A simple, fast, system-less VTT.
https://github.com/ryleu/simple-vtt
dungeons-and-dragons ttrpg virtual-tabletop
Last synced: 7 months ago
JSON representation
A simple, fast, system-less VTT.
- Host: GitHub
- URL: https://github.com/ryleu/simple-vtt
- Owner: ryleu
- License: agpl-3.0
- Created: 2022-02-12T00:40:31.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-03T15:11:23.000Z (about 3 years ago)
- Last Synced: 2023-03-04T16:03:36.942Z (over 2 years ago)
- Topics: dungeons-and-dragons, ttrpg, virtual-tabletop
- Language: TypeScript
- Homepage: https://vtt.ryleu.me
- Size: 113 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# SimpleVTT
A simple, fast, system-less Virtual Table Top.If you want to use it **right now**, you can use this handy button here to
launch it on Heroku:[](https://heroku.com/deploy?template=https://github.com/ryleu/simple-vtt/tree/main)
A free demo (that may be laggy and should not be used for actual games) can be
found at .**Table of Contents**
- [Configuration](#configuration)
- [Running](#running)
- [Protocol](#protocol)
- [Roadmap](#roadmap)
- [Attribution](#attribution)## Configuration
The port is set through the `$PORT` environment variable.
## Running
Install Node.JS and NPM and then run `npm i` in the project root.
Use `npm start` to start the server.
## Protocol
S-VTT uses a simplistic spec for websocket communication:| Action | Request | Response | Description |
|:-----------------:|:--------------------------------------------:|:---------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------|
| Add a piece | `&S;;,;` | `&S;;;,;` | `id`: Unique identifier
`name`: Base 64 encoded piece name
`x,y`: Integer coordinate pair
`icon`: Base 64 encoded icon URL |
| Move a piece | `&M;;,` | `&M;;,` | `id`: Unique identifier
`x,y`: Integer coordinate pair |
| Delete a piece | `&D;` | `&D;` | `id`: Unique identifier |
| Create a line | `&L;,;,;;` | `&L;____;,;,;` | `x1,y1`: Initial coordinate pair
`x2,y2`: End coordinate pair
`thickness`: Thickness of the line
Hex color code |
| Remove a line | `&R;____` | `&R;____` | `x1,y1`: Initial integer coordinate pair
`x2,y2`: End integer coordinate pair |
| Fill a tile | `&F;,;;` | `&F;<x>,<y>;<color>;<style>` | `x,y`: Tile coordinate pair <br /> `color:` Hex color code <br /> `style:` Style of fill. Options: solid. Default: solid. |
| Re-size the board | `&B;<x>,<y>` | `&B;<x>,<y>` | `x,y` Integer length / width pair |
| Clear the board | `&C` | `&B;30,15` | None |
| Join a room | `&A;<invite>` | `&A;<invite>;<success>` | `invite`: Invite code <br /> `success`: true if the session exists, false if it does not |
| Set the background| `&G;<image>;<width>` | `&G;<image>;<width>` | `image`: Base64-encoded image URL <br /> `width`: integer width of the background image measured in tiles |There are also an HTTP API at `/api/`:
| Endpoint | Description |
|:-------------------------:|:---------------------------------------------------------------------------|
| `/api/board/?id=<invite>` | GET to get the board for <invite> or PUT to load in a new one for <invite> |
| `/api/new/` | POST to generate a new blank board, responds with `{"invite": "<invite>"}` |Any other path is sourced from `site/`.
## Roadmap
- [x] Basic HTTPS communication
- [x] Rendering
- [x] Lines
- [x] Pieces
- [x] Saving and loading
- [x] Heroku deploy support
- [x] Tile fills
- [x] Chromium / Webkit support
- [x] Rewrite in TypeScript
- [x] Reactive design for mobile
- [ ] Default pieces
- [ ] Custom saved pieces
- [ ] ~~Game master~~ This will never be implemented in v1.x.x.## Attribution
Icons are from the [Papirus Icon Theme](https://github.com/PapirusDevelopmentTeam/papirus-icon-theme).