Git Product home page Git Product logo

togetherness's Introduction

logo

sjbrown

Togetherness Table

| Live Demo | Quick Start | Goals |

Tabletop RPGs are no longer just played in physical spaces. More and more, this kind of game is being played online, and players are discovering online dice rollers, communal game maps, virtual tabletops, and digital character keepers. But too often these tools are walled gardens whose owners see players as products, not human beings.

screenshot

Togetherness Table is a web-based virtual tabletop whose chief aim is the empowerment of players as free human beings participating voluntarily in a community. There are no "owners", just equal participants enjoying a gamut of activities including "creation", "play" and "hosting".

Goals

Togetherness Table aims to be Local-First Software

  • No spinners: your work at your fingertips
  • Your work is not trapped on one device
  • The network is optional
  • Seamless collaboration with your colleagues
  • Survival post-demise
  • Security and privacy by default
  • You retain ultimate ownership and control

Furthermore, Togetherness Table should:

  • Be document-centric. The state should all live in the document. Let creators treat their game state like documents they can save to disk, edit in Inkscape, and use their own SVG-editing workflows in the way they feel most comfortable and productive.
  • Use HTML5. Use SVG.
    • Don't reinvent wheels that already exist
    • Use the opportunity to deeply learn the standards
    • Leverage other contributors' knowledge of the standards
  • Not require special server-side software
    • No software to install, no security concerns, no dependency hell. A contributor should have to do nothing more than run a single command then open up their web browser.
    • Easy to fork. If someone wants to add Togetherness Table as a widget on a website they host, that should be possible.

Live Demo

I'm going to try to keep a demo up and running at https://www.1kfa.com/table

Quick Start

git clone <this repo>
cd togetherness/src
python3 -m http.server

# Or,if you prefer,
# python2 -m SimpleHTTPServer 8000
# Or if you prefer Node.js to Python:
# npm install npx -g; npx http-server -a localhost -p 8000

Then open your browser to localhost:8000

That's it!

Making your own "objects" for the table

Any interactive objects (dice, decks of cards, etc) are simply SVG files.

Click on + Other and then + SVG File and you can paste in an SVG file. Ensure the "Allow JavaScript" option is selected.

Interactivity Interface

To make your object interactive, you need to include some JavaScript.

Your <script> element needs to have an attribute data-namespace with a name that's unique to your object.

Inside the script, there must be one JavaScript object whose name matches that data-namespace value. This object uses a specially-named key, "menu", to integrate with the main web UI:

<svg x="0" y="0" width="100" height="100">
  <!-- This is a red rectangle.
       It has a context menu.
       A context menu option will allow the user to change it to green.
  -->
  <rect x="25" y="25" width="50" height="50" style="fill:#ff0000" />
  <script
    type="text/javascript"
    data-namespace="myThing"
  ><![CDATA[

myThing = {

  menu: {
    'Change Color': {
      eventName: 'changeMyColor',
      applicable: (elem) => { return true },
      uiLabel: (elem) => { return 'Change Color To Green' },
      handler: function(evt) {
        // Note - "handler" must be written as a traditional function,
        // not an arrow-function, so that "this" is bound correctly
        console.log('Changing color!')
        this.querySelector('rect').style['fill'] = '#00ff00'
      },
    },
  },

}

]]></script>
</svg>

That's it!

Developers: Permanently adding objects

If you've forked this repo and want to make your interactive objects permanent, you can do the following:

First, add a + My Thing button to the index.html file.

<button class="btn" onclick="add_object('svg/v1/my_thing.svg')">
 + My Thing
</button>

Then just add the file svg/v1/my_thing.svg.

History

After joining The Gauntlet and playing around with the awesome roller, I got the itch to create my own "dice-rolling" application.

togetherness's People

Contributors

mrroboman avatar sjbrown avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

togetherness's Issues

Fix Save/Load

It's been broken for a while

Add tests for the feature too, so it doesn't break again

Improve the UI!

Step dice means the system is designed around changing die sizes rather than adding a modifier. It's a streamline to reduce arithmetic.

The best example is with Savage Worlds, which rolls a die equal to your attribute or skill and a wild die, then keeps the one which rolls higher. Attributes or skills are directly measured as dice sizes. For instance a d4 in strength is awful, a d6 is average, a d8 is above average. Etc.

For me specifically? I need a group of three dice of mixed size and the ability to reroll them individually as I boost the roll. I actually think your rolling program has those.

I've actually come across and used your die roller before. It works very well, but has a cumbersome UI, which is probably why it's not seeing much use. Prepare for some tough love. Can't code for crap, but I do know a thing or two about UI design.

The add dice function requires menu surfing and the roll, delete, and turn up functions are on the bottom of the screen, far away from your other controls. To add a die and roll it, you have to click to open the dice menu, click to add the dice, click the submit button, and then scroll all the way to the bottom of the page and hit this tiny button labeled "Roll." Then to delete the dice, you must scroll all the way up to the top, individually select them. then scroll back down to the bottom to hit the Delete button.

Now, I would use the crap out of this if you had a menu of keyboard shortcuts, like "+ and 6= add a d6" and "R = Roll." If you had enough of them, you could probably bypass menus altogether and just have a reminder of the shortcuts set as the default background.

For more normal, cursor-bound users, I would recommend making adding dice a vertical menu on the left edge which by default displays the D&D dice so you can add with one click, then I would reserve the top right corner inside the display for a big 'ol "Roll" button. This way the cursor can reach everything without leaving the top left corner.

Unknown tick

It looks like there's two event fired when using double click the interface.

unk_tick

I don't know if it's the supposed behavior of it's a bug, but it seems to roll twice the dice, and the clocks always tick/untick by two, never by one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.