2d Game Development on Android: Demo Launch

A lot of interesting innovations were added to the latest version: program animation of characters instead of frame animation, possibility to tear off parts of the body, survival mode, stationary guns, missions for the quest mode, new weapons, perks and bonuses. The mechanics of getting weapons was also hanged.

All parts of the diary

Program animation of characters

Earlier we used frame animation for the main character. As a result we had a big set of sprites in one file for walking and dying. Similarly, separate sets were specified for every monster. Some have been quite large, for a nest for example. In the future characters appearance (emotions, clothing, etc.) is to be changed and we find it too expensive to do animation for each possible appearance. Therefore, we decided to switch to program animation.

For example, the walking is done by alternately moving the sprites of legs in a vertical plane. Also the torso and head move synchronously imitating swinging. All this is implemented using code which allows us to save a lot of memory. To do this, we had to cut all the characters into their component parts. Each of them got silhouettes of different colors. These colored fillings are used when the characters are under different influences. For example, if the main character took a bonus, the whole figure becomes yellow for a moment; and when a bullet hits a monster it becomes red.

2d Game Development on Android: Demo Launch

Tearing off body parts

All parts of the body are separate entities and we can do with them whatever we want. The first idea is to break the monsters into pieces when they are hit by grenades or a shotgun. We have done even more: tearing off hands and head at random as health approaches to zero. Later monsters began to explode even the main character. By abundantly spicing it all with blood we got a unique feature for this type of 2d shooter.

2d Game Development on Android: Demo Launch

Survival mode

At the beginning our software development company planned to add this option as soon as possible but we were not able to squeeze it in for a long time. When the system of waves has been finally established and some really big monsters were added, we began the implementation. The result was a very dynamic gameplay.

With each wave we increase the number of monsters by 1. With the fourth wave after each two waves we add bosses and big monsters. Since there is no access to the weapons store from survival mode, we throw them out of dead monsters as bonuses. We limited weapon ammo to a few cartridge clips. When the player runs out of cartridges, a pistol appears in hero’s hand. Survival mode allows player to quickly try all kinds of weapons. This mechanic was working fine so we implemented it in the quest mode with a few conditions (new guns become available after purchasing). In the future we will add the top players stats.

New monsters and stationary guns

Apart from the usual nests we added two huge modifications. Now nests produce zombies but we plan to use small spiders instead. For comparison:

2d Game Development on Android: Demo Launch

According to the plot, stationary guns represent the fortification installations built by a highly developed civilization which protect themselves from monster invasion. They are equipped with three types of weapons: machine guns, lasers and rocket launcher. In the early stages guns fire at us, but in the future they become our allies. Bullets, missiles and plasma beam damage not only us, but also monsters and, of course, guns can damage each other.

2d Game Development on Android: Demo Launch

Tasks in the quests mode

In order to diversify gameplay we came up with a variety of tasks and conditions for completing levels in the quests mode:

  • Kill everybody — destroy all the waves.
  • To remain alive for a certain amount of time — there will be particularly large amount of monsters at these levels.
  • Protect allies — as the game progresses we will help highly developed race to get rid of monsters.
  • The movement of cargo from point A to point B — our assistance will also be expressed in the delivery of various cargoes.
  • To get to a certain point — we will have level with a maze from which you are to get out in a certain amount of time.

New weapons

We have already implemented 6 weapons + 2 more guns are planned:

  • Pistol — unlimited ammunition, the weakest weapon.
  • Shotgun — long range, 4 shots per shooting.
  • Uzi (submashine gun) — very high fire rate.
  • Grenades — effective against hordes of zombies, nests and guns.
  • Grenade launcher — only slightly inferior to the grenades.
  • Laser gun — shoots monsters through, high damage.
  • Flamethrower — ignites monsters; is very effective against spiders.
  • BFG — the biggest gun in the game and perhaps the most powerful.

2d Game Development on Android: Demo Launch

Perks and bonuses

A few interesting bonuses were added:

  • • Bonus of invisibility — monsters go to a point where you were seen the last time.
  • Bonus of freezing — monsters around turn frozen and stand motionless.
  • Bonus of fear — monsters stampede from you.

Names of perks were ordered, falling out was improved.

The new mechanics of obtaining weapons

Previously guns were purchased from the store in the quest mode. After completing a level you used only one type of weapon which was preselected. A similar approach but with the possibility to choose between two types of weapons is used in Monster Shooter.

At the same time in the survival mode guns fall out randomly and have multiple cartridge clips. Once the player runs out of cartridges, he gets a pistol. This is done in Age of Zombies. During one such level a huge pile of weapons can be changed. The game becomes dynamic and walkthrough style changes with the change of the weapon.

After playing in a survival mode we realized that guns should just fall out instead of being bought. Gameplay becomes much more interesting when a player uses different weapons in one level.

Therefore, in the quest mode we have implemented mechanics of getting weapons that is similar to the survival mode. After a player buys a new gun from the store, it is available to him in the beginning of a level but with a limited ammo. Later it is drawn randomly from the list of the purchased weapons.

Performance issues

With the increase of the number of monsters in Survival mode we faced the problem of sharp FPS drop even on powerful smartphones. Setting culling — setCulling (true) for each sprite allowed to get performance gain. But there appeared to be a serious problem: the monsters were drawn only if they could be fully placed into the camera view otherwise they were impossible to see. Therefore, a separate method was written for specifying the need to display or hide sprite in case it would not fully fit into the boundaries of the camera.

private void optimize() {
        if (RectangularShapeCollisionChecker.isVisible(new Camera(ResourcesManager.getInstance().camera.getXMin() - mFullWidth,
                ResourcesManager.getInstance().camera.getYMin() - mFullHeight,
                ResourcesManager.getInstance().camera.getWidth() + mFullWidth,
                ResourcesManager.getInstance().camera.getHeight() + mFullHeight), this)) {
            setVisible(true);
        } else {
            setVisible(false);
        }
    }

This small optimization has significantly improved the performance of the whole game.

That’s all for now. Stay tuned for more of the software development process! Follow the official Facebook page of the studio, I will regularly upload interesting notes and images from the game.

Part 4: Release

UPD: Galaxy Recon is already on Google Play — check it out!