10 tips to help you choosing the right hosting plan for your blog/arcade site

When you are about to create a blog or an arcade game site, the first thing you should consider is where your site will be hosted.

It’s something really important.

As your site popularity grows, your server will get more and more stressed, and this may affect the site itself.

An example: this blog generates about 10,000 pages/day, and every page is made by about 80kB html, 100kB images, 50kB files… that’s more than 2GB/day… not to mention all the MySql queries needed to generate every WordPress page.

The whole thing gets still more complicated if you want to set up an Arcade site: the average game ranges from 500kB to 2MB. Now imagine to serve 10,000 games/day (and that’s not an huge number…) and you’ll get an idea of what I am talking about.

It’s very important to choose the right hosting plan, and I am going to help you finding the one that can fit your needs.

Please note: These rules fit perfectly if you want to set up a blog or a small Arcade site (when I say “small” I mean 99% of the arcade sites in the world).

1) Forget Blogger.com, WordPress.com and all minor free offers

Having a domain name is the only way to look professional, and if you are going to try and monetize your blog/arcade, you must have your own domain name.

2) Hosting Vs Housing

There is no reason for having an housing plan until your hosting provider can’t handle the resources your site is asking for.

This means if you choose your hosting plan wisely, you won’t have to switch to an housing plan until you have a large amount of traffic (and revenues…)

3) Php Vs Asp

I hope this is an useless question nowadays, but there is really no reason for you to choose Asp.

Don’t listen to “programmers” saying Php is for small projects… NewGrounds is made with Php and if you aren’t developing next Expedia’s competitor you must choose Php

Moreover most of the most famous free resources (such as WordPress, Phpbb and so on) are made with Php.

So it’s time to choose…

4) Php version

Don’t trust hosting services that still offer Php 4.. it’s no longer under development nor will any security updates be released.

Php 5 was released more than four years ago… do you know how much are 4 years in internet? There is no reason why hosting services haven’t updated it until now… other than they will never update it.

So run away from Php 4 hostings. Choose a hosting plan with at least Php 5.2.2

5) Disk space usage: Don’t believe the “infinite” word you read on their offers: upload 10,000 DivX movies and you’ll understand what I mean. Choose an hosting plan with a specific amount of space, so you know that space is guaranteed. 500GB should be enough for a long, long time.

6) Monthly Bandwidth Transfer: In this case, look for “infinite” word. Again, it’s not true, and probably in case of big traffic the hosting company will slow down your site, but there is nothing worse than a “Oooops: Bandwidth exceeded for this month” when you land to a page.

Especially if that page is yours. Especially is it’s only the 15th day of the month and you aren’t able to upgrade your hosting plan in five minutes.

7) Email accounts: If you are an one man company, you will only need one email: info@yourdomain.com

I hate when I have to write to marketing@yourdomain.com rathern than support@yourdomain.com when I know the site is mantained by one person.

Let’s say five email address are enough, so you can give one email to your little sister and make her happy. Anyway, she will continue using HotMail

8) MySql Databases: Choose a plan where you can define the name of your databases. Having databases called “Blog”, “Arcade” and so on is way better than “34524″ and “gdfyrty_2″.

9) 24/24 customer support: Very important. There is an easy way to test it: open a ticket (or contact the support center by email) saying your can’t connect to your MySql database. It’s not true, but it’s just an “hello world” to see what time does it take for the support team to reply…

10) Memory management: From a cute little file called php.ini, that you won’t be able to edit, your hosting company can set an huge number of options such as memory management, maximum time to execute a script, and so on.

While only time (and traffic) will say if your hosting plan can handle enough work, you should at least be able to run the script published in Parsing MochiAds feed in a friendly way or you won’t be able to have your WordPress arcade site.

Where are you hosted? Are you happy? Do you need some more advices?

Create a Flash game like Snowflakes - AS3 version

As announced in Create a Flash game like Snowflakes, here it is the AS3 version.

I used the same comments to help you understanding the conversion.

