MookieData C#

 

In 2012 when I was trying to make my game, SlotFriendzy profitable, I felt the need for an Admin tool to analyze the game’s usage and performance. I didn’t want it to be hosted on the web and decided to build it as a Windows Desktop App. I chose Visual Studio and built it on the .NET 4.5 Framework, along with a MySQL C# Connector I downloaded from the MySQL web site.

For security reasons, I normally would not put a database connector directly in a client-side application, but in this case, the intended audience was very a specific population – me. Designing a Form based app in Visual Studio was easy, and this simple layout made it easy to add commands every time I thought of something I wanted to query on a regular basis.

I named it MookieData because the game belonged to my company, Mookie Games Inc.

Form Creator

 


 
In late 2013, I started working at Deluxe Entertainment in Burbank and was debugging several versions of a LAMP stack application with Linux, Apache, MySQL, PHP as well as AMFPHP and Flex. The project was Media Recall, a digital media storage and cataloging system for several major clients including Harpo (Oprah Winfrey), Johnny Carson, Martha Stewart Online, and more. Later on I moved into tools development for the Operations team and created this application. Several of the tools being developed by the team had an XML format for the forms, and creating that XML was becoming a large task. My project was to simplify that by creating a visual tool to create and modify the XML. This tool was also a LAMP stack application, in which my focus was mainly the Flex and PHP.

SlotFriendzy Game – a Passion Project

In 2012, I had a dream of making a successful slot machine game on Facebook. I spent about 6 months on it during my off-time from work. I even formed a Delaware company to own the game  – called Mookie Games Inc.

Concept

The idea of the game was to have a slot machine where the slot items were your friends. It used the Facebook API to grab their profile pictures and basic info about them. You could also launch their profiles from the pictures.
You were given a certain number of coins to begin with, and over time if you ran out, you could purchase more. You could adjust your bet, and the number of pay lines you wanted to bet on. Increasing the pay lines also increased your chances of winning, but increased your wager.
Like real Vegas slot machines, logic was in the game to control your odds of winning, and eventually lead you to making a purchase. I also added lots of free play options such as getting bonuses for each friend of yours that played the game, and how often you and your friends played. Other features such as posting screen captures of your wins, messages on your Facebook wall, and bulk invitations to friends were utilized to make it more viral.

Cloud Deployment

Hoping the game would get used by millions, I decided to learn how deploy cloud based apps using server stacks, virtual machines, load balancers, and distributed databases. I began with Facebook’s default host, Heroku, and then ended up on Amazon Web Services (AWS). I also did research and experimented with others such as App Fog, Google App Engine, and Micorosft Azure.
I picked AWS because of the autoscaling feature. The game was deployed using Git, which would get pushed up to EC2 Virtual Machines behind a load balancer. If the game got heavy usage, more EC2 VMs were automatically launched to handle the load, and then terminated when usage decreased.

Deployment was similar on Heroku, except for the Auto Scaling. I could switch back and forth between Heroku and AWS with the way I had the app set up, using Environment Variables and PHP. I just had to change the url settings on Facebook.

CDN

All Flash swfs, images, and sounds were uploaded to an AWS S3 Bucket. I set up an AWS Cloudfront distribution which used that bucket to copy and cache local versions around the world. This was important as I was doing Facebook advertising for my game in several other countries, and I needed the game to have good performance world wide.

Databases

Both AWS and Heroku apps were using a cloud Database from a company called Xeround ( no longer in business ). An alternative today could be ClearDB. This is basically a cloud hosted mysql endpoint that has synchronized copies hosted around the world, for better performance. Much of the games features required the use of SQL queries, so I chose MySQL over those no-SQL alternatives.

Serverside

The server side language for this app was PHP. It used the PHP APIs for Facebook and AWS S3, but most of the PHP was in AMFPHP service classes to handle database operations and communication with Flash. A gambling transaction api was created in the process that had 2 way encryption between the PHP and Flash, and prevented game cheating.

Front End

The Flash App was my largest ActionScript project ever. I proudly architected some clean reusable MVC OOP code that made it easy to invent, integrate, and update features. The graphics assets were from Flash CS6 and published as SWCs, and Flash Develop was the main IDE for coding.

The End

Even though users were making purchases in the game, it never hit a point where it became profitable. Also, a company in the UK claimed the game’s name was too similar to theirs. Facebook never saw a resolution to the dispute and simply shut down the game. All in all, at its peak, the game had over 25,000 users, and was a joy to develop. It allowed thousands of retirees to gamble on the cheap while seeing pictures of their loved ones 🙂

 

Vandalize


 
Launch Flash!see it

  • doodle on pictures using different colors
  • save as jpeg and set compression quality
  • your picture gets placed in the Vandal Hall of Fame where people can see it
  • people can comment on your picture
  • live preview generation
  • several communication methods in it’s own “Vandalize Service”

This was a prototype for a FaceBook app, designed by the UX ( User eXperience) designers at speakTECH back in 2007. I created the back end and front end, making it functional based on some nice specs from the team. The back end was it’s own remoting service called “VandalizeService”.

Portfolio Application

 
I was looking for a way to display CS4, CS5, Flex 3, and Flex 4 content all in one contiguous Flash experience. Turns out Flex 4 (FlashBuilder) was the best choice! It has proven very stable compared to CS5 as a swf in swf container environment, and does not seem to have any issues with Flash components. Whenever I had free time, I added more items to the portfolio or more features to the portfolio application.

Launch Flash!see it

Perhaps the biggest piece of programming in my online portfolio is the portfolio application itself. It’s not described anywhere in the portfolio, so I’m doing it here.

Here’s a list of features it has:

  • Database Driven: All portfolio items are assembled in a mysql database with info such as title, description, swf path, etc. From the database, you can choose items in the sliding “accordion” component, or the 3D image wheel – both on the left side.
  • Data Services: Data is fetched using Flash Remoting, I wrote the PHP services that feed my ActionScript structured, binary compressed data
  • Integrated WordPress Blog: Portfolio Items described in the blog are linked to the items in the portfolio, and the blog entries can be read while in the site. Click the “W” icons to see.
  • XML Menu system: I can easily add links and items that trigger AS3 functionality. Also, items can be launched in a JavaScript LightBox just by populating the xml
  • Windowing system: Allows you to view multiple items at once and move them around
  • Layout Control: Sizes to any ( decent ) resolution and automatically adjusts the layout to compensate, even when you resize the browser during viewing
  • 3D Item Selector: A custom PaperVision 3D component I built to select items. Selected items have a yellow 3D polygon above them, and highlighted items use a glow effect.
  • Deep Linking: Using Asual SWFaddress, you can link directly to individual portfolio items such as the Slideshow example: https://arnoldbiffna.s3.amazonaws.com/asd001/index.html#/id43
  • Shadowbox: Some portfolio items launch in a JavaScript box overlay. This allows it to launch html content in a separate window without “leaving” the site
  • Full Screen Mode: Click the “Max” button in the top right corner
  • Cascading Windows & Close All functionality: in the Appearance menu
  • Code Generated Wallpaper: in the Appearance menu. Uses a radial gradient

The structure of the portfolio could be reused to develop a large application where interactive modules are loaded and unloaded as needed. Floating windows and dialog boxes, along with the menu system are all elements of this. The code is an MVC ( Model View Controller ) structure that I find easy to update and build on.

The portfolio was rendered dynamically from the database, following a path of mysql -> PHP -> AMFPHP -> Flex.