Elephant in the Room with John Rudolph Drexler
E6

Elephant in the Room with John Rudolph Drexler

Joe (00:05)
Welcome to Side Project. Today I've got John Drexler on, co-founder of Thunk. As of late, a major side projector, I would call you. You got a couple irons in the fire here. How you doing, John? Super side projector.

John (00:17)
SuperSide Projector. I'm,

I know, I feel like a lot of the code that I actually write on a daily basis is like in toy projects that are not real. It's funny. Yeah, it's definitely the most fun rather than like, yeah, writing some like wild classes to parse some data for some arcane API on some client project. It's a little bit more fun than that. Yeah, exactly. Yeah.

Joe (00:27)
but that's the most fun.

which is all of client work.

You just summed it up in a sentence. Good for you. That was amazing. So succinct. Yeah, for sure. Yeah, so you so right now I'm most focused on your your game work. You're trying to bring some to you and making games for a long time. Right. So you've been making physical games for a long time, I should say. And now you're kind of bringing them online.

John (00:44)
Yeah, that's right. Yeah, you paid like pretty decent money to do that full time.

Yeah.

Joe (01:06)
the latest being elephant in the room which is very good how many how many games have you actually brought online or how many online games have you made like website games

John (01:16)
Well, there's always the distinguishing thing of things that are live and available and have a public link and things that don't. So like.

Joe (01:25)
Sure. Okay,

let's break it down. How many don't? Let's start there.

John (01:30)
like five.

Joe (01:31)
that's pretty good. Okay.

John (01:32)
Yeah, but

but you know, it's like rest assured it's like this thing that I'm always thinking about which is like in terms of just like reputation and like social capital that you have with with Waving your hands and jumping up and down on the internet and going look at my thing Please look at my thing. Please look at my thing and then and then in some cases, please give me money it's like I try to be extremely selective with those things and so I Don't I work on like ten times as much stuff as I release

Joe (01:47)
Yeah. Yeah.

Right,

John (02:00)
And if I'm waving my hands, it means like, actually think this is really good. And if I'm asking for money, then I'm like, this is like the best thing I've ever made.

Joe (02:08)
This is extraordinary. Yeah, this is gonna blow your mind.

Okay, so how many have made it actually to a public link?

John (02:16)
basically like two ever and one of them is now defunct.

Joe (02:18)
Okay.

Okay, or de-Thunked, depending on how you wanna.

So you, well, you and Daniel made pyramid scheme, which was essentially an online game for all intents purposes, which, so you got three. So one of them is no longer just because you said we're done here, this doesn't live up to my standards anymore. Like what was the reason for taking them off?

John (02:27)
Yeah, yeah, yeah. Okay, I guess that's a third, sorry. Yeah, I didn't really think of that as one of them. Okay, yeah, that's right.

Yeah.

Yeah, it basically was like, I mean the short version is I gave a whole talk at PHP × NYC, which was an event that is run by my friend Joe Tannenbaum and yeah, never heard of him. Sounds like a real chump. But basically we spent years building this thing. We built it with technology that we don't use anymore. We use it with Spatie event sourcing package.

Joe (02:50)
Don't know, I've never heard of him. Not familiar with that idiot.

Alright.

John (03:05)
It

is like, you know, the old Caleb Porzio, said, legacy code is any code you resent. The entire code base is legacy code. And it's like, there was a point where I was like, maybe I'll go back. It's also like kind of a huge game. It was like, it really ballooned out into a lot, but it is the thing that got me into writing code. And so it has a very special place in my, it's called Pecking Order, yeah.

Joe (03:19)
Yeah.

Okay, this is, pecking order? that what it's called? If you wanna

see him talk about this, there's a YouTube video called Stone Soup, which is great, and you should go check it out. John Drexler, Stone Soup.

John (03:32)
There you go.

Yeah, I will not rehash

the whole story. It basically that's talk goes through like how we made it, why we made it, why it was so special for us. And then also then why I decided to kill it. and the thing that is now interesting is to the main people I worked on that with are people who I we're going to we're talking about making a new game. That's like a radically simplified version of it that is like meant to be played in person.

Joe (03:58)
Okay.

John (04:01)
and is flexible for different player counts and is not so scary to newcomers. So we're trying to sort of chip away and find just the gem at the center of pecking order and make a game out of just the gem. And we'll see how goes. Yeah.

Joe (04:16)
That's cool. Nice, nice.

I was playing Elephant in the Room earlier today. You have so many elements that are deceivingly hard, such as sound effects, a bot player, animation. it feels really polished. It's very impressive. Can we talk about...

John (04:35)
Thank you.

Joe (04:37)
the stack journey, because I think if I remember correctly, you were posting about that you changed stacks. Like you started with one, you changed stacks. So what was that evolution? And then where did you land? And like, what were the tough bits? were the parts that tripped you up?

John (04:51)
Yeah, it's been a journey and I actually think this is, it's like very interesting. was like, it's been, you could mark my journey as a programmer by the iterations of this game. So.

Joe (05:00)
Actually, let's back

up and say what is elephant in the room? Do you want to just describe the mechanics of the game?

John (05:04)
Great,

Yep, the quickest way you can kind of picture it in your mind is imagine if you were playing Connect 4 and the pieces could move around. So I was thinking about game ideas like in 2018 maybe, and was thinking about, was like, Connect 4 is a good like simple abstract concept that everyone gets intuitively, but the thing that's not interesting about it to me is that it's static.

Joe (05:13)
Well, perfect.

John (05:27)
once you play a piece, is always where you played it. And it would be how interesting if you could move rows or columns of pieces to like go because then that's like now that's a much broader space to think about. And so there's like a lot more chances to outwit your opponent. And so Elephant in the Room is a simple four by four grid. You take turns sliding tiles onto the grid. The elephant blocks movement so you get to play a tile and then

