Software Engineering Daily: Game Emulation on the Carbon Engine with Dimitris “MVG” Giannakis
Release Date: January 8, 2025
1. Introduction
In this episode of Software Engineering Daily, host Joe Nash engages in an in-depth conversation with Demetrius "MVG" Giannakis, the lead developer of Limited Run Games' innovative Carbon Engine. Demetrius, renowned for his contributions to the hacking, emulation, and game development communities, alongside his popular YouTube channel Modern Vintage Gamer, shares his journey, the intricacies of building the Carbon Engine, and insights into game emulation and porting.
2. Demetrius's Journey to Limited Run Games and Carbon Engine
Demetrius begins by recounting his path into the gaming industry, which diverges from traditional academic routes. Instead of formal education alone, he immersed himself in the underground homebrew scene of the early 2000s, hacking consoles like the Dreamcast and original Xbox to build emulators and applications.
Demetrius [01:56]: "My kind of way into the industry was predominantly by just messing around with game consoles, hacking them, building homebrew for them, building or porting emulators..."
His passion led him to document his experiences on YouTube, ultimately catching the attention of Limited Run Games after he ported Diablo to the Nintendo Switch in an unofficial capacity. This pivotal project showcased his expertise and led to his recruitment into Limited Run Games around 2018-2019.
Demetrius [03:44]: "They reached out and said, you obviously are very experienced, you know what you're doing. Would you be interested in coming on board?"
3. Understanding the Carbon Engine
The Carbon Engine is Demetrius's brainchild, designed to interface a variety of emulators with modern gaming hardware. It supports systems like SNES, Genesis, PlayStation, Game Boy Advance, and more, encapsulating emulation within a framework that also integrates modern console features.
Demetrius [05:44]: "It's definitely software that kind of encapsulates emulation... there's also a lot more functionality around it and it has to do with the various aspects of a good or modern game console design."
Key functionalities include trophies, achievements, controller support, and social integrations, ensuring that retro games not only run smoothly on contemporary platforms but also offer enhanced user experiences.
4. Emulation: Building vs. Licensing
A significant discussion revolves around the decision to build custom emulators versus licensing existing ones. Demetrius emphasizes a strategic approach based on resource allocation and project timelines.
Demetrius [07:09]: "It's a combination of licensed emulation and homegrown stuff... how long is it going to take us to build something versus just to license an open source emulation product out there."
For systems like the Game Boy Color and Nintendo, Demetrius opted to develop in-house emulators due to available documentation and community support, enabling quicker development. Conversely, for more complex systems like the PlayStation 1, licensing existing emulators was more feasible to avoid prolonged development cycles.
5. Community Support and Test Cartridges
The emulation community provides invaluable resources, including test cartridges that verify emulator accuracy. These tools run comprehensive tests covering CPU instructions, PPU timings, and sound accuracy, ensuring high fidelity in emulation.
Demetrius [10:00]: "There's one particular cartridge that it's a ROM, basically, that tests every CPU opcode in the Game Boy... it will tell you if you have any kind of specific errors along the way."
Such resources are crucial for achieving the level of accuracy required to run games seamlessly on the Carbon Engine, with only a few emulators managing to pass the entire suite of tests.
6. Development Tools and ROM Hacking
Building and modifying games without access to source code necessitates sophisticated ROM hacking techniques. Demetrius describes their approach, which includes both hex editing and dynamic code patching using tools like LUA scripts and custom interception handlers in C.
Demetrius [16:33]: "We use things like LUA scripts to kind of intercept. We do our own custom interception handlers as well. We do ROM hacking... it really just depends on what is the most sensible approach to get things done."
This flexibility allows the team to modify game assets, remove outdated licensing information, and implement features like achievements directly in memory, avoiding the need for source code access.
7. Platform Portability and Challenges
The Carbon Engine boasts remarkable portability across various platforms, including Nintendo Switch, Steam, Xbox, and PlayStation series. Demetrius highlights the engine's adaptability in handling different graphics APIs, such as transitioning from OpenGL to DirectX when porting to consoles like Xbox.
Demetrius [21:30]: "If it's running a graphics API like OpenGL that something like the Xbox doesn't understand because it's DirectX based and the PlayStation has no knowledge of what OpenGL is, getting those things running on those platforms... there's a little extra work involved."
This portability ensures that retro games can reach a broad audience across multiple modern gaming ecosystems.
8. Transition from Homebrew to Official SDKs
Demetrius shares his seamless transition from using homebrew SDKs to official developer kits, facilitated by his extensive experience in porting and developing emulators.
Demetrius [22:53]: "When I actually got my hands on a Switch dev kit and I started working in official capacity. It was pretty easy. It was very, very seamless."
While homebrew SDKs provided a strong foundation, official SDKs are mandatory for certification processes, ensuring stability and compliance with platform standards.
9. Reverse Engineering and Game Enhancements
As the team ventures into emulating more complex systems like the PlayStation 1, reverse engineering becomes essential for implementing enhancements such as widescreen support. Demetrius recounts the challenges faced with games like Tomba, where technical limitations prevent certain enhancements from being viable.
Demetrius [25:38]: "We were able to get the game running in widescreen, but there's just that occasional frustum clipping issue... it's not good enough to ship a product, a commercial product with something that's a little bit off."
Despite these challenges, the team continues to push the boundaries, successfully implementing features like full-color translations in games such as Tripworld DX.
10. Archival Material and Museum Features
Beyond gameplay, the Carbon Engine project emphasizes the preservation and presentation of a game's history. Each title includes a museum section featuring archival materials like concept art, design documents, and interviews with original developers.
Demetrius [28:21]: "We have a museum section where we will produce things like key artwork, prototype drawings, all sorts of things... design documents, level design documents, old video clips and archive material."
This archival approach not only enriches the gaming experience but also serves as a tribute to the legacy of classic games.
11. Quality Assurance and Testing on Carbon Engine
Ensuring the reliability of emulated games involves rigorous quality assurance (QA) processes. The team leverages both internal testing and community resources to identify and address issues such as soft locks and glitches, distinguishing between original game bugs and emulator-induced problems.
Demetrius [35:00]: "We want to identify what they are. Some instances we actually can work around them. Sometimes we can't... we've found a couple of areas where there is some kind of glitchy soft locks and quirks about that game."
Their QA methodology ensures that any enhancements or modifications do not detract from the original gaming experience.
12. Balancing Limited Run Games with YouTube Channel
Demetrius navigates the challenge of maintaining an active YouTube channel while fulfilling his role at Limited Run Games. Through disciplined time management and scheduling, he consistently produces content without compromising his professional responsibilities.
Demetrius [39:24]: "I'm very, very good at time management and scheduling. I have set routines every single week... I'm very, very schedule focused and very set in my ways, I guess, in that regard."
This balance allows him to continue contributing to the gaming community both as a developer and as a content creator.
13. Future Outlook: Dream Ports and the Future of Carbon Engine
Looking forward, Demetrius expresses a dream project: porting Chrono Trigger, a beloved classic, complete with comprehensive archival content and enhanced features.
Demetrius [43:21]: "Chrono Trigger. And... digging deep, trying to get all sorts of design documents, prototype artwork, anything we could find... make it about the game and the awesome stuff that went into making that game."
This vision underscores the Carbon Engine's potential to preserve and celebrate gaming history through meticulous emulation and enhancement.
14. Conclusion
Demetrius Giannakis's work on the Carbon Engine exemplifies the fusion of technical prowess, community collaboration, and a passion for preserving gaming heritage. Through strategic development, rigorous testing, and a commitment to both original and enhanced experiences, the Carbon Engine stands as a testament to the enduring legacy of classic games brought to life on today's platforms.
Demetrius [44:48]: "Thanks for having me on, Joe. It's a pleasure to talk."
This episode offers a comprehensive look into the complexities of game emulation, the innovative solutions behind the Carbon Engine, and the dedication required to honor and revitalise beloved classics for modern audiences.
