BingoGems.co.uk Menu
2011
Jul
22

Local Game Testing Progress

Categories: Bingo Game Server, Flash Bingo Games, Site Updates

I’m almost done with the local game testing. Here are the latest changes/additions:

  • Best players page has been updated.
  • Catch mysql data truncation potential errors, so it doesn’t kill the game server abruptly. Ideally, this error shouldn’t be happening at all, but just for precautionary measures, the error will now be logged and the game server will continue to run normally.
  • For 75/80/90 ball bingo games, card limit selection in the Flash bingo games is now working. Each room has a predefined card limit that can be played, with higher level rooms allowing up to 36 bingo cards at a time. The 3 Flash bingo games now interpret this properly.
  • Added Twitter links in some pages (as additional support medium other than e-mail).
  • Finalize all the game rooms and corresponding setups (e.g. maximum number of cards, timer limits, levels required, default pot amounts etc). Initially, I will only open 3 rooms per bingo game, however all future rooms are already shown.
  • Changes in Table codes, minor CSS changes for some site page updates as well.
  • Home game pages have been re-organized. Preview graphic has been moved to the left side. Minimum pots and jackpots are now being shown. Also removed some unnecessary spaces/texts so the bingo game room listing can be viewed immediately with less page scrolling needed.
  • Fixed a Flash/PHP message parsing bug (plus sign not being parsed properly in some messages).
  • Fixed some bugs in the creation of test accounts for the game server stress testing application. Make sure some tables are properly updated to better simulate web-based connections, and also link as friend to the main test account (so friends-related pages/areas can also be tested).
  • Fixed a major bug in the code confirmation screen, where it fails to go to the chat area after signing in (instead it shows an error). This happens when the player is coming from the sign in screen and not from the registration screen. Good thing I was able to catch and correct the error now, as most players will likely encounter this.
  • Fixed e-mail guidelines link not working in the Flash registration area.
  • Fixed game window not resizing properly depending on the player’s monitor screen resolution (instead it incorrectly uses default sizes always).
  • Added codes so the site can display a “Site under maintenance” message properly as necessary.
  • Strip out illegal characters in chat messages prior to parsing. This shouldn’t really be an issue as there are existing filters in the Flash bingo games. However, since the stress test application doesn’t implement filters, this is also now being done in the bingo game servers for better security.
  • The Best Players links (header, footer) will now point to the currently active bingo game. So if you are currently on a Spin Bingo page (main game page or game rules page), if you click on a Best Players link it will now show the appropriate list for that game properly (less clicks and page reloads required).
  • Fixed javascript e-mail validation bug (should be case-insensitive).

While doing some stress testing on the game servers, I encountered a mysql data truncation issue again as mentioned above. I think I’ve seen similar issues before, but I have not been able to pinpoint the cause, as it’s very hard to replicate (it only happens like once every 100 stress tests, and each stress test happens for hours). Thankfully, I had a clear head when I encountered the issue again so I was able to track the real cause.

The problem is thread synchronization related, which is really a complex issue on its own. Without going into too much details, I think this has now been fixed properly.

Anyway, unless I encounter more issues with the local game testing, I will be moving the tests to the production servers already.

Tags: , ,

2009
Dec
20

Game Server Stress Testing

Categories: Bingo Game Server

Over the last few weeks, I have made (and continues to tweak) a stand alone java application to aid in stress testing the bingo game server. Stress testing puts the game server under heavy load. Due to time constraints, this is something that I have not really done in more detail in my previous site projects, but for BingoGems I decided to develop a separate java application so I can do some stress tests before the bingo site is launched.

The application does the following:

  • Create socket connections to the game server, at random intervals
  • Simulate player sign in to the game server, joining a random room (since a game server may be running more than 1 game room)
  • Buy cards to join the game, the purchase is also done at random intervals to simulate joining during a valid buy event, in the middle of an existing game, and when buying is no longer allowed
  • Player names are randomized, so names of different lengths can be tested in the Flash chat and games
  • Random chats are also sent at random intervals, which is actually even based on a valid dictionary of words to better simulate chatting, with some random characters thrown in for more variety
  • Random smileys are also sent in the chat, at random lengths
  • Chat will simulate normal and capitalized (when the player has the CAPS LOCK key on)
  • For Spin Bingo, spins are also simulated at random intervals so scores are also generated
  • Connections are also dropped randomly to simulate a player logging out of game (who may or may not have a game in progress)
  • Multiple connections dropping out simultaneously is also simulated (this happens in cases when a bingo jackpot has been won, and most players end up leaving to go into other bingo rooms with higher jackpots), this has actually been a major issue on HB when it was initially launched since it was crashing the game server unexpectedly
  • Simulate a player dropping out, then logging in to continue an interrupted game
  • Simulate slow internet connection (e.g. the Flash games will experience some delay in receiving some packets)

So basically, the stress testing simulates how the game server reacts to multiple players in a live environment, especially at high loads. The time I spent developing this java application was well worth it, as most of the game updates I have done this month are actually because of issues I encountered during stress testing. There’s just A LOT of issues that only appear when already testing with multiple players, since I usually just test with a single player connection.

All the issues I noted have been fixed. This also includes a very rare occurrence of the game server becoming unresponsive due to synchronization issues, which has been very hard to reproduce. While I am sure some problems will only appear when I have the site launched, I can safely say this bingo game server has undergone better internal testing compared to the other projects I have done before.

So far, the game server is looking stable, and thanks to the stress tests, many issues (in the game server and the Flash bingo games) are now resolved prior to site launch.

Tags: ,

2009
Nov
25

Object Pooling

Categories: Bingo Game Server

The game server now supports object pooling. There were 3 objects that have been modified to support it. Supposedly, this is a good optimization technique since there are less object creations and deletions going on. In the old days of my Java programming, this has actually been very useful, especially since server RAM was still very limited then.

However, there are now debates as to whether object pooling is still beneficial in Java these days. They say the newer JDK has much improved garbage collection, so object pooling actually slows things down in some instances. It looks like the use of object pooling is now advised mainly for objects that maintain external resources (e.g. threads or database connections).

On BC and TTG, I remember I was using 2 threads per connecting player, and then a database connection is created as needed. It wasn’t until TTG when pooling has been given a more serious look. On HB, a minimal thread and database approach has been implemented from the beginning. And now on BingoGems, it has been a complete redesign again. Only 2 main threads are running, there are also only 2 live database connections, and multiple game rooms can be running on a single game server instance.

This has been possible because of advancements in the Java language itself, and of course taking into account the many things I have learned from experience developing these kinds of things. So now, it looks like I don’t need to do object pooling at all. However, the only way to find out is to do some actual profiling, but I don’t think this is necessary at this point.

Anyway, in the meantime, I have disabled this feature. The good thing is, it’s something I can easily enable in the future, should the need arise. I did leave out the part of manually calling the garbage collector, so that clean-ups can be done at a more appropriate time.

Tags: ,

« Previous12Next »

Search Blog