Travis Briggs - YABIWU

Yet Another Blog I Won't Update

When I wrote that post about making a computer game, I seem to have left out one of the major projects I've been working on for the past year or so, which is Q Poker.

Q Poker is envisioned as an online poker site, with play money (coins), that hosts games other than Texas Hold'em. The first game I've been implementing is Razz (7 card stud lowball) and you can see some of the in progress results in this screenshot:

Screenshot of online poker game

So far, the things I've got working are:

  • Backend game logic, in Python, where you can start and finish Hands (of Razz). — Includes check/bet/raise/fold logic for all players.
  • Logic in Python for a “Table” which is where the hands get played out.
  • Asynchronous logic in Python for sending game updates to the client, when things of interest happen. For example, the web client doesn't have to “poll” the game state, it receives socketio events when someone performs an action.
  • ReactJS frontend app which responds to and displays the Table state changes from the backend.
  • Frontend allows users to take actions, communicates with backend.

Things I still need to work on include:

  • Proper registration system with emailing, password reset, etc.
  • Proper accounting of User bankrolls, aka debits when sitting down at a table and credits when standing up. (This kind of scares the crap out of me but at least it's not real money!)
  • Timer for player actions.
  • Disconnect handling. User sits out N hands, then gets kicked from the table (for what value of N?)
  • Ability to create (private?) tables and invite friends to them
  • Landing page

With all that in place, I think I could actually maybe go to an open beta and see if anyone wants to play. Actually what I was really thinking was that I could program some kind of bots that players could play against. I've got bots now, but they just make a random action out of the available options which is really frustrating and not a good experience.

I've studied some of the techniques of the Pluribus poker bot that came out this time last year. I even paid for access to the paper they published. Sadly, like many results in science nowadays, it doesn't seem like the results are fully reproducible just from what's in the paper, but maybe I'm just too dumb to understand it (fully possible!).

I've actually got a basic implementation of counterfactual regret minimization (CFR), the algorithm used by Pluribus, implemented for toy game theory examples like Kuhn Poker. I'm having a hard time generalizing it to Razz though.

If I could get it working, I think it might be fun for players to start a table with 1 or 2 friends and 1 or 2 bots. The point is that there is literally NOWHERE to play Razz online (and in general nowhere to play it live either, even before COVID), so there must be at least some pent up demand for something like this.

If things go well with Razz, I'd like to implement other “mixed” games, like Omaha 8, Pineapple/Crazy Pineapple, Big O, and maybe some of the weirder games we've played in the Reno Atlantis mixed game, like Drawmaha.

This isn't something that I've started and shelved. I'm actively working on it. In fact, I just spent the past week implementing Table/Hand persistence for the backend, so that it can load a table when a user takes an action, then persist the changes to the table.

If you'd like to discuss this post: I'm Travis Briggs — @audiodude on Twitter and Github, @audiodude@toot.cafe on Mastodon, and audiodude@gmail.com

I've always wanted to program a computer game. I can program pretty well, so it can't be all that hard right? I know that many people pursue gamedev the way I pursue music production: in fits and starts, as a hobby, never particularly successfully. Since I already have a pursuit like that, why would I want to add gamedev to the list? Am I a masochist?

I've actually used pygame successfully on a few occasions. One of them was just learning game dev, I made a game where you caught a dot with a paddle. I called it Butterfly Catcher and it's still available on Github. The other “game” I made with pygame was actually a game loop for a full sized skee-ball like drinking game called Whiskeyball.

For a long time, I had the idea of an “API-only” game. I registered the domain scriptslash.com and had the bare bones of registration and a bit of a tutorial up there. The idea is that the game engine is just implemented as a bunch of API endpoints, and you make HTTP requests to interact with it. So you end up having a script that does the hacking and slashing.

In fact, now that I think of it, this idea is over 10 years old! The main impetus for it was the thought that if you're writing scripts that interact with REST APIs to play a game, it will look to anyone who walks behind your desk at your programming job like you are working (and not playing a game).

As part of this, I actually implemented the so called “2 legged” OAuth scenario, which is not widely used, but basically lets you sign an individual API request with your API key, so that you don't have to have any login mechanism, or cookies or persistent state. I thought it was pretty clever. I even released a Ruby “API client” which just basically imported the right libraries and signed the request, so you could focus on what parameters you wanted to send.

The problem with Scriptslash was that there was never really a “game” there. I had all the ideas for the technical infrastructure, but no ideas for what the gameplay would be like. I even re-wrote the engine, which was originally in Node.js, in Python Flask, porting my two-legged OAuth implementation. Does this sound familiar? How many people have you heard of that develop intricate game engines but there's never really a game there?

Later, I had an idea for a multiplayer game I was calling “Space Base Race Game”. You can read the document I wrote about it if you're interested. It was kind of hopelessly complex for what it was trying to do, and I never really had a firm grasp on what the “graphics” if any would look like. The basic idea behind the game is the multi-armed bandit. Given a row of slot machines, do you pull the one that seems to pay a dollar 75% of the time, or do you play a new one in search of a larger reward? I think this exploration of reward spaces can lead to fun gameplay, because the user has to choose between exploiting a known resource or exploring.

Of course, why not pair Space Base Race Game with Scriptslash and have it be the game for that engine?

I'm not sure why I never did that, to be honest. Part of me had soured on the whole Scriptslash idea. I realized that for any game, a player is going to be a real live human being somewhere, and that they're going to want to see the output of the game. Yes they might at first be satisfied to read the output in the logs of their “script”. But eventually they're going to want to see output in real time, and provide input in real time. This is starting to sound like a real Game Client that needs to be developed, possibly with graphics. And I didn't want to do that.

Most recently, I had the idea for “Factorio but as a MUD”, which sounds as brilliant as it sounds horrifying to me (and of course is in the grand tradition of “Twitter for dogs” type startup ideas). I've got 200 hours plus played in Factorio, which is by far the most time I've put into a game in probably the past decade.

The idea hasn't really gone anywhere, though. I downloaded the Evennia MUD engine which is both written in Python and claims to be widely extensible. But I already sort of gave up, after getting the MUD running, because I realized how much work it would be to rip out all of the existing MUD systems (ie “examine cup”) and replace them with Factorio like things. Or maybe I just didn't have the idea fully formed in my head enough. Maybe I should write another Google doc.

At some point in this journey I picked up the excellent Mazes for Programmers which was a lot of fun to work through. This originally gave me ideas for Scriptslash, while that was still a thing. The examples in that book have stayed with me, and they're part of the lingering “background radiation” around actually making a video game. But the question is, will I ever do it? And if not, the larger question is, what's stopping me?

I've also played more than my fair share of “clicker” and “idle” games, more than anyone should probably ever play. So I've got ideas down that road too. I had an idea for a game called “Super Progress Bar Pro”, which is basically exactly what it says on the tin.

So my ideal game that I'd like to make is Factorio, but a MUD, but a clicker, but API driven.

Maybe I just need to answer some basic questions and go from there:

  • Single player or multiplayer?
  • Graphics or text based?
  • Story based or mechanics-driven?
  • Clicker/idle mechanics or actual gameplay?

Anyways if you have any ideas, or want to collaborate, or just want to comment on this blog post, I'm Travis Briggs — @audiodude on Twitter and Github, @audiodude@toot.cafe on Mastodon, and audiodude@gmail.com

I never really blogged much when it was popular, in the 2000s. And I continue to not really blog much to this day, so not much has changed in that regard. But I've always had this desire to blog. It's like my vague desire to use a Zettelkasten, even though I don't have much of anything to take notes about.

Nowadays, I've discovered the Gemini protocol which claims to not be trying to replace Gopher or the Web, but seems to strike an interesting middle ground between them. It's kind of an improved Gopher with more modernized semantics.

I actually have created one of the first 50 Gemini sites in existence, gemini://gem.bestalbumsintheuniverse.com. This is the Gemini version of my bestalbumsintheuniverse.com project, the goal of which is exactly what it says on the tin. I feel a bit of pride about this, that “hipster” feeling of I knew about it before it was cool. But there's also another feeling, that of getting to see what Gemini turns into eventually, to watch its evolution from near the beginning.

All this leads back to blogging because a lot of the people who run Gemini spaces like to write blogs. Or really they like to write phlogs, which are Gopher Logs (blog being a Web Log). And some of them write Gemini logs as well. It's a whole small universe of people giving status updates and the like, and it's pretty interesting to just do a random walk across some of the pages and see what you find.

I want to contribute to this, of course, but as I've lamented in my previous blogs about blogging, I just don't have that much to talk about on a weekly basis without it getting very personal and mundane.

The following is the email I sent to iwant@hey.com to convince them to give me an invite.

===

Hey,

I don't go to the gym, and I don't eat healthy. I don't call my mom nearly as often as I should. But one thing I do is keep a meticulously manicured email inbox. It's inspired by, but not quite equivalent to, Inbox Zero.

This system works great, but there is something of a flaw. It's not a flaw in the inbox system. Actually, it turns out 80% of the email I get is not only crap, but crap from mailing lists and such that I can easily unsubscribe from anytime. About five years ago, I realized this. I resolved that the very next email I got from some dumb email list that I don't read, like GAP or iTunes or something, I would immediately unsubscribe. I did this for a few weeks.

Pretty soon, as you'd expect, the garbage (not quite junk, not quite spam) emails stopped. Entirely. I stared into the gaping void of a pristine email inbox and did I feel triumph? Did I feel joy? No, I felt dread. More than anything I felt lonely. I realized that some amount of my self worth was tied to the subtle, subconscious idea that I was a real person, with feelings (and at least a credit card) who, in some capacity, was worth emailing. Even if it was an ad or some dumb newsletter I didn't really want, someone out there cared enough to send it to me. In the isolated, alienated, cyberjunk dystopian present that we live in, that mattered to me.

So I went back and resubscribed to the newsletters (or at least, stopped unsubscribing to new ones). And I felt better. It's kind of like those vacuum cleaners with fake noise added so that people believe they're working (look it up on YouTube).

It's not a flaw in the inbox system. No, it never was. The flaw is the frailty of human emotion and the failings of constant attention seeking.

I’d like to try Hey, because I’d like to maybe finally come to grips with those feelings, that flaw.

Thanks, -Travis

There have been some posts on Hacker News lately about various systems for GTD (getting things done), both endorsing and adjacent to the official GTD method. There have been productivity apps, note taking and bookmarking browser extensions, and more. All of it promises a way forward for organizing all of the tasks in your life and making sure they get completed effectively and in a timely fashion.

This is not necessarily a post about why I think it's all bullshit, or why I'm a serial procrastinator and none of this will ever work for me, or even why I might prefer whatever ad hoc method I have for getting things done over these meticulously manicured systems. It's not any of that. The point of this post is to admit something about why these systems kind of miss the point for me completely.

I don't have anything to get done.

I mean, I have a full time job, and through various methods that I've learned over the years, including keeping a tidy inbox, I manage to get most things done most of the time, for things at work.

But otherwise, I can't help but wonder what everyone is filling up these todo list apps with. Because I don't have a list of tasks that demand my attention in my free time. Certainly none with any specific deadlines. Sure, I'm working on an open source project for Wikipedia. I could always be writing music. I could update my list of the best albums in the universe which I did recently convert to be served concurrently as a Gemini site.

So yeah, I have the odd side project here and there that I could be working on. But none of it has any urgency or deadlines, so why bother organizing it into GTD task boards?

Thinking cynically, I can't help but imagine that all of these todo apps are filled with people's aspirational goals and dreams that quite frankly will never happen. Maybe they've taken the first step by writing down that they want to write a short story, or start a blog, or start selling things on eBay, or whatever. But is it going to happen? All the same mechanisms are at work that keep you from doing those things whether they're written down in a trendy app or not. Lack of motivation, enthusiasm, know-how, mentorship, etc.

I guess I just try not to buy into the Protestant work ethic thing, that hard work and “accomplishments” define our existence. And if my goal is to play some video games or even sit quietly on the couch and do nothing, do I really need a GTD app to write that down in?

As I've written before, I'm a sucker for New Year's Resolutions. And yet as the first link from this time last year states, I've also kind of given up on them. They're simply ineffective at creating any kind of real or lasting change. I've come around to the “today is New Year's Day, it is a Wednesday” kind of thinking.

Is it a loss of innocence, a renunciation of magic, with which I give up New Year's Resolutions? I think a belief in the special, the magical, is very healthy and energizes me more than anything else. For me, however, at this time in my life, resolutions are just something to feel bad about in March.

I'm not interested in any kind of self-help, getting stuff done, motivational voodoo to replace resolutions with, either. I think I'm more attracted to the mode of thinking, currently, that things are basically fine and I should just let what happens happen. Not that I'm going to stop trying new things, like maybe a D&D group at work, or tutoring a new friend in Javascript in the new year. But those are just things I kind of want to do anyway.

No, I'm not a bastion of satisfaction and joy. I don't spend every minute wrapped up in feelings of usefulness and contentment. Many of my minutes are still filled with malcontent, boredom and apathy. But maybe that's okay, that's just part of living.

According to songs.travisbriggs.com, I haven't published a song since July. That's a drought. I actually have written a few songs since then, ones that were mostly finished. That includes the sweet, completely finished song I wrote for Abby for our anniversary, which might never get a proper recording (though I probably owe her one).

All these other songs, though, I haven't gone through the process to actually clean them all up, mix them, add missing instruments and all that. It just seems like a lot of work without a lot of payoff. Of course, the payoff might be that I don't end up writing remorseful blog posts like this one.

I feel like I've lost a sense of wonder in my songwriting process. I'm either going at it with feverish diligence and follow through because I feel like I have to, I have to do it to make myself complete. Either that or I'm just “messing around”, indulging in “letting myself play” but ending up with listless, half-complete junk because I'm not forcing myself to write coherently.

I could resolve now to challenge myself, to push my comfort zone and write something that moves my song writing forward. I want to issue myself such a challenge. And I'm not reluctant to do so because I feel I will fail, necessarily. I think I could definitely do it.

The real reluctance comes from the fact that I think I'm stagnating for another reason. I've developed the basic facets of songwriting to a certain degree. I can write songs. I can write songs where I write all of the instrumental parts, the arrangement, the mix, etc. But it's exhausting friend. It really is.

I want to collaborate. I want to come up with a strong, driving chorus with no consideration for how it will fit into a song, and have another real breathing person help me figure out an intro and verse that will work with it into a finished song. I want to play with a band, where the drum feel and groove drive the composition of the guitar and bass parts, rather than playing guitar parts, adding bass later, and always just having a drum machine on repeat for the whole song.

Sigh. It's not going to happen. I feel like I'm some kind of musical incel, where I'll never find anyone to collaborate with. I don't know where to look, where to start. I've had very very limited success with collaborating over the internet, so I know that I need to find someone who I can sit in a room with and write with. But it's just as awkward as dating, except even more niche. I don't know where to start.

That songwriting challenge is looking more appealing. I might need to just NIKE the shit out of some songwriting (just do it).

Halloween is a time for the spooky, the scary, sometimes the terrifying and maybe a bit of the downright goofy. Is there room in there for a bit of Halloween sadness?

Two years ago one of my friends, Will, moved away from the Bay Area to pursue an MBA from Chicago Booth. We were all very proud of Will and wished him the best of luck. Two years later, he's graduated! But now he's moved to Berlin.

Will used to throw pretty extravagant, costume-required, Halloween parties. He and his friends were very into cosplay in general and would have costume parties throughout the year, for birthdays and other occasions. But Halloween, now there was a chance to get schmucks like me and a few of his other friends to be forced to wear a costume. Legend has it that if you showed up to one of these parties without a costume, you would be assigned a “loaner” from the rejected costume pile. And no one wanted that.

Is there room in Halloween for sadness? For the past two years, some of Will's friends and I haven't celebrated Halloween at all. We had no party to go to, no celebration. We had no reason to eek out the smallest semblance of a costume and hope it passed muster. Can you be nostalgic for something that happened 2 years ago?

It's just one more thing that reminds me that today, right now, the time we are currently living, will one day be looked back upon as the good old days. So put on your best costume, even if it's just “The Color Red”.

In part 1 of this tutorial, we explored some terminology related to domain names and websites, and made recommendations on how to find a registrar and purchase a domain.

Now we will look at the “hard” part: putting a single page website at that domain. We will be using Netlify for this process, since they provide perpetual free hosting for static websites which includes CDN support. A static website is a site that is served completely from files and contains no server side logic. Wordpress sites, for example, are not static, they are dynamic, because every time you visit them the Wordpress software assembles all of the parts and pieces and gives you back the resultant HTML page. With a static website, there is a one to one correspondence between the files on disk and the web pages you see. For more of a deep dive into this topic, see my article on dynamic web apps.

Step 1, register for Netlify

Head over to netlify.com and register for a free account. You won't even need to put in a payment method just yet (though that will be necessary if you are registering a domain name with them).

Step 2, prepare your site

We've provided a very simple, single page website that you can download here as a zip file. Extract it to somewhere on your hard drive and get ready to publish your first website! Note: it is recommended that for the first deploy, you don't modify the source code of the site at all, since this will help rule out potential trouble should you have problems.

Step 3, log into Netlify and upload your site

When you log into the Netlify dashboard, you should see something like this:

Netlify dashboard upload area

As the text recommends, you can drag the unzipped folder of the sample website directly to this browser window, and it will upload all of the files, preserving the directory structure, then immediately deploy the site. Deploying in this case simply means making it live on the internet.

Don't worry if you're not ready to share this sample site with the world yet. We haven't set up your custom domain which you bought (or will buy) yet, so it won't be there. The site will only be live at an obscure Netlify URL that you would have to share with people before they could view it. But it will be live!

Step 4, preview the site at its Netlify URL

Your dashboard should flash a bit as its processing, then eventually settle on something that looks like this:

Netlify dashboard with uploaded site

In my case, my site was assigned the ID “tender-archimedes-8ebddf” (don't worry, this can be changed later). Underneath that, we see an https:// link, which if you click on it, will take you to the live on the internet version of your copy of the sample website. You should see {TODO: put what the sample website looks like}

You also see the “3 simple steps” banner that Netlify provides. As you can see, the next step is setting up your domain

Step 5A, purchase a domain from Netlify

If you don't care about registrars and want the absolute dead easiest option, this is where you can buy a domain from Netlify.

Click the Step 2, “set up a custom domain” link. You should see the following:

Netlify custom domain setup page

Note that there isn't a button directly to “buy a domain name”. The way this works is you type in a domain that you're interested in (myawesomesite.pizza comes to mind) and Netlify tells you that it's either available and offers to sell it to you, or tells you that it's not available.

If it is available, and you buy it, you are immediately redirected to your site's settings page. If you scroll up, you'll see that your custom domain has already been added to your site:

Netlify custom domain settings

(Yes, for the purposes of this article, I actually purchased and registered https://netlifytestsite.com)

At this point, the test site will be live to the world at the domain you purchased. But don't worry, no one will see it unless you tell them about it.

Alternate Step 5B, use your existing domain

If you bought a domain from Netlify, it's already configured and you can skip to step 6.

If you have bought your domain somewhere else, maybe sometime in the past, you can still set it up to point to Netlify.

Click on Step 2, “set up a custom domain”, just like you would have above. Except this time, instead of typing a new domain name that you'd like to purchase, type in your current domain (without the https://). For example:

Netlify custom domain setup with existing domain

You'll notice that when you enter the domain, Netlify recognizes that it's already registered and asks if you're the owner. (Don't worry, you can't just claim any domain that you don't own this way. You have to be able to configure the domain to point to Netlify properly which means you really have to be the owner).

Click “Yes, add domain”.

Now, this is where things get hairy. You're going to have to go to your registrar and edit DNS records for your domain, so that they point to Netlify. This isn't as scary as it sounds, but every registrar has it's own user interface for accomplishing this, so there's no straightforward way to give instructions for this part.

Basically, though, it's just one step: Create a CNAME record that points “www” to “tender-archimedes-8ebddf.netlify.com”. Of course, in your case it won't be “tender-archimedes...”, you will have your own site ID, but it will always end in .netlify.com, so “.netlify.com”.

For example, for Namecheap:

  1. Find your domain and click “Manage”
  2. Go to Advanced DNS
  3. Click “New Record”
  4. Choose “CNAME record” from the dropdown
  5. For host type in “www”
  6. For target put the site-id.netlify.com
  7. Make sure to save the changes so they update.

Like we mentioned, every registrar has a slightly different process and name for all of these steps.

What's next?

In part 3 of this tutorial, we will cover basic HTML authoring so that you can turn the sample site into something you're a bit more happy with posting at your own precious domain.

In recent years, tons of new so-called “generic top level domains”, also known as gTLDs have been released to the general public. These include things such as .club, .website, .social, and even .pizza. Those helpful wikipedians have been maintaining a full list if you're curious.

Many people don't know that these TLDs exist or that they are available, often for a discounted rate. For example, if you happen to be Steve Harrison, the domain steveharrison.best is available for only $2.99 a year right now. And of course, if you can find something in the crowded .com space, those are available for between $8 and $15 dollars. (I recommend trying somethinglikeafullsentence.com for example).

If you're interested in dipping your foot into the pool of domain ownership and simple website hosting, read on!

Domain names versus websites versus HTML pages versus URLs

Let's start with a few definitions. A domain name is something like google.com or yourawesomewebsite.pizza. It is simply an entry in a global system that you (or someone else, or some company) has bought the rights to. Once you've bought these rights, you need to “set your domain name up” so that it points to something. That's the important part: the domain needs to point to something in order to be useful.

What it points to is the website that is located at that domain name. Actually what it technically points to is an IP address (or a series of IP addresses). The IP address is often referred to as the internet “phone number” of a computer located somewhere in the world. When you type “https://yourawesomewebsite.pizza" into your web browser, the browser queries the “global system” referred to before (the Domain Name System or DNS) and finds the IP address of the computer that is hosting the website that the address refers to.

For our purposes, it's not necessary to understand the details of IP Addresses or the Domain Name System. The important part is to understand that yourawesomewebsite.pizza isn't a website. It is a domain name that points to a website.

What about an HTML page? You may have heard of HTML or HTML pages, but how do they work into the picture? Well, HTML is basically a computer language that is used to describe web pages. A website is simply a collection of web pages under a common domain, or under a path under a domain.

What about URLs? Where do they come in? You might think that yourawesomesite.pizza is a URL, but it's not: it's missing the https:// part that makes it a URL. So yourawesomesite.pizza? Domain name. https://yourawesomesite.pizza? URL. URLs can also contain paths, such as https://yourawesomesite.pizza/products/1234, where /products/1234 is the path. URLs can also contain query strings, such as https://yourawesomesite.pizza/products/1234?display=full, where ?display=full is the query strings. Query strings allow for websites to dynamically respond to things like search queries and filtering parameters, but they're not particularly important for our purposes.

Note that the last example represents a URL of a certain domain name, with a path and query string, and resolving it via your web browser will result in seeing an HTML page that represents the website that is hosted there. Just to bring it all together, but all that is again probably too much detail for the purposes of this article.

Choosing a registrar

As far as choosing a registrar, I have consistently recommended Namecheap. There are plenty of other options out there (just type “domain registrar” into Google), but I would caution against GoDaddy because of their poor customer service and predatory business practices.

Update: It appears that Netlify is a registrar now and you can actually buy your domain directly from them. This might be a much easier option, since we will be using Netlify to host our site for free.

Once you've found a registrar you like, you can go through the process of searching for your domain. You can generally type in any string you like, and the registrar will first tell you if the .com domain is taken for that string, and then recommend alternatives from the wide world of TLDs described at the top of this article. You can also put in somecrazystring.pizza directly, with the TLD (.pizza in this case) included, if you have a specific TLD in mind. (Note that some TLDs have residency or other requirements, like those for specific countries).

After you've found a domain that you like that is available, go ahead and buy it! If your registrar provides any additional services as upsells (and most of them do), be sure that you don't purchase any website creation or website hosting. We'll be handling that in part 2 of this article. One thing you might consider adding though is any “privacy guard” add-ons that allow you to hide your real name and address in the WHOIS system. Without such privacy guards, your actual name, address, and email address will appear in the global WHOIS database, which will make you a target for not only spam, but real life junk mail too in some cases.

Many folks I know have already taken the first step and registered a domain. They saw that myactuallfirstandlastname.com was available and went through the steps to buy it. If this is you, that's great! That's an awesome first step. Unfortunately, if you go to the website at that address, you find that it's probably some “Website coming soon” page, with the branding of your registrar. Less than satisfactory.

Part 2 of this guide will help you figure out how to host something on your domain (other than the so-called parking page). The best part is, with a little bit of effort, it's completely free (the hosting that is)!