Recent Posts

Grapevine Updates for May 2019

Posted on 31 May 2019

The last month of ExVenture and Grapevine continued the pace of last month, mostly continuing work on the web client and test server.

Links for ExVenture & Grapevine:

Modals

New to the web client are modals. These are sent as a known GMCP message that opens up a modal. The text is processed as ANSI escape codes for coloring and acts as a draggable terminal for now.

There are more plans in the future but I got it working at all and kept moving on. I would like to make this be stylable from the game, to enable some pretty cool flows. Letting users have a wizard of prompts, receiving input, button presses, display images, etc. Lots of cool things can be done here and done fairly generically from the game's perspective, so another client like Mudlet can have a package that does the same.

Grapevine web client with modals

Color Processing

I completely rewrote the color processing part of the web client. Before I was using Anser and in a fairly bad way. Partially sent escape codes didn't process properly and I wasn't merging the buffer after processing it. It was a stop gap that worked well enough to get where we're at.

The rewrite is a fully custom parser utilitizing small bits from Anser (namely the really ugly regex to parse the escape code properly.) Past that it handles parse errors and merging new text in to update the last line. All of the lines except for the last line are considered "sealed" and that lets react not have to re-render anything once it renders. This keeps the parse and DOM updates to a minimal.

So far this new parser is very fast, sticking to about 0.3ms for each step. I am pretty happy with this and may pull it out into its own package.

ExVenture

Movement is starting on ExVenture again. I fixed a few bugs for a new patron that picked the hosting tier. While fixing those bugs, the itch to work on ExVenture again popped up. I am starting to plan out some refactors I can do to help bring in some ideas from Spigot into the main project.

I'm hopeful that Grapevine will slow down and I can get back to some minor refactors.

Small Tweaks

  • Grapevine, Send the user's real IP if enabled for a game
  • Grapevine, Load speech synthesis voices and display, starting on text to speech
  • Grapevine, Detail list for events
  • ExVenture, Fix some bugs around Character.Simple
  • ExVenture, Fix changing your password

Social

We have a few new patrons this month, welcome! Thanks for supporting both ExVenture and Grapevine. If you would like to support both projects, check out the Patreon.

Titans of Text has had two more episodes come out. We talked with Griatch from Evennia and Janey from Stillborn. These were both great episodes and we have some really exciting ones lined up. It's pretty great to have a fairly large backlog of people to talk to.

I have also continued streaming over on Twitch every Monday at 12 PM EST doing ExVenture or Grapevine development. Join me over at https://www.twitch.tv/smartlogictv.

I am also going to be one of the keynote speakers for The Big Elixir this year, talking about ExVenture. I am very excited for this and I hope to see you there!

Next Month

Next month I'm thinking I'll start working on the chat side of Grapevine, making that nicer and more in line with the web client. More advanced features of the web client may be on hold for a brief period, but I may also get pulled back in as this is the part of Grapevine that people use. I would like to start some small refactors of ExVenture as well.

Grapevine Updates for April 2019

Posted on 30 Apr 2019

The last month of ExVenture and Grapevine continued the pace of last month, mostly being touch ups, and the addition of a new test server.

Links for ExVenture & Grapevine:

Spigot

I started on a new test server to easily send new GMCP messages without needing to modify ExVenture to properly send the events I am looking to act on in Grapevine.

I am also using this as an opportunity to better layout a game server using some better principles learned with more Elixir development time. Commands now act as controllers, keeping light and mostly rendering "views" back to the telnet session. I'm playing around with a better layout for internal processes as well. I'm pretty happy with the direction this is headed, and I might do a deeper blog post soon.

OAuth & Telnet

As part of Spigot, I finally got an initial dream for Grapevine working. You can click "Play" in Grapevine and be signed into a MUD using OAuth of sorts. It takes the standard OAuth flow and shoves it into the telnet IAC flow. TLS is required for this to work in order to keep things more secure.

Sample flow:

Server: IAC DO OAUTH
Client: IAC WILL OAUTH
Client: IAC SB OAUTH Start {host: "grapevine.haus"} IAC SE
Server: IAC SB OAUTH AuthorizationRequest {response_type: "code", client_id: "...", 
  scope: "...", state: "..."} IAC SE
Client: Requests confirmation from the user, displays a standard OAuth request asking
  for scopes and the connection
User: Approves request
Client: IAC SB OAUTH AuthorizationGrant {state: "same as above", code: "..."} IAC SE

Server then goes through standard OAuth

See the current draft spec on a gist.

Web Client

