It is currently Tue 28 Mar 2017, 22:37


Post a new topicPost a reply Page 1 of 1   [ 3 posts ]
Author Message
 Post subject: Just fixed an 8 year old bug with MASSIVE performance gains!
PostPosted: Wed 18 Nov 2015, 18:25 
Geneshift Creator
User avatar

Joined: Sat 14 Mar 2009, 17:50
Posts: 5977
Location: Sydney, Australia
Gender: Male
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:

Old version:
FPS: 65fps
Memory Usage: 735MB

New version:
FPS: 95fps
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:

Old version:
Editor FPS (full screen): 10fps
Editor FPS (small window): 10fps

New version:
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!

_________________
Creator of Geneshift and Nik Nak Studios. Hope you enjoy the game!


Top
 Profile  
Reply with quote  
 Post subject: Re: Just fixed an 8 year old bug with MASSIVE performance ga
PostPosted: Wed 18 Nov 2015, 18:35 
Geneshift Creator
User avatar

Joined: Sat 14 Mar 2009, 17:50
Posts: 5977
Location: Sydney, Australia
Gender: Male
Btw if you're curious you can test this bug on your current version of the game. Go into the map editor and create a new map which is very tall and narrow (width 64, height 512). It should run pretty fast. Now create a map which is very wide but short (width 512, height 64). Same number of tiles as before but this map will render a lot slower due to this width bug. I'd be curious to see what sort of FPS times you get on each map.

We might be able to start playing Raze again!

_________________
Creator of Geneshift and Nik Nak Studios. Hope you enjoy the game!


Top
 Profile  
Reply with quote  
 Post subject: Re: Just fixed an 8 year old bug with MASSIVE performance ga
PostPosted: Fri 27 Nov 2015, 18:25 
Pro Casual
User avatar

Joined: Mon 27 May 2013, 23:45
Posts: 554
Location: Northeastern USA
Gender: Male
bencelot wrote:
We might be able to start playing Raze again!

Dear god... pls no bancelod.

Perhaps this is related to the issue I was having with my old computer on map editor. Who knows lol.

_________________
Image
My Official Map, Bridge
"Mysterious as the Dark Side of the Moon"


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 3 posts ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron