Yes, I’m still alive! A lot has happened in the last couple months, and some of you may have wondered if Soulcaster 2 is still on track. It absolutely is, but I think it’s going to miss its original “Summer 2010” release date.
Here’s an explanation. It’s pretty embarassing for a professional programmer to admit to making this sort of mistake, but here goes.
Since the release of Soulcaster 1 I have been working on upgrading the game engine in a variety of ways. There are a few new features like multi-layered backgrounds and more scripting possibilities. A lot of changes were also under the hood–essentially, refactoring to make the code easier to extend for future games. Another goal was to increase the performance.
Here’s the mistake. I went over two months working exclusively in Windows without testing on target (360) until June. For some reason, there were frame rate issues, meaning my new “optimized” code was bogging down the 360. Aha, time to bust out the profiler! (A profiler analyzes a program while it’s running and reports on various performance issues.) I checked for memory leaks (garbage collection) and CPU bottlenecks. Within a week I had the update and draw logic about 75% faster and things seemed fine.
Then I started testing out some of the old SC1 levels to see how they ran on the new engine. To my horror, the two swarm levels (with over 100 mobs in the scene) completely chunked out on the 360. We’re talking 5 FPS at some points. Unacceptable.
I spent another two weeks scrambling to find the performance problem. What had I changed that killed the performance? The new features were costing a bit of extra draw time, but that wasn’t it. I could call the draw function four times per frame and it wouldn’t change anything. And according to the profiler, the update logic (calculating AI, creature positions, collision, etc.) was 40% faster in the new engine. It was completely inexplicable and frustrating. There was some architectural difference between the 360 and Windows, and my profiler just couldn’t track that down.
OK, my debugging was not working. Time for deductive reasoning. Let’s go into source control and keep rolling back until we find the version of the code that can’t run the swarm levels anymore, and see what’s been changed. I rolled back to early July… then June… eventually found the problem to be in the first week of April, at revision 3. Great! Now it’s just a matter of finding what changed between revisions 2 and 3.
Another week passed and nothing came up.
Programmers in the audience may want to sit down at this point. My next move was one of the most dreaded last resorts in software development: I made a new copy of the Soulcaster 1 code base and put it in a new source control repository called “Soulcaster 2 New.” Now I am in the process of adding all the features, bit by bit, by copying code from the broken Soulcaster 2 code base. I’m paranoid enough to test my changes on the 360 several times a day, and so far things are good–much better in fact, since my torture tests can have about 150 monsters on the screen now with no issues (Soulcaster 1 could barely handle 100).
It’s not as bad as losing all my work, but it’s a lesson learned.
So where do we stand? I have about 15 levels done, and four new tilesets complete. The game is going to need all new music, but the sprites and sound effects are reused from SC1. I figured I would post some screenshots to show what’s coming.