Joe (05:44)
Yeah.

John (05:53)
Move the elephant and if you can if you manage to construct the shape sometimes it's a line sometimes it's a square There are other shapes as well You win the game immediately and so you you know the general experience when people start playing it is they're like well that seems too easy and then their opponent starts pushing their pieces around and they're like This is like kind of hard to think about which is kind of like right in that sweet spot of an abstract Game that you want to you want to hit?

Joe (06:16)
Yeah.

As I was playing, was like, wonder, I wonder what the good strategy is. Like, you know, you know, when you,

When a kid as a kid, you're playing like tic-tac-toe and you learn about putting one in each corner. So you have multiple ways of, you know what saying? Like you, there was that unlock that was like, if I do this, I can basically win like every time if I can get that like in three different corners. And it feels like there's something analogous here where there's a strategy where if you place a couple to give yourself several opportunities as things shifts around, but then it does shift around in the elephant is sort of like the X factor of

well it's not always going to work out that way because you can't always shift in the way you want to. I don't know it's it's do you have strategies at this point that are a little bit tried and true?

John (07:05)
I... here's a quick confession. I'm not that good at games. And I am... I am like way... I'm way better at designing games than I am at playing them. And people laugh at me all the time when we're testing my games because I will make like catastrophic blunders in almost every game I play. And like, it's really funny. Yeah.

Joe (07:10)
And the podcast, we're done. We're Interesting.

fascinating.

I kind of love that. think it actually

makes sense at some level that maybe you're just thinking about maybe the mechanics of the game more than you are about like actually playing a game on any given.

John (07:37)
That's

part of it too. mean, we'll go with that. I mean, it is true that whenever we're testing the game, I am like thinking about it like a designer and I'm thinking, is this specific thing working? What do I want to change next time? So like, I am very preoccupied when I'm testing, but also like even when I play like, I don't know, I have played a lot of games and I will introduce Lindsay, my fiance to games and she's like not, she didn't grow up as a big gamer and she'll like...

Joe (07:40)
I

Yeah.

Great.

John (08:03)
frequently beat me and stuff that she's never played. I'm just like, and she, she, I do think some people just have like game intuition where they're just like, they pick something up and they just get it. Um, but yeah.

Joe (08:06)
Yeah.

My wife is that person as well. She

demolishes me on a regular basis. Doesn't really matter what the game is. She just latches on. She's like, I get it. boop, boop. And just understands like the common sense to her moves to make. And then she's always like four steps ahead of me. I don't know how it works, but like she definitely has that.

John (08:28)
Totally.

But to answer the question, I have strategies that work for me. if I'm playing a game, I played, Daniel hadn't played much, and right when I launched it, we played 10 games online, and I beat him nine out of 10 times. I've played the game so much now that I have some things that work really well. If you want to know how I play, the bot is basically programmed to think exactly like I think, but it doesn't make mistakes. And so,

Joe (08:42)
Mm.

Okay.

John (08:54)
If you play against the bot, the bot is generally doing what I would do.

Joe (08:59)
sort of the perfect

version of you if you were always on. Yeah.

John (09:02)
Yeah, and so

then what's interesting is like a bunch of people played the game right when I launched it and several people texted me they were like the bots too hard because it make mistakes. But then a handful of people texted me like Jake Bathman. know, Jake Bathman is a true true gamer. And he messaged me and was like, is this bot right? I keep on beating it on the first try. I'm like, well, you might have intuited something about my game that I don't understand myself.

Joe (09:26)
I beat the bot today. I beat it today. I was very proud of myself. But it didn't look good for a minute, I'll be honest. Like there was a minute when I was like, the bot's got my number. And then I just shifted.

John (09:28)
Nice. Great. I have been... Yeah.

I think the secret

strategy to beat the bot is the game dramatically changes in the end game when you have to conserve tiles. So if you run out of tiles, you lose your turn, which almost certainly means you're going to lose the game. And so if you're playing against somebody who's equally skilled with you, you will very likely reach a point where one of you only has one tile left. And then the game significantly shifts because you have to be thinking,

I need to make a good move, but also I should probably push one of my own tiles off the board so I can have another tile. And that, that, that like third act like dramatically shifts the strategy and the bot is like not very good at those decisions. So if you want to beat the bot, just like wait them out.

Joe (10:06)
You gotta reclaim a little bit,

Yeah, I just keep shuffling things around the board until they have no tiles.

That's good advice. So, okay, so now we understand what the basic mechanics of the game are. You started with what stack? You started with Inertia, right?

John (10:30)
yeah.

Well, so way back when I, it was the very, very first learned how to write code, I did this as just like, like a Livewire crud app, basically. And it was hilarious because all of the game logic was just in this one Livewire component called board. And it was like, knew nothing about how to write code. So I was just like, I don't know where else to put this. I'm gonna put it here. You know, like.

Joe (10:41)
Mm-hmm.

The

fattest controller you've ever seen. Like, yeah.

John (10:57)
Yeah, yeah. And also

it was ridiculous. Like every space on the board was like a row in the database. It was like insanity. was so bad. was literally like, here's somebody who has never written code before. Yeah, exactly. But it was really exciting because it actually did work. It was like ugly, slow. The code was like hilarious. But like you could log in and play.

Joe (11:08)
Listen, else are you going to start? Like, come on. Yeah.

John (11:23)
And so I was like, whoa, I can make stuff now I can like get better at making stuff, you know so eventually I came back and I said, you know the Naively what I said like six months ago was the thing that it's missing is animation and that is true because You know when you play a tile if you don't animate it at all You just like click a button and then you see the thing appear

Joe (11:23)
That's dope.

