Thursday, December 31, 2015

NoTilt pinball

I released Rhino Roll my previous game on the 18th December 2015, I then set myself a target to release a new game by the end of the year.
Rhino Roll on GooglePlay
Rhino Roll get it on GooglePlay

My new game is called NoTilt pinball and relies heavily on my 1st game Shuffa ball's mechanics. 

 NoTilt get it on GooglePlay
NoTilt Pinball get it on GooglePlay

Here it is like a traditional pinball game with bumpers, triggers and slingshots. The one thing missing is the flippers. You use the table itself to control the ball. Watch the trailer video to see it in action.



Sunday, December 6, 2015

Creating a video game trailer using Movie Maker

To get your game noticed a lot of people say you need a trailer video for your game. I don't know if that is true but here is how I went about making the trailer.

Rhino Roller trailer

To do that I used Movie maker for editing, Open broadcast software (OBS) for the screen capture and Spriter and Inkscape for the logo animations.

Logo animations

To do the logo I used Inkscape to create PNGs, then in Spriter I created an animation for the logo. Then I exported the animation to multiple PNGs which I then imported into Movie Maker, changed the time to display each frame to 0.1s.

Dragging multiple .PNGs into Movie Maker


Change dsiplay time


Game Play

To capure the game play I used OBS to screen capture. I turned the music off as that will be added later in Movie Maker. I edited multple shots of game play together and added to the main trailer project.

Music

I then added the music from the game itself into the video.


Click here to see the video

Monday, November 30, 2015

Rhino Roll

I've changed the name of Endless roller to Rhino Roll and it is now available for testing on Google Play.
It is a side scrolling platformer game.
To jump deform the ground and use as a trampoline.

Here are some screenshots of the game





Saturday, September 26, 2015

Adding a Font in Unity

So I was getting ready to release a version of my game Shuffa ball: Endless Roller onto game jolt for play testing. So I decided I needed to have text for the menus, I used a font I found in Inkscape and asked myself am I allowed to release a game using this font.
The font is called Showcard Gothic and it appeared it is not free to use commercially. So I needed to find a new font free to use in an application. I came across the site http://www.fontsquirrel.com/ that contains free to use fonts.
There I found this great cartoony font that fits perfectly with the cartoon style of my game. It is called Pusab and here is a picture of the level complete panel featuring the font.

Pusab font on level complete

In unity to use the font is really simple, just place the PUSAB___.otf file in the assets folder, then when using the text click the select font button.

Select font in Unity

Now I have a full level of the game to play, please play it and leave comments. It still isn't finished but it is getting there.

Tuesday, September 8, 2015

Unity Editor scripting: How to create levels

So in creating the levels I came across a problem.

It was really difficult to set up a level. Moving all of the tiles about was really difficult as they are inside a game object. Each parent objects has 4 sprites, a ceiling a floor, a top and a middle. These can all be assigned different Y axis positions.
What I really needed was a way to select multiple parent GameObjects then somehow manipulate them all in one go. So the way I’ve achieved this is by editor scripting.

To do this I created a script it that goes into a special folder called Editor in the Assets directory, if the folder isn’t there create it.

At the top of the script we need to add.

using UnityEditor;


We need to add the attribute for the menu item;

[MenuItem("Adz/Floor/UP/FloorUP")]

This allows us to change the IDE of unity to have our special function available as a menu item.
To run the function we select multiple GameObjects then click the FloorUp function.

Multiple GameObjects selected with new Menu items in IDE 

Here is the code for the FloorUp function, it loops through all of the items selected in the scene view, in order of the transform’s X position and increases their y by .1f.

   static void FloorUP()
        var items = Selection.gameObjects.OrderBy(go => go.transform.position.x);

        foreach (var item in items)
        {
            anchor p = item.GetComponentInChildren<anchor>();
            p.FloorTileY += .1f;
        }
    }

After clicking the menu item FloorUp we see the effect on the selected GameObjects, it gives us a ramp going upwards.

