Thursday, March 14, 2013

Almost at v1.03

Almost there... Going to try to get a build out by Friday, but we will see what happens. Online for the most part is cooperating. The biggest challenge is there are just so many menu screens and sections that need to be able to scroll and show additional information.

As of yesterday a new mode went in! TimedVS, has all players confined to a 20 sec time limit for their turns. More advanced options like setting that interval is planned of the future, its also missing the major indicator of when the timer hit 5,4,3,2,1 which should help player realize their turn is about to be skipped.

Oh, so we had a bit of a wrinkle getting the web build running well. As you played the game would get progressively slower and slower and slower, which made no sense. How could an iPad (very much so underpowered compared to a desktop) actually run the game better?

Well, the reason is because when i build Pathogen out for tablet devices I direct it to use the devices GPU instead of the CPU. The GPU, which coverts all vector images into bitmap is capable of greater computational power when it comes to displaying images on a screen.

The thing about putting the game up on the web is that i cannot direct the users computer to access the GPU, which means that the CPU is doing all the heavy lifting in terms of displaying images (which it always does poorly). This meant that no matter how good your CPU is Pathogen would "lag", we had a report of the i7 not even being able to handle it.

So how did I fix it? Well the issue was caused entirely by the background elements. Each of those pieces has their own stack of effects (blur, glow, etc) and are all transparent. Which means that for each object the CPU had to do several draw passes per frame to render it to the screen. The background consistently has about 30 objects in it, which meant the CPU was getting pretty taxed with just dealing with those fancy background effects.

The key was to render all background objects in a single pass instead of the 50+ it was doing. For the web build now all objects are added to a single bitmap object and that singular image is redrawn every frame with each objects updated location due to their wandering AI. Pretty cool huh?

No comments:

Post a Comment