How one typo ruined 100 RoF maps

investigator

When I became Moderator again on RoF, I spent most of my time in spectator mode. It’s a very useful gamemode for Rof: You can look at players without them knowing, you can watch & avoid lava without much of a hassle, and you can basically see everyone at any time. Of course, while I was in spectator mode, I often went through walls and other solid materials. One of the first things I noticed, after noclipping through the underground of some maps in spectator mode, was this:

2016-08-15_03.10.42.png

What you’re looking at is the underground part of Taiga, filled with little one-block or two-block pockets of air. The entire map is filled with them, and it seems like all stone had a certain percentage changed into air. I remember discovering this with Ogarci, who asked me why the entire map was filled with airpockets. I said I didn’t know; when I submitted this map it definitely didn’t have these airholes in it.

I shrugged it off and figured it wasn’t important. This map, during this round, specifically, seemed to be broken. But in later rounds, the airholes were there too. And then I noticed this:

2016-08-15_02.46.05.png

2016-08-15_02.44.53.png

2016-08-15_02.43.12.png

Every single map on RoF containing stone is filled to the brim with airpockets. It wasn’t just Taiga, it wasn’t just that round; it was every single map, every round. I asked some other staff members about it but they didn’t seem to be sure why exactly this was a thing. I wondered if this was an intentional feature, maybe? To handicap players who mine a lot, in an attempt to nerf mining?

I asked around and quickly found out it wasn’t intentional. No one knew why they appeared, or how, but they sure did. So I figured—Okay, whatever, something completely ruined our maps at some point. We don’t know how or why it happened, but hey, at least we can try to fix the maps. I decided to fix all maps, one-by-one, by replacing all airholes with stone.

Because it’s difficult to determine which holes are supposed to be in the map and which aren’t, this needed to be done manually—meaning a lot of time and effort would be needed. In fact, it sometimes took multiple hours to fix a single map. Even with commands like //replace air stone and //brush sphere stone, along with other WE tools, it still took ages. But at least it worked.

2016-08-15_02.43.12.png

Until, well, it didn’t. I fixed Corruption and Paradise at some point (also fixing a ton of larger holes in the map) and had partially started with Ichidou_Hitoshirenu (now known as Hidden_Shrine). The problem was that the airpockets started reappearing.

Of course, there weren’t as many as there were before I got rid of all of them—they re-appeared ever so slowly, increasing gradually over a long period of time. They were obviously being generated. It seemed like the airpockets didn’t just appear suddenly; they had slowly increased over time, and they would continue to unless we managed to fix this.

Of course, knowing this, it was a lot easier to pinpoint the exact problem: Ore generation. Clearly, because these airpockets generated only in stone and seemed to increase over time, it had to be because of buggy ore generation code. We had had notorious huge problems with ore generation before when we tried to stop surface ores from appearing (which lagged the server so much that the surface ores nerf had to be removed), and it seemed like this was just yet another ore generation-related problem.

But how exactly did the ore generation cause airpockets? I bugged SirComputer a billion times about it—This was a huge problem. The airpockets were almost like cancer in my eyes, slowly spreading through all our maps; slowly killing them. Every single time I was in spectator mode, looking at those airpockets, I felt frustration.

At some point, it just became a familiar scene whenever I looked at the underground of any map—Airholes everywhere. Whenever I’d fly through a map, I would be constantly reminded of the ever-present airpockets. Of course, the players noticed them too: Some thought it was intentional, others complained about wanting it to get fixed.

We tried for months to fix the issue—Not constantly, of course. SirComputer always has so many things to do regarding RoF that it was never really a huge priority. I feared that it would never get fixed, and airholes would forever stay in our maps, never to be fixed. One day there would be no underground left, and every map would be one big… airhole.

On Sunday, the fourteenth of July, we made a breakthrough. Or, well, SirC did. The sentence that sparked my hope:

SirC – Yesterday at 12:04 PM
and wow it seems that monster eggs are the ones causing airholes

Back in 2014 (or was it 2013? I don’t remember), the high staff decided to add silverfish blocks (monster eggs) to the ore generation. Most players were actually a fan of this and it seemed like a fun change: Every few hundred stone blocks, you might stumble across a silverfish and get surprise attacked.

This was a neat little addition to RoF and although it was not at all necessary, it added some fun flavor to the game. Nobody seemed to notice, however, that suddenly they didn’t spawn anymore. For a while now, maybe even a year, silverfish blocks have not been generating in maps. And airpockets have.

Why did this happen? Well, turns out, it’s all in the config. A couple updates ago, Mojang decided to change IDs. Instead of the old numerical IDs, they wanted to switch to wordy ones, like minecraft:log instead of 17. I’m not sure if the ore generation config used to have numerical IDs and then switched to the new ones, but something changed.

A certain percentage of stone in maps would turn into monster egg, as defined in the config—but the wrong kind of monster egg. In the config, it was set to generate MONSTER_EGG. The ID for MONSTER_EGG is 383—which is a spawn egg. What we actually wanted to have in the config was MONSTER_EGGS, which is 97.

Instead of the monster block, the server was trying to generate a spawn egg.  When it realized that it couldn’t do this, it just put air there. And that’s how airpockets were generated. One single typo caused almost 100 RoF maps to be completely ruined. One single unnoticed typo, confusion about the right ID, ruined the underground of almost all RoF maps.

2016-08-15_02.42.22.png

Of course, this is entirely Spigot’s fault—under Mojang’s code, it’s SPAWN_EGG and MONSTER_EGG. It’s terribly confusing to have MONSTER_EGG be a spawn egg and MONSTER_EGGS be a block—there are tens of other solutions Spigot could have used which wouldn’t have caused this kind of confusion. For example, they could’ve made the actual spawn egg MONSTER_EGG_ITEM and the block MONSTER_EGG.

But that’s in hindsight. It’s fixed now. Airpockets in the ore generation have been fixed, and now begins the real challenge: Manually fixing every single map to get rid of all of the existing airpockets.

Now it begins.

One thought on “How one typo ruined 100 RoF maps

Leave a comment