Adventures of an Entrepreneur
  • Creating a Mobile Apps/Games Company

Good video about User Acquistion

5/31/2013

0 Comments

 
Just sharing with you another good video about user acquisition.
0 Comments

Creating a VB.net "WebService" for your Corona app/game

5/25/2013

1 Comment

 
Hi there.

When you want to create multiplayer games or communicate data between your app in different devices you need a server to be the "middleman". Today you can find some companies offering that kind of service for you (Corona has the Corona Cloud, Google now have the Google Play Game Services, ...) but sometimes these services are not sufficient for you (because the free tier price is not enough, or you need more flexibility of types of data that you store,...). So sometimes you need to have your own server.

These type of server that has the mission of providing data for application is called WebService, WebAPI or REST API and in this post I will show you how you can create your own "WebService" for you Corona app. 

You can use any type of language to create the server (PHP, ASP,....). In this case I will be creating a VB.NET server.

I use the quotes in WebService because we are not actually creating a WebService, but a simple WebPage that will receive your app request, process it and give a response. It will work as the same as a WebService and until not I did not find any big difference between the two, even in terms of performance. So, Let's go.

This example will be a game requesting the server all multiplayer games of that user and a specific opponent. So, the app will make a request for the server passing the params via GET and receive the response in JSON format.

Code in the app

-- Function that makes a http request to a server and returns false if not succeed, or returns true and the response if  operation was done with success

function getJSONFromServer(serverURL, paramsToBePassed)

    local json = require "json"
    local jsonData = {}
    local linkComplete

    local paramToString = function(paramsTable)
        
        local str = ""
        local i = 1
        
        for paramName,paramValue in pairs(paramsTable) do 
            if i == 1 then
                str = paramName .. "=" .. paramValue
            else
                str = str .. "&" .. paramName .. "=" .. paramValue
            end
            i=i+1
            
        end
        
        return str
        
    end

    local linkComplete = serverURL .. "?" .. paramToString(paramsToBePassed)
        
    -- Makes the request to the server
    local requestResult, requestResultCode = http.request{url = linkComplete, sink = ltn12.sink.table(jsonData), headers = {accept = "application/json"} }
    
    if (requestResult == nil or requestResultCode ~= 200) then  -- Something wrong occurred in trying to download that page, return false
            return false
    else -- download from internet was done with success
        local jsonFree = json.decode(table.concat(jsonData))  -- decodes the JSON data to a table        
            return true, jsonFree
    end
    
end

Code in the server (VB.NET) - filename: getgames.aspx

Partial Class getGames

    Inherits System.Web.UI.Page

   Public Class gameInfoClass
        Public localPlayerID As Integer
        Public opponentPlayerID As Integer
        Public opponentName As String
        Public gameScore As Integer
    End Class

    Public Class OutputClass
        Public status As Boolean
        Public errorMessage As String         
        Public gamesList As New List(Of gameInfoClass)
    End Class


    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load

        Dim output As New OutputClass

        Dim OKToProceed As Boolean = True

        'Retrieving the GET params
        Dim localPlayerID As String = Page.Request.QueryString("playerID")     
        Dim opponentPlayerID As String = Page.Request.QueryString("opponentID")
      
        'Verifying if required params were entered

        Dim allParamsEntered As Boolean = True

        If localPlayerID = "" Or opponentPlayerID = "" Then

            allParamsEntered = False        

        End If

        If allParamsEntered = False Then
            output.errorMessage = "Required parameters missing"
            OKToProceed = False
        End If

        output.status = OKToProceed

        If OKToProceed = True Then

            ''Opening Connection
            Dim BDConnection = ConfigurationManager.ConnectionStrings("myConnectionString").ConnectionString

            Dim sqlConnection1 As New System.Data.SqlClient.SqlConnection(BDConnection)

            Dim cmd As New System.Data.SqlClient.SqlCommand

            cmd.CommandType = System.Data.CommandType.Text

            cmd.Connection = sqlConnection1

            cmd.CommandText = "SELECT * FROM vw_games WHERE (local_player_id = @localPlayerID and opponet_player_id = @opponentPlayerID)"
            cmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@localPlayerID", localPlayerID))
            cmd.Parameters.Add(New System.Data.SqlClient.SqlParameter("@opponentPlayerID", opponentPlayerID))

            Try

                sqlConnection1.Open()
                Dim reader As System.Data.SqlClient.SqlDataReader
                reader = cmd.ExecuteReader()
                Do While reader.Read()                    Dim gameInfo As New gameInfoClass
                    
                    gameInfo.localPlayerID = reader("localplayer_id")
                    gameInfo.opponentPlayerID = reader("opponent_id")
                    gameInfo.opponentName = reader("opponent_name")
                    gameInfo.gameScore = reader("game_score")

                    output.gamesList.Add(gameInfo)                     

                Loop

                sqlConnection1.Close()

            Catch ex As Exception

                output.status = False

                output.errorMessage = "Database Error"

            End Try

        End If


        'Writing the output to JSON format
        Dim outputJSON As String
        outputJSON = Newtonsoft.Json.JsonConvert.SerializeObject(output)

        'Printing the JSON in the screen
        Response.Clear()
        Response.Write(outputJSON)
        Response.ContentType = "application/json"
        Response.End()

    End Sub


