My Generative AI Workflow

Imagine being able to build a huge world inhabited by hundreds if not thousands of players who were exploring worlds and monsters of your own creation, collecting rewards from quests that you’ve designed. Picture the amount of work that is needed to be done, all the departments, all the artists, the programmers, the writers, the producers. Now instead of a team of 50 or more people, having to do all of this work by yourself. The task itself is extremely daunting, but that is what I am seeing it to do with my game Dungeon Delvers, and the task is becoming a little less daunting with help from all of the new AI tools that are now available at our fingertips.

For a while now I’ve wanted to take a stab at game development on my own. The one project I’ve always wanted to undertake was the large task of building an MMORPG. The sheer size and scope of doing a full 3D world by myself seemed impossible until recently. I have been leveraging generative AI in almost all of my workflows and it has helped to speed up my work in some areas while introducing complications in others. I’m writing this post today to give insight on how I leverage generative AI to help create in-game assets, how it assists me in my programming and how it even helps with things such as the creation of my animations.

Programming:

Visual studio has an amazing integration called GitHub Copilot. You can use it to implement autocomplete suggestions from code that it’s pulled from various repositories all over GitHub. I’m primarily a front-end developer in my 9 to 5 job, so leveraging the suggestions that Co-pilot offers with my back end tasks has been insurmountable in allowing me to feel more comfortable with APIs that I am not as familiar with. Normally I use the tab autocomplete suggestions that GitHub co-pilot offers, but more recently I started leveraging the GitHub copilot chat to help me build out unit tests for my code. Unit tests have always been one of those things that I’ve had trouble writing. I always seem to forget some area of the code that needs coverage or some if statement that hasn’t been properly tested. I can say that GitHub co-pilot does an amazing job of scanning files that I’ve already written and then creating a unit test based off of that code to help ensure coverage. One of the first pitfalls that I found, however, was that out of the most of the unit tests that were generated, almost none of them ever passed initially. Normally this had something to do with the setup of my jest mock, so it would generate a test but I would have to go back and update the initial set up in order for tests to work the way that they were expected to. This proved to be both a blessing and a curse. The blessing was in the fact that I was getting a lot more code coverage right out of the gate than I feel like I would have normally done, which is a huge win in my books. The drawback was that I spent a lot of time trying to figure out why my tests weren’t working the way that they should be even though the code looked as if it should work. This has been a warning I have read online not to trust exactly what AI spits out, and how having a good understanding of programming is still extremely important. The good news, at least with the tests that the AI generated for the authentication server (which was a fairly standard Express server) didn’t seem to really require any updates to the actual logic that was being tested itself which was great. The jury is still out on writing unit tests for the more bespoke areas of the game: that of the game client, and the actual game server.

Assets:

A more controversial section than the last is my workflow for using generative AI to create both concept art, textures, as well as models for me to work off of. I’m going to go on record and say that as much as I wish, I am not the greatest artist. As such, being a solo developer I already have a stacked deck against me as I don’t have the time, resources, or skill sets to create models and assets that AAA game studios are able to create. The workflow that I use to create base mesh models is I go to Gemini and I ask it to generate for me a picture of a high quality 3D model (let’s say a human male) and I tell it to show me the front and back profile of the model wearing nothing but briefs. Sometimes it takes a little bit more prompting in order to get it closer to what I want look and feel wise. Once I find an image that I like, I am then able to go to Trellis where I’m able to upload an image and it will actually generate a 3D mesh based off of the image that it’s provided.

Sometimes the mesh doesn’t exactly match what I was hoping for, but sometimes doing another generation will provide better results that I can then use. This entire workflow has absolutely changed how I work. Before I was spending hours and hours watching YouTube tutorials on sculpting and anatomy, or just general Blender tutorials, and now I’m able to get a working base mesh that has all of that for me out of the gate as well as a texture that is generated from the image that I gave to this artificial intelligence. I am already able to get an entire working idea out the door in minutes where before it would probably take me days or weeks. One major hurdle is the model’s topology—the arrangement of its vertices, edges, and faces. AI-generated meshes often have uneven or inefficient topology, which can lead to visual distortions and performance issues in a game engine. For instance, the generated model of the human male had numerous triangles and stretched polygons, which would cause shading artifacts and make animation difficult.