John (11:46)
and it's not intuitive that the tile was sliding onto the board.

Joe (11:50)
It's hard to tell like what just happened. Like you have to sort of like fill in the blanks a little bit. Yeah, I totally see that. Yeah.

John (11:52)
Yes.

So I was like, okay, so it is true. Like that is an assumption that is correct, which is that like you need to have animation. But that was only part of the story. So what I did was I was like, maybe I'll use this as my chance. I've heard like Inertia 2.0 is coming and Inertia is really cool. I will use this as my chance to like go get good at React. And I talked to some people and was like, I asked Twitter about like, what should I use? And people were like, framer motion is really cool. It's really powerful.

And I went and looked at it. Framer Motion is really cool and really powerful. And I had a lot of fun playing with it. seems like you could do some really radical stuff with it. And there was one response that I didn't look at very carefully from this guy named Connor Lindsay, who I've gotten to know a little bit since then, who sent me this blog post that was like, Framer Motion is really cool, but did you know that pretty much everything Framer Motion can do, CSS can do now? And I was like,

Joe (12:23)
It is a.

Yeah.

John (12:46)
Really? And I kind of ignored it and then moved on. Yeah.

Joe (12:48)
Go on. Yeah.

John (12:51)
And so then I went and built it as like this React app. And this is where I got into the second, like, or not the second, or maybe the third or fourth, like, about this was that I needed the front end to know everything about the game. And the reason is...

When you click a button or you say, go play this tile, we need to animate the entire board state and the slide and maybe immediately upon playing that tile, you actually won. We need to animate the tile moving immediately, which means we need to know how tiles move. We need to know what's on the board. We need to know the whole history of moves. We also need to know how do you calculate victory condition.

Joe (13:25)
Mm-hmm.

John (13:39)
does Joe have victory condition? We need to know all of that before we even get a response from the server, right? Because if we wait until we get a response from the server, there's gonna be some kind of delay. And even if it's a half second delay, it feels really bad.

Joe (13:56)
Yeah, it feels bad. Yep. Yep.

John (13:57)
So that was the part that I think I had not wrapped my head around. was like, well, if you have animations, it's really cool. But I had built, because of the game, I'm to talk about Peking Order first. You think about Pecking Order, you don't need a lot of like real time stuff. It's a social game. I won't go all way into it, but like similar with Pyramid Scheme. Like you vote, you do stuff and then like, you know, it can like load the scoreboard after you vote or whatever. But like, there's not a lot of real time stuff. You can kind of treat it like a crud app.

Joe (14:25)
It's pretty purposely

asynchronous because you were playing when you had time basically. Yeah.

John (14:27)
Exactly. Yeah. And so

like, that's everything that I had built to date. And so the way that I had the way that game like engines work in my head is I use verbs, they're all event sourced, and they're all on the server, right? And like the server does need to know game logic. But it's like, that's where I've always started is I just say like, well, what's the game logic? Let's start building out a cool world.

in event sourcing and build a backend that can accommodate all this cool future stuff and works and knows everything and has really good exception handling and whatever. once I started really, I'm like, how do I really polish Elephant in the Room? It's like, well, actually all the polish has nothing to do with the server. I actually need to know everything in the client. And so not only do I need to do animation there, in order to intelligently do animations, the client basically needs to know

everything about how the game works even before we talked to, we can't rely on the server basically. And so that was like a really interesting revelation for me. And I was like, had a bunch of really interesting conversations with Daniel about that where I was like, this is weird. Like if you want a super responsive thing in the browser or just in the client in general, it's like the client has to know everything, but also the server has to know everything. And it's like,

Joe (15:45)
Yeah.

John (15:46)
this is why people are writing next JS apps. okay, got it. And it was like, was, it was cool to like push that as far as I could to get to that point where I was like, I think I just like understood the rationale for next JS from first principles and like, get it. Like there's a reason people want to do it. And like, maybe that would be a fun little toy to build is like, you know,

Joe (15:50)
I didn't want to say it, but there we are. Yeah.

John (16:11)
is to build something in Next JS just to learn how it all works. I don't really want to use it for real, like, just, I don't know, sounds kind of fun.

Joe (16:18)
Yeah, totally. mean, the power of writing the same language front and back end and a language that natively runs in the browser, you know, it's very powerful. It's like a huge, the logic sharing everything about that is amazing. It's probably the one, one of the few shortcomings that we have as like Laravel developers is that we can't truly, truly share logic and have that sort of like low.

super low latency interactions in that way, just because of that. so you said Inertia is not it. What was next in the? not yet.

John (16:48)
Well, it wasn't

that, I mean, yeah, and it wasn't that it wasn't it, it's that I, so that's where I realized I ran into a problem with Framer, and it was not really a problem with Framer, it was a problem with how I had built it, and so I was staring down the barrel of like a big refactor, because I, basically I was trying, I don't know if this is right, I don't know if I know enough to say that this was the problem, but.

I think I was thinking about it wrong, where I was like, I was like having, I was doing like framer stuff at like a individual component level, a component being like a tile or the elephant itself. And like all of these like instances of framer were like bumping into each other and it was getting weird and bad. And I was like, I think this is not how you're supposed to do it. So I was like, okay, time for me to like run it back and like,

Joe (17:23)
Mm-hmm.

I can see that.

John (17:37)
think very differently about this and it was at that point that I revisited that blog post that Connor sent and honestly without even trying it I went into cursor which I use I had just started using cursor for the first time and I just made a blade component that had like nothing there's no it wasn't connected to livewire it wasn't doing anything but I was just like hey cursor

make me a grid, a four by four grid with a bunch of like colorful tiles on it and when I press a button they all slide to different positions and only do this using Tailwind classes. And it wrote like 15 lines of code and it was like more beautiful than anything I had made and I was like, no!