After the editor script FloorUp is run

So then all I did was create similar functions for the ceiling, Top, Middle sprites then I could easily create levels for the Shuffa ball: Endless roller game.



Sunday, August 30, 2015

Desert Tile Set for Endless Roller

Here for my game in development, Endless Roller, I've updated it to use gameart2D.com's desert tile set.
It just adds the professional quality.

I was sick at looking at my done in 5mins crappy artwork and saw that the site http://www.gameart2d.com/freebies.html has a number of freebies to use.

To use in my game I used Inkscape and did as I explained in my blog creating scrollable background tiles. I increased the number of tiles used by 5 as I thought it looked better in the game. I added a new layer called Desert, this means I just hide my old background layer and Inkscape will only export the desert layer. If I want to go back and use the crappy versions I can unhide the desert layer and show the original background layer.

Background tiles selected ready for export.

This background is much taller than the other backgrounds. This is because I've changed the game so that the camera will follow the Rhino as he goes up in the air.

Middle background layer

Front background layer


video on Youtube of the new desert tile set in action.





Monday, August 17, 2015

New Main menu for Shuffa ball

I decided to update the UI of my original game Shuffa ball. Previously there was 21 levels in one large scroll rect and it often seemed slow on startup.

So the idea is to have a main menu from which we can choose one of the 5 campaigns. It should also have the Settings and About links as well as an Exit button.

So in Inkscape I went about creating the assets to be used.

First off there needs to be a background, one of the filters I use in the design of the game graphics is Bevels->Combined Lighting. So what I do is apply that filter to the background then cut-out the buttons which gives a nice sunken feeling to the buttons.


To do a cut-out, make a shape on top of the background then Path->Difference (Ctrl+-).


 Here is how my main menu looked after all of the cut-outs.

I then hooked up all of the buttons for the level selection, they all call the old main menu, but I set which difficulty level is to be used.

New Main menu in action.

Then in the old a subset of the levels is displayed.

 Easy levels selected

By splitting the menu system into 2 Screens, I believe the menu system is simple on the main menu and is less cluttered on the level selection.



Wednesday, August 12, 2015

Self bouncing balls

To make the game more interesting, I’ve decided to have the balls bounce along too.

They also will use the floor to jump, when they are just about to come into contact with the floor it deforms beneath them, then they let go launching the ball into the air.

To do that we have the balls look down and to the right, when we detect that the ball is going to come into contact with a floor tile, we send that floor tile a message to start sliding down. It will then slide down the adjacent floor tiles too.

Ball being launched by the floor

Code sending the message to the collider to start swipe down


Here is a video of the balls bouncing by themselves.

Wednesday, August 5, 2015

Rhino animations and transitions

To the Rhino sprite I want to add 3 things.

  • A sprite to represent the dust as the wheel turns on the ground.
  • A Dust explosion when the ball takes off and lands.
  • The third is more difficult I want the whole Rhino sprite to be angle differently when it takes off and lands.

Rhino Revving, taking off and landing

Revving Sprite

This blog will be about adding the revving sprite to the Rhino ball.

Again I’m going to use Spriter by BrashMonkey, and the Dust.scml from the Game effects artpack.

It has 2 animations the Rev sprite and the landing sprite, I’ll export them to separate PNG files like I did previously. Then drag them onto the hierarchy to create the animation.

If we were to attach to the wheel as a child the rev sprite would rotate with the ball. We could attach the sprite to the Rhino head as that is doesn’t move much but as with the flame sprite I’m going to use the Update function to position relative to the centre of the ball.
Unlike the flame sprite we need to apply an offset as the rev needs to appear on the left of the Rhino ball. To find the offset make the Rev temporarily a child of the Rhino ball then move to the ideal position, store the transform position as this is what we’ll add in the Update function. Remembering to move the Dust_000 from the RhinoBall hierarchy.

adjusting the transform of the Rev sprite

adding the sprite to the Rhino script

