I just found a huuuuge bug in my map rendering code that I wrote 8 years ago, and it's been with us ever since! When I first started working on Mutant Factions I wasn't a very good coder and this bug managed to go unnoticed this entire time. The bug was making maps render significantly slower based on the width of the map. Therefore the bigger the map, the slower the game would run. I thought I'd accounted for this but apparently not. Technically the bug was that every frame the ENTIRE WIDTH of the map would be sent from RAM to the GPU, instead of just a single tile. This created a massive bottleneck as the computer had to wait for all this data to be sent across. Very inefficient!
A game can only run as fast as the slowest bottleneck. On some computers that's the CPU, on others the GPU, and on others (like mine and probably yours) the bandwidth between the CPU/RAM and the GPU is a big bottleneck. While all of this useless data was being sent to the GPU to render, the CPU and GPU are just sitting around doing nothing! But I've fixed this now and am only sending across the data that is actually needed, and boy are the results good!
As a bonus while I was fixing this I found ANOTHER bug that massively cut down on memory usage. Who knows how many more bugs are waiting to be discovered?? Anyway these results may vary for your computer but here are the before and after times on my Sony Vaio Pro 13 (i5 cpu). This is running on Downtown with full settings:
Memory Usage: 735MB
Memory Usage: 445MB
Not bad! That memory usage saving is great, and the FPS is very nice too. But if you'r a map maker it gets better... a LOT better:
Editor FPS (full screen): 10fps
Editor FPS (small window): 10fps
Editor FPS (full screen): 80fps
Editor FPS (small window): 140fps
1400% improvement!!!! That's insane. Making maps will be so much nicer and faster now. The 3 hours I spent fixing this bug this morning will probably save me 20+ hours over the next few weeks just being able to make maps so much faster. Very happy with this!