New Levels and Bug Fixes for Piggy Chase

In preparation for submitting my game, Piggy Chase, for Magfest, I’ve been doing a bunch of work on the game. I’ve fixed some of the AI bugs (like animals floating up in the air on hills?!) and changed the control scheme to be more user friendly. Additionally, I added two new levels! I am hoping to have 10 levels — so only 6 more to go before I go for a release.

Now I have a tutorial level, a farm level, a city level, and a snow level. The farm level has the animals dodging tractors while the city involves lots of traffic. The Snow level has bad snow man that patrol perilously narrow ice platforms. I also have a Bowser’s Castle-style level in the works with lava and spikes–but it’s not ready yet so it isn’t in the video.

lavalevel

At the moment it’s basically a deceptively simple looking happy silly animal frogger game that actually is a pretty hard timing/reflex based game underneath. It’s pretty unfair and unbalanced right now and I think one would have to be really skilled to get all the animals to survive in the end. Part of me thinks I should scale back the difficulty or add  in lives to allow players to sort of pick up where they die. I could also have animals respawn, so if you are really into completing a level you could go back and get everyone. I was also thinking about puzzle elements beyond the maze and timing elements, but I don’t want to spoil the formula that I have so far.

Fixing the Unity Constantly Turning or Spinning Player / Camera Problem

If your players are reporting that they keep spinning in your game and can’t stop, there might be an issue with the joystick inputs on their end that makes it impossible for you to find the bug. However… you can program to solve it if you make enabling Joysticks optional.

Here is a player video of the bug!

The best way to solve this from the programmer end is to write your input scripts to deal with it. Currently, your game (by default) accepts Horizontal and Vertical Axis info from the keyboard or a joystick. They are labeled the same in the Input Manager… That way you can write code like:

float translation = Input.GetAxis(“Vertical”) * speed;
float rotation = Input.GetAxis(“Horizontal”) * rotationSpeed;

And it won’t matter if the player is using a keyboard or a joystick. Unfortunately when a player has something going on with their joystick stuff (virtual joysticks seem to cause issues), the Axis gets all wonky… Players report spinning around that won’t stop.

BUT… If you change the name of your second set of Horizontal and Vertical Axes in the Input Manager (the ones that correspond to the joysticks) to something like HorizontalJoy and VerticalJoy then they won’t interfere for your keyboard-only using player. You could then add a toggle on your Controls or Pause menu to enable Joystick controls.

then you might write code like this:

if( !joystick )
{
//if joysticks aren’t enabled – just track keyboard axis

float translation = Input.GetAxis(“Vertical”) * speed;
float rotation = Input.GetAxis(“Horizontal”) * rotationSpeed;
} else

{

float translation = Input.GetAxis(“VerticalJoy”) * speed;
float rotation = Input.GetAxis(“HorizontalJoy”) * rotationSpeed;
}

Below is a screenshot of the input manager – notice the second set of Horizontal and Vertical Axis are called HorizontalJ and VerticalJ. Do something like that and write code to allow for joy support if you want to give your user the option and the bug should be fixed on your end and the users. This also means joys won’t really be tracked unless you write code to watch the specific axis as stated above. This solution worked for my testers.

Screen Shot 2014-12-01 at 7.08.51 PM