ACTIONSCRIPT:
  1. package {
  2.     import flash.display.Sprite;
  3.     import flash.ui.Mouse;
  4.     import flash.events.*;
  5.     public class snowflakesas3 extends Sprite {
  6.         // max stars on stage
  7.         var max_stars = 20;
  8.         // current stars on stage
  9.         var stars_on_stage = 0;
  10.         // gravity
  11.         var gravity = 0.1;
  12.         // this is the influence distance
  13.         // using influence and real_influence I perform the square root only once
  14.         // when the distance from the mouse and the star is less than real_influence
  15.         // then the star is affected by the mouse
  16.         var influence = 625;
  17.         var real_influence = Math.sqrt(influence);
  18.         // friction
  19.         var friction = 0.9;
  20.         // divider, to make stars move slowly
  21.         var divider = 50;
  22.         // mouse speed
  23.         var mouse_speed = 0;
  24.         var playersprite:pointer = new pointer();
  25.         public function snowflakesas3() {
  26.             // mouse cursor replacement
  27.             Mouse.hide();
  28.             playersprite.addEventListener(Event.ENTER_FRAME,playersprite_enterframe);
  29.             addChild(playersprite);
  30.             addEventListener(Event.ENTER_FRAME,main_enterframe);
  31.         }
  32.         // function to be executed by the mouse pointer
  33.         public function playersprite_enterframe(event:Event) {
  34.             // calculating the distance from the last point the mouse was spotted
  35.             // and the current mouse position
  36.             var dist_x = playersprite.x-mouseX;
  37.             var dist_y = playersprite.y-mouseY;
  38.             mouse_speed = Math.sqrt(dist_x*dist_x+dist_y*dist_y);
  39.             // minimum speed = minimum force applied
  40.             if (mouse_speed<0.2) {
  41.                 mouse_speed = 0.2;
  42.             }// updating pointer position
  43.             playersprite.x = mouseX;
  44.             playersprite.y = mouseY;
  45.         }
  46.         // main function
  47.         public function main_enterframe(event:Event) {
  48.             // should I add a star?
  49.             if (stars_on_stage<max_stars) {
  50.                 //adding a star
  51.                 stars_on_stage++;
  52.                 var starsprite: star = new star();
  53.                 starsprite.xspeed = 0;
  54.                 starsprite.yspeed = 0;
  55.                 starsprite.x = Math.random()*450+25;
  56.                 starsprite.y = Math.random()*50-100;
  57.                 starsprite.addEventListener(Event.ENTER_FRAME,starsprite_enterframe);
  58.                 addChild(starsprite);
  59.             }
  60.         }
  61.         // function the star will execute at every frame
  62.         public function starsprite_enterframe(event:Event) {
  63.             var current_star:star = (event.currentTarget as star);
  64.             // gravity
  65.             current_star.yspeed += gravity;
  66.             // calculating the distance from the star and the mouse
  67.             // without square roots
  68.             var dist_x = current_star.x-mouseX;
  69.             var dist_y = current_star.y-mouseY;
  70.             var distance = dist_x*dist_x+dist_y*dist_y;
  71.             // if we are in the radius of influence...
  72.             if (distance<influence) {
  73.                 // ...apply a force to the star
  74.                 // force is determined by mouse distance and speed
  75.                 var xforce = mouse_speed*dist_x/divider;
  76.                 var yforce = mouse_speed*dist_y/divider;
  77.                 current_star.xspeed += xforce;
  78.                 current_star.yspeed += yforce;
  79.             }
  80.             // adding friction
  81.             current_star.xspeed *= friction;
  82.             current_star.yspeed *= friction;
  83.             // updating position
  84.             current_star.y += current_star.yspeed;
  85.             current_star.x += current_star.xspeed;
  86.             // make the star rotate
  87.             current_star.rotation += (current_star.xspeed+current_star.yspeed);
  88.             // if the star reaches the bottom of the stage, remove it
  89.             if (current_star.y>300) {
  90.                 stars_on_stage--;
  91.                 current_star.removeEventListener(Event.ENTER_FRAME,starsprite_enterframe);
  92.                 removeChild(current_star);
  93.             }
  94.         }
  95.     }
  96. }

