Category Archives: Uncategorized

Update your Browser

I’ve been doing a little bit of web development outside of Asteroid Outpost recently, and the question came up: Which browsers should I support? The obvious answer is “All popular browsers”, which got me looking at stats. People still use IE6, 7 and 8? What?! Even IE9 doesn’t support half the things I want to do. I’ll stop here and say that even though I’ve been a Firefox fan for years, I’ll try to keep this as un-ranty as possible.

Before I go into the details, what is HTML5? I’m sure you’ve heard everyone raving about it, and with good reason. It’s pretty cool. Essentially, it’s a collection of tools that can be used to make a rich web experience, as well as improved standard ways to write web code. This includes everything from standard ways to embed videos and music, Canvas, Vector Graphics, CSS3 support which includes: Transitions, Animations, and other styles that were previously difficult to achieve. The catch is: HTML5 is still a draft, a work in progress. And because of this, each browser in the market supports different parts of the draft. Various sites on the internet will measure how well the browsers support the new HTML5 standards, and many web developers, myself included, are using the HTML5 standards long before they will be approved.

Major browsers that support a good chunk of HTML5 are: Internet Explorer 10, Chrome, Firefox, Safari 6, and Opera. Note that I didn’t include version numbers for Chrome, Firefox, and Opera, I will go into why later on.

IE10 has great support for HTML5 and it’s been out for many months now, so why don’t IE users upgrade? Well… some of them can’t. IE10 used to require Windows 8, but it was released for Windows 7 recently. Even if every Windows user on Win7 & 8 upgraded to IE10, that’s still a maximum of ~60% of the Windows market covered. 60%! So if I write an HTML5 application, only 60% of my IE viewers will be able to view it? Here’s a graph I compiled showing the browser version ceiling based on your operating system, scaled (roughly) by the number of users using the operating system.

Windows Browser Support Scaled

I think I speak on behalf of all web developers when I say: If you’re on XP or Vista still, please Please PLEASE either upgrade your operating system to at least Windows 7. If you’re already using Win7 or 8 and are using IE, make sure it’s version 10. The alternative is to start using Chrome, Firefox, or Opera.

Here’s where version numbers come back in: Chrome, Firefox, and Opera work across all of these different operating system versions, and they all automatically update to the latest version. There is absolutely no reason you should be running any version other than the latest with these browsers because it’s not limited by your operating system version.

Internet Explorer 10 isn’t the only one that requires the latest Operating System version, look at this graph I compiled showing the version ceiling for browsers based on Mac OSX’s version, (not scaled based on usage):

Mac Browser Support

My hypothesis is that operating system (OS) developers, Microsoft and Apple, design their browsers to take advantage of the new operating system features, which causes their browsers to become incompatible with earlier versions of their OSes. I bet this is on purpose to not only make their latest browser work better than their competitors (with the new OS features), but also to force users to upgrade and give them more money. I’m not opposed to making a little money, but I don’t think they are considering the effect it’s having on internet at large.

Can you use HTML5 today? Sure, if you want to ignore 20-40% of your viewers. Realistically, businesses can’t use HTML5 today. It’ll be 3 to 5 years before more than 90% of users upgrade from XP, Vista, or OSX:Lion and are able to view HTML5 material like the rest of us. That makes me very depressed.

/rant

Screenshot Saturday, October 13th

I’ve started to participate in #screenshotsaturday on twitter. The idea is that game developers like myself post a screenshot of their work on Saturdays. There’s a pretty cool website that collects all of the tweets and displays all of the Saturday screenshots, aptly named screenshotsaturday.com. Here’s my entry from last week where I added a power indicator for the solar station that will fade away at further viewing distances (click to enlarge):

zp6DEIu

And my entry for today, where I’ve started to create a missile launcher.

CzGDG92

So yeah, I have finally added something to the game, can you beleive it? Nor can I. The missiles still don’t do any damage, they’ll just fly straight through the enemy ship and continue to accelerate into oblivion, but it’s a start.

New Domain

Welcome to my new domain! Back in the day, “stat-life.com” seemed cool because I was working on a project with that name (a pun of Half-Life), but when work on that project ceased, I just made a sub-domain (cell.stat-life.com) and carried on. Time to move on.

In-game Component Editor

I have started work on an in-game component editor, doing exactly what I mentioned in my previous post: serializing my components to JSON, sending that through Awesomium to some JavaScript/jQuery/jQueryUI to display controls on the screen. It looks pretty slick. Here’s a short video about it:

As you can see, there’s still some more work required: certain datatypes don’t have an associated control (Vector2 and Color), the numeric sliders’ max-value isn’t fixed (it uses current value * 2), and modifications to the values go nowhere. Once I’m able to live-edit these values, this will become useful for debugging, balancing, and perhaps scenario editing.

Oh, and I may be turning into a Twit. I have started a twitter feed where I will try to regularly post about Asteroid Outpost.

Data-only Components, jQueryUI, JSON, and Networking

My components are comprised of nearly 100% data with no methods. All of the manipulation of the data occurs in my systems. Some of you may be wondering why you need to separate the logic from the data. Doesn’t it just make work and reduce encapsulation? Well… not really. Once you start working with data-only components, you notice that components are able to encapsulate an idea without worrying about the world around them, and each system handles a particular aspect of the game, one to move things, one to build stuff, one to draw, etc. Even though the data and logic are in separate classes, everything has a very clear role: Components store stuff, Systems do stuff.

After following the development of Overgrowth, watching some pretty cool development videos about live-coding and live-editing, and cutting my teeth with some near-live-coding for my web-UI, I thought to myself: “I want that!”, and who doesn’t? Adding a way to view/modify the component data for the selected entity(s) on the fly wouldn’t actually be that hard, I’d just need some web-UI controls. Googling web controls quickly led me to jQueryUI which looks amazing compared with some of the other solutions available. Since I have data-only components, I can easily wrap them up in some JSON, pass a collection of them down to some jQuery that will display the values using jQueryUI controls. When the user changes something, data would travel the other way: jQuery would produce some JSON and pass that up to XNA where the changed data would overwrite the data in the component. So what if XNA were to consume JSON from the UI in the same way it would handle it from the network? Wow, everything just clicks. JSON wins.

Starting from the beginning: I’ll have partial JSON files for each entity type that will define which components to build and any default values for those components. At creation time, I will provide value overrides for real-time values like position and rotation. Since everything is data, that’s all that’s required to construct a new entity. The same JSON used to create the entities will be used to populate things like the selection info panel on the HUD, the entity viewer/editor discussed above, and to transfer new components, or changes to existing components across the network. Since it’s just data, it’s easy to visualize. I better get the last of the logic out of my components before anyone notices.

Building it up

I can’t say that my game is a game again, but I’ve re-built the solar station, laser miner, and power node. I built the power node most recently, and it was eaaasy to do because I just slapped existing components together and gave it a name. The more components I build, the easier it’s going to be to build new entities from them. If things keep up, maybe I’ll be able to add something new before Christmas!