Optimizing the Optimizer

Today I worked on the tool that will generate the optimized maps for each level of EARL’s Warehouse: The Depot. In theory, its job is to determine what blocks within the master map can possibly be seen by the player in each level, then save an optimized copy of the map for the level that contains only those blocks.

In practice, I am still working out a few kinks. The concept sounds simple enough, however, you start realizing things like the fact that you have to test multiple points (each corner) on each block, and that the resulting algorithm has a O(m^3 * n^3) performance profile that results in literally 10 billion Line-Of-Sight calculations and thus is the type of thing you leave running overnight… Not very good for testing.

With such a slow, methodical algorithm, at first glance it seems that it would be quicker just to hand-tune the levels, until one realizes that CPU time is a lot cheaper than human time, especially when that CPU time is spent while the humans are sleeping.

I’ve done what I can to speed this processing up, such as skipping processing on empty blocks, tweaking algorithms, multithreading, etc., and it seems I am at about 400 minutes to process an average map, and it doesn’t look like it’s going to get much faster than that.

Testing is going well, earlier this week I went through all of Chapter 1 and most of Chapter 2, and have made a few fixes and tweaks. Some were a long time in coming, such as shortening the jump a bit on the first Dash block level to make it less brutal.

Overall, I think I am still on-target for a September 14 release date. More updates to come!