Minecraft’s WSL build time cut in half after working with Visual Studio C++ Team

Learn more about how the Visual Studio C++ team delivered cross-platform solutions to help meet the Minecraft's teams specific needs.

February 15, 2023
Minecraft Customer Success Story Hero image

In June of last year, the Minecraft Publishing team within Mojang Studios reached out to the Visual Studio C++ team because they needed to expand C++ development to a new platform (Linux) while respecting their existing technological base (MSBuild). These constraints prevented them from pursuing more established cross-platform pipelines, so the team needed to find a solution. That’s where my team came in, as we’re focused on shaping the future of cross-platform development for customers in both Visual Studio and VS Code.

When developing with these technical constraints, they were experiencing issues with extremely slow full rebuild times on WSL (40-50 minutes!) and remote Linux systems with MSBuild. For reference, the same rebuild would take around 20 minutes for Windows. The Visual Studio C++ team met with them extensively to identify the issues and develop solutions that fit these constraints, and ultimately this made a huge difference, with all build times reduced by 50% and matching the performance of other platforms they develop for. 

Minecraft landscape with a large rock creature and a person holding a flag while riding a bird
Minecraft Customer Success Story inline image 3

This blog post was written in conjunction with Isaac Dayton, a Software Engineer working on the Minecraft Publishing team within Mojang Studios for Minecraft Legends.

Sinem: What does your team do?

Isaac: Our team, the Minecraft Publishing engineering team, provides technological guidance to partner game development studios developing new games in the Minecraft franchise. We overcome multiple technical challenges in our daily work, including developing for multiple platforms, working with large legacy codebases, and acting as technical liaison with various partner teams. These challenges require us to be flexible and responsive, giving them opportunities to specialize while maintaining a strong overview of their technologies. For Minecraft Legends specifically, we have a simultaneous worldwide release across 8 different build targets, including all major consoles. In total, our team is around 70 people.

four Minecraft people on horses in front of a temple
Minecraft Customer Success Story inline image 1

Sinem: What was your C++ cross-platform development experience like before working with the VS C++ team?

Isaac: Our team chose to use Visual Studio for their C++ development since we believe it is a robust, long-standing, and well-supported development tool with years of testing and refinement. Also, since we already use Visual Studio to develop for most of our platforms, continuing to do so for Linux was only natural. Additionally, we wanted to leverage as much of their existing build setup as possible, further cementing VS as the best option.

For the most part, our experience with Visual Studio has been very positive. It delivers the features we need for large-scale development across multiple platforms. However, due to our particular needs detailed above, when we first began developing for Remote Linux, while the pipeline worked, we encountered some issues that made development within Visual Studio difficult:

·       We were seeing slow WSL2 builds, which led us to revert to using WSL1

·       We wanted to use lldb as the debugger, as gdb debugger perf was too slow. However, at the time, there was no way to use lldb with MSBuild.

These issues were what initially led us to getting in touch with the Visual Studio team to explore solutions.

Sinem: What was your experience like working with the VS C++ team?

Isaac: Most of the issues raised ended up being already known and improvements were already in progress. Other issues were prioritized and mitigated promptly, allowing us to keep our development schedule on track. The VS C++ team delivered for us in Visual Studio 17.3 a new MultiMakeCI task that significantly improves MSBuild times on large projects, a WSL2 Clang toolset for MSBuild projects, and a new MSBuild debugger project property for selecting lldb rather than gdb as the target debugger. These all turned out to fix our problems, allowing us to use lldb as their debugger with MSBuild and revert back to using WSL2, all in all cutting our build time in half.

a landscape in Minecraft with a person on a horse on a cliff overlooking houses
Minecraft Customer Success Story inline image 2

After receiving the updates and adapting our workflows, our experience developing for Linux with Visual Studio is as pleasant and as performant as any of their other platforms. Initial configuration is now minimal and once it’s set up, everything works as expected. Being able to develop for multiple platforms using the same tools and build configuration is a huge win, certainly better than maintaining a separate build system for Linux.

The VS C++ team was a massive help, and we would not have been able to achieve as much as quickly as we have without their engagement. Specifically, the VS C++ team was understanding of our particular technical needs and highly responsive in addressing high-priority issues. They respected the reality of our situation as opposed to offering unrealistic and ideological solutions.

Overall, this has been a very pleasant experience and I am grateful for the opportunity to work with the Visual Studio team.

Thank you to Isaac for his team’s partnership! We look forward to working together on any other future cross-platform issues that his team, or any others, identify.