Dev Diaries: Custom Blocks

Over the past month, we've worked on new tools to bring custom blocks to The Hive. This is essential to achieve our long-term content ideas that require expansive, immersive worlds.

Dev Diaries: Custom Blocks

Dev diaries are a series of articles from the development team giving you a raw insight into the thoughts and ideas that go into making The Hive.

The Hive first used custom blocks in July 2021 to bring the iconic world of Sonic to Minecraft. We were incredibly proud of our work on the event. It enlightened us to just how immersive worlds in Minecraft can be by combining entities, animations, sounds, and custom blocks.

Although we made some essential tools to assist us in using custom blocks, it was a very slow, tedious process that relied heavily on our development teams.

An example build from our build team. Custom plants, walls, roof tiles, and more are being used. Screenshot taken in Java Edition. Note: build is for testing purposes only.

Over the past month, we've worked on new tools to bring custom blocks to The Hive. Most importantly, these tools empower our creative team of artists and builders to take control with little developer input. This is essential to achieve our long-term content ideas that require expansive, immersive worlds.

Custom Blocks in Java

While it may not be common knowledge, our build team uses Minecraft: Java Edition to create our worlds. This allows us to use plugins like WorldEdit to develop and create amazing worlds quickly. These worlds are exported from Java Edition into our custom world format, which we specially created for the needs of a minigame server.

If you'd like to hear about our custom world format, including the config/meta-store system within it, let us know!

A selection of custom cuboid blocks, including a crate with custom geometry.

Because we rely on Java Edition, we've made a Fabric client mod and a Spigot (Paper) plugin that brings the Bedrock Edition custom blocks to Java. This allows our builders to create worlds with our custom blocks natively in Java Edition.

It's a game-changer.

How does it work?

Java Edition and Bedrock Edition formats are not interchangeable. As such, we must convert our Bedrock resource and behavior packs into formats that Minecraft (or our mod) can understand.

Another example build from our build team. Screenshot taken in Java Edition. Note: build is for testing purposes only.

This is where our Spigot plugin comes in. When the build server is booted, it loads the Bedrock resource and behavior packs, systematically reading and converting all required data points:

  • Model geometry, including UV co-ordinate translation
  • Material instances
  • Placement logic (custom block states)
  • Language files (block names)
  • Extra data: break times, sounds, friction, light emission

We then dynamically inject our custom blocks into the Java Edition (Spigot) server so that to the server, they seem and act like any other vanilla block. This means popular plugins, such as WorldEdit, VoxelSniper, and Arceon, work with our custom blocks without modification.

Our client mod then downloads these assets from our server, registering them as custom blocks, much like any other Fabric mod might do. Our builders can then pull any custom blocks they want from the custom blocks creative menu.

Our custom blocks are added to a special tab in the Java Edition creative inventory.

If we add new blocks, a client reboot will automatically download the updated data. No mod update is necessary.

Creating Blocks

In addition to being able to use these blocks in the building process, it was also important that adding these blocks was time efficient. Adding custom blocks to Minecraft: Bedrock Edition can be slow and cumbersome.

So we made another tool, lovingly named Blockie. Blockie had two goals:

  • Make adding blocks to the server painless.
  • Give the power of implementation and testing to our art team.

Blockie can create blocks from just an image file. It will automatically make all required assets and insert them into any configured resource/behavior pack. Materials are automatically calculated by analyzing the alpha channels of the texture. Even the block name is sourced from the source image name.

If a custom geometry is required, a geometry file with the same name is placed in the images' directory, and Blockie does the rest. Blockie detects if multiple blocks use the same geometry and will only import it once, ensuring we don't waste resources.

More complex blocks can be configured using a custom Blockie meta config. This can be done manually or by using our custom Blockbench plugin.

Our custom Blockbench plugin allows our art team to configure their Hive blocks easily.

Additionally, Blockie can generate the required code for our custom server software, requiring little to no dev time. This is a running theme: we want to make processes as efficient as possible so we can focus on what we do best, content.

0:00
/
Behind the scenes: testing server-side collision boxes. Fake players with dynamically generated skins (white boxes) show the server-side calculated collision. Testing only, does not show planned gameplay changes.

To put into perspective the power of a tool like this, we added 200 custom blocks in just a few hours (excluding the time required to create the models and textures). This is a huge improvement over our process during the Sonic x Hive event, which took days of manual configuration and testing.

Why?

Custom blocks will be used in short-term projects to enhance world-building and provide new gameplay opportunities. In the long term, we expect it will help unleash our creativity and help us achieve some bigger ideas.

Currently, we're in our late-stage testing phases and hope to deploy the first iteration of custom blocks to The Hive shortly.

We hope you enjoy this insight into the behind-the-scenes of The Hive. If there's something you'd like to hear more about, please let us know on Discord.