Addictive Social Gaming

Comment 1 Standard

My largest game, White Oak Stables (WOS), has a newspaper that’s run and managed entirely by the members. Today someone posted a contest where you fill in the remainder of the sentence. The topic was “You know you’re addicted to White Oak Stables when…” Needless to say some of the responses are quite shocking:

  • You know your addicted when you log in 3 times plus a day spending and hour min each time and.. When you put time into knowing your horses as well as putting time into making custom pics :p
  • You know your addicted when you play on it for four hours and not clean the house up at all! 🙂 Went there, done that!
  • You know you’re addicted when you take care of your WOS horses before your real ones!
  • You know when your addicted when you breed a foal and can’t wait for a week later to see it.
  • You know you’re addicted when you call your real horse by your virtual horse’s name.
  • You know your addicted when you get up at 5 am on a horse show morning to make sure that your virtual horse is taken care of before his 6 am race.
  • You know you’re addicted when the color red reminds you to check on your horses. (White Oak Stables racing has a red game background).
  • You know you’re addicted when you read a label and know that that would be the perfect horse name [on WOS].
  • You know you’re addicted when you run out of names for foals and listen to different songs hoping to find a good name!
  • You know you’re addicted when start naming horses in real life after your champion racehorse on WOS.
  • You know you’re addicted when you can’t leave for the day until you’ve checked your WOS horses.
  • You know you’re addicted when almost anything you see or read gives you an idea [for a name of a horse on WOS].
  • You know you’re addicted when you get on half an hour before each horse’s race to make sure that they are ready.

As a game owner and developer I’m always looking for ways to get the kids to play. Play time equates to profits in advertising and sales of game products and services. But when do you cross the line? When do you have to stop and say, my game is causing more harm than good and I need to do something about it?

Case in point, reports of sweatshops in third world countries to level up characters on World of Warcraft (WOW) and more recently a baby being starved to death while parents attend to their virtual one. How does WOW justify people living on substandard wages so someone in another country can level up high enough to beat the “unbeatable” quest or kill the “invincible” dragon? How will any virtual child in Prius Online compensate for the three month old little girl who lost her life?

I’m always thinking about finances — I have to in order to stay up and running on a daily basis. I understand the need to keep members active and playing, to constantly present them with new and different experiences in an effort to increase sales or boost advertisers. Yet where does  social responsibility draw the line and say “hey, it’s time you looked at the big picture.” Sure, a starving baby and a sweatshop aren’t the norm but are an indirect result of your marketing and business strategies.

Are horses around the world going starving or being neglected because of the virtual ones White Oak Stables? I work hard to promote rescue and rehabilitation of neglected equines and I donate yearly to a local horse rescue group — I would be heartbroken to find my edutainment based games were in fact having the opposite effect — and if they were, what (if anything) could be done to rectify the situation?

Advertisements

SmartFoxServer Flash AS3 Tutorial: Using Classes

Comments 10 Standard

Okay so one of the thing I’ve learned about SmartFoxServer is that the documentation is hard to search through and the sample code they have available really doesn’t cover a lot of standard coding practices. In trying to use SmartFoxServer with classes I ran into several problems. After several hours of fussing with it I’ve finally created a working piece of code. If anyone else has a better way of doing this I’d LOVE to see it. Or you can be lazy and download my working code. You might also be interested in learning how to create a custom login extension using MySQL.

This goes in the main .fla file:

import it.gotoandplay.smartfoxserver.*;
import it.gotoandplay.smartfoxserver.data.*;
import com.design1online.gameinstance.*;

//class variables
var smartfox:SmartFoxClient  = new SmartFoxClient();
var game:gameinstance = new gameinstance();

//smartfox connection variables UPDATE THESE
var zone:String = ""; //zone in smartfox server
var ip = ""; //IP address to a server running smartfox
var port = 9339; //the port smartfox is listening to
var room = "Lobby" //the room to join in that zone

var username:String = "player" + Math.round(1000 * Math.random());

//event listeners
smartfox.addEventListener(SFSEvent.onConnection, onConnectionHandler);
smartfox.addEventListener(SFSEvent.onRoomListUpdate, onRoomListUpdateHandler);
smartfox.addEventListener(SFSEvent.onJoinRoom, onJoinRoomHandler);
smartfox.addEventListener(SFSEvent.onLogin, onLoginHandler);
smartfox.addEventListener(SFSEvent.onPublicMessage, onPublicMessageHandler);

//init the game
game._smartfox = smartfox;
game.init();

//ip and port are vars loaded from an XML file
smartfox.connect(ip, port);

function onConnectionHandler(evt:SFSEvent):void
{
	trace('connect request returned');

	if (evt.params.success)
            smartfox.login(zone, username, null);
	else
    	trace("Error connecting to the server: " + evt.params.error);

}

function onLoginHandler(evt:SFSEvent):void
{
      if (evt.params.success)
      {
      	trace("Successfully logged in as " + evt.params.name)
      	trace("Active Room: " + smartfox.activeRoomId);
      }
      else
      	trace("Zone login error; the following error occurred: " + evt.params.error)
}

function onRoomListUpdateHandler(evt:SFSEvent):void
{

      //joinRoom can only be called after the roomListUpdate
      if (smartfox.activeRoomId == -1)
            smartfox.joinRoom(room);
}

function onJoinRoomHandler(evt:SFSEvent):void
{

   if (evt.params.room)  //a room was joined
   {
       trace ("timeline onJoinRoomHandler");
	   smartfox.sendPublicMessage(username + " joined " + evt.params.room.getName());
   }
   else
   		trace("Error joining a room: " + evt.params.error);

} 

function onPublicMessageHandler(evt:SFSEvent):void
{
        trace("On Timeline user " + evt.params.sender.getName() + " said: " + evt.params.message)
}

This goes in an actionscript file:

 package com.design1online.gameinstance { 

 import it.gotoandplay.smartfoxserver.*;
 import it.gotoandplay.smartfoxserver.data.*;
 import flash.display.MovieClip; 

 public class gameinstance extends MovieClip
 {
   public var _smartfox:SmartFoxClient; 

   public function gameinstance():void
   { 

   } 

   public function init():void
   {
     _smartfox.addEventListener(SFSEvent.onJoinRoom, onJoinRoomHandler);
     _smartfox.addEventListener(SFSEvent.onPublicMessage, onPublicMessageHandler);
   } 

   function onPublicMessageHandler(evt:SFSEvent):void
   {
     trace("gameinstance user " + evt.params.sender.getName() + " said: " + evt.params.message)
   } 

   function onJoinRoomHandler(evt:SFSEvent):void
   { 

     if (evt.params.room)  //a room was joined
     {
       trace ("gameinstance onJoinRoomHandler");
       smartfox.sendPublicMessage(username + " joined " + evt.params.room.getName());
     }
     else
       trace("gameinstance error joining a room: " + evt.params.error);
   }  

   function onPublicMessageHandler(evt:SFSEvent):void
   {
     trace("gameinstance user " + evt.params.sender.getName() + " said: " + evt.params.message)
   } 

  } //end class 

 } //end package
evt.params.error