
We took another stab at map importing using a process where map designers paint Hexels files with only a white brush, but using opacity. However, as soon as we read this map into Unity, it became clear to us that this process wouldn’t suit the style we wanted for Quench, and that this process was much more work than it was worth. We figured that we’d build a palette of some 16 grays to use and make maps using those distinct height levels. In this way, we could read the RGB colour value directly, assuming that black was 0 height, and white was maximum height. To begin with we thought that the process of using Hexels to build maps would involve selecting colours to define the terrain height and we would use a grayscale palette. Pretty sweet progress for not a lot of work!

HXL reader working around the same time that I finished up the integration and Bill’s map looked just like this: The coding work to read a file in took a little longer, but lucky for me, James had the. Our game designer and map designer Bill got to work on some basic map concepts to try out, and before long I had something basic to test. HXL file and deform the hex grid based on the ground height values read in from the binary file.
Select tools hexels code#
With the bare basics working, the next big move was to implement the code to integrate with James’ Hexels reader so that I could load up a.

Below is the for that this menu takes as of today: In order to provide everyone a clean experience in using the pipeline tools that I was starting to build, I built up a menu system to allow map designers easy access to all of the pipeline macros that do the heavy lifting (and to let me test more easily). My first attempts looked something like this: At least for a map containing no actual data. Having perhaps WAY too great of a personal interest in hexagonal geometry, this actually didn’t take too long to get working. I don’t know too many people patient enough to do that manually. The first process that needed to be built was clear: We need to be able to automate the process of laying out thousands of hexes on the map. HXL reader/writer and providing the facilities to render the hex map in 3D. Meanwhile, I was busy writing most of the Unity Editor extensions responsible for connecting with this soon-to-be. James is a stubborn fellow when it comes to debugging so he wanted to sort things out without asking Ken any unnecessary questions, and it was slow going, but it got done! Unfortunately the file format spec wasn’t as accurate as we might have hoped, so at times James just had to pick through the data by tracing out a big block of hexadecimal and reading it at face value. This process of building up this reader/writer has been James’ work over the last while, and he has dug through a ton of binary data to get things working. Ultimately the power of Hexels has been well worth the effort, as it provides us with a ton of map editing features that would have been a mountain of work to implement from scratch in Unity as Editor extensions.

HXL reader/writer (Hexels itself is written in C++). Thankfully Ken is amazing and happily provided us with a specification to follow in the process of building a C#.

With that in mind, we realized that we’d have to bite the bullet and decode the Hexels binary. When this integration process began, we planned to utilize Hexels’ XML output feature to pass data back and forth between it and Unity, but after a short email conversation with Ken Kopecky of Hex-Ray Studios (the developers behind Hexels) it was made clear to us that Hexels doesn’t actually read its own. I figured that I would run through the stages that we’ve passed through on the way to a working (but still pretty unstable) product. We’ve got the initial stages of this process working and from this point forward we’ll be making more and more map features in Unity editable from Hexels. We’ve been working on the Quench pipeline tools for a couple of months now, and despite the apparently endless barrage of school assignments that keep slowing things down, we’ve managed to reach our first major milestone! As I mentioned in this post, our plan has been to closely integrate a hex-based pixel art editor called Hexels with Unity as a 2D map editor to let our map designers more easily do their work.
