Sunday, 29 June 2014

Facebook - Racing game photo album

I made some little progress on the racing game project for Android. Here is the current screenshot album on Facebook. For more, please like my Facebook page!

Tuesday, 11 March 2014

Simple iframe for Unity Webplayer (with instructions and download)

I made an easy way to embed Unity games into websites. Download link: https://dl.dropboxusercontent.com/u/85819592/Unity/SimpleFullFillTemplate.zip
(Extract the WebPlayerTemplates folder into your project's assets folder and select the template at Edit->Project Settings->Player)

To use it with iframe, put this into your html / php's <body>:

<iframe height="95%" src="your_webplayer_url/webplayer.html" width="100%" ></iframe>

Also works with any CMS. In some situation, you should modify the height to a fixed value in your webplayer html and in the iframe too. If you want to get rid of the default iframe border, use this attribute: frameBorder="0"

The following example is sized to 700px high. The reason is just because it is embedded at an other site where this size was set.

Racing game? It'll be done!

I started a racing game back then, but I didn't make any progress in the last months. It doesn't mean, I forgot about it or I gave it up! I was working on that Flappy Bird clone. Also I had problems with the car physics.

James Hunt McLaren M23
A pretty old screenshot...
Good news, I found a pretty good way to make the cars work with the wheel collider component of Unity. It will be a little bit arcade style, but also it'll be fun. And it will be pretty stable at high speeds too. Nothing to worry about!

James Hunt McLaren M23
...and a newer one.


Also I'll make the tracks low poly, but detailed. It'll work on PC and Android too. What I learnt from my Flappy Bird project is handling MySQL databases through Unity. I think it'll be a useful thing for online lap time comparison.

Friday, 7 March 2014

My first game!

Do you know Flappy Bird? Maybe you are one of the unlucky persons who knows that game. And guess what? I made a Flappy Bird clone. There are hundreds of them! And I made one too. The main character is an F1 driver who jumps out from his smoking car. Probably you know who I am talking about. That photo of him was a great target of Photoshoppers. And a good target of me to create a game of it.

Click on the image to start the game!

It's not 100% finished, I need to fix some things, but it's working. Final version is coming soon! You can play it here: https://apps.facebook.com/flappymax/


Saturday, 22 February 2014

[Game Review] - Pixel Dungeon (Android)

Pixel Dungeon - an addictive rogue-like experience

Platform: Android
Developer: Watabou
Genre: RPG, Rogue-like
Date of release: 2013 (usually updated with new contents!)

Back then there was a game called Rogue. Released in 1980, it was a dungeon crawler game with random dungeon generation, released on multiple platforms. It used a non-graphical (character based) terminal interface, so there was not even pixel art graphics back then. The player could get items, fight monsters, and go deeper in the dark and dangerous dungeons. There are tons of rogue-like games, and Pixel Dungeon is one of them.
Pixel Dungeon title screen
Title screen and menu (I took the screenshots from BlueStacks App Player, yes, you can play it on PC too, it works without any issues!)

Monday, 17 February 2014

Adam Jones and the wheel colliders of doom

Wheel colliders... my enemies... or is it? I tried to use them for my racing game, I was sure they will be great. Well, they are great but they need to be properly used. And it's not easy to set them up correctly.

First problem: car goes left or right without steering on a plane ground. It's a common problem as far as I know. I read about on forums and some say it's a bug, other say it's because of incorrect settings. Honestly I don't know, which one is the truth, because as I made experiments with it, some settings were even worse, some of them were almost good... just almost. It still went left or right. I actually found a gif on Unity Forum, which tells me, it's a bug.

Decreasing fixed timestep removes the drift effect, image uploaded to Unity Forum by bitbutter 
It's a serious issue, especially at high speeds! Actually,  I couldn't fix it. I tried to slow down the outer wheel, but it didn't work. I didn't really make any precise calculations for that so...
It's frustrating. I really don't want to make my own wheel collider. Maybe I could do it, but I never tried. Actually, there is a good raycast based wheel collider in Unity Car Tutorial, which I mentioned in previous posts, but they are slow on mobile, however, the suspension system can be useful from that code.

Second problem: finding the right setup is never easy. In case of the custom Pacejka formula based custom collider which comes with Unity Car Tutorial, it was really easy to set up. Hours of tweaking, but I was never far from the right values. It was always enjoyable to drive the car, sometimes it was too easy to drive, sometimes the grip was very low and it made it hard to drive. But it was fun. And at the end I was able to set it up right, just the problem was, this wheel script is slow on mobile platforms.
In case of the Wheel Collider component, I still wasn't able to find the good values. So bad performance vs bad handling... good.

I made a little research and I checked out the Unity Car Tutorial once again because it doesn't have the weird drifting effect and it uses the same wheel colliders! How it's possible? Well, the answer is simple: it doesn't use motorTorque, which means, the car is not powered by the wheels. It's more like a force pushes the car, because exactly that is happening! It uses forces instead of torque, even for braking. Also for turning, it doesn't turn the wheel colliders, but uses rotate.around to rotate the car around a point based on some simple calculations. I must say, these are cool tricks, but mainly for arcade style racing games. In this case, if you want drifting and making doughnuts, it's more about good scripting than pure physics.

I think, I need to go deeper about this topic, because those wheel colliders are the doom for me. Like some untameable animals. They are there, they are useful, but hard to use properly. Or should I make my own custom wheel which is fast even on mobile?

Actually, old games make me think. There is my favourite NFS title, Need For Speed - Porsche Unleashed (also known as Porsche 2000). which is a fairly old game, came out in 2000, and it had a nice, semi-arcade handling. It was running on a 200MHz CPU, a little bit more powerful was recommended, but it ran. I think maybe 6 or 8 cars could race at once. I don't know how it was programmed, but it worked well. Or I should mention earlier F1 titles. That's cool, how they achieved pretty good physics with simple calculations.
Note: old games rock!

TO BE CONTINUED...

Saturday, 1 February 2014

Burning some rubber.

And an other test is here! I was playing with the tyre friction values of Unity's built in collider. Damn, it's hard to setup properly, but I'm on the right path to get what I want. This time, there is sound too.

 A video of a very early progress:


Friday, 31 January 2014

First video of the project

Hello there! Here is my first video of my game. It's a very early progress, I am currently working on the physics. As you can see, it's far from perfect. I didn't program the engine, and gears, also the traction needs more programming. I'll be back with more videos soon! Enjoy!