Alice Middleton - Games Programmer

Jackpot Bingo

Jackpot Bingo is a 2D Multiplayer Bingo simulation game. It is available on Facebook here.

Jackpot Bingo has been the first live game that I programmed entirely from start to finish. I was shown a design document at the start of the project, and given an empty flash project to start working on. I programmed this game in Haxe, using the in-house Inertia game engine that is based on Haxe. Since this game is a multiplayer game that relies on live updates for all the players, I was unable to use the same methods Inertia’s other games normally employ for contacting the servers (using PHP scripts).

Instead, I learned about Node.js and programmed a client-server system using this JavaScript-based networking API. Fortunately, we were able to compile Haxe code into JavaScript, so I did not need to program the entire game in a different language!

The Server

This has been the most challenging part of the project by far, particularly because it is harder to debug, since I was unable to use breakpoints with the FlashDevelop IDE. The server’s main job is to be the ‘number caller’, manage multiple (approx. 50) simultaneous bingo games, handle client connections and handle player wins. When play testing the game, we realised it would need some simulated players to make the bingo rooms appear less empty, so I also had to program a second Node.js program, which can run up to 1,000 simulated players. These have been programmed to play as real players; buying cards, marking off numbers, buying rounds of drinks and even talking in the chat rooms!

I ran into several issues with the server program, almost all to do with handling people with an unstable internet connection. This includes adding functionality for sudden loss of connection, packet loss, and players receiving packets from the server very late compared to everyone else. I added several helper classes to deal with re-sending data, and many error messages that are displayed to the players, advising them to check their connection!

Another issue was handling so many connections to the database; we had to re-configure some of the MySQL settings to allow for more simultaneous connections, and I had to ensure all my MySQL queries were as optimised as possible, which included ensuring the tables had the correct indexes on them.

The Client

The front-end side of the project was very UI heavy, and involved a lot of optimisation. For example, in some games, you may have up to 9 bingo cards, each with up to 25 numbers displayed, and 25 possible extra images for when the numbers are marked off. I had to flatten these cards down to a single bitmap each time a new image (dauber stamp) was added, to stop the games slowing down. The animation of the balls rolling in was also optimised, by programming each frame in, rather than running it as a timeline in flash.

Any connections to the database that did not have to be ‘instant’ or synchronous with other players (such as receiving XP for playing a game, or sending and receiving friend requests were handled with PHP scripts. I again had to ensure that any MySQL queries were optimised, and that the client could handle being unable to connect to the database, or ask for the data again.

The live chat is one of the most used features in bingo, and allows players to type short messages both in public and privately to individual players. I also added ’emojis’, which required the use of TLF textfields so that we could display moving images along with text. Implementing this feature required a lot of testing both on the client and the server side, as the server program handles all in-coming messages, and must send them back out to the correct clients. I was required to handle players swearing and spamming the chat, which I did respectively by replacing offensive words with asterisks, and temporarily banning players from typing.

The above image is the ‘Room Selection’ screen where players are able to select a game to play. This was quite tricky to implement, as it has been designed to show players live updates about the rooms, such as how many players there are, and whether Jackpot Bingo rounds are running (in which some of the rooms merge together into one big game). This was another challenge when it came to handling players with slow internet.

I programmed many animations for this project, mostly designed by the Game Designer, but some also designed by me. Some of them have been put together in the Flash Project as movieclips with timelines, but many were more easily handled with code (to get better control over the speed etc. of the animation).

The game also has a mini slot machine that players can play during the game. This was a ‘small’ extra feature that got added late into production, and ended up being quite involved, due to the large number of animations and balancing that was required to make sure the prizes were fair!

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top