Showing posts with label unity. Show all posts
Showing posts with label unity. Show all posts

Wednesday, August 15, 2012

How I Doubled the FPS of my Game

The past few days, I've been working on getting the frame rate of my game up since when there are lots of zombies spawned, the frames per second dropped so low on mobile devices that it was unplayable.

So I set out to create some dramatic changes in my game. First thing, I created a backup of my game in case anything went wrong. Then I did what I should have done from the very start but I did not because I was fairly unexperienced in how to edit UV meshes. Previously for all my FBX files imported from 3DS max, I applied a different texture, each with a different material, to the planes. This results in one draw call for each material. This means there is at least 4 draw calls for each zombie (arms, legs, body, and head) and many more for each floor tile type.

I solved this by recreating all the FBX files and redoing all the UVW maps. I did this three times over for the three groups of FBX files I had: scene prop meshes, zombie and player meshes, and ground meshes. Each of the objects from the groups had to be organized into their own little area from the UVW map: The bottom-left 1/8th is given to one type of ground, the middle-bottom 1/8th is given to another type of ground, and so on and so on. Each UVW template is rendered out and then using Photoshop, the templates are combined into one large 1024 x 1024 and then I can add my textures into each place. This was the hardest part for me to understand when I was learning.


Then the new meshes from 3DS Max now have to be reexported with their new UVW mapping information. So yes, this means there will be more meshes in your project folder but there will be only one material that is shared between the meshes and so the objects will be batched, significantly improving FPS and decreasing draw calls.

As you can see from the first image, I compared the FPS and draw calls from the very first backup that I performed before redoing all the UVW mapping on most of my meshes and I was able to cut the draw calls in half and double the FPS, not bad for a few days of work.

Now I still have to redo the meshes for the houses, I'm thinking about repainting the texture for the brick building, not sure yet though.

Saturday, August 4, 2012

Level Up!

This afternoon, I knocked out a new idea I got last night. Originally, the weapons were going to be purchased at any time durring the game, when ever the player had enough money to buy the gun and enough bullets. Now there is a simple leveling system. A lower level player is barred from purchasing higher level guns until they level up.

Leveling up is achieved simply by killing more zombies, the more you kill, the more levels you gain, and the more weapons are unlocked by the weapons dealer. When you level up, the notification center will pop out as well as a particle system around the player will start (below).

Friday, August 3, 2012

New Super-human Character

Today, I completed creation of a fourth player that will give the player super-human abilities. The new character, dubbed QZ-199, after unlocked by reaching a certain Day in Classic mode, will give the player full stamina and speed.

Wednesday, August 1, 2012

Fixed Shooting, now with Double Barrel Shotgun

Today morning, I fixed the shooting element of the players bullets and coincidentally I was also able to solve why the police officer shoot was not working, two birds with one stone. Perviously, the bullets would instantiate themselves in the correct place, but then in the next frame would move to a completely different place this would happen more frequently when the player was rotating. I solved this problem fairly simply after lots of debugging, turns out I had to place change the velocity of the bullets in FixedUpdate() instead of Update().

Double-barreled shotgun

I also coded in the double barrled shot gun which looks awesome now. Now I'll be fixing the rotating gun viewer in the Pause menu, the animation for it seems to be acting up.

Tuesday, July 31, 2012

Progress of It's Raining Zombies

I have been working on It's Raining Zombies for over a year now and since it is nearing completion, I have posted a video showing how it has changed over the months. The concept I started with is still the same, a top down shooter but the story and game dynamics have completely changed.


Saturday, July 28, 2012

Meet Your Enemies

The enemies, one of the most critical parts of the game. The user will be seeing these guys everywhere so it's best to make these as solid as possible. It's Raining Zombies has 5 different enemy zombies, each one with their own special attributes, each one with a reason to be feared. The enemies are driven by Unity's Nav Mesh Agent. This allows them to efficiently navigate towards the player without getting stuck behind a wall as a normal follow might do.

Let's go in depth with these guys:

Enemy 1: 




This friendly face is the first enemy you will encounter, not too fast, not too hard too kill. Easy, right? That's until they decide to bring all their friends. This enemy is a master at being able to swarm around a player until there is nothing to do but fire your last bullets and die.

Enemy 2:


This business man is dressed for the job at hand, to get your brain. Slightly faster and twice as  strong compared to his cousin, Enemy 1, he will lead to your downfall.

Enemy 3:



He may be slow but this zombie uses his size to his advantage. Able to simply absorb many bullets without flinching, you better be armed with more than a started pistol if you don't want to be crushed.

Enemy 4:


What happens when the police become zombies? Let's just say that you should be near the health shop when this guy decides to show up. Fully equipped with a tracking system and an unlimited supply of ammo, this is truly the police officer from death.

Enemy 5:



This orange beast is incredibly quick, you'll need to be a pretty sharp shooter because a few missed bullets could be lethal.