So the Rev sprite now works and is well positioned but the problem is when the Rhino jumps and is airborne there shouldn’t be dust revving. So as with the flame in the previous blog we will RayCast down from the centre of the ball to see when we lose contact with the ground.
If we lose contact we set active of the Rev GameObject to false, in the future we will transition from the Rev sprite to the take-off sprite but this will do just now.

Tuesday, August 4, 2015

Rotation of the flame sprite

In my previous blog, I hinted that we wanted to rotate the flame, the idea is that when falling we want the flames above the Shuffa ball, with an upwards motion the flames below and when on the ground the flames to the left of the ball.


Shuffa ball with rotated flame

To do this we need to know when the ball is in contact with the ground, and if airborne whether the trajectory is upwards or downwards.

To see if the ball is in contact with the ground we will use RayCasting, we will cast an invisible line down a certain distance from the centre of the ball; if it collides with a piece of floor then we return true saying it is grounded.

With RayCasting we need to use layers, these layers separate the different object types. If we didn’t then the RayCast will always return true as it casts from the centre of the ball down to outside the circle collider, thus hitting the collider and returning true.
We will assign all of the floor sprites to the Floor layer, then when RayCasting we tell it to only search the Floor layer.



To set up the Floor layer click Layers->Edit Layers, then add the Floor layer to one of the User Layers.
adding the Floor layer
Next assign the floor tile to the Floor Layer.
assign the floor sprite to the Floor layer
To work out whether the ball is falling or on an upward trajectory we compare the current transform position with the previous frame. Then adjust the angle accordingly. When adjusting the angle we don't want it to change immediately but have a smooth transition, that is where the Slerp function comes in.


Video of the ball flame rotation in action

Saturday, August 1, 2015

Bouncy fire-starter

As I've chosen a Rhino and as we all know they live to put out fires, I've now come up with a goal of the game.
The Shuffa ball instead of being the main player becomes the fire-starter, bouncy fire-starter. The Rhino then has the task of putting these fires out.

For the animation of the fire I use a package I bought called Spriter by BrashMonkey, when I bought it all of the artpacks were included. It is free to try and I do recommend it.
The one I am going to use comes from the Game effects pack and is called flame.scml.
Once opened; Click File->Export Animation to PNG.

Export animation

Then I set the size to 200% and the number of frames to export, in my case 9. You obviously will play about with these figures depending on the project. 

Exporting flame frames

These need to be exported into a directory inside the Assets directory of the unity project. Then to create the animation you drag all of the images onto the Hierarchy, this creates the animation. One thing I like to do is un-check the "Generate mip-maps", I'm not sure what this is for but it just seems to create a lesser quality animation.


Drag images to Hierarchy

Now to make the flame follow the ball:
If you drag the flame onto the ball it becomes a child of that object and therefore as the ball rotates the so will the flame animation. Not the effect I'm after, so we need to create a script that as the ball moves the flame animation is also moved.
To do that we create in the ball script we a public GameObject that in the update we change the transform position to match that of the ball.

Ball script with GameObject

Back in the unity editor drag the flame_007 object into the fire, make sure the flame object is no longer a child of the ball.

Now we have a flame object that follows the ball, because the flame animation is much taller the middles do not line up.
Misaligned images

In the Update of the ball we could add an offset to the transform position but later on I want to change the rotation of the flame depending on whether it is airborne or rolling on the ground. So the easiest way is to change the pivot point of each frame in the animation.
Navigate in the Project to the directory where the individual PNG files are store then click on each on and in the sprite editor change the pivot point.

Changing pivot point of each sprite

Aligned ball and flame.


Thursday, July 30, 2015

Work around for a System.IO.FileNotFoundException: Oracle.DataAccess

I wrote a simple program that uses ODP.Net to copy data from one server to another.

I have the ODP.NET version 2.112.3.0 installed on my machine with the Oracle.DataAcess Specific version set to false. The server is a Windows 2003 32 bit so the output is x86.