I was able to get around to letting you pick the font and font size for the web client. It doesn't save yet, so each session you need to tweak it. I got part of the way through saving preferences and then was side tracked and haven't gone back yet.

I am getting very close to starting to add cool things to the web client, such as modals, sound, and text to speech. I keep stalling in Spigot, trying to get it to a nice spot. Its in a good enough place that I can go back to working on the reason it exists, extending Grapevine!

Small Tweaks

  • Event listing page
  • Homepage featured games
  • About page
  • Site map
  • Contact form
  • LiveView for concurrent player counts
  • Discourse SSO
  • Invalid byte in the JSON stream
  • Web client play button logic fix
  • Socket connections should enable the player graph
  • TLS cert pinning for self-signed certs
  • Langing page after registration

Social

We have a few new patrons this month, welcome! Thanks for supporting both ExVenture and Grapevine. If you would like to support both projects, check out the Patreon.

Titans of Text has had two more episodes come out. We talked with DarkWind and Sindome. A few more episodes are already lined up, they should be pretty good ones. We're finally on all of the podcast aggregators including iTunes.

Grapevine also got a forum which uses your Grapevine login to sign into. If you're looking for a place for more long-form discussions around MUDs, this is the place.

I have also continued streaming over on Twitch every Monday at 12 PM EST doing ExVenture or Grapevine development. Join me over at https://www.twitch.tv/smartlogictv.

Next Month

Next month I would like to start working on more advanced features for the web client. I am starting with modals, and possibly adding in sound or text to speech next. I'm sure I'll keep working on Spigot as well, smoothing out that while it's still small. I would really like to start develing into ExVenture again. It's been too long since I worked on it.

Grapevine Updates for March 2019

Posted on 30 Mar 2019

The last month of ExVenture and Grapevine was fairly light, with mostly small touch ups.

Links for ExVenture & Grapevine:

Grapevine Web Client

You can now have a custom CNAME for the web client, so it goes directly to connecting to your game. See it in action for Darkwind at play.darkwind.org.

The web client should also be faster now. It is limited to 1000 lines of history instead of all of the output from the game. After being connected for an hour or so to a few games the client really dragged down. It should now keep a lot quicker as it starts dumping output.

Gauges can also undock from the bottom toolbar area and will float in the top right of the client. This can be useful for things like enemy health.

Phoenix LiveView

For a stream I worked on making the new admin dashboard "live." It will now view any open web client as they update without having to refresh. You can watch as I add it into Graepvine from the YouTube export:

Stein

I started a new library called Stein which handles a lot of common utilities you might need for a web application. Such as common user auth functions and storage. Stein started by pulling out common code from Grapevine, which itself was pulled from ExVenture.

Check out the documentation for Stein on hexdocs. If anything is confusing please let me know so I can update them!

Grapevine Hosted Site

If you have a game with a web site that looks like it hasn't changed from when your game started in 1996, I started on a Grapevine hosted alternative. The plan is to have minimal customization, a blog, and the Grapevine web client built in.

If you're interested, please reach out to me on Discord or the Slack.

Social Updates

We have a few new patrons this month, welcome! Thanks for supporting both ExVenture and Grapevine. If you would like to support both projects, check out the Patreon.

This month I started a new podcast with Swift from the MUD Coders Guild called Titans of Text. It will be a bi-weekly show where we interview developers and admins from around the text gaming community. We want to reach out to more than just MUDs for this. Find us at titansoftext.com and soon on iTunes.

I have also continued streaming over on Twitch every Monday at 12 PM EST doing ExVenture or Grapevine development. Join me over at https://www.twitch.tv/smartlogictv.

Next Month

I took a bit of a "break" this month and slowed down development a lot. This might continue a bit more for this month, but I want to start getting back into ExVenture and continuing with the refactor process. Pulling in Stein would be a good start, and pulling more out of ExVenture into Stein as well. I also plan to keep tweaking the web client and getting some kind of customization for that in place, letting you change the font and font size to start with.

Local Clusters with epmd

Posted on 26 Mar 2019

For Grapevine, I recently started a single machine cluster. There are two nodes, one for the main application (sockets and Phoenix) and one as a base for telnet connections.

With this I can redeploy the main application and not disconnect players from their game sessions. This is very important as telnet connections cannot drop if they are open.

Clustering

The start of this cluster was incredibly simple. I installed libcluster and configured each node to connect to the other via named nodes. Each node was simply their release name @127.0.0.1 by default thanks to distillery's default configuration.

