13 votes

Made a free VTT prototype

4 comments

  1. [3]
    archevel
    Link
    Being on vacation I wanted to try out coding solely using an LLM. I've mostly been disappointed with the results when using it on existing projects, but I've seen that it is quite capable when...

    Being on vacation I wanted to try out coding solely using an LLM. I've mostly been disappointed with the results when using it on existing projects, but I've seen that it is quite capable when building frontends. So I figured I'd try it out from a blank slate and see if I could prompt it to create a custom VTT for me.

    There were a few of requirements that I wanted to solve.

    1. Voice communication between participants.
    2. Basic board controls for the GM (adding tokens, a map etc).
    3. Should be deployable as a static site. No backend required.

    To solve this I figured I'd use webrtc. It enables connecting multiple clients to each other sending data and audio streams. The tricky part is that in order to set up the communication channel a signaling server is commonly required. That is the peers need to exchange some data in order to agree on how they should communicate. Since I didn't want to set up a signaling server the initial connection need to be mediated in another way. Currently this is handled by the GM creating invites and sending them to the participants (outside the web app, e.g. in a text message). The participants then need to send back an answer containing their encoded signaling information to the GM. Once that is completed the GM acts as a signaling server for all the other peer connections. In short the initial setup is a bit clunky and currently if the GM looses the connection it's a bit of a hassel to set it up again.

    I also added a feature that I think can promote role-playing. A player (or the GM) can claim a token. If two participants claim some token then to each other the volume of their audio streams will depend on the distance between those tokens. So if two claimed tokens are far apart they will hear basically nothing, but if they move closer the volume will increase.

    The UI/UX is very basic and will needs a clean up and some more features (dice rolling probably being the main thing missing). Some features are a bit hidden, eg:

    • the GM can change the size of individual tokens by double clicking on them.
    • right clicking a token allows people to claim that token.
    • the GM can add, scale and move a background images for a layer and toggle visibility of layers
    • the GM can shift click to remove tokens

    That said, I think there is enough there to make it possible to run an session.

    The source code is on GitHub and all of it is licensed under AGPLv3 so feel free to poke around. Since 99% of the code is promoted it is a little bit messy with some shared state. The whole thing is deployed as a GitHub page so you could clone the repo and deploy it elsewhere on your own server by just hosting the files.

    Of note is that in some cases the communication between peers need a STUN server. Currently this uses Googles one. So if that is a concern you'd need to find an alternative. It also doesn't have a TURN server configured so some clients might not be able to connect.

    If you just want to test it for yourself you can open a second private window in eg Firefox and invite yourself in order to see what it looks like for players. Try it out and let me know what you think! I'm happy to answer any questions.

    4 votes
    1. [2]
      SpruceWillis
      Link Parent
      Wow, love the idea of proximity chat in a VTT. I must say, my regular players are generally very good when it comes to, at the very least, basic role playing but they suck at moving their tokens....

      Wow, love the idea of proximity chat in a VTT.

      I must say, my regular players are generally very good when it comes to, at the very least, basic role playing but they suck at moving their tokens.

      Ones so bad I've just given control of their token to another player so they can move them too.

      If I'm talking and they can barely hear me it might prompt them to actually engage with their token.

      3 votes
      1. archevel
        Link Parent
        Yeah, that was one of the reasons to do this. I have it in the back of my head to add walls that hinder sound, but we'll see if I get around to it. I want to improve the UI a lot before that. Of...

        Yeah, that was one of the reasons to do this. I have it in the back of my head to add walls that hinder sound, but we'll see if I get around to it. I want to improve the UI a lot before that. Of note is that anyone can move any token. I didn't want to limit it to just the GM and controlling player since I often find I want to illustrate something eg. "Can I push that character here if I stand there?"

        2 votes
  2. Parou
    Link
    Nice one!

    Nice one!

    3 votes