The .EXE works fine on my machine, then when I tried it on the server itself I got.

Exception non gérée : System.IO.FileNotFoundException: Impossible de charger le fichier ou l'assembly 'Oracle.DataAccess, Version=2.112.3.0, Culture=neutral, PublicKeyToken=89b483f429c47342' ou une de ses dépendances. Le fichier spécifié est introuvable.

I needed to have this .EXE work on the server so in order to make it work; I copied the version of the ODP.Net from the server to my machine. I then changed the reference in the project to this one and set the Specific Version to True. I tried with it set to false and I still got an error.


The .EXE worked on the server.

This seems like a work around, there was probably something wrong with the Oracle installation on the server but I couldn't change the server, so this did the trick. 

I would have thought having specific version set to false would mean it would work no matter what version of the ODP.Net was installed. 

If I ever find out the problem I'll post an update.

Sunday, July 26, 2015

Rhino face-off, bouncy version

In my previous blog I thought to add a rhino to the game as a baddie.
So to recap, I had two versions, one as Rhino/Spacehopper hybrid the other as a proper animated version of a rhino.
This blog will follow my research into how to make the Rhino/Spacehopper hybrid.

Rhino face-off

So looking around in the Unity physics 2D I thought I'd start with the ball. In Shuffa ball I have a script for the ball, a RigidBody2D and a circle collider 2D so I added the same.

Unity editor after adding Rhino script, RigidBody2D and Circle Collider 2D

Then in the script I add code to apply force to the rigidBody2D. This little snipit says if the velocity is less than 5 add I to the force, by putting it in the fixedUpdate as opposed to every frame it does it at a fixed time. If every frame, different machines have different frame rates.

Rhino script in VS2013 Community edition

Here I use VS2013 Community edition, I tried MonoDevelop that comes with Unity, but found the Intellisense a bit flaky. Using Visual Studio at work everyday, I am too used to the Intellisense working and all of the keyboard shortcuts, so I changed to the VS2013 community edition.

Running the scene, everything worked as normal, then I wanted to add the Rhino head, this is where I went looking through various Physics 2D components.

The thing that seemed most obvious to me was the Wheel Join 2D, this seemed what I wanted. I connected my wheel joint 2D from the wheel to the head of my rhino, which seemed the obvious way but it really didn't work as I expected. 
Then I found on the internet that you connect from the head to the the wheel, that was better but again didn't look right. So I added a small wheel at the front of the head. Then for movement you have a motor not the FixedUpdate function above.

It was OK but not the vision I had for my Rhino ball, it was more like a Rhino bike than a Rhino ball.

Click here to see a video of the Rhino motor bike in action.

Rhino bike

Next I tried the Spring Join 2D, this is like car suspension. Added two to the head and then I stopped the head from rotating on the Z axis. This gave more of the effect I was after.

Rhino with 2 Sprint joint 2D



Thursday, July 23, 2015

Why not a Rhino?

I was talking about my game with my wife, when I had the idea of a baddie, something with a sharp point who's sole purpose is to burst the Shuffa ball. I thought of a bird with a beak, but my wife said.
"Why not a Rhino?"
So here are a couple of mock ups.

The first is my drawing of a rhino, it reminds me of a film I saw many years ago called "The Gods must be crazy" about a cola bottle being thrown from a plane.
The thing that has stuck with me are the scenes with a Rhino, where it would run towards and stamp out bush fires. I've googled this to see if it is a real thing, but can't find evidence. Anyway here is my Rhino running to stamp out a Shuffa ball.


The second is a Rhino ball, more of a stylised version of a rhino living in the Shuffa ball universe. If you could cross a space hopper with a rhino this is what you'd get.

The rhino too would react to the obstacles so you can ping him out of the way. If you ping him hard enough he'll get stuck to the ceiling.


The rhino ball has the advantage of being easy to animate with less moving parts, but the 4 legged fire marshall could be more dramatic.