End Class

So, an example of the usage of the code above in your app would be:
local params = {}
params.playerID = "3435434"
params.opponentID = "122343"

local gamesList = getJSONFromServer("http://www.mywebsite.com/getgames.aspx", params)

Some Important Information:
  • You need to add the Newtonsoft.JSon reference to your VB.net site. You can do that by going in Tools->"Add Library Package Reference" and installing the "Newtonsoft.JSON" in your Visual Studio / Visual Web developer IDE.
  • The code above is a mix of some codes that we use in our games and I did not test. If you find any difficult in running, please let me know and I can help you. Maybe I made a mistake when putting together the code
  • I highly recommend you to use a https server so you data in encrypted during communication between your device and your server

The code above use GET params and sometimes GET is not the best method to pass the params (Ex: Specially if you have a large amount of data to pass). In that case, you would want to pass the params via POST. The code with POST params will be almost the same but you would have to make the following modifications:


1) Delete these lines in the app code:
local linkComplete = serverURL .. "?" .. paramToString(paramsToBePassed)
        
    -- Makes the request to the server
    local requestResult, requestResultCode = http.request{url = linkComplete, sink = ltn12.sink.table(jsonData), headers = {accept = "application/json"} }
2) Add these lines in the app code in the same place of the lines above:
local body = paramToString(paramsToBePassed)
    
    local headers = {
        accept = "application/json", 
        ["Content-Type"] = "application/x-www-form-urlencoded",
        ["Content-Length"] = string.len(body),
        ["Accept-Language"] = "en-US"        
        }

    -- Downloading a specific page of popular actors
    local requestResult, requestResultCode = http.request{url = serverURL  sink = ltn12.sink.table(jsonData), method = "POST", headers = headers, source = ltn12.source.string(body) }
3) Delete these lines in the Server Code
      'Retrieving the GET params
        Dim localPlayerID As String = Page.Request.QueryString("playerID")     
        Dim opponentPlayerID As String = Page.Request.QueryString("opponentID")
4) Add these lines in the Server Code in the same place of the lines above
      'Retrieving the POST params
        Dim localPlayerID As String = Page.Request.Form("playerID")
        Dim opponentPlayerID As String = Page.Request.Form("opponentID")

Hope that this example helps you in developing your server.

See you.
1 Comment

Daily downloads of a normal game

5/22/2013

0 Comments

 
When I started developing games, the first question that I had was how many downloads would I have in my first days. Of course, there is no definitive answer for that question because it depends on several factors (marketing budget, type of game,...).

But now, after 2 months for the release of our first game (Cut My Puzzle), and also talking to several developers, I think I can give you a ballpark of the daily downloads of a normal game. In fact, I think Cut My Puzzle reflects exactly that.

I call a normal game here a game in which the majority of your downloads are organic, what I think it is the reality for most indie developers who don't have lot of money to spend in markting/PR.

So, let's see how Cut my Puzzle has been performing until now.
Picture
The first thing that attracts the attention is the pick in the iOS version as soon as it was released. That is because we were featured in the New and Noteworthy section of iTunes in the Puzzle and Family category. The game was featured during 1 week and after that we saw the number of downloads decreasing until it stabilized around 50 downloads per day (d.d).

On the other hand, Google Play started with very downloads (<10 d.d.) and now it almost with the same rate of iOS downloads.

Amazon Store has very low downloads and it is the only store that we have a free and paid version of Cut My Puzzle. The graphic reflects the free version. Amazon has recently expanded to more 200 countries, so I would not be surprised if the d.d. starts to increase.

If we take the average daily downloads from that period above (~2 months), we have:
  • iTunes Store: ~70 daily downloads
  • Google Play Store: ~28 daily downloads
  • Amazon Store: ~9 daily downloads

As you can imagine such numbers of downloads are very low if you want to make money from your game but I think that it is what you would have if you simply launch a traditional game in the market (like Cut My Puzzle which is a jigsaw puzzle game) and do not spend time/money in marketing it properly.

Something that I will try to do now is optimize the search keywords for Cut My Puzzle in the iTunes Store (what is called ASO - App Store Optimization). Some developers say that you can expect thousands of daily downloads if you have a good ASO for you app/game. You example you can find here.

I hope you find these numbers useful and I will continue to post more statistics about our games specially as we try new different marketing techniques.

See you.
0 Comments

More about User Acquisition

5/7/2013

0 Comments

 
I really think that User Acquisition is a very important topic, so I am sharing here more interesting videos about that subject. I hope you liked it.
0 Comments

    Author

    This blog it not updated anymore.  

    Archives

    February 2015
    June 2014
    May 2014
    April 2014
    March 2014
    January 2014
    December 2013
    November 2013
    October 2013
    September 2013
    August 2013
    July 2013
    May 2013
    April 2013
    March 2013
    February 2013
    January 2013
    December 2012
    November 2012
    October 2012
    September 2012
    August 2012
    July 2012

    Categories

    All
    Data
    Event
    Fun
    Games
    Key Success Factors
    Management
    Marketing
    Mobile
    Monetization
    Movies
    Startup
    Statistics
    Technical
    Tutorial
    Videos

Powered by Create your own unique website with customizable templates.