Development of a multiplayer web browser card game in javafx

INTRODUCTION:

The project aims at conducting research towards Browser-Based Games with emphasis on Multiplayer functionality. This includes server-side and plug-in based web browser games and the technologies utilized. This project also aims at the development of a Browser-Based Multiplayer Trading Card Game using the brand new JavaFX technology. The author has conducted a literature review about Browser-Based Games and the technologies used to develop such games. The author has also done a comparison between several popular rich multimedia web application technologies and has chosen JavaFX as the best one for this project. This phase is where the Literature Review report will be produced where all findings, citations and references will be documented and compiled.

FINDINGS:

1.1Introduction toMultiplayer Browser-Based Games

1.1.1Overview

According to Statemaster.com encyclopedia browser games are electronic games that are played online via the Internet without having to install any client-side software, which separates browser games from conventional online games (StateMaster, 2006). The word “multiplayer” indicates that it is played by more than one player. The only client-side technology needed is a web browser plus some web browser plug-ins such as Flash or Java. Some browser games also make use server-side scripting if multiplayer interaction is present.

In this literature review, we will review all the past research done towards browser games by others. This will include how browser games work and what technologies are normally used to develop such games. Examples of the most popular web browser games will also be shown. A comparison between JavaFX and its peer technologies will also be done and the reasons why JavaFX is chosen will also be discussed and clarified. All findings will be included in this part of the documentation.

1.1.2How Browser Games Work

To start playing a browser game, a player visits the website of a particular browser game and signs in using his/her account to play if it is a multiplayer game or start playing immediately if it is a single player game (that does not record any player information). This can be done through any web browser on any system using any operating system. The game checks if the browser used by the player has the needed plug-ins for the game to work and if all needed plug-ins are installed, the user can run the game and proceed to login or start playing immediately. On the other hand, if the plug-in is not available, it will ask the player to install the needed plug-ins and may redirect the player to the homepage of a particular plug-in (Normally Flash Player, Java or Shockwave). One browser game only uses one type of plug-in depending on the language/scripting language used to program it.

1.2Benefits of Browser-Based Gaming

-Platform Independent Gaming.

Browser games can be played regardless of the machine, type of operating system, or type of web browser you are using. This solves the problem of making sure a game works on the platform used by the player. Traditionally, most standalone games do not work on all platforms (either Mac OS or Windows) and those who do not have the suitable OS cannot play such games. Browser-based gaming solves this problem. Cross-platform compatibility of browser-based games means more gamers can be reached and more of them will want to play your browser game. A browser-based game can run on a Windows PC, Macintosh, or Linux machine with no modifications (Adams, 2009).

-Mobile Device Compatibility.

Browser-Based Games that are designed to be played on computers and mobile devices can be supported on smart phones/PDAs that have a web browser. The best examples of mobile devices with this capability are the iPhone by Apple and the HTC Diamond by Microsoft. If you are able to access web pages on your mobile device the way you do on a computer, then you are able to play web browser games on your mobile device.

-No Installations Required.

Since browser games run on a web browser and all data is retrieved from a server, no installation of the game is required. The only time installation is needed is when your web browser doesn’t have the require plug-ins to play the game. However, the installations of plug-ins are easy and speedy.

-No Software Updating Needed.

Browser games do not need to be updated on every machine that uses the application since no game files are installed onto the machine. This means downloading of updates for the browser game isn’t needed, removing the hassle of having to update or patch the game.

For example, the game Warcraft 3: The Frozen Throne which is a relatively old game currently has a patch of up to version 1.24b and players will have to download this patch in order to play certain maps. This may be an inconvenience for players as they will waste time downloading and applying the patch.

-Low System Requirements.

You don’t need pricey hardware (powerful graphic processing units) to play browser games. All you need is a computer with normal and working hardware that has internet connectivity, an operating system and a web browser and you are set to play without degradation of game performance.

Compare playing Crisis, one of the games with the highest known system requirements, with a multiplayer browser-based game Travians. Crisis needs at the very least a NVidia 9800GT Graphic Processing Unit (GPU), Intel Pentium Core 2 Duo, at least 2GB of RAM and a more powerful power supply unit in order to run above 30 frames per second (FPS).

Read also  The Office Depot ECommerce Systems Information Technology Essay

Low System Resources Consumption.

You don’t need big amounts of hard disk space since very little data is stored whilst playing browser games. Random Access Memory (RAM) usage is also low because memory is shared with the web browser running the game.

