Tag: programming

  • Claude is kind of good

    Claude is kind of good

    Image credit @fireship / TheCodeReport on YT.

    A few months ago I wrote about how Claude failed to build a simple macOS menu bar application. After burning through $5 in API credits and multiple sessions, it eventually gave up and suggested I reset my NVRAM. GPT-4o built it on the first try.

    I still think that critique was fair. But I’ve started using Claude Code for the past few weeks after all the opus 4.5 hype, and I need to update my assessment: Claude is actually pretty good.

    I used it to re-write crapslesscraps.com from scratch, and I am very pleased with the results. Here is the before & after:

    Before

    Screenshot of the Crapless Craps game interface, displaying a virtual betting table, current bank amount, and options to roll dice. The table features various betting options with a vibrant green background.

    After

    Screenshot of the Crapless Craps game interface showing the betting options and game controls.

    In addition to looking way better, I went from this insanely complex project for something so simple:

    .
    ├── assets
    │   └── initial.png
    ├── eslint.config.mjs
    ├── next-env.d.ts
    ├── next.config.ts
    ├── out
    │   ├── _next
    │   │   ├── qZpjdeMzF2EBa0T0miGAH
    │   │   └── static
    │   │       ├── chunks
    │   │       │   ├── 4bd1b696-1962bfe149af46cd.js
    │   │       │   ├── 684-80ddbd5c2fee50a3.js
    │   │       │   ├── 748-170506f584844847.js
    │   │       │   ├── app
    │   │       │   │   ├── _not-found
    │   │       │   │   │   └── page-6bf1735bae9e04ee.js
    │   │       │   │   ├── layout-bb587b94ee6256a7.js
    │   │       │   │   └── page-b1329367083c88ad.js
    │   │       │   ├── framework-f593a28cde54158e.js
    │   │       │   ├── main-477a2845a0a3ba6c.js
    │   │       │   ├── main-app-cb108c2984af81c8.js
    │   │       │   ├── pages
    │   │       │   │   ├── _app-da15c11dea942c36.js
    │   │       │   │   └── _error-cc3f077a18ea1793.js
    │   │       │   ├── polyfills-42372ed130431b0a.js
    │   │       │   └── webpack-f029a09104d09cbc.js
    │   │       ├── css
    │   │       │   └── 643c490fd7af8faf.css
    │   │       ├── media
    │   │       │   ├── 4cf2300e9c8272f7-s.p.woff2
    │   │       │   ├── 747892c23ea88013-s.woff2
    │   │       │   ├── 8d697b304b401681-s.woff2
    │   │       │   ├── 93f479601ee12b01-s.p.woff2
    │   │       │   ├── 9610d9e46709d722-s.woff2
    │   │       │   └── ba015fad6dcf6784-s.woff2
    │   │       └── qZpjdeMzF2EBa0T0miGAH
    │   │           ├── _buildManifest.js
    │   │           └── _ssgManifest.js
    │   ├── 404
    │   │   └── index.html
    │   ├── 404.html
    │   ├── about.txt
    │   ├── android-chrome-192x192.png
    │   ├── android-chrome-512x512.png
    │   ├── apple-touch-icon.png
    │   ├── favicon-16x16.png
    │   ├── favicon-32x32.png
    │   ├── favicon.ico
    │   ├── file.svg
    │   ├── globe.svg
    │   ├── icon.svg
    │   ├── index.html
    │   ├── index.txt
    │   ├── next.svg
    │   ├── playonlinefree.png
    │   ├── site.webmanifest
    │   ├── vercel.svg
    │   └── window.svg
    ├── package-lock.json
    ├── package.json
    ├── postcss.config.mjs
    ├── public
    │   ├── about.txt
    │   ├── android-chrome-192x192.png
    │   ├── android-chrome-512x512.png
    │   ├── apple-touch-icon.png
    │   ├── favicon-16x16.png
    │   ├── favicon-32x32.png
    │   ├── favicon.ico
    │   ├── file.svg
    │   ├── globe.svg
    │   ├── icon.svg
    │   ├── next.svg
    │   ├── playonlinefree.png
    │   ├── site.webmanifest
    │   ├── vercel.svg
    │   └── window.svg
    ├── README.md
    ├── src
    │   ├── app
    │   │   ├── globals.css
    │   │   ├── layout.tsx
    │   │   └── page.tsx
    │   ├── components
    │   │   ├── AnimatedBankroll.tsx
    │   │   ├── AuthenticCrapsTable.tsx
    │   │   ├── ChipClearAnimation.tsx
    │   │   ├── CrapsTable.tsx
    │   │   ├── DiceAnimation.tsx
    │   │   └── WinDisplay.tsx
    │   ├── contexts
    │   │   └── UserContext.tsx
    │   └── lib
    │       ├── game-logic.ts
    │       └── sound-manager.ts
    ├── tsconfig.json
    └── tsconfig.tsbuildinfo
    
    20 directories, 79 files

    ^ that’s before node_modules which added an additional 1949 directories and 22,781 files (lol):

    1969 directories, 22860 files

    to this:

    .
    ├── favicon.ico
    ├── index.html
    ├── public
    │   ├── apple-touch-icon.png
    │   ├── favicon-16x16.png
    │   ├── favicon-32x32.png
    │   ├── favicon.ico
    │   └── icon.svg
    └── README.md
    

    A favicon, and an 800 line html file that spits in the face of every flavor of the month javascript framework. I love it.

  • Global Game Jam 2021

    Global Game Jam 2021

    As I mentioned in my last post, I was able to hook up with a local team from The Greater Gaming Society of San Antonio and participate in this year’s Global Game Jam. Global Game Jam® (GGJ) is the world’s largest game creation event taking place around the globe. This year’s theme was “lost and found” and the team decided that a private investigation / noir type game would be fun. So my teammate Ansley spun up some art and Wes composed some music and we got to work. We ended up naming the game “Chase Ventura: Kid Detective” – a mystery game where you have to find clues as the neighborhood kid sleuth to “solve cases”.

    Animated title screen for "Chase Ventura: Kid Detective" - our team's submission for the Global Game Jam of 2021
    The game’s title screen

    Overall it was a super cool experience. I was lucky to have a great team; they produced super quality assets to work with and were great at communicating and providing feedback. I wish there had been more time to implement all of the ideas, there was just too much to do in such a short amount of time. I guess that’s the nature of game jams though. I also wrote the game’s systems from scratch and that detracted a lot of time as well. Unfortunately with four hours to go and tons to do, I had to strip virtually every idea out of the game to get something shipped, so you basically get a cut-scene, and then walk around the neighborhood and talk to the various characters Ansley created. Fortunately I feel like our team was on the same page and the game, the art, and the music fit well together. Here are some stills from the game:

    I put up a little time-lapse of the last four hours of the Jam condensed to 10 minutes (the deadline was at 5pm CST and I think I submitted at 4:56pm):

    I’m super thankful to my wife for being supportive as I basically spent 48 hours binging over code. Also a big thanks to John and his team over at the Greater Gaming Society of San Antonio for putting on the event and helping me get on a team to participate.

    If you haven’t ever done a game jam I think it’s a great exercise from a development perspective for a few reasons:

    • Even though I broke every programming best practice, from DRY to bad spaghetti code, the time constraints force you to move forward with the mistakes and take the least path of resistance at every turn, forcing you to write a lot more code and figure out problems quickly on the fly.
    • Letting your team dictate the idea and direction of the game takes you out of your comfort zone for games or projects you would normally make.
    • Reviewing your own code after the fact gives you an opportunity to review what you could have done to make the code better / more extensible if you had ideal conditions.

    While it was stressful, It’s also great fun in general. We also ended up taking second place out of our portion of the GGJ, and I am pretty happy about that 😀.

    Here’s the link to the Jam Page:

    https://globalgamejam.org/2021/games/chase-ventura-kid-detective-8

    And here’s a link to play the game online (recommended browser: Chrome)

    https://ggj2021.rudyfaile.com/

  • Fortuitous A.I. Mechanics

    Fortuitous A.I. Mechanics

    Kristen is out of town today which means I have some free time to drill down and work on my little game side project. The working title is “Lucy’s Adventure” (Lucy being the fox). It’s a Super Meat Boy/Boshy inspired platformer that aims to be progressively difficult, but in a non-bullshit type of way. Translation: death happens a lot, but the game telegraphs to the player how. The goal is for the player to feel like every death could have been avoidable.

    After completing the game’s first two levels, aptly named “Baby Steps” and “Mechanics” I started work on level 3: the game’s first boss fight. In this fight, Lucy picks up an M16 which initiates a battle with the Boss of the first three stages: Lava Lord.

    Sometimes when programming, the funniest and/or most unexpected things can happen. In my case, this usually is from a result of lack of understanding, a mistake, or more often: laziness. These two images sum this up perfectly:

    For example, I didn’t want to redraw or edit sprites to have the gun move with Lucy, so the gun destroys itself and redraws every frame on Lucy’s position. It works great, and looks hilarious. Perfect.

    😂

    Even more funny was when I started programming the Boss’ A.I. It’s a pretty challenging process in itself, lots of function tail calls and recursion until certain conditions are met, signalling the boss to change states. I created some states to bring what I’ve considered abstractly to the game. When I ran my build, I just about lost it:

    Holy…

    The problem was obvious: I was calling the function that handled the Boss’ attack incorrectly. However, the outcome was better than if the game were working properly: it was harder to dodge, and actually looked pretty cool.

    LAME

    After I fixed it (he only throws a single fireball, which was the original intention) it felt… lame. Obviously the movement will be sped up, but a single fireball at this point seems unfulfilling.

    I wonder if I should change it back. If I do, I wonder if creating so many instances of the fireball object like that will run poorly in some browsers or devices. I wonder if I should find a way to make it look like that properly without devastating that poor Android device running KitKat.

    I wonder how many developers work on software and make mistakes that become features. It’s really a great feeling. I imagine it’s like painting a picture and spilling the paint bucket on the canvas. While you’re initially worried that you screwed up, on second look – that blotch kind of looks like something, let me add a few more colors. Wow, that mistake really made the piece!

    At a minimum, I definitely think I need more fireballs on this canvas 🔥.