There is no better way in learning a new language than porting your old projects into the new language.

I'll write a post about it... meanwhile download the source code.

Create a Flash game like Snowflakes

Today I enjoyed a cute game called Snowflakes and I am about to show you how to create the main engine behing the game.

Snowflakes

The game is simple: a bunch of stars (snowflakes in the game, but I guess the author new saw the snow...) is falling from the sky, and you can affect their direction with your mouse, blowing them around.

Only two objects in this movie, the star and the mouse pointer.

This is the AS2 version, tomorrow I'll publish the AS3 one. Read more

Parsing MochiAds feed in a friendly way

I made this little script to debug my portal script (almost completed) and I want to share it with you.

It simply shows MochiAds feed in a friendly way, using lists.

PHP:
  1. <?php
  2.  
  3. $mochi_url = "http://www.mochiads.com/feeds/games?format=json";
  4. $feed = file_get_contents($mochi_url);
  5. $games_array = json_decode($feed, true);
  6.  
  7. $number_of_games = count($games_array[games]);
  8.  
  9. echo "<ol>";
  10. for($x=0;$x<$number_of_games;$x++){
  11.      echo "<li><ul>";     
  12.      foreach($games_array[games][$x] as $varname => $varvalue) {
  13.           echo "<li><strong>$varname</strong>: ";
  14.           if(is_array($varvalue)){
  15.                echo "<ol>";
  16.                foreach($varvalue as $subvar => $subvalue){
  17.                     echo "<li>";
  18.                     if(is_array($subvalue)){
  19.                          foreach($subvalue as $lastvar => $lastvalue){
  20.                               echo "$lastvalue";
  21.                               if(!$lastvar){
  22.                                    echo ": ";
  23.                               }
  24.                          }
  25.                     }
  26.                     else{
  27.                          echo "$subvalue";
  28.                     }
  29.                     echo "</li>";
  30.                }
  31.                echo "</ol>";
  32.           }
  33.           else{
  34.                if(strpos($varvalue,"http")!==false){
  35.                     echo "<a href = \"$varvalue\" target = \"_blank\">$varvalue</a>";
  36.                }
  37.                else{
  38.                     echo $varvalue;
  39.                }
  40.           }
  41.           echo "</li>";
  42.      }
  43.      echo "</ul></li>";
  44. }
  45. echo "</ol>";
  46.  
  47. ?>

Hope you will find it useful.

Create a Flash game like Cirplosion - AS3 version

Some days ago I published Create a Flash game like Cirplosion using AS2, now it's time to do it using AS3.

AS3 is becoming more and more popular so I think it's time to give it more exposure.

This is the uncommented AS3 version of Cirplosion.

I would like you to compare it with AS2 one.

I am preparing a line-by-line explanation of all differences between AS2 and AS3 versions.

This will be very helpful for all people out there that are afraid to start coding AS3.

While AS2 is far from being obsolete (in my opinion), you can't ignore it exists and it's better than AS2 Read more

Distribute your Flash games worldwide with FlashGameDistribution

If you're not a professional in marketing, one that loves to promote and sell games, pins, socks... whatever... Flash game marketing can be an hassle, or even a nightmare.

Unfortunately, if your game does not hit the frontpage of one of most popular portals spreading virally, you'll have to manually submit your work to at least an hundred sites to earn some cash.

As said, it's not a problem if you like marketing, just remember that every hour you spend in marketing cannot be spent in programming... or enjoying the summer.

That's why I can't wait for FlashGameDistribution (FGD from now on) to be released.

Still in a limited early beta, FGD is the last work from the creators of FlashGameLicense (read the review) and First Impressions (read the review).

FGD's goal is assisting developers in distributing their flash games accross the internet, allowing developers to easily post their games to game portals, contact game portals, and automatically distribute their games to FGD partners.