Joe (18:15)
and your mind exploded just right then and was just like, boom.

I've wasted so much of my life.

John (18:31)
So

it was really cool because it was like there was all this stuff I just didn't know and honestly doing it with cursor was like super fun because I you know I have a strong it helps me also develop some strong principles about how I use AI because I was like I I'm definitely not merging anything into this project that I don't totally understand because like I will not be like owning and maintaining code that I don't understand

Joe (18:40)
Yeah.

Yeah,

yeah, that's a good starting point. Yeah.

John (18:58)
But yeah,

but like I, I did, kept on like going back and like a lot of what it wrote, like kind of didn't work, but it like almost worked. and it was really interesting. So I literally just like went from that to like, would, I was like, okay, well now I can go back into a world that I'm comfortable in. And I went back to Livewire. And what was interesting was then I was, because I had had that Inertia experience, I felt like I had a better intuition of like,

being choosy about like when I talk to the server and why and what information I'm passing back and forth. And I introduced reverb as well. I guess I probably had reverb already for the Inertia one. But that was cool to use reverb for WebSocket stuff.

Joe (19:29)
Mm-hmm. Mm-hmm.

So we're

using, so I know that there's also like obviously a multiplayer element where you can play in real time against people on the internet, but are you using that, like does reverb come into play with the bot as well? Like are you, okay.

John (19:47)
Yeah.

The bot is all, the bot's all happening on the server. And so

I need to like, basically like after you from your client, you make a move and your turn ends when you play the elephant. You play the elephant and then the server sees that you played the elephant and is like immediately do a bot move. And at the end of the bot move, you know, inform the client that new stuff has happened.

Joe (20:13)
So it is still

over. You still have WebSockets involved there as well. Yeah. Okay. Cool. Cool.

John (20:16)
Yeah, yeah, for sure. And the bot

is what the bot is on the back end is just another player. So the all the WebSocket stuff is indifferent as to whether your opponent is a bot or a human. Yeah. And that was really cool. One of the things I realized was that like my state, I actually might do it differently again, if I to start over from scratch. mean, first of all, if I were to start over from scratch, I would actually start with literally just the client and I would make the client really smart and happy and

Joe (20:22)
Yeah.

Perfect. Perfect.

John (20:45)
clean and good and then I would build out my server probably like which feels crazy but in retrospect I think that's actually smarter.

Joe (20:52)
You're mean, it's, you're, you're butting up against like local first almost like you're basically giving the client all the power and then just kind of making sure the server just serves as sort of like a rectifier. It's like, okay, does all this make sense? And then like, it's, it is the source of truth ultimately, but the client is the smartest person in the room at that point, like for the, for the course of gameplay. Yeah.

John (20:57)
Yeah.

Totally.

Yes.

Which, Will King, who's building some really crazy stuff with React right now, he's building a video game in the browser and it looks like it's crazy what he's doing. But he's a great developer. So he was like, from the beginning, he was like, I remember he tweeted early on, was like, I'm pretty sure the approach here is super smart client, probably kind of dumb server. And I was like, what are you talking about? And then like.

Joe (21:16)
Yeah.

Mm-hmm.

John (21:38)
And then getting into even just this simple little game, was like, that is exactly what I would do if I was starting over. Yeah. I was like, you idiot! What are you thinking?

Joe (21:43)
Dear William King, I apologize for my previous comments. Yeah. I would

like to retract my statements from September 14th. Yeah.

John (21:52)
Yeah, yeah, but but

what I was gonna say is that part of the reason I would also consider the interesting thing that's weird about it is that like I might I actually might not even use livewire in the future because I actually got to this point where That big blade component that is like the whole game Which is not good. It should be broken up, but it was easier to have it all in one file for me so That component

I'm wire ignoring the whole thing because this the this the state of like if you think about like where every tile is is like got there as a result of like a bunch of events happening and so like the state of it it should be correct but it's also like kind of fragile and so if you just start like willy-nilly updating things and being like you know we just got a new request from

from Livewire, we just did a new request to Livewire because something happened. And now, Livewire is sending up shoving data up into the component. Things kept on breaking, breaking when I didn't expect them to because I was like, I had built this fragile little world in the client. And I was like, I need the sledgehammer of Livewire to not hit my fragile little world. And so I ended up wire ignoring everything and then specifying exactly when Livewire hears something from reverb.

Joe (22:50)
Mm-hmm.

Yeah.

John (23:10)
or anything like that, it in a very surgical way, like emits an event to, Livewire still is probably the right solution, but like, I'm not automatically like updating anything. It's like extremely meticulous. Like, okay, we saw that Joe played a thing on the server. Do we already know about that? Or do we not already know about that? Like what's the state of the world? Okay, animate this way. And so it's interesting.

Joe (23:16)
Mmm.

But you're still shooting information

to the server as it goes, just to say like, Hey, this happened, just like record it just in case like they refresh the page or, know, whatever, they lose the client state basically. Yeah. I mean, not, yeah. I mean, saying it that way, Livewire feels a little overblown. Like if you're going to wire ignore 90 % of it at that point, like maybe just write some vanilla JavaScript or just, or just Alpine really would probably be fine. know? interesting. That's fascinating.

John (23:41)
Yes. Yeah.

Yeah.

No, it's 100. It's 100 % of it. Yeah. Yeah, totally. Yeah, yeah. But there were some niceties

with how Alpine receives those events from Livewire and stuff. There were some nice things in there. it is interesting. Literally, it's this one Livewire component in the blade file, the entire thing. The parent div is wire-ignore. So it's like...

Joe (24:10)
Sure, of course, of course.

John (24:20)
It's a weird, yeah, like what am I even doing here?

