ArnoldSmith86 / virtualtabletop

a virtual surface in the browser on which you can play board, dice and card games
https://virtualtabletop.io
GNU General Public License v3.0
173 stars 31 forks source link

Gitpod ready-to-code

virtualtabletop.io

VTT is an open-source, free to use platform for creating and playing games. This project aims to create a virtual tabletop in the browser where you can (re)create all board, dice and card games and play them without registration over the internet.

Playing games

We have hundreds of games in our public library that are ready to play right now. That includes classic games like Chinese checkers, backgammon, mancala, Nine Men’s Morris, Reversi, tangrams, and hangman. It includes modern games that are similar to many popular card and board games available around the world today. Most of the games are in English, but quite a few are “universal” and require no ability to read or understand English. And a handful are offered in German and Portuguese and a few more in Spanish and French. See Games for more detail.

Creating games

New games may be created in VTT using a combination of drag-and-drop and writing JSON text. Capabilities added in JSON include iterating, conditional evaluations, calculations, and other things you might expect to find in a programming system. (See Functions for more detail.) The game designer can include player seats, action buttons, sound, scoreboards, and drawing canvases, in addition to many other tools. (See Widgets for more detail.)

To understand how to use VTT for playing or creating games, you should start by reading Playing Games. This will give you an overview of how VTT works as a game-playing platform, including information about loading and storing games. If playing games is the only way in which you want to utilize VTT, this should be all you need to read. But in any case we recommend joining our Discord server. There you will be able to ask questions about how VTT works.

If you want to modify an existing game, or do game development, after reading about Playing Games, you should next read Creating Games. This section will give you an overview of how to create a game, and will point you to the other sections in this Wiki that provide more detailed information. In particular, you will want to use the pages in section 2, Developer Documentation, as a reference, and we encourage you to at least read the introductory section to each of those pages.

Contributing

If you want to contribute to VTT development, please read Helping Out.

Finally, we appreciate donations that go towards paying for the domain name, the servers, and additional software supporting game development. You can donate at https://www.patreon.com/virtualtabletop/about.

Enjoy! And don't be shy about asking questions in Discord; you will find a helpful and responsive audience.

Playing offline on Android

You can use an Android phone as the server and play with any devices offline by using its wifi hotspot:

Hosting own server

You can host your own instance or go to VirtualTabletop.io.

This project is inspired by playingcards.io.

This project aims to be able to import PCIO files and have them be immediately playable.

Come join our Discord server if you want to discuss the project.

This project started after a reddit post in our playingcardsio subreddit.

Download this repository and get all dependencies

Follow the steps in Download Repository.

Starting the server

Now you can start the server by typing:

npm start

If that doesn't work, try:

node server.mjs

This will serve the project at localhost:8272.

If you close you terminal and wants to restart you server you will need to get back to you clone folder using cd

Debug

To debug client-side code, first start the server so that it doesn't compress the code:

npm run debug

On windows, enter SET NOCOMPRESS=1 in a terminal prior to starting the server with npm start.

In your browser, refresh to have it re-download the client code. Press F12 to show the developer tools.

In Chromium, select the Sources tab, then the select the file for the room. Press Ctrl-f to search for the code you want to set a breakpoint for an step through.

Testing

To run the unit tests (and get a coverage report):

npm test

To run them continuously (on each save) while you develop:

npm run test-cont

License

The project is licensed under GPLv3.

The cards in assets/cards-default were created by Adrian Kennard and released under CC0 Public Domain license.

The cards in assets/cards-plastic have their own license.txt file.

The icons in assets/icons-white were found at Font Awesome with license CC BY 4.0.

The games in the public library have their license information and attributions inside their attribution metadata field. You can read by adding the game to your game library and clicking Edit.