Varun Ramesh's BlogArchive Feed
ChatGPT is Really Good at Roleplaying
Last year I released a game, FeedVid Live, entirely controlled by natural language inputs. The character in that game (a fictional livestreamer) would respond to commands that were parsed using parser combinators. Unfortunately the character in that game couldn’t speak back to the player.
Recently, I’ve been experimenting with using ChatGPT to power NPCs that can actually talk back to the player. I’ve been blown away by how, with very little prompting, ChatGPT can entertainingly play a character and continually improvise in repsonse to player input.
Unfortunately, ChatGPT is still pretty expensive. Deploying a game to the public with AI-powered NPCs could easily cost thousands of dollars. Still, I wanted to share some of the experiences I’ve had since it’s entertaining and kind of eye-opening. I’ve created some character role-playing demos that you can try out below.
Simple Tips to Level Up Your Python Programming Skills
Python is on its way to becoming the world’s most popular programming language. If you’re just starting to learn Python, here are some simple tips that can help you use the language more effectively.
This blog post contains runnable code snippets powered by Pyodide, a version of Python compiled to WASM for use in the browser.
Over the past three months, I created and released three horror games - Proctor, Thermomorph, and Arthur’s Nightmare, the latter of which recently went viral. This post is a postmortem for Thermomorph, the second of those games.
Over the past three months, I created and released three horror games - Proctor, Thermomorph, and Arthur’s Nightmare, the latter of which recently went viral. This post is a postmortem for Proctor, the first of those games.
Loop, Autoplay, Muted - Say Goodbye to Animated GIFs
Animated GIFs are awesome for showing off projects. Unfortunately, GIFs have significant limitations. For one, they only support 256 colors per frame. This means that some color information is lost, resulting in that classic 90s webpage aesthetic. Futhermore, GIFs are big - they are losslessly compressed. This GIF below of Mario Kart from one of my AI projects is almost 10 MB!
The Boehm GC Feels Like Cheating
A while ago, I worked on a simple interpreted Lisp, primarily as a way for me to understand the philosphy and ideas behind Lisp languages.
However, I ran into a problem when trying to integrate garbage collection. Because I didn’t plan garbage collection from the beginning, my code left pointers to Lisp objects (
expr*) all over the C stack.
No More Primitives - What Python and Java Get Wrong
Many languages such as Java distinguish between primitives and objects. Primitives are stored directly on the stack, and don’t have any callable methods. Objects have callable methods and fields, and are typically allocated on the heap with only a pointer stored on the stack.
I Allowed All Web Push Notifications for a Week
You can’t escape them. Web push notifications are the new e-mail newsletter, and every site wants you to subscribe. Up until last week, I had never allowed any site to send me notifications. Because I’m curious what it’s like to have sites constantly ping you with content, I decided that for a week, I would enable all push notifications on every site that I visit.
Editing Gameplay Videos without Re-encoding using FFmpeg
I recently worked on a YouTube let’s play with my brother. It was recorded using Dxtory with the x264vfw codec, meaning that the saved recordings are H.264 streams in an AVI container. Our recordings are 1920x1080 at 60fps. Audio commentary was recorded separately in Audacity.
When it came time to edit the videos, I fired up Adobe Premiere, but quickly ran into a problem. Rendering the 1080p/60fps videos was taking upwards of an hour. Futhermore the output videos had significantly lower quality due to the re-encoding. I knew that after YouTube transcoded the videos for it’s internal format, the final output would look even worse. To fix this, I did some experimenting with FFmpeg, a command-line based video processor, and found a worflow for editing our let’s play without re-encoding.
How I Structure GameObjects - Components and Mixin-based Inheritance
Component-based GameObjects are similar to the concept of mixins/traits in some Object-Oriented langauges. In this article, I’ll discuss the relative advantages and disadvantages of both patterns, then describe how they can be unified in a way that takes the best of both patterns.