Alien Blitz: animated lava/poison, video memory usage, pick up effect, flawless victory achievement

Animated lava/poison

I’m really improving my shader skills lately, it’s quite enjoyable :)

Just a small addition with animated lava & poison they will get a brightness boost for a few milliseconds every now and then.

capture_2015-02-11_21-34-49_0211_Alien_Blitz_ capture_2015-02-11_21-34-50_0959_Alien_Blitz_

It doesn’t add that much, but it’s nice.

I tried something similar with water but brightness boost isn’t nice, I can easily move the texture, but problem is that I can’t really set a moving direction, so it doesn’t feel nice (water can move away from the coast).

 

Video memory usage

After a full play through I noticed the video memory usage was a bit high, it was using 350mb video memory instead of something around 100-150mb. Of course it’s not that high considering most video cards have more than 512mb and people won’t usually do full play through but still it’s not good.

The “memory leak” was not easy to spot, my usual tests (launching all maps individually, killing all monsters and activating everything each time) did not really help. There was indeed something like 50mb too much used memory, but in this case it was so small that it could have been anything (cache, other application,…).

So instead of going through all the code I preferred checking if textures were correctly disposed after finalize, basically:

  • create a com.badlogic.gdx.graphics package in your project
  • copy the Texture class from libgdx to this package. It will override default Texture
  • Add a finalize() method that checks whether glHandle is equal to zero or not, if it is not it means the texture was not disposed before finalize
  • (you could also change Libgdx source and recompile it, but I think this method is a lot easier)

And there were indeed a few instances where textures where not disposed properly:

  • A texture used for drawing rectangles (<1kb, too small to do anything bad)
  • A texture used by a few sprites (same)
  • The texture used for “floating messages” (hit points, power up name display,…), this was the real culprit, this is a very small texture but a lot of them are created during a normal playthrough (my tests generate a few, but a lot less than a normal player playing a lot)

All these points have been corrected, and there doesn’t seem to be any video memory leak now.

 

Pick up effect

The old pick up effect when picking up ammo, keys and such as been removed, it was using the 2d version of sprites which was kinda weird.

Instead it is now replaced with a nicer effect, the sprite will just slowly fade and also will be sent a bit into the air before falling into the void.

capture_2015-02-12_15-45-10_0261_Alien_Blitz_

 

Flawless victory achievement

My bad, the flawless victories achievements could only be obtained with 100% kill, this has been corrected, you just need to complete a level without taking any damage, even with 0% kill.

Comments are closed.