MineCraft Boat Race Port Part 1

Good Morning from my Robotics Lab! This is Shadow_8472 and today, I’m starting a new project in MineCraft. Let’s get started!

A couple years ago, the MineCraft server I sometimes play in, Titancraft, had a special mini-game built for it where a player gets into any one of three arenas and plays through a series of five courses and gets an award at the end. Any of the arenas would load the player’s next level, but that was about it from a technical aspect, as far as I’ve figured out. I want to port it to MineCraft 1.13. (As of this writing, the MineCraft is on 1.13 release 3, updated in the middle of this week).

First, I contacted one of the moderators, GrifterMage, and got his blessing on the project. Then, I started setting up a server as close as the target software as possible. I understand the server runs on Spigot, and that they had been making 1.13 pre-release snapshots… which I couldn’t seem to compile. I setup a vanilla server thinking this project is likely to take either two or three weeks.

I started looking into installing structure block files. They had changed for 1.13. Now, they are part of something with a steeper learning curve, but have all the more power once you get the idea of them: datapacks. Following the trend of going from texture packs to resource packs, datapacks are a new series of files that organize simple modifications to the game. All I know about them so far is that they contain both functions and structures, which before now were more free floating in their own folders, and that the packs themselves can be switched on and off.

With a vanilla server and a bit of ambition, I set about making a “Hello World” function. I asked for some help on the server’s Discord channel, and a user by the name of DrHenchman was helpful in pointing me to the correct way to structure a datapack; I sent him a bunch of screenshots as I debugged my way to victory.

Structure block files can save and load sections of the world up to 32 blocks in each of the three directions, so I made four test levels of 32×32 blocks and got them to load from a datapack on the server.

When I started thinking about the actual levels, I started looking for any videos someone may have had with footage of when the map was originally operational. I found acg1000’s posted livestream from when the custom dimension containing the boat race was opened, but two hours seemed a bit much for a just-adequate-for-YouTube WiFi connection when I needed to skip around a bit. After I skimmed it using my PC, low quality, and 2x speed. He didn’t have it…. Later, GrifterMage managed to scare up the original structure block files for me to work on. Another mod, DropDaBass, apparently had a copy. They are both awesome for that.

The files are two years old. A lot of things have changed since then. First of all, from 1.12 to 1.13, structure files no longer accept capital letters in their file names. Even though I was cautioned against it, I tried copying the files directly into 1.13 and changing the names and dropping them in the correct place to load them. I don’t remember exactly what happened, but they didn’t work correctly. I ended up having to load them all up in 1.12 and re-save them.

Which brought me to another challenge. One of the levels features floating water blocks. Before, they were simply “still_water”, a feature removed for 1.13. As a side effect, the now-regular water blocks flooded the level. As a step in the correct direction, I put a repeat command block out to continuously clean up the drips. The seizure alert results should have been expected. I then messed around with using “structure_void” blocks to hold up the water, since they look the same as air when you’re in adventure mode. Structure_void blocks are about the one block structure blocks cannot copy. So I set my commands to filling each level with them as soon as it was loaded. The next command replaced any leaked water blocks, in case of any lag Grifter pointed out there may be. Ultimately, I’m opting to just use a crazy block, like diamond ore blocks, to contain the water until they can be replaced when the level loads.

Around this time, I poked into loading the actual arena building, including the lobby and thee arena floors above it I gutted two of the three arena command blocks and started installing the hardware for my port. The existing logic no longer functioned, in either 1.12 or 1.13. After an hour or two, I found the credits to three people who originally worked on it. TheDukeMinecraft, listed as Project Manager, Designer, and Builder; 2CubedTech, listed as Tester and Command Writer; and dminer78 listed as Tester and Food Eater.

I reached out to the only original designer still present on Titancraft’s Discord server, Duke. He was eventually able to put me in contact with 2Cubed. Both seem excited that their old project is getting some love, but I got the impression both are busy with their own endeavors.

While I was waiting for messages back from Duke and later 2Cubed, work continued on the design. One of my priorities is minimizing load on the server. This means as few repeat command blocks running their contents every tick as possible. (Another reason why the blinking water was a bad idea). All I really need is two end conditions listening for if the player is standing or if his boat is at the goal, a line of three gold blocks. To make things more interesting, I wanted the ability to load one of two maps for each level, one classic or one newly built for the grand re-opening. While I still don’t have the logic figured out, I have a comment version of it in the server files. These are very likely to get rethought and scrapped.

I looked out in the vast, 30×30 room that was the command block room. It is so big! There’s room for a lot more than just a few levels. I mocked up some structure blocks and found that each arena can hold up to 4 separate games of 5 levels each, with 6 variants of each level. And then I did one better. After working with the levels themselves, I produced a version that loads both halves from a single structure block. Now that that 4×5 corridor can hold even more levels. Plenty of room for expansion.

This week, my lesson has been about building a team. My skills don’t quite encompass the full spectrum of tasks that need to be done. As I was starting my writeup, a fellow Titancraft member, jamcdonald120 just agreed to help with the scoreboard commands. As soon as I get the files transferred over to my server computer, I’m looking to have him help me with those.

Final Question: Did you know that, even though it will work and act all normal, MineCraft 1.13 pre-releases don’t seem to like dashes in their file names?

Open Beta

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I’m opening up my turtle program for open beta. But first, a few words about the challenges I dealt with this week. Let’s get started!

Timings. My greatest enemy this week was timings. Something might be a little off and an item slips in when a turtle is busy and the whole thing breaks. I had to put several lines of code in to print to the console just to figure out when an item made it in to glitch the system. I can only imagine how much more I’m going to have that problem when using a more sophisticated robot.

I’m declaring all my programs at version 0.9 for the purpose of beta testing. In the future, I may use a different scheme, but I will need to look into it farther first.

My notes assume you have a stable installation of ComputerCraft (specifically the Computeacube implementation.) I developed it under 1.12.2 Forge.

Link to code: https://letsbuildroboticswithshadow8472.com/?page_id=275&preview=true

Final Question: Practical question, What bugs are left in my code?

A Final Delay

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am delaying the publication of my modded MineCraft skeleton farm. Let’s get started.

For the past month or so, I’ve noticed I’m on an on-week, off-week cycle. This was an off-week. I didn’t get the project finished, despite how little there seemed to be left. When I publish, I want to make sure my code is solid and well-documented. I may have a workable prototype, but with the constant lack of concentration, I ended up with almost zero progress.

For when I do make progress, I have a few challenges in the way of making a solid program. Parallel editing between an in-game editor and an out-of-game editor often leaves me behind in either one or the other spots; I either find myself fixing the same bug over and over again in the same program each time I make a new transfer (usually the case when I have a bunch of tiny, bug fix type edits), or I have to make a new transfer to propagate extensive changes. I plan on publishing when I can transfer straight from Notepad++ to ComputerCraft.

Up until now, I’ve been working purely in survival server across the room. Maybe I should consider working in a creative, single-player. That’s it. I’ll edit my code directly from Notepad++ and run it in-game. I’ll be able to drop the version number nonsense, and my busywork will drop off dramatically. Why didn’t I think about this a month ago?! I suppose I did, but the server computer is across the room, and the station is frequently occupied. I know ComputerCraft has some PastBin feature, but I don’t want to mess with that yet/ever.

Final Question: I know this has been a short blog with a lack of time spent on it, but I feel like this week, I made more progress than any other week working on this project so far. Have you ever had a comparable moment of inspiration?

Prototype Automated Spawner

Good Morning from my Robotics Lab! This is Shadow_8472, and today, I am going over my completed pure ComputerCraft prototype automated spawner. Let’s get started.

I now have a turtle program I’m mostly, but not completely happy with. The notepad++ doc I originally coded now has the bugfixes I missed while parallel coding, but there’s still a bug when the program is deployed across many turtles. As of this writing, I have yet to look into it, but it’s simple enough to repair for a functional prototype.

I’ve turned my attention to the other two programs. I have a program to attack the gathered mobs, and it works at about 98% for a pretty heavy load, but it’s sloppily coded. I will be reworking it before publishing. When will I publish? I honestly don’t know. Whenever it’s done. At this point, I doubt I have anyone waiting on it, but at the same time, if I did, I’d be asking for help.

Long story short, I’m focusing on a program to filter out matching items before the attack program. Already, I’m considering potential benefits of making a custom library. One function, itemOut(), should be useful for a lot of turtle programs. As long as I use the same variables it depends on, I can just copy it into each program. A library would let me just access it without having to have it in each program. With a little modification, I might even be able to write some code to read a comment in the header and get library version numbers… and with a little expansion, I could setup a software update system.

Unfortunately, that neat idea is unlikely to save me any time. I don’t think it’s likely to happen unless I come back to ComputerCraft in a while. I want to get back around into more real world applications some time here.

Getting back on topic: the sorting program. I’m trying to recycle as many of my ideas for the loot repair program as possible. I started with the getState-action structure. As mentioned earlier, itemOut() is exactly the same. I do have an evalItem() function in both programs, but I have no desire to try and reconcile the two. Even if there were a way to make a unified evalItem() function, getState() itself must be different; the two programs have different possible states. Of course, good programming gives you a “control panel” of variables to edit.

Final Question: For anyone who knows: What is the best tutorial for Gazebo?