Soulcaster 2 Development Status

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.

6 comments

  1. Hi, Ian !

    I’m surprised that no one ever comments your messages but, as long as it does not distract you from coding the new Soulcaster game, that’s ok ! :p

    I wanted to thank you for the first iteration of the series, which I appreciated a lot. Congrats for this piece of perfect gameplay.

    Hopefully you can bring us the second volume anytime soon.

    I’m a bit surprised you didn’t redraw / enhance the sprites but I liked them in first place, so that won’t be a problem. I hope you can add some new backgrounds that could add some variety to the ones who went through the first adventure.

    Don’t hesitate to bring some news in the weeks to come cause I think that some people might be really interested in this game.

    See ya,

    Sebastien (France)

  2. Thanks Sebastien! I know my updates are scarce these days, but rest assured SC2 is nearly complete.

    There really wasn’t time to redo all the graphics so I decided to redo the backgrounds and keep sprites from SC1. The backgrounds and soundtrack are completely new, as are the levels of course. There are also a couple new surprises in the monster category.

  3. Yeah, figure I should post an update so people don’t think SC2 development is at a standstill.

    I spent one month slowly and carefully upgrading the SC1 codebase to accommodate SC2 features, testing frequently on XBOX to make sure I wasn’t introducing the dreaded 5 FPS bug. I made one change that I never would have guessed would impact anything, which reintroduced the bug, and I actually spent two days tracking it down. It was in the sound player. If a song wasn’t being initialized when the game started, and a null song was being played, it kept trying to buffer this song in and fail it. So changing one line, where it initializes to the Silence song on start, fixed everything.

    I went back to the broken SC2 codebase and made this change (one line!) and all was well. So, only one month lost instead of four.

    The current code situations are some AI behavior and performance issues (pathfinding) and a Code 4 crash that has occurred once after 1 hour of play. I’ll just do my playtesting hosted through Visual Studio instead of played from the dashboard and it should rear its head again…

  4. Wow, thats really rough, but glad you managed to track it down.

    I am actually in a similar state with performance issues eating up all of my development time (and have little experience with the profiler, so thats not helping as much as I had hoped it would). I am not quite at the point of starting from scratch again (I don’t have a working code base to fall back on), and I really hope it doesn’t come to that.

    Hope everything works out for you on SC2, because I was a big fan of the first one.

  5. You know how much I liked SC1 and I am looking forward to SC2 a lot.

    Thank you for sharing the insights into your development struggle. That such a stupid soung bug can destroy a whole month of development time is really a lesson one can learn from. I bet you have.

    I hope the Winter Uprising brings a lot more visitors to your blog, so maybe it´s time to give out some more details on what to expect in SC2. 😉

Leave a comment

Your email address will not be published. Required fields are marked *