Saturday, June 16, 2007

From an online game to a virtual machine

So I decided to get my gears back into a project that had been abandoned for almost a year now. An online game that I started as a school project, but I didn't really finish it at the time. I had been thinking of taking it up again a long time, but did not do so until now.
The first thing I was going to do was rewrite the protocol, I needed to make it more foolproof. For making it I had simply made a chat, just to design the way the client communicates with the server. I pulled this chat out of the closet and started working on it again.
I wanted smooth transitions back in the day, so I opted for using the xmlHttpRequest method. Big mistake. It's a nice method and gives nice results (and I love knowing quite a bit about it now), but it has been taking up quite a bit of time. Okey, maybe it was not such a big mistake, but it was probably not the right choice for a school project you are supposed to spend 10 hours on (I was intending to spend more on it anyway - when hobbies and school meet there is something to be gained :P).
Anyway, I was refining my protocols, so I was dabbling with the xmHttpRequest again. Cross-browser compatibility is the worst thing with it. But in the process I found out that IE 7 actually uses the syntax every other browser uses, unlike other versions of internet explorer. One big step forward, as my new code (this time I made better use of functions and put some 'libraries' in external files and made the code so that if any file does not reach it's destination the worst thing that can happen is text that is typed not appearing on the screen) worked with IE 7 immediately after designing it for Firefox. I had left in a bit that was different for IE, but as it turned out that was only needed for IE 6 and below. Unfortunately many people still use IE 6 and thus I want my site to be IE 6-compatible. So I went and started to adjust it. My first problem was a simple mislocation of a statement (inside the non-IE bit rather than just done no matter the browser). But I wasn't out of problems yet, there was some other problem as well, which I haven't fixed yet. I needed IE 6 to see what the problem was, but I only ran IE 7, and you can not have both at the same time.
I tried MultipleIEs an application that does let you run multiples, but I wasn't able to clear the cache there and you can not ctrl-f5 a js-file (yes in FF you can, but not in IE). The big plus was that I had already installed some IE-javascript debugger (some other m$ product that dual-functioned? The debugger I tried to install last year when working on this project?). Anyway I decided to go for the one other option, making a virtual pc and running IE 6 on that (there are special images for this).
So I looked up Microsoft Virtual PC (I knew how to use it, I had dabbled with a earlier trial version before) and you know what, it was F-R-E-E. Wow, that's the second (or even third) positive thing about Microsoft in this post.
To be honest I already knew it was free, as it was told on each of the pages that told me about this workaround for running more than one version of IE... but that's where I am now, downloaded the stuff and and installed it. Now I have to get the IE dev toolbar (a friend told me about this when trying to help me with this project) to my virtual pc as well as the mysterious debugger. Let's hope it works out.

No comments: