I’ve been working with the old Magma 3.0 codebase for almost a week now. Things I’ve done so far:
- Removed all of the old outdated OS-specific code (Sequent, Apollo, Amiga).
- Removed all instances of sprintf (a very dangerous function prone to buffer overflows). These have been replaced with snprintf, which is safer. Over 1000 functions have been replaced.
- Converted all major structs to classes (a C to C++ conversion).
- Broken the single monolithic merc.h header file into many different header files in order to make the code easier to maintain.
I’m also working on removing or replacing most of the old predecessor code and adding support for just about every area format I can find. When this is all over it will be a full codebase rewrite in C++.
The goal is to build an engine that is easily extended and modified, with OLC, easy-to-add mods and scripts, and plenty of ways to add fun things to the game without it being too unstable. Original Magma was incredibly unstable because it was built in a hurry — the codebase was based on reverse-engineering the format of existing areas for Basternae 1. There was very little testing at first and it took years for the engine to fully develop into a robust form.
It may take a few years for this new engine to develop into a fully robust form, too, but this programmer knows a vast amount more than he did eight years ago when building Basternae 2 was begun.