( click image to enlarge )
Project: Computer Craft
In the summer of 2023 I broke my ankle playing paintball with my cousin and a group of other hobbyists at a local woodsball field. Of course, I was having the best match of my life just before it happened. In hindsight, I was having a little too much fun and got carried away. During my six month recovery period, I created a heavily modded Minecraft Forge server for me and several family members to play on. We had a great time!
For those less familiar, there is a mod package for Minecraft called ComputerCraft that enables the player to use the Lua programming language to program in-game robots to do various tasks. Shortly after learning about it, I excitedly installed this mod for us to play with. I knew I would enjoy it, but holy cow did I go overboard! Over the span of a few weeks, I spent 100+ hours writing 2,000+ lines of Lua code to command a small army of in game robots to do my bidding. This manifested into accumulating thousands of diamonds and hundreds of ancient debris as my robots mined tireleslly all day and night while the server was online.
Getting into the technicals, the code is divided up into three scripts. Turtle_miner.lua is the program that runs on the mining robots, turtle_commander is the program that runs on a central command computer to orchestrate the robot cluster, and chunky_turtle is a program that runs on the chunk loading robots that follow behind the mining robots. Key features include channel-based networking for robot specific instructions, XYZ coordinate based pathfinding, multithread-based orchestration for remotely controlling all bots simultaneously from a single controller, a style-ized GUI interface, automatic item storage and refueling, junk item handling to avoid running out of internal storage, and bot location polling to simplify locating them after hours of mining. Here is the most recent iteration of my code if you'd like to check it out!
- James