Joe (24:20)
It's like, why? Yeah.

So ultimately you ended up with a very smart client, sounds like. The client knows basically everything about the game. Is that right? That's what we ended up with? Okay.

John (24:31)
Yeah. Yep. Yep. And

there is a bug in there somewhere. People occasionally send me screenshots that I cannot replicate where the client is wrong. But yeah. Yeah. Yeah.

Joe (24:41)
That's

rough. final result is we have live wire being used, largely ignored. have web sockets.

Once you settled on like, okay, this is the implementation, this is the stack, this is like how I'm choosing to do this. Like what was, was there any tech or any decisions that were particularly tricky or like something that like took you a while in implementing the actual gameplay of it?

John (25:06)
I think some of the hardest parts were, figuring out like time. There's, there's, it's like, there's some hacky stuff in there with like timing. which is like, if you, I'm trying to even figure out how to articulate. Like if I like,

Joe (25:17)
Hmm.

John (25:23)
move a tile and then move the elephant really fast and not wanting those two things to collide. And so I did introduce, there's a concept of in the Alpine code that's is animating, is a thing on the component. And I try not to animate anything while that's true. And then there's other stuff in the same way.

if from reverb I find out that you like what I actually ended up doing was to ensure that I had control over that for animating your opponent's I basically ignore when you play your the turn is like you play a tile and then you play the elephant I basically ignore when you played the tile and I wait until you've played the elephant and then I like can animate both of them in like a sequence that's like consistent with its timing

Joe (26:11)
Smart.

Smart.

John (26:11)
But then

that introduced some other things where it was like, what if you have played a tile and then I refresh and then I like see your tile, but then you play the elephant. So then it like plays another tile. And then my client is like confidently wrong. And so I had to introduce this other concept in Alpine, which is like known moves. And I'm like, cause everything is like stored as a move. I'm like,

Joe (26:20)
Yeah. Yes.

John (26:38)
If I like when you load the page, it loads in the IDs of every move that it is aware of. so like, if I ever tell it to animate a move and it's like, no, we actually already animated that move. It skips over it and jumps to the next one. so there was a bunch of that stuff that I was like, none of that was really in my mind when I started. And then as I did it, I was like, this is all working, but like it is clunky and weird and bad, you know? So there was a lot of just like,

Joe (26:52)
smart smart

Yeah.

John (27:07)
I'll like, a substantial amount of the code in that component is like solving those little things that like, if you looked at it, you're like, why are you doing a like set timeout for 700 milliseconds right there? I'm like, if you take it away, everything breaks, you know? Yeah.

Joe (27:17)
Yeah, yeah. It was the evening of December 7th.

I remember, so I built over the pandemic, I built a real time card game like that you could play against. Yeah. In that, I ran into a bajillion and I, you know,

John (27:32)
Yeah, you told me about that. really want to see it.

Joe (27:39)
I think I'm probably a better developer now than I was then. And I think I would probably build it in entirely different way, but I ran into like so many instances of like,

Okay, that just happened. like everybody chill. got to like deal out these cards first. then like, it's like somebody won, but five things need to happen before that actually displays in that way. And like, everybody's got to be in sync and on the same page. And then hopefully nobody refreshes, but if they do, we have to like, resync this state and like play it back out again. It was so, I mean, first of all, I would definitely be building it with verbs behind the scenes because like, probably like your initial game, like I haven't looked at that code in forever, but it's probably.

horrific and like very large. But I remember so many of those instances where I was like setting weird timeouts and like, we currently animating and you know, are we, we in the process of doing X because then just hold off and then do the next thing after that and sequencing was really hard. And so, yeah, I remember all of these problems and yeah, it's, it seems, it's, it's tricky. It's hard to do these things. And I wonder if somebody's cracked it in such a way. Like would like, would front end verbs like fix a lot of this stuff because you could sort

of like tap into events in the same way and then just like respond to those events with the correct animations.

John (28:53)
I

will not try to give... will... literally very little is being built right now. We have a lot of clients. So I will not try to answer that because I think I will muddy it, but I will say this. There's been a bunch of speculative conversations about what something like that could look like.

Joe (28:54)
Confirm or deny that front-end verbs is being built right now.

Yeah.

John (29:12)
There was even a moment where like we didn't actually do any of this but like I was showing something to Chris Morrell and he was like he's like what if like a you know what if an event like return could return like a blade component and like what if what if like you could actually like return components and like tell them how to behave when

like at the end of firing an event and we like we kind of started going off into galaxy brain territory and it was like whoa and daniels played a lot with like this whole like he's talked a bit about publicly like verbs commands stuff and like verbs livewire integrations where you're like if you could imagine i mean this is a smaller case but it's like if you could imagine that like each for every action that a user could take suppose that

Joe (29:52)
Mm-hmm.

John (30:04)
there's an event that goes along with that. And in verbs, you validate and authorize each event. so imagine you did command K to open up a command palette. And what you see in that command palette is, under the hood, five events, some of which you are authorized and valid to take and some of which you are not. And it's like all of the code about those activities just lives in verbs, which is so cool. And then your validation logic for the front end

Joe (30:29)
That is really cool.

John (30:31)
and for the back end lives in one file, which is like really cool.

Joe (30:36)
Yeah, that's pretty solid. That's pretty solid.

John (30:39)
Anyway, I'm giving away his tricks here, I think

he's talked about that publicly. that stuff does not exist yet. I mean, not really for real. There's little toy examples exist. there's some cool stuff. There's some really cool stuff you could do.

Joe (30:52)
Mm-hmm.

That's awesome. To switch back to the game real quick, how hard was it to build the bot? Like how hard was it to have the bot make decisions? Because I'm interested in that. And you also made it, I think, did you make it varying levels of difficult? Like you could make it easy, medium, hard, or did you not end up going down that road?

