Monstercraft Postmortem Part 3: Win32 and iOS
The port to C++ for Win32 and then iOS took about 60 hours. As with Zombie Outhouse, I used Instant C++ to port the C# to C++ which took about a minute. The rest was all manual labor. Monstercraft runs on the same bioroid enhanced version of the bork3d engine that was used for Zombie Outhouse so it uses a custom C++ XNA style layer to ease the process.
There were a few parts of the port which I felt took too long and need to be optimized for the future.
First was the namespaces. I stripped out namespaces for Zombie Outhouse because they were getting in the way of the actual porting but that itself was a time consuming process, so for the next game I will make sure that namespaces will be used and port smoothly to save a good chunk of time.
The next annoyance was rewriting the checkpoint saving/loading code which was a tedious process. For the next project, I’m going to write a file I/O wrapper class to handle savings the various data types and classes. The wrapper will then just be rewritten once from C# to C++ but all the code actually calling the wrapper should not need any modification. This should save a lot of time.
In Zombie Outhouse, there was a data type name conflict in Win32 with Rectangle so I renamed my class to XRectangle. For Monstercraft I used the Point class a lot and that name caused problems on iOS because it’s defined in a place you can’t get around so I had to rename it to XPoint. A few people online looked into clean ways around it but renaming was the cleanest option at this point.
In relation to the file I/O, I need to stop relying on XNA’s automatic loading of XML data files and use a standard text or binary data format for more complex data. Monstercraft’s XML data was minimal but it will become an issue for future games.