Friday, September 28, 2007

Building a Webgame - Putting the Chrome on a Stock Simulator - Part 2

Last article we detailed the first list of functions we wanted the stock simulator to do...

  • Buy and sell stocks in TV shows, TV channels, Studios, and stars
  • Short sell and cover the same stocks (Short selling and covering is the opposite of a buy or sell, if you short a stock, you hope the price drops so you can gain money on the fall.)
  • Rate or vote for popular TV shows
  • offer easy to use registration that is seamless
  • design the market system for extreme modularity so we can add in new features as we develop them without interrupting the market itself.

That list has now significantly expanded - this is the current list of functions and capabilities for the Stocks Online application...

  • buy and sell stocks
  • Short and cover stocks
  • Rate or vote for a random list of 10 stocks
  • easy registration process
  • retain modular market system for additional modules without extensive recoding or rebuilding
  • Display stocks not yet released so players can see upcoming stock listings or IPO's
  • Allow players to pre-buy IPO stocks before they go live at the IPO price
  • Flash-based stock ticker pulling information off of a cron-built data file that is updated every 15 minutes
  • hot-links in the stock ticker so players can go to individual stocks as they stream across
  • Generate a top 10 list of stocks so players can see what stocks are moving
  • A function to make a stock featured
  • Put a hotlink on the main page that shows a random pick of an IPO stock released that day, a featured stock that is being promoted, and the top moving stock in regards to share volume
  • Different stock types so there can be easy separation between categories such as shows, people, and studios or channels
  • cross-link stocks so if one stock goes up or down in price, all associated stocks also feel the adjustment to a smaller degree.
  • An admin function for stock price adjustment that allows for all cross-linked stock to be effected by the price adjustment without the cron cycle
  • a stock hold function with cash out ability so we can put a stock on hold and cash it out if it delists or go's onto a hiatus
  • Allow a player to rate individual stocks for a reward
  • Allow a player to write a review of a stock for a reward

We are currently finishing up the last two items on the list, at which time the application will be completed and we will begin branching out the stock sim to different niche market applications.

As the entire application is php based, we can put functions into php includes and as such modularise the system to create custom pages for Reality TV or for specific studios or shows as events occur, such as the Emmy awards.

Once the base system was completed, the real work began , putting in all the data for current television shows, the actors involved, producers, directors, creators, the studios and the channels that air the shows. Everything had to be put into the system, cross-referenced, and checked to ensure it all worked seamlessly.

That data entry took most of two months to do - but by the end, the market system had been seeded with all of the current run prime-time shows and their related actors and production studios. The market was brought out of Beta status on September 2nd and went live later that day.

We then began tracking neilson ratings so we could revalue the market as we realised the arbitrary values we had put into the stocks were far too low. Tracking neilsons back to early august, I began to compile a spreadsheet showing the neilson trends and the growth in viewership as new shows premiered and then either faded or survived.

In the last week of September, we put a hold onto the primary channel stocks, freezing and cashing out ABC, CBS, NBC, Fox, and The CW - and then neilson adjusted each one up to it's corrected levels based on the neilson ratings that had been accumulated. The reaction to the linked stocks was dramatic. CBS which linked to every CBS aired show gained ground rapidly. By the time the next Cron cycle had run after all neilsons had been put in, CBS stood at over $100 a share in game currency. It had started at about $2.

We examined the transaction history that had been generated as well as the link history and found that CBS's initial adjustment up to +56 had caused a cascade within it's linked stocks - they had all adjusted by about $10-$15. This backflowed and upped CBS even higher, up to around $70 a share. Then the neilson adjustments for each show went in and those also backflowed through the link bringing CBS even higher.

Since then, all stock ratios have stabilised at corrected levels and the market is stable. We don't see the need for future adjustments on the level of the first major price readjust, but if so, the market software seems more than able to cope with it. PHP is a remarkably stable application framework, and with the mysql backend, the Stocks Online application looks to be very solid and stable.

Tim Morrison is the designer of TV Stocks Online, the world's first fully developed television stock market simulator totally functional with live data from Nielson figures and user interactions. Join the growing fantasy market, share your opinions on current TV and see if you can pick the winners and losers out of the current Primetime television lineups.