John (31:13)
It actually, it would be really easy for me to implement that. I didn't implement it. It's pretty easy to implement. Basically, it was surprisingly not that hard. And the reason was, the reason that it's not that hard is because I was able to write it in a dumb way. And the reason I was able to write it in a dumb way is because there are not that many different things that the bot could do on a given turn.

So there's, if you think about it, on a given turn, you could make one of 16 choices. And then if the elephant is blocking a couple of those, you could make one of 14 choices, right? And also we have certainty about what the state of the board will be with all 14 of those choices, right? So it's like, you could play in the first column in the first row and down, you could play in the second column in the first row down. And we know exactly what the board will look like after each one of those.

Joe (31:40)
Mm-hmm.

John (32:03)
And so basically in Verbs land, when it's time for the elephant to, or time for the bot to take their move, you can just basically go, what are all the moves that they could make right now? Pass them. I basically pass through, I have like an object called, or an array called like a hypothetical board, you know? So it's like, here's the 14 hypothetical boards that will be generated by those 14 hypothetical moves.

Joe (32:15)
You play through them. You say like, what do these all look like at the end state?

John (32:28)
And then just a pretty simple little function to score those outcomes. So basically it's like, okay, well if that outcome gives the bot a victory, that's like plus a million points. If it gives me a victory, it's like minus a million points. If it gives them check, basically like they are one move away from completing their shape, that's really good. But if it gives me check, if it gives them multiple checks, you know, and then basically after all of those different things that matter a lot,

then it basically just says, maximize the number of my pieces that are together and touching each other and subtract how many pieces of theirs are like connected and touching each other. It's like, if we don't have anything else to go on, just like make me have more pieces that are touching and in any combination. And so basically just as like, it's a knowable thing and it takes like, you know, a very short amount of time to compute that. It's just like,

what's everything the bot could do, score it based on what's good for them versus what's bad for them, and then put those in order and pick the first one.

Joe (33:30)
It's much simpler than I would have imagined, I, that makes sense when you, when you spell it out that way, that makes a lot of So if you were to do varying degrees of difficulty, you would sort of build in mistakes. Basically, if it was like on easy mode, it was that is that.

John (33:36)
Yeah.

What I think I would

do, what I've played with before is right now, so let's say you get those 14 hypothetical boards and then each board has a score and then we just sort it based on the score. Right now what it does is it just picks the top score. I think what you could do if you were on like, yeah, exactly, exactly. So what you could do theoretically for like medium mode is like.

Joe (34:02)
which is theoretically like hardest mode, right? Like this is like a bot on hardest mode, yeah.

John (34:11)
pick one of the first three in that array instead. if, yeah, in easy mode, pick one of the first five. You probably have to play test it to figure out what, I mean, that would probably include some big blunders. So I don't know, maybe medium mode is like pick one of the first two. So I don't exactly know what the.

Joe (34:14)
You could just lottery it basically. Yeah.

Or it's like 80

% of the time pick the best one, but 20 % of the time pick two or three. Interesting.

John (34:30)
Yeah, you could get more specific. Yeah.

It's also interesting because it got it. Man, I got into some weird like so initially for a long time, the game was the only shape you need to make as a square, the two by two square. And it wasn't until very recently that I introduced the idea that like, it's randomized. Maybe you're trying to make a line. Maybe you're trying to make a square. It's basically all the Tetris shapes that are in there. And

these you'll notice that the bot is really good at the square and it's not as good at the other like my logic does not hold up with as well with those other ones and part of it is like this is the ugliest and dumbest part of the code base is like when it's the most important thing that it has to do really is check to see if it has check to see if it's one space away from winning

But actually enumerating every situation where you're one space away from winning is more slippery than it seems. it's like, yeah, because you have to take into account, what if there's three pieces in the middle here? If there's a piece to the left of it that you could push it over, that's check. But if there's no piece right there, it isn't check. And so like,

Joe (35:31)
It seems very slippery to me. Yeah.

John (35:47)
nailing all those down. like it was weird. I got in some testing in the final days where I was playing against the bot like a lot and like the bot was on the non-square shapes. It was making some blunders and I'd have to be like, okay, draw that board and like sit and think about it for a while. Like why did the bot not comprehend why this was check? You know, it's

Joe (35:47)
Hmm.

It's a lot of like extrapolation

to like go a move or two ahead. It's very, yeah, it's hard. That's very hard. Yeah. On a more general note, just because the thought of like designing a game to me feels very daunting. It feels very intimidating to design a game. Yeah, no. Says the guy who like designs games. But like, is it about like...

John (36:25)
No, it's funny, you just do it.

Joe (36:32)
I guess you can answer this one of one of two ways. What is it about a game that makes a game good and or what makes a game immediately bad? Like, do you know what I'm saying? Like I remember you talking about like Kingmaker a lot, right? Like there's like a sort of that's either good or bad and like, I don't know. What are your, what are your thoughts on that? Like how do you, what levers are you adjusting to make a game better than it was before? Or what are the red flags when you were in your creating a game?

John (36:59)
that yeah

I do have a more intelligent answer than this, the true, true answer as I'm developing is like, it's purely vibes. It's like, do I like playing this game a lot? You know? And it's, sometimes that's easy to articulate why, and sometimes it's really not easy to articulate why. But the only things that I'll ever release are things that I'm like, I straight up do not get tired of playing this and I like it every time. That's...

That's the barometer. And it's like, I just have to like it so much. That's pretty much it. Now there are things you pay attention to, obviously, right? I mean, there's some things, there's some classic blunders of like, one classic thing that people love to point out is like, in Monopoly, you know who's gonna win potentially 45 minutes before the game's over?