I started each node and all was well. They both connected and I was off to the races. Until I wasn't.

Issues

This worked well until I went to deploy. I was never able to successfully deploy each node separately without one of the two not being able to connect to the other. It was very reliable which node couldn't connect. The second node to start could never connect to the other node.

I tried a few ways of getting around this but couldn't figure out what was wrong. I scratched my head for an evening before letting it sit overnight.

Starting epmd Separately

What I think was the issue, was that epmd was being started automatically by the first node to boot. The way I was deploying was simply overwriting the entire release directory with the new code. I think this screwed something up, I'm not 100% sure about this though.

By starting epmd as a separate service, the issues stopped. I set up my service files to require epmd before starting. In a sense I pushed the issue up the supervision tree!

Service Files

This is the epmd service that Grapevine uses. Ansible places the epmd daemon at /home/deploy/epmd (in this file.)

[Unit]
Description=Erlang Port Mapper Daemon
After=network.target

[Service]
User=deploy
Group=deploy
WorkingDirectory=/home/deploy/
Environment=LANG=en_US.UTF-8
ExecStart=/home/deploy/epmd
SyslogIdentifier=epmd
RemainAfterExit=no
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

And the grapevine.service requires that it is booted with this line:

[Install]
WantedBy=epmd.service

Conclusion

If you have a local cluser, you should avoid node connection issues by starting epmd separately and not allowing for the automatic daemon start. As an extra bonus, you can now use the epmd binary to communicate easily with the running daemon. This lets you know each node is alive and connected, use epmd -names for this.

Finally, all of this code is open source so you can inspect what Grapevine does for clustering. See the main repo here and the telnet node repo here.

See more about epmd.

ExVenture & Grapevine Updates for February 2019

Posted on 28 Feb 2019

The last month of ExVenture and Grapevine saw some refactors in ExVenture and a brand new web client in Grapevine.

Links for ExVenture & Grapevine:

Grapevine Web Client

Grapevine Web Client

The biggest new feature of Grapevine, and the thing that has consumed most of my time is a new web client for accessing telnet based games. This feature is turned on by the game administrator and configured by them for all users. This way a consistent and simple interface is given to everyone, keeping configuration on the player non-existant at the moment.

Game admins can configure only what gauges should show at the bottom of the client right now. I'm slowly working on more options, but this is a good start. It's powered by GMCP, a telnet protocol extension.

The client is powered by React and Redux, and even has a few reducer tests. This is my first go around with a "real" react and redux application and I'm liking it. It finally "clicked" as to why I'd want to add in redux this time.

I even set it up so games can have a subdomain on their own domain that launches directly to the web client. If you have a game and want to enable this, let me know!

Grapevine Clustering

In order to enable the web client to not drop connections on a deploy, I pulled a node that holds the connection to games out of the main node. This hosts just the telnet connections and that's about it.

This lets me deploy the main Grapevine code as often as I like and not have it drop connections. Users still see a brief period of web client <-> Grapevine disconnection but they eventually reconnect and pick right back up.

I need to work on better messaging around this, but the core works well.

Check out the new telnet only application.

ExVenture Character Tuple

Not to forget that ExVenture exists, I started work on a fairly large refactor that tackles something that's been annoying me for a while. The character target system passed around tagged tuples that tag what kind of character the tuple is, e.g. {:player, player}.

This is really ugly to read in the code so I've been working through the code base removing those in favor of pushing around the plain Character.Simple struct, adding in a type field when its necessary to distinguish between the two. I'm hoping that this will also let me collapse the Room process caring about the two as separate entities.

See the current state of this pull request on GitHub.

Social Updates

We have a few new patrons this month, welcome! Thanks for supporting both ExVenture and Grapevine. If you would like to support both projects, check out the Patreon.

I will be at Lonestar Elixir at the end of this week, giving a talk about monitoring your application with Prometheus.

I have also continued streaming over on Twitch every Monday at 12 PM EST doing ExVenture or Grapevine development. Join me over at https://www.twitch.tv/smartlogictv.

Finally, SmartLogic launched a new podcast centered around Elixir in Production. Find it over at podcast.smartlogic.io

Next Month

Next month I will continue expanding the features that the web client can do. I feel like it's pretty close to being the right amount of simple and usable. I don't want to provide that many options, as MUD clients that are extremely powerful already exist. I also want to get back to ExVenture and keep that pushing forward, but we'll see where the wind takes me.

Creative Commons License
This site's content is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License unless otherwise specified. Code on this site is licensed under the MIT License unless otherwise specified.