Warsmash: Emulator of Warcraft 3 written in... Java - JVM Weekly vol. 121
Artur Skowroński
Head of Java & Kotlin Engineering @ VirtusLab ? Editor of JVM Weekly Newsletter
It’s probably not the first time it has come up in our newsletter that I am The Gamer, but one of the type who keeps track of what’s going on and owns every available console. I’ve always loved gaming, and I still do (my beloved Nintendo Switch is my travel companion). Still, the fact that Java isn’t one of the most popular technologies in game development (except for Minecraft, of course) is quite well known, so this topic rarely appears in this newsletter.
However, since I’ve always loved Blizzard games, alongside jRPGs (and RPGs in general), I couldn’t resist sharing a project called Warsmash: Mod Engine, which was born out of a fascination with Warcraft III and the desire to extend its capabilities.
To mash up Japan and Blizzard, my BattleNet's BattleTag is Hibari#1962. Why? Hibari is a loose Japanese translation of the Skowronski surname (in English, Lark). Nerdy, I know.
Warsmash is an emulator for Warcraft III created using the LibGDX engine (which I’ll talk about shortly). The project doesn’t include the original game’s assets; to use it, you need a legal copy of Warcraft III from Activision Blizzard and set up Warsmash to use those assets.
The creator of Warsmash is Retera, well-known in the modding community as the creator of Retera Model Studio – a Java-based tool for editing 3D models for Warcraft III. Using his experience, he decided to create a game engine that would allow for easier modification and expansion of the original game.
Compared to the original Warcraft III and its remastered version, Reforged (we won’t forget this, Blizzard ~community), Warsmash offers unique opportunities for modders. With open-source code and flexibility, users can create their own modifications, which were previously difficult or impossible to implement. This opens the door to endless creative possibilities, allowing the community to innovate and share their creations with other players.
And what fans are able to achieve... is amazing.
Warsmash stands as a testament to the passion and commitment of the gaming community. It shows how a love for a classic game can inspire the creation of tools that not only refresh the original but also allow for its continued development and adaptation to modern standards. I decided to play around with it myself and fired it up on my Mac. Unfortunately, I encountered a sad surprise – the game only works on Linux. However, if you dig through the Issues, you can learn some interesting things about OSX itself.
Warsmash doesn’t work on Macs primarily because macOS enforces a specific way of handling OpenGL, which is much more restrictive than on Windows or Linux. Warsmash was created by combining shaders and graphic technologies from different sources – from older WebGL shaders (GLES 1.0, compatible with OpenGL 2.0) to modern OpenGL 4.5 shaders, resulting in inconsistency between OpenGL versions. Windows and Linux can freely handle multiple OpenGL versions simultaneously, allowing the program to use both older and newer features. On the other hand, macOS requires a specific version of the OpenGL standard to be strictly defined and doesn’t allow simultaneous use of features from several different specifications.
As a result, Warsmash, which combines different OpenGL versions, isn’t compatible with Apple’s approach. The solution would be to rewrite all shaders either to a single low OpenGL version (which would limit graphical capabilities) or to the latest OpenGL version (which would limit compatibility with older hardware). The author, however, doesn’t plan to do such a refactor anytime soon, so for now, the only practical option for Mac users is to use another computer with Linux or Windows.
It is rumored to even run on modern Raspberry Pis. I’m tempted to check it out, but my Raspberry Pi is already pushed to its limits without running Warcraft. If yours is bored, I recommend checking this link. Of course, only as something for backing up yours already acquired physical goods.
Finally, I encourage you to watch a video where Retera talks about the history of Warsmash and the motivations behind its creation:
I also promised to explain what libGDX is. The project was born in 2009 under the initiative of Mario Zechner , who wanted to simplify game development for the Android platform. Initially, the project was called AFX (Android Effects), but it quickly evolved as Zechner recognized the need for easier app testing on desktop computers. In March 2010, he decided to release the source code as open-source under the name libGDX, which attracted the first contributors and sparked the rapid development of the framework.
libGDX is a cross-platform game development framework written in Java, based on OpenGL. It allows the creation of games that run on Windows, Linux, macOS, Android, iOS, and even web browsers with WebGL support. libGDX allows for the development of both simple mobile games and complex applications with advanced 3D graphics, making it an incredibly versatile tool in any developer’s arsenal.
When searching for "big games" created with libGDX, I didn’t find many non-mobile titles. However... have you played Slay the Spire? It’s a combination of a card game and roguelike, which became a huge hit and, alongside Hearthstone from Blizzard, started (or perhaps started, being a historian in the gaming industry is a complicated profession, which has a large saturation on YouTube) the trend for deck builders, which persists today. In this game, you build your own deck of cards and face a variety of opponents in randomly generated mazes. And this is surely the game with and very invested community.
And finally, we’ll dive into the fascinating world of retro game emulation, focusing on the Kocoboy project. This is an experimental Game Boy emulator written in Kotlin using Kotlin Multiplatform and Compose Multiplatform technologies. This project allows you to run classic Game Boy games on various platforms such as Android, iOS, desktops, and web browsers via WebAssembly. While Kocoboy is still in the experimental phase and doesn’t offer full emulation accuracy at the machine cycle level, it can already run many games, making it an interesting tool for retro gaming enthusiasts.
BTW: If you thought you once spent a lot of time doing something not useful - just check this… This is not just an animation - to make it, I created a real Rom Hack. Seriously, you can download it.
I believe that for all the pain (and fun!) of creating the above GIF, I deserve at least a single share of this newsletter from you!
Projects like Kocoboy are also a great example of how Kotlin can be used to create tools with high interoperability. Thanks to a multiplatform approach, developers can create applications that run on many operating systems without needing to write separate code for each platform.
But why am I writing about this and why gaming today? KotlinConf is coming, and I will have the opportunity to talk about my experience creating a NES emulator... also in Kotlin and with Kotlin Multiplatform support.
The full conference schedule is already out – so I invite you to check it out.
I'm planning to run Super Mario Bros on stage. Just in case someone wants to inform Nintendo so they can immediately haul me off to jail afterward. ??
PS: JVM Weekly is the media partner for the whole event.
PS2: This Reddit thread about the guy who found his Java-written game from when he was 10 years old is super cute.
PS3: L8 Conference is happening in Warsaw on Monday. I'm thrilled to invite you to an event so we can exchange fist bumps and connect IRL. This is also a unique opportunity to hear me speak without mentioning Java even once - don't miss out!
PS4: Today, Azul is celebrating 30 years of Java with multiple JUGs around the world (including Kielce JUG in Poland, organized by Mariusz Magdziarz ) with a stream with presentations from Simon Ritter , Frank Greco , Venkat Subramaniam , Gerrit Grunwald and ???? Marit van Dijk (+ two panels).
You can watch it online or on one of the local groups.