Joe (37:28)
Okay.

John (37:47)
obviously bad. I had that one time even with like a fairly sophisticated board game that I play. I actually don't like the like super complicated five-hour board games. A lot of people like those. Somebody invited me over to play the Game of Thrones board game and like it's like incredibly complicated and I in the first like 30 minutes I had no idea what I was doing and I like made a move that I didn't realize was stupid and I was like

Joe (37:48)
Yeah, yeah, that feels bad. Yep.

John (38:14)
I turned to guy next to me, was like, I'm kind of blocked in here for like the rest of the game and your army is just gonna get stronger and mine's just gonna get weaker, huh? And he's like, yeah. I was like, I'm just like riding this out for the next five hours. He's like, yeah, pretty much, yeah. I was like, that's bad. Like that's a big feel bad, you know? So like having...

Joe (38:25)
You're like, can I stop right now?

Oof.

And you had no like

escape hatch. was no, there was nothing you could do to like rectify that situation built in.

John (38:39)
It was like, maybe

there was if I was better at that game, but it was my first time playing it. you know, so it was, it was just like, there's stuff like that that are just like, yeah, really, really bad feeling. Like having like certainty about outcomes is like generally not very good. that's like kind of what a game is, is like uncertainty of outcomes. and so like, it's not a game is not a story. and a story is a thing that has like a certain outcome. and

Joe (38:46)
gives you a bad taste.

John (39:02)
a is like an emergent machine. It's a machine which generates like emergent scenarios. And that is like much more interesting, you know, for me, I like stories too, but it's like a game should not be this like kind of like linear deterministic thing. In my mind, some people disagree, but the yeah.

Joe (39:18)
No, think that makes sense.

John (39:20)
There's a guy who I can't stop thinking about right now, whose name is Brian Moriarty. And he programmed these text based adventures back in the 80s. And he's like maybe like the smartest person in like game thought stuff. Clearly I'm not. That's my description of the field is game thought stuff. But he gives a lot of these talks about.

Joe (39:36)
Okay.

You

John (39:44)
about the relationship between games and stories and they're very super interesting. I'll send you some links if you're interested. He is completely taking over my brain. I don't know, other things to watch out for? I think one...

Joe (39:50)
Yeah, we'd love to read up on that.

John (39:58)
framework that I let me you'll hear a lot of people say this like game design 101 stuff is like you start with the intended player experience and work backwards from there but it's like this thing for you to point to over and over throughout the game development process and it's

Joe (40:13)
Can you, so wait, break

that down. Intended player experience being like in Monopoly, the intended player experience would be, like how do you summarize that? This is so abstract to me. It's hard to even like comprehend. Right.

John (40:23)
Yeah. Yeah, yeah, yeah. Well, here, how about it? So you you did the pyramid scheme, right? So like we could start with

that because that was one where like we knew exactly what we wanted the experience to be. And it's actually it's actually good for it to be pretty abstract because then that's like it's not tied to a specific mechanic. But like for that one, it was like, OK, so at Laracon we're going to have 1500 people in the room and in this loud room.

Joe (40:43)
Okay.

John (40:52)
I need to be able to come up and get in your ear and yell, hey, there's a game going on for $1,500 and here's how it works and have to explain that to you in about one sentence. You need to instantly find it like intriguing and kind of obvious. Like, I get how that works. I could see how me or one of my friends would win. Like, I see why that's interesting. It's like it's so clear and sticky that like

Joe (41:18)
It's gotta click

quickly. Like the whole thing has gotta click quickly. Yeah, yeah.

John (41:20)
very quickly without you

using any brain power on it. And then throughout the game, the player experience is like, it's something you can check in on. It's not something you need to do every hour. It's probably good if you check in on it once an hour, but you don't have to. Also, like if you quit, it's not a big deal. In fact, we built quitting into the game and we made quitting interesting. So it's like when you decide you're done, that's not a sad moment. That's an exciting moment.

We wanted it to be something where you have a strong reason to go invite your friends, which in this case, you win the game by working with your friends. We wanted it to have this kind of viral effect. And we wanted it all to ramp up to this big finale where one person gets this bag of money. We were picturing just the scene of a bunch of people gathered around and you hand a big bag of money to somebody. So that's pretty abstract because that says nothing about the rules. That says nothing about the tech stack. That says nothing about anything.

but it's almost like just painting this picture of like, what do want here? And it was like, that is what we wanted and we had total clarity about that. And you could write it down in like four bullet points, you know?

Joe (42:19)
Yeah.

And it's your

sort of, so then that ends up just being the guiding star of like, you, as you're creating a game, say, is this still happening? Is this still the end result? Is this still the experience that we're, that's, that's smart. That's smart. Yeah.

John (42:36)
totally. And part of that, like I

would say one of the biggest ones for me, I had to make a bunch of things before I started to understand like what is consistent about that for me across games. in pretty much every game that I make, it's always, Elephant in the Room is actually kind of an anomaly. It's the least, it's the game of mine that feels the least like a game that I would have made.

But like in all the other games that I make it's like direct competition. I don't make it really anything that's like single player and it is there there's ample opportunity for you to like put a few pieces together and feel like a genius and to like mess with people and so like that was part of the other big part of the player experience with with pyramid scheme is like the rules like

Joe (43:17)
Yes.

John (43:25)
are open for you to like mess around and play. Like you could really play with those rules. It's open to being like there's no rules about like you can't cajole people and offer them money to quit early and all this stuff. So it's like there's this big open creative field. And in the same way like Colossi or this new board game that I'm working on like we just hand you a bunch of tools and then we're like have fun, you know? And it's like if you, if you

Joe (43:49)
Yeah.

