Just fixed an 8 year old bug with MASSIVE performance gains!

Wed 18 Nov 2015, 18:25 by bencelot



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!


2 Comments


bencelot says:

Wed 18 Nov 2015, 18:35


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!


Nightfall says:

Fri 27 Nov 2015, 18:25


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.

Blog Posts For Geneshift


Version 1.02 Adds Three New Skills!

(0)


Geneshift has launched on Steam Early Access!

(3)


Geneshift v1.00 Released!

(0)


Play the Multiplayer Demo on Steam Today!

(1)


Geneshift hits Steam on May 23rd, 2017

(0)


Official Discord Chatroom

(0)


Geneshift v0.997 Released!

(0)


Geneshift Launch Trailer is Live!

(7)


Server Downtime

(0)


Geneshift v0.996 Released!

(1)


Steam Store Page is now Coming Soon!

(0)


Steam Integration & Achievements

(12)


Geneshift v0.995 Released!

(1)


Geneshift - new game name!!

(4)


3D Vehicle Models!

(36)


3D Player Models!

(34)


Time for Graphics!

(10)


Skill Casting Guards!

(6)


Campaign Stage 6: Inferno

(6)


Updating the particle system

(2)


Stealth speeds by Outbreak in Speedruns!

(1)


Version 0.994 released! Introducing Stealth mode!

(0)


Graphics fun

(2)


Trigger music with bombs and text zones

(1)


Making Music!

(22)


Version 0.994 test build is available!

(22)


Started work on the third campaign stage: Driving Downtown

(4)


Just fixed an 8 year old bug with MASSIVE performance gains!

(2)


Guard Waypoints!

(59)


Version 0.992: Speedrun Leaderboards and new skill scaling!

(0)


Leaderboards are done!

(2)


New Version, new trailer, new year!!

(17)


Finished the new trailer!

(3)


Hooray! My laptop can take video!

(0)


Version 0.99 Released!! Amazing graphics and new chemicals!

(6)


Rewording all the skills

(8)


Working on team chemical vision!

(15)


FINALLY finished map making! Thank god.

(3)


Free skill resets on mutants under level 30!

(11)


Reworked Barn, Canal and Asylum

(9)


Reworked Downtown

(0)


Added the Newbie Checklist!

(7)


3D Models!! Mutant Factions has finally gone 3D baby!

(19)


Just rented an apartment in Peru!

(0)


Update on plans and Menu Music!

(9)


Massively expanded the in-game tutorial guide

(0)


Textured, Animated, Layered and 3D Fog!!

(5)


Specular Highlights!!

(6)


Added Ambient Occlusion!

(5)


Sexy Soft Shadows!1

(11)


Version 0.98: Some nice balance changes

(1)


A little bit of graphical goodness!

(0)


Brasil trip is over, back to coding!

(2)


Version 0.97: Chemical Warfare polish and skill queues!

(0)


Introducing Chemical Warfare!! Version 0.96 is here!

(0)


Chemical Warfare is finished!

(1)


Chemical Warfare: Graphics finished, coming out soon!!

(0)


Chemical Warfare: super sexy chemical graphics

(5)


Chemical Warfare: Today I finished coding all gameplay!!

(1)


Chemical Warfare: buy menu icons and descriptions

(2)


Chemical Warfare: carrying a chemical graphics

(0)


Chemical Warfare: buying chemicals

(0)


Chemical Warfare: compound graphics!

(5)


Chemical Warfare: HUD, networking and compounds

(0)


Chemical Warfare: point scoring and compound discovery

(6)


Chemical Warfare: menu, networking and compound locations

(0)


What's this blog business??

(0)


Version 0.95! New cash system!

(3)


Version 0.94!! FLAMETHROWERS!!!

(16)


Version 0.936 is out! Superweapons galore!

(7)


Please tell your friends and vote on Steam Greenlight!

(2)


Wooot Woot! Version 0.935 is here! No longer in alpha!

(10)


Check out the new main page!

(8)


Version 0.93!! Brand new ranked servers and CC system!

(3)


Rescaling of Respect Ranks

(2)


Version 0.92 is out! Sexy new maps and Outbreak changes!

(3)


4 new custom-maps servers

(3)


I'm going to be working on Mutant Factions full time again!

(10)


Mutant Factions v0.91 is out! Introducing Respect Rankings!

(4)


Outbreak has been released! Introducing Mutant Factions v0.9

(4)


Subvein has changed names to Mutant Factions!

(7)


12 Official New Servers!

(7)


Mutant Factions Madness: Official Play Sessions!

(12)


Subvein version 0.74 has been released!

(2)


Like Subvein on Facebook!

(8)


Subvein version 0.73 released!!

(13)


Let's Play Together!

(1)


Explosions now dynamically light up the map!

(5)


Subvein is on Steam Greenlight!

(54)


An amazing optimisation!

(12)


Version 0.71 has been released!

(1)


Version 0.7 is out! Translations, Unicode, and New Skills!

(5)


Today I'm going to add translations (переводы)

(34)


Version 0.698 is out! Vehicle netcode and skill changes

(2)


Version 0.697 is out! Restructured weapons, skills, missions

(6)


Version 0.696 released! Improved netcode, AI and skills!

(30)


Playing with pathfinding

(30)


Playing with netcode

(8)


Version 0.695 is here :D

(21)


Subvein v0.694 is rockin' OUT!

(6)


Subvein v0.693 is LIVE!!

(15)


Latest developments: In-game quick levelling!

(41)


Version 0.692 is out!

(9)


New version is out! Introducing v0.691

(7)


Yehaaa!! Version 0.69 is out!

(4)


Woo hoo! We now have new hosting :D

(10)


Woohoo!! Over 5000 members!

(4)


Subvein is back up and running!!

(8)


2000 members. Let's make it 20000!!

(36)


Subvein version 0.6 has been released!

(13)


New promo video!!!

(12)


Added a new Community page!

(6)


Just added camera shake :)

(3)


Updated the news page!

(3)


Start earning community credits today!

(16)


A war is coming..

(6)


Account system coming to Subvein v0.6!!

(29)


First ever demo of Subvein vehicles is up!

(5)


Version 0.551 Released :)

(4)


Subvein version 0.55 Released!

(8)


Version 0.541 is out. Thank god!

(5)


Version 0.54 is different. Experience it now!

(9)


Version 0.54 comes out in 24 hours!!

(9)


Subvein v0.53 is OUT!!

(3)


Subvein v0.53 will go up within 24 hours!!!!

(9)


Added a new SHARE button!

(2)


Added a new FAQ section to site!

(5)


Subvein version 0.52 is HERE!!!

(13)


Subvein v0.52 will be released in 7 hours!!

(13)


Development towards version 0.52:

(70)


Version 0.51 is OUT!

(6)


Welcome to Geneshift!

(167)