Flash Chat Revisions

Categories: Bingo Game Server, Flash Bingo Games

A few changes in the chat component:

  • when old chat history is purged, messages are now cut off per sender (not per line), this way a chat message is not unnecessarily cut off in the middle
  • text is made smaller, to accommodate longer screen names and more chat messages
  • computation of chat smiley locations is now more accurate, previously I just made some manual adjustments to account for some pixel differences (which I understand more clearly now)
  • fixed character computation of breaking down a message into lines, since I was using a slightly incorrect set of values (due to Flash anti-aliasing variations)

UPDATE: Upon further testing, I find that the chat message functions (breaking down a message into lines, encoding and placement of smileys) are not 100% accurate. It has something to do with anti-aliasing. I prefer to optimize anti-aliasing of text for readability, however determining the widths of texts (for proper placement of chat smileys/emoticons) becomes unreliable.

It looks like the only way to do this accurately was to move the functions to the Flash side (away from server side). I did some quick research and found out that there are actually some new classes supported in Flash 10 to make this a lot easier, but while Flash 10 now has 91.7% market penetration in the UK (based on current Flash player version penetration stats as I write this), I still prefer to just target Flash 9 which already has 99.3% market penetration.

In the end, I found a suitable compromise, without having to rewrite the chat functions and still keep the lower Flash 9 requirement. I’d say it’s about 99.5% accurate. There will a few instances (depending on the chat message) where e.g. a smiley will be 1-2 pixels away from its intended location, however I think this is a good enough implementation for the time being.

When it’s time for me to update the codes again (when the site and the bingo games are already stable), I will likely take a pure Flash approach already, and that’s the time I will shoot for the 100% accuracy. By then, Flash CS5 is probably released already, and a new Flash player version as well, which will surely support more things.

Tags: ,


Player Pop-up Menu Revisions

Categories: Flash Bingo Games

The implementation of the player pop-up menu (used to add/remove friends or mute/report players) was broken. I tried making the menu selection “intelligent”, such that if a player is already a friend, you will not be presented the option to add him to your friends list again (which is redundant).

This worked when invoking the pop-up from the player’s list. However, one of the new features I have also implemented for BingoGems was the ability to click any name from the chat history, and be able to invoke the player pop-up from there. This case wasn’t handled properly by my previous code, since keeping track of friends was tied to the player list, and it’s possible a player is already offline but another player may still click on any of his previous messages.

I have revised the way friends are kept track, in such a way that the server doesn’t need to send a lot of data (imagine a player having 500 or so friends). It took me awhile to figure out a suitable solution to this problem, but I finally settled on one (basically, the “trick” is to only send data of online friends playing in the same room). Anyway, so far it’s working well.

Additional benefit is the player pop-up can also now be invoked from the winner list during intermission. This required changes in the common/shared codes, so all the Flash games have been updated.

I’ve also revised the player profile page so it can detect parameters by user id (when linked to other pages) or by screen name (when invoked from the Flash side of things). I’ve also thrown in additional error detections so the page is still displayed properly with an error message in case the expected parameter is not specified or is invalid.

Tags: ,


Various Game Updates

Categories: Bingo Game Server, Flash Bingo Games

Some of the changes done lately:

  • Fixed points display issue in the Flash games when the amount is greater than 1,000 (actual value must be sent unformatted)
  • Fixed character set issue in the game servers (noticed the problem while testing with java socket connections), string being sent should be properly encoded
  • Additional check to make sure duplicate buy cards are prevented
  • Made changes so the game server only starts accepting connections when everything is ready (e.g. game rooms have already been initialized)
  • Fixed progress bar issue in all 4 bingo games during buy card event and the game has already started (progress bar jumps from partial to full incorrectly)
  • Fixed low-balance issue (error message is properly displayed, but player is unable to do anything anymore, solution is to adjust the low-balance check so the player is automatically given additional points)
  • Minor changes in chat formatting (first line formatting may not be being calculated as accurately as possible)

I’ve also wrapped up doing a maintenance program, similar to what I’ve done on HB. Combined with some scripts, this basically checks whether a particular game server is running properly, and when it’s not, the script will try to restart the game server appropriately. The code check is finished, so I just have to add some scripts to the linux server later.

This is very important, since problems with the game servers may happen any time. Not so long ago (on BC and TTG), sometimes problems occur while I am asleep or on vacation. So game servers may be down for a couple of hours before I am even aware of it. These program/scripts give me more peace of mind, since game server problems are usually auto-corrected already.

The other uptime issue (i.e. dedicated servers having problems) is handled by something else. This is already working on HB, so I just need to adapt the system to BingoGems. The more things I can automate, the less maintenance the site requires on my part, freeing me to do other things.


Search Blog