Welcome To The Hustle: Dungeon Delvers

I figured I’d just get into the nitty gritty for my first blog post and forgo the “Hello World” type post and instead work through some of the thoughts and ideas for the game I am attempting to build. Despite the large scope of the project, I have decided to begin development of a 3D MMORPG.. Inspired primarily by the folks building Project Lantern, Monsters & Memories, as well as Pantheon: Rise of the Fallen, I’ve decided to try and take a stab and lay another brick in the wall of fantasy MMOs that currently exist. The goal for the project is less to make a profit, but to see if I can push to create something that I’ve always wanted to do.

The Idea:

Since I was in middle school I got absolutely lost in the worlds of Norrath in Ever Quest and Ever Quest II, much later in life with the release of Classic World of Warcraft I delved into the realm of Azeroth. I have always loved the sense of community, the lore, and the draw of battling mythical creatures in a 3D world that is shared. I got an absolute thrill a couple years back when I was the dungeon master for several Dungeons and Dragons and it was this spark that really got me chomping at the bit to share the stories and lands that I had envisioned in my mind’s eye.

When a friend of mine introduced me to a height map that was generated via BabylonJS, I was hooked. I have spent a bunch of time getting up to speed with the 3D Javascript framework, and I have been more recently trying to cut my teeth on 3D modeling in Blender. After years of just learning APIs and industry standards, as such I have several goals for this project:

  • Set up a game server where multiple users can interact in a 3D space
  • Leverage a real time combat system that draws on the stats from the Pillars of Eternity franchise (I love the idea that there are “mighty” warriors and wizards instead of your standard strength based fighter or intelligent wizard)
  • Model both male and female models for the following races in Blender: Human, Dwarf, Orc, and Goblin
  • Add four facial customizations for the races to allow for them to be more unique
  • Create 20 unique enemies in blender
  • Model and texture a set of cloth, leather, chain, and plate armor, as well as a robe for player characters.
  • Model and texture at least 10 weapons for player characters and monsters to wield.
  • Implement the four following player archetypes: Fighter, Scout, Healer, and Mage and add unique skills/abilities till level 10
  • Create one city zone for players to train, sell/purchase goods, train, and gain quests
    -Create 4 unique zones for players to explore and battle in.

This list is already growing quite large and this doesn’t even include the main gameplay loop. Seeing as how I am only one man tasked with a slew of daunting tasks I am looking to leverage generation to help aid me where it can.

For the unique enemies that can be fought, I am looking to lean into image and model generation via AI to aid me. I wish I could say that I am more artistically inclined but I am more of a code slinger. A point of note, the models that AI generates don’t tend to produce clean meshes at all (at least with the process I use). So these models need to be brought into Blender and cleaned up with nicer topology. To aid in animation I am hoping to lean into the amazing work that has been done over at Mixamo.

For the zones, I am looking to again leverage procedural generation to help me create terrain, dungeons, and disperse assets to make a convincing area for players to explore. This also is one of the main areas that I am extremely excited to explore. Currently most MMO’s that I am aware of seem to offer a “theme park” sort of experience and I am hoping to break out of this and generate a unique world when a server is started up. This in turn will hopefully keep players coming back if a new server is simply started.

Tech Stack:

As a seasoned web developer, I’ve opted for a JavaScript-centric tech stack for ‘Dungeon Delvers.’ This choice allows me to utilize my existing skills and leverage the flexibility of web technologies. Specifically, I’m using Node.js/Express for secure authentication, Postgres for reliable data storage, Node/Socket.io for real-time game server communication, and BabylonJS/Socket.io for the 3D game client. To ensure code quality and maintainability, the entire project is written in TypeScript and thoroughly tested with Jest