The service will remain in beta until FGD crew will be able to count on a considerable amount of portals distributing the games through their API (I'll review it later) and until some minor issues will be fixed.

Obviously this service is not only for developers but for portal owners too... they will be able to install an API that will automate game submissions.

I decided to test the service, as usual... this time on the developer side. Read more

Flash obstacle avoidance prototype

Obstacle avoidance can be very important in Flash gaming because allows designers to create smart enemies.

Obstacle avoidance behavior gives a character the ability to maneuver in a cluttered environment by dodging around obstacles.

In this prototype, I'll try to simulate everyday life.

In everyday life, you walk straight until an obstacle appears in your line of sight.

Then, you slow down, and choose a random direction to cross the obstacle. If necessary, you make two or three steps back and approach the obstacle again.

Well, I hope you don't act this way in your real life but this is what we are going to do in this prototype.

It's up to you to improve it and make a more realistic movement.

In the project there are 20 random obstacles placed in the same way as seen on Create a Flash Game like Nano War, and an object linked as runner running through them. Read more

Creation of a Flash arcade site using WordPress - step 5

In Creation of a Flash arcade site using WordPress - step 4, we saw how to post a game into a wp database, now we'll see how to retrieve game information.

It's time to parse the json feed.

Where can I find the feed?
At this link http://www.mochiads.com/feeds/games/xxx/all/all?format=json you will find the json feed. Just replace the xxx with your publisher id.

Or use http://www.mochiads.com/feeds/games?format=json like I am doing in this example.

There are various solution according to your php settings. If you don't know how to check your php settings, refer to phpinfo() at this link.

Php version 5.2.0 or above

If your server runs php 5.2.0 or above, you're really lucky because it provides native json support.

In order to have the $mochi array as shown at lines 37-50 in Creation of a Flash arcade site using WordPress - step 4, you just need to use this script: Read more

The free sound dilemma

Here I am to introduce you an interesting question made by Pierre Urban.

I think we all asked this question to ourselves, and did not answer for our convenience...

Here it is:

«I'm a french developer currently coding a game.
Your blog helped me a lot with some really specific stuff about AS!
Also about monetizing =)

I really appreciate your blog but I have a problem.
My game is almost finish and I have some difficulties to find some free sounds.
The fact is that I'll add mochiAds ad system to my game and I would like to know how to get some fine sounds.
I found two websites: www.pdsounds.org and www.freesounds.org.
But I don't know if I can use some sounds of these since the mochiAds will make me earn a little bit money... For freesounds, the CC licence is non-commercial use. Even if it was commercial use, I would have to add every owners of the sounds in the credit which will make a very long list. But usually I do not see a very long list of people in the credits of flash games, hence I thought there was another way to have sounds...

About the music: I found somebody who is OK to let me use a music he made on newgrounds.com.
I clearly told him I will put ads with mochiAds, but he responded that if it's not commercial then it is OK... I guess he misunderstood the thing, no? Or maybe I misunderstood...
Does putting some ads on a flash games makes the thing commercial?

Maybe you can make a new post about how to find and use musics/sounds in a flash game which uses MochiAd?
Maybe about how to create our own music/sounds using some random software?
I'm almost sure that it will be really handy for many people! =)

I really must have miss something because I don't get why I am getting so much trouble to put some random sounds (like gun reloading, explosions, etc.) in my game just because it uses mochiAds...»

If any music/effects composer is reading, I would like to know his answer.

Create a Flash game like Cirplosion

Do you remember Cirplosion?

Cirplosion

It was quite successful some time ago, and now it's time to create a game like it.

In this tutorial we'll design the main engine. When you are going to design a game, or to write whatever script, try to explain yourself what you are about to do.

Let me try to explain with simple words what the does the script do:

* There are some blue orbs running everywhere with a linear motion
* You control a red orb moving it with the mouse
* If you click and hold mouse button, your orb start growing
* While growing, you can't touch stage border or other orbs, or you will return small
* When you release mouse button you are ready to explode
* Pressing again mouse button will make you explode and kill all orbs you are touching
* Orbs close to explosion will move faster from now on

That's about 75% of the original game... of course you will need to polish it and add new features. Read more

Next Page →