For example, comparing one of the latest standalone games Grand Theft Auto 4 with any browser game running in Google Chrome, you will find that Grand Theft Auto 4 takes up to over 13GB of hard disk space for that one game alone while you only need 53MB for a full installation of the web browser Google Chrome (plus a few more Megabytes for plug-ins) to play RuneScape for example on Google Chrome.

Low Cost Gaming.

Browser-based Gaming is generally lower in cost compared to standalone online games. The game play of browser-based games is normally free except for a few paid in-game items where those willing to pay with physical money can purchase while standalone online games such as World of Warcraft require players to pay a monthly fee in order to play the game. Browser-based Gaming is also low cost due to the low hardware requirements. As mentioned above, you don’t need a very powerful graphics processing unit (GPU) in order to play such games. Users do not have to spend a lot on hardware in order to play browser-based games. The average cost of a high performance graphics processing unit (GPU) such as the NVidia 9800GT can be around US$250 to 300 and casual gamers will not prefer spending this much just for the sake of gaming, especially in times where the economy isn’t at its best.

In the USA, to play World of Warcraft, you will need to pay a monthly fee of US$14.99 for the basic package, US$13.99 per month for a 3-month package, or US$12.99 for a 6-month package. To play multiplayer browser-based games such as RuneScape, all you need is to register for a free account.

1.3 Examples of Popular Web Browser Games

Travians.

Travians is an interactive online browser-based game programmed in Asynchronous JavaScript and XML (AJAX) which allows multi-user interaction. As of 28th September 2009, there are currently 41359 registered players and on average 1000 online players daily. This game is a server-side based game and does not require any plug-ins to play. Anyone who wishes to play just has to go to the Travians website (www.travians.com) and register for a free account (if you don’t have one yet) and login to start playing. This game is available in multiple languages.

RuneScape.

RuneScape is a massive multiplayer online role playing game (MMORPG) developed by Jagex Ltd. that is browser based and only required the Java Runtime Environment to be installed on your browser in order to login and play. Players start off with basic skills and are able to improve these skills or learn new skills as their level increases in the game. There are many interesting features such as fighting NPC monsters to level up their character, completing quests, player vs. player battles, and an economy system where players can buy or trade items. There is also a special feature called “Random Events” that prevent players from using bots. RuneScape is developed in Java and incorporated with 3D rendering.

Dogs of the Seas.

Dogs of the Seas is a pirate themed server-side multiplayer browser-based game. Users will need to create an account in order to play. The process of creating an account however is quick and easy. The game play contents advanced features such as NPCs with advanced AI, a ship leveling system, hundreds of quests, player vs. player wars, alliance owned territories, chat system, trading and buying/selling of items and many more interesting game play features. As of the 4th of October 2009, there are 983,831 registered players. Dogs of the Seas has real time game play and activities can last hours.

2.1Common Technologies Used for Browser-Based Game Development

2.1.1Plug-in Based Browser Games:

Flash.

Also known as Macromedia Flash, this technology is used for various online multimedia applications especially when user interaction is required. Flash has been used to create media players as well as web browser games and they need a common plug-in called Adobe Flash Player. The ActionScript scripting language is used to develop interactive Flash applications.

Java.

Similar to Flash, Java (developed by Sun Microsystems) has also been widely used for online multimedia applications but not many games that use Java technology have been seen before. To run Java applications on a web browser the Java plug-in is required. Java web applications are also known as Java Applets.

Shockwave.

Also known as Adobe Shockwave is the multimedia technology that people always mix up with Flash, but the truth is that Shockwave and Flash are two different technologies. However their purpose is still exactly the same which is to display rich and interactive online media content such as web applications. According to HowStuffWorks.com however, Shockwave is capable of creating more complex browser games because it supports 3D graphics (HowStuffWorks, 2009). Applications using the Shockwave technology will require the Shockwave Player plug-in installed in the browser in order to work.

Read also  Overview Of Hotel Reservation Software Information Technology Essay

Silverlight.

This technology is very new in the market and not many developers have adopted this technology in browser game development yet. Only a few web applications have been found to utilize this new technology.

JavaFX.

Not to be confused with Java, JavaFX is a dynamic scripting language for the creation of rich client-side applications. Similar to the previously mentioned technologies, JavaFX can be used to develop enterprise dashboards that do extensive data visualization, GUI for business applications that integrate with complex back-end systems, as well as games that run on browsers and mobile devices (JavaFX FAQs, 2009). Although this technology is very new, it has already been used in a few commercial and non-commercial applications and has various useful features. JavaFX is also a very young technology and is still constantly being improved and optimized by Sun Microsystems.