John (43:52)
can take a second to look at the tools available to you and string them together. You can go like, you have these moments where you go like, wait, does this really work? That's crazy, I can't imagine. Oh, you can actually do this. That is basically the fundamental player experience I want people to have over and over and over.

Joe (44:10)
And I will say that specifically with Colossi, right? Not Colossi, I always say Colossi in my brain. Okay, Colossi. So Colossi is a physical game that you made. And my wife and I played it and that was the constant experience was like, oh, you can do it. Oh, oh, it was just constantly going like, oh, oh. And that was satisfying. was something, was like, it felt like it was like morphing in front of us, like as you played the game a little bit. And then I got a little, mean, I won the first

John (44:13)
Yeah, yeah, whatever. It's up to you.

Yeah. Yeah.

skirmish. Yeah.

Yeah, like, no.

It's so fun.

Joe (44:42)
because she, I think she saw that mechanic. She's like, almost nothing is as presented because as soon as you get into a skirmish, it changes virtually constantly depending on the gameplay. So it was just delightful and fun and it's wonderful.

John (44:56)
Well, there's another,

I'll talk about this all day, by the way. I'm sure you have work to do. So, you cut me off when we're done. But like another, so would you ask a question about sort of like things that you watch out for? I didn't give a very direct answer, partly because I think when people talk about like games as like a category, it's almost as broad as talking about like writing, you know? And it's like.

Joe (45:00)
We'll wrap it up soon. We'll wrap it up soon.

John (45:18)
well, what are the general principles of writing? It's like, I don't know, what are we writing? you know, and so I think I like to think in terms of like spectrums or spectra, is that the plural? And, you know, there are no rules. Perfect. Careful. So the so like another spectrum that that reminds me of, which is like another

Joe (45:22)
Sure.

There are no rules. is a lawless podcast. You can say whatever you want.

John (45:47)
good framework for thinking about things is like, people talk about like strategy versus tactics. Strategy being like, everything you do has like super long-term consequences that are very difficult to undo. And so if you are really smart strategically, and you can like string together several smart things in a row over half of the game, you have like,

built up something that has sort of had compounding interest growth, you Or it's like, you've strung things together in a way that will give you a massive upper hand against your opponents later on. And tactics is much more about, what am I doing right now? What clever thing can I do right now? And you can think of games as being on that spectrum. so, I don't know, something like the Game of Thrones game I was just describing would be far on the strategy side, where it's like...

Joe (46:19)
Hmm.

John (46:36)
You have the opportunity, if you know a lot about this game and you make 10 smart decisions in a row, to really bludgeon your opponents. The things that I make try to be pretty forgiving in terms of strategy and lean very far in the direction of like, do something clever right now. You can probably dig yourself out of the hole later on if it doesn't work. But like...

you've got some cards in your hand that could probably do something clever. If you can't do anything that clever, like get out of there. And it's actually like, you will be rewarded for leaving early because you get to keep more of your cards. But if you can do something clever, don't wait. Like do it right now. You know, wow them, shoot off some fireworks, make them go, is that really what that card does? my gosh. And then move on. And I lean pretty far in that direction. And I think it's partly because like,

Joe (47:18)
Get the payoff, yeah.

John (47:30)
in games I'm really not good at. Like when I try to really play chess, I have a very difficult time envisioning two moves into the future. And so it's probably just a result of that. I enjoy much more just like what are the six cards that I have right now and is there something insane I can do with them.

Joe (47:38)
Yeah.

I think that's a great note to end on. What are the six cards I have right now and what's something insane I could do with them? I could also talk about this all day. I find this really fascinating. It's also like so far outside of my daily work, daily thought process. Like I certainly play games, but I've never thought about like making one in that way.

John (47:51)
Perfect.

Joe (48:09)
I think it's fascinating. It's just a fascinating thing to take up. Yeah, I might have you back on. Where can people find you? Where do want people to find you? What do you want to, this is now we're in Plug City, Plug away.

John (48:12)
Yeah. Well, happy to talk more anytime.

Yeah, yeah.

yeah, I assume

you're in, you're gonna, you'll put these links in there, but I'm on Bluesky JohnRudolphDrexler.com. You can also do, you can also do, just go to JohnRudolphDrexler.com, which is, I think has all of my links to everything. And you can find the games. I think you can find links to the Elephant Game and to Colossi if you want to buy it.

Joe (48:30)
I'll put no links in there. You gotta tell them now this is your opportunity.

John (48:47)
And keep up with stuff that I'm doing in the future. I don't know. I'm on also an Instagram LinkedIn You know all the things letterbox follow me on letterbox. think I have like 11 followers They're reading my really good movie reviews

Joe (49:00)
John is a,

I wouldn't even say movie, I would say a film fanatic. I probably, I imagine you have good taste. I have no actual idea, but I bet you're impeccable taste. So if you are also a movie person, connect.

John (49:08)
yeah, no chance. My most recent letterbox movie was 1994's

Little Rascals.

Joe (49:15)
So impeccable taste. I stand by that. Impeccable taste. Dude, a pleasure. Come back anytime. This was so fun. Thanks for coming on.

John (49:22)
Yeah. should probably

also say hire Thunk if you want to. Yeah. Thunk.dev. Yeah. Yeah, we'll put that in there. Yeah.

Joe (49:26)
hire Thunk. Thunk.dev, right? Thunk.dev. Okay.

Megatalented team, led by two megatalents. You should definitely hire Thunk. Do it up. All right. Catch you later, buddy.

John (49:35)
Perfect. Thanks, Joe.

Episode Video

Creators and Guests

John Rudolph Drexler
Guest
John Rudolph Drexler
Laravel and Product Management: Thunk.dev. I also make games: Catacombian.com. NYC (by way of St. Louis, Chattanooga, Jakarta, & Oakland)