Sunday 24 February 2013

Is it easy to make your money back on the App Store?

So, as some of you might know (if anyone is actually reading this), I'm a hobby developer with a degree in game development. My biggest problem, when working alone, is that I can't finish the stuff I make. I always make something, but before I can properly finish it for release I start something new and then the cycle continues. Though there's one exception, a little app I wrote, called Magic Tools, for iOS.



Magic Tools

Magic Tools is a very simple app, and the first app I released ever. The problem is that it's also the only app I ever released. On top of that, for some reason, I made it for iOS. Because of this I had to pay the developers fee of 100$ (€80), and this isn't much if you're a proper developer, but might be much if you're just making app for fun and are a poor student like me.
Now, this brings me to the actual point of this post. My attempt to make some money on the App Store completely failed, but it did become an interesting experiment. How easy is it to make your money back on the App Store?


Very Easy

The short answer is: very easy. The app I made was a very simple app, I made it in a few days (while watching series) and did everything myself. Then I put it on the AppStore for 99 cents. It never sold like crazy, only a few sales per day, slowly going up. Now, after about half a year, I already made back more than half of what I paid. This with only one app, and a very simple one at that. I will report back in half a year.
So getting the developers fee back shouldn't be too hard. You can probably even making a little cash if you make more than just one app.


Thanks for reading!

Note: If I forget to make a new post about this is half a year, and you really want to know how much I made, comment here and I will keep my promise.

Tuesday 5 February 2013

First-Person Adventure Kit (Unity)

Lately I've been making a lot of unfinished project. Most only go as far as making a basis for the game, so I've decided to put some of this online so other people (you!) can use it and hopefully learn something of it. You can use those code as-is, or alter it in any way you want. You can also use it in any game you want, even ones you sell.

What does it do?

So, first things first. What does this project do?
It's a very simple set-up to make a first-person adventure game. It contains a player script, which can walk and look around. On top of that it can interact with object in the world, and that's where it gets interesting.
But first, here's a link where you can try it out. Walk around with awsd (or zqsd for azerty) interact with leftmouse button (the wheel can be turned backward with the right button.)

How it works

Player

The player should be pretty straight-forward. It's a simple script which does the walking and the looking. It has basic first-person controls.

Variables

You can set it's walk-speed (m/s), jump strength (3.5 will make you jump just over one meter) and it's look distance (in meters.)

Pushing

By default a Character Controller can't push Rigidbodies in the world, so I added a few lines of code so it can push, the 'Pushing Power' variable sets how hard the player can push. (Look in OnControllerColliderHit for how this works.)

Objects

Now the interesting part. How does the interacting work. I've tried to make it so it's very easy to add new interactions without having to modify any code, only add a new script.

So, let's take the little green cube as en example.

Interactable Object

First of all, each and every object you want to interact with needs to have an "Interactable Object" script attached to it. This is used to gather all the interactions and tells the player-script that this object can be interacted with. It also cashes the interactions so only the first time you look at the object they need to be collected. This is also the script the player communicates with.

Interactions

If your object is an Interactable Object you need to add interactions. Interactions are custom scripts (I already made a few as an example) which define what your object does when the player interacts with the object. Instead of deriving directly from Monobehaviour they derive from Interaction (which is a monohebaviour.)
...

If you do this, you can override a bunch of methods and by that define what will happen when you interact with the object. You can add multiple interactions to the object and they will all work simultaneously. If you want an interaction to only work when something else has happened first, you can do this with custom code you write yourself.

Looking at the Interaction class you can see there's a lot that can be done with this:
So if you derive from this class and override one or more of these methods it'll work like magic! As you can see, by default the methods are empty, so if you don't override them they'll just do nothing.

Rotator

Rotator is a very, very simple class I wrote to make the wheel rotate when you interact with it. The wheel is the round red/green/blue thing on the blue box.
So, while I'm holding the use-button and looking at the object the HoldingUse method will be called. This will make the object rotate. While I'm holding the inspect button it'll rotate the other way. Very simple, almost no code and it just works!

DebugInteraction

Lastly I wrote a little DebugInteraction. This script shows when which method is called. All methods that are called once (StartXXX, EndXXX Use, LongUse, Inspect and LongInspect) are written to the console. Those that are called every frame keep how long they are being called and it's shown in the top-left of the screen (as you can see in the web-player.)

Download

Now you know the basics go check out more of the code and play around with it a little! You can download the project right here.
Note: I have custom input settings, so if you use it in your own project you might need to change these a little.


If you want some of the code explained more just comment here or email me, and I'll be happy to help!

Have fun coding!