2.1.2For Server-side Browser Games:

PHP.

Also known as PHP: Hypertext Preprocessor, this popular scripting language has been widely used in web development and this includes browser games. This includes many games on Facebook which do not require any plug-ins to play. For example, Mafia Wars and Street Racing by Zynga.

AJAX.

Short for Asynchronous JavaScript and XML, this technology allows immediate response to users’ actions in interactive web applications. Travians is an example of multiplayer browser-based games that are programmed in AJAX.

2.2Comparison between Flash/Flex, Java, Shockwave, SilverLight and JavaFx

The table below illustrates the various characteristics of popular web application development technologies.

Name

Browser Plug-ins

Cross-Platform Capabilities

Supports Mobile Devices

Security Features

Flash/Flex/Air

Required

Yes

Limited Support

Weak

Java

Not Required

Yes

Mobile-specific Applications only

Strong

Shockwave

Required

Yes

No

Weak

SilverLight

Required

Yes

Currently Limited Devices

Strong

JavaFX

Not Required

Yes

Yes

Strong

Table 2.2 Comparison between various web application development technologies

Based on the table above we can see that JavaFX has the best features compared to other similar technologies. JavaFX does not require any extra browser plug-ins while still not losing out other technologies in terms of cross-platform capabilities to. It also supports mobile devices that can access normal web pages while other technologies either does not support of have limited support for such devices. JavaFX is also one of the few technologies that have strong security features. Flash for example is the most easily exploitable technology where attackers can use for malicious reasons. According to Secunia Advisories, one of the many loophole of Flash is that Flash has methods that browse or download files that can be called without user interaction and can potentially be used to trick a user into downloading or uploading files (Secunia Advisories, 2009). This means that these methods can be used for malicious reasons such as infecting a computer with malware (i.e. viruses, Trojans, and spyware etc.). JavaFX has good security features that will not allow such exploitations to occur.

2.3 Why Choose JavaFX

2.3.1 Advantages of JavaFX

JavaFX has been chosen for the development of the Multiplayer Browser-based Game in this project. JavaFX has been chosen because of the many advantages that JavaFX has over its peer technologies. Below are the benefits and advantages of using JavaFX compared to other similar technologies:

2.3.1.1 For the users:

Plug-in Free.

First of all, JavaFX doesn’t require any browser plug-ins. This means that users of any JavaFX application can start using it without having to go through the hassle of installing plug-ins, unlike Flash, SilverLight, and Shockwave where plug-ins are required. The Flash plug-in in fact, needs a different plug-in for different types of web browsers. For example, installing the Flash Player plug-in for Internet Explorer only enables the user to view Flash content on Internet Explorer. If the user wishes to do so using Mozilla Firefox or Google Chrome, he/she will then have to download a different Flash Player plug-in for that other browser that he/she wants to use. JavaFX applications can be used as long as the JavaFX 1.2 Runtime (which is part of the Java Runtime Environment (JRE) if it is installed on your computer) is installed on your computer which is automatically downloaded on Windows and Mac OS desktops and browsers that support Java 1.5 or higher when users access a JavaFX application for the first time (JavaFX FAQs, 2009).

Works on Any Operating System and Many Mobile Devices.

JavaFX can be used to develop cross-platform and cross-device compatible applications. This means that if this multiplayer browser-based game is developed in JavaFX, players running on any operating system or even certain mobile devices are able to play this game as long as they have a web browser. JavaFX Script programs run on the Java Virtual Machine (JVM), so they will run virtually anywhere (Weaver, 2007). This means that using JavaFX to create the Multiplayer Browser-Based Game would allow more people using computers with different operating systems and different devices to play the game.

2.3.1.2For the developers:

Reusability of Java Libraries.

JavaFX also benefits not only the users but the developers as well. Since JavaFX has the ability to reused standard J2SE libraries, Java developers who are familiar with the functions of the standard Java libraries will not have difficulties programming in JavaFX. This includes the Swing libraries for attractive user interface design. To program in Flash or Flex for example, the developer will need to learn ActionScript, which is a totally different language from Java. Since Java is a popular programming language and many programmers are experienced in this language, being able to reuse Java libraries will be an advantage to the Java programmers who want to adopt the JavaFX scripting language.

Read also  A Case Study On Facebooks Dilemma Information Technology Essay

Development of Standalone and Web Applications.

Developers can create web applications that run not only in the web browser but can be dragged onto the desktop and launched directly from there if the user wants to. Doing so does not cripple any of the intended functions of the application created.

Cascading Style Sheet Compatibility.

It is possible to edit the visual aspects of a JavaFX application through the use of Cascading Style Sheets (CSS). Developers can configure the appearance of Swing objects such as Textboxes, labels, buttons etc. as well as text formatting such as font family, font size, color and style. This means that developers will not have to go through the entire source codes every time he/she needs to change visual aspects of the application.

Strong Security Features.

JavaFX has strong security features and currently does not have any loopholes for attackers to abuse. This prevents attackers from using JavaFX applications for malicious reasons such as to infect computers with malware or to steal information. Creating a multiplayer browser-based game with strong security also means it will be almost impossible for players to cheat using software known as Trainers or by using bots.

Low Development Cost.

JavaFX can be developed in the free NetBeans IDE which can be downloaded for free from the Sun Microsystems website. Developers will only need to bear the cost of the computer hardware and save on programming Integrated Development Environment (IDE) software. To program in Flash however, you will need the Flash development software called Adobe Flash. The latest version of this software, Adobe Flash CS4 costs up to US$699 for a new copy or US$199 to upgrade from an older version. Developing in JavaFX however costs nothing in terms of development tools.

2.3.2 Examples of JavaFX Applications

One of the most distinct applications that uses the JavaFX technology is the photo uploading function of the Facebook social networking site. When users use the photo uploading function for the first time, the web browser used does not request the user to download any plug-ins and instead downloads the JavaFX Runtime in the background, making users feel as if no additional plug-ins are needed and saving them the trouble of having to install additional plug-ins manually.

Image Source: Taken as a screenshot from the author’s own Facebook profile.

The photo uploading feature of Facebook is an Applet programmed in JavaFX and is one of the most widely used JavaFX applications currently since there is an abundance of Facebook users who upload photos each day. This is a good sign as this will popularize the JavaFX technology and encourage developers to make use of this new technology.

Conclusions:

The project successfully met the two objectives to be completed in Phase 1. A literature review report has been produced successfully and a comparison between JavaFX and its peer technologies have been done. It has also been stated clearly the reasons and benefits of using JavaFX and why it has been chosen for this project. Therefore, Phase 1 has been completed successfully.

The author has managed to develop an in-depth understanding towards browser-based games through this literature review. The author has also compared between the various Rich Internet Application (RIA) development tools and has firmly chosen JavaFX as the most appropriate scripting language for the development of the Multiplayer Browser-Based Game that will be developed. The author has also documented all findings, discussions, figures, citations and references and therefore Phase 1 has been successfully completed.

References:

Books

  1. . Adams, E., (2009) Fundamentals of Game Design (2nd edition), California, New Riders Press, pg 80 – pg 81
  2. Weaver, J. L., (2007) JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications, California, Apress, pg 2

Websites

  1. . StateMaster – Encyclopedia: Browser game (2006) (Online) (Cited 28th September 2009). Available from:
  2. < URL: http://www.statemaster.com/encyclopedia/Browser-game >

  3. HowStuffWorks “How Web Animation Works” (2009) (Online) (Cited 28th September 2009). Available from:
  4. <URL: http://www.howstuffworks.com/web-animation6.htm >

  5. JavaFX FAQs | How to and General Questions About JavaFX (2009) (Online) (Cited 28th September 2009). Available from:
  6. < URL: http://javafx.com/faq/ >

  7. Secunia Advisories – Adobe Flash Player Multiple Security Issues and Vulnerabilities (2009) (Online) (Cited 29th September 2009). Available from:
  8. < URL: http://secunia.com/advisories/32270/ >

  9. Webshots – Pictures from friends and fun photos (2008) (Online) (Cited 29th September 2009). Available from:
  10. < URL: http://good-times.webshots.com/photo/2371922470014879709zmHkyr >

  11. MMORPG.COM – RuneScape : Official Screens and User Screenshots of RuneScape (2009) (Online) (Cited 29th September 2009). Available from:
  12. < URL: http://www.mmorpg.com/gamelist.cfm/game/37/view/screens/user/5/display/9401 >

  13. Dogs of the Seas – Gallery (2009) (Online) (Cited 29th September 2009).

Available from:

< URL: http://www.dogsoftheseas.com/gallery/?img=18 >

Prepared by Tan Choon Chi BCSCU Double Module Project September 2009

Order Now

Order Now

Type of Paper
Subject
Deadline
Number of Pages
(275 words)