8Realms Wiki
Advertisement

Template:DevBlog

DOM stands for Document Object Model. It's the model by which JavaScript interacts with elements on a web page authored in HTML. Now the educational bit is out the way, I will start talking about 8Realms- more specifically, how 8Realms uses HTML, JavaScript and the DOM.

Barbs-300x240

Not Everything is Smooth Sailing

The first thing I will say is that, although we're making use of JavaScript in 8Realms, we don't use it as heavily as some of the other games out there. This is for the simple reason that JavaScript is not like the programming languages we would use to make a desktop application or console game. It is actually very slow in comparison. We felt we should make a game that used JavaScript as little as possible, to allow you to play 8Realms easily on almost anything you want – be it your computer, your phone or any other device that can display a website.

Initially, we attempted to make the game entirely without JavaScript. This led to some very interesting challenges, such as how to display information when you hover over buildings in your settlement. This, in a standalone game, would be easy – but with HTML it was not so. Thankfully, Mod Mog found the answer using IFrames, and effectively, piling pages on top of each other, we managed to get it to work.

We did actually make the game work entirely without JavaScript. However, due to the level to which we pushed the HTML and CSS specifications, we managed to break several browsers to the level that, instead of showing any images, they would just show a colourful mess. This meant we had to look at incorporating some JavaScript, but we still didn't wish to use so much that it would make the game unplayable on less powerful devices, preventing you from playing 8Realms wherever you are.

This post starts to demonstrate the difficulties that are found when making a game like this. Unlike making a game for console or PC, we have to try to make the same code work on many different platforms – like buying a PS3 game and playing it on a Wii. To this end, we currently have 8Realmsworking in Firefox, Internet Explorer, Google Chrome, Apple Safari and Opera – and on the iPad. We're working hard to ensure this continues, as well as considering other devices.

On that note, I shall get back to work. :)

Mod_Damname
Game Developer

Advertisement