Saturday, April 4, 2009

Jangaron 0.6 Online: 3rd Person Perspective!

After improving the Jangaroo tool (sorry, new version not yet released) and major refactoring of Jangaron into separate modules, I put online a preview on the upcoming new version:
Now, eventually you can play what you could only see in a video so far!

The new features include:
  • smooth switching between 1st- and two different 3rd-person perspectives
  • shrinking lightcycle walls when players derezz, like in the movie, instead of fading walls like before
  • support for IE8 (also patched Jangaron 0.54) -- lightning fast!
  • offer you an offline version to install (you need to install Adobe AIR first -- I used version 1.5.1), much easier than my previous attempt. Jangaron now has a really nice build process (Maven), so that I can promise to build a version to install for each future update.
  • bug fix: controls now work correctly when going very slowly
  • redesigned the Jangaron home page with the look and feel of the new version and links to all available versions of the game to give visitors better guidance which one to start
  • added meta-data so that iPhone and iPod touch use full screen mode
Open issues are:
  • clipping: depending on the type of browser, when you go very close to another wall, the angle of the wall may be displayed incorrectly. The reason is that when introducing arbitrary trapezoids, I removed clipping for the time being. Different browsers have different limitations in the size of borders (most around 1000 pixels) which lead to problems with steep slopes.
  • restart game: you still cannot return to the configuration screen other than by reloading the page. This is especially annoying in the AIR version, where you cannot reload! I hope I'll have this fixed soon. Besides that, there are still some states (glance direction, speed when having jumped to another lightcycle) that seem to be reset incorrectly when the game restarts.
  • iPhone on-screen controls are not yet available. As you might remember, I patched them into 0.54, but this solution will be replaced by browser detection and/or configuration.
I successfully tested in Firefox 2 (Windows XP), 3, and 3.1beta, IE7 and 8 (Windows Vista) (known not to work in IE6 and never will!), Safari 3.1 (XP) and 4 beta, Chrome 1, Opera 9.62, AIR 1.5.1 (Vista), and iPod touch 2.2.1. I also experimented with a new open source AIR alternative called Titanium, but only made work the "mini" Jangaron version, i.e. the one without the settings dialog. Brave folks can download a Mac, Windows, or Linux installer on the Jangaron Titanium page.
I'd like to ask you help me collect all other browser/OS environments Jangaron 0.54 or 0.60 run on! Please report any functional or performance issues!

Sunday, August 3, 2008

Jangaroo Released and Jangaron Updated to 0.54

It's been a while since you last heard of me. Of course, I've been really busy, but rather less with Jangaron itself (and, as obvious, even less with the Jangaron Blog) than with the base technology Jangaroo.
Jangaroo? As mentioned before, Jangaron is completely written in JavaScript, but it uses features of the new language version JavaScript 2, most notably packages, classes, and static and private members. To allow this JavaScript 2 code to run in today's browsers, I use the Jangaroo compiler, which was developed by CoreMedia as an internal tool, but has just now been released to the public as Open Source. Guess what kept me busy: I was the initiator and so-called "Program Manager" of the project at CoreMedia, with the goal to launch the Open Source Jangaroo project. (Okay, plus one week holiday, where I refrained from touching a computer. To be honest, I lost a bet with my wife.)
Read all about the goal, features, and history of Jangaroo in the Jangaroo Blog.
What I did update for Jangaron are two things: I used the latest version of the Jangaroo compiler, and I revamped the settings UI. Read about both changes in a minute, but if you want to try the new version immediately, here are some hints for troubleshooting:
If you have any JavaScript errors, try to clear the browser cache. If that still does not help, reset your settings by clicking the corresponding button with the red x in the settings UI. If that does not work, either, delete the Cookie "jangaron" from domain "www.jangaron.net", path "/jangaron0.5" using a Cookie manager for your browser. If your browser does not have a Cookie manager, then don't use IE (well, you can still delete the Cookie from the file system). If you still have problems with the 0.54 update, please report back by comment or using the e-mail address given on the "About" tab of the game. For the time being, you can still use my back-up of version 0.52 or the (very old) stable version. I also updated Jangaron mini in the Blog, so here, clearing your browser may also make problems go away.

Updated to the Latest Jangaroo Compiler
I used the latest version of the compiler (version 0.1.1, which has just not yet been released) to recompile the Jangaron code. Besides some performance improvements, the main point is an even better browser compatibility of the Jangaroo runtime. This makes Jangaron run in Konqueror 3.x (tested with 3.4) and even on... yes... Safari/iPhone!!! It seems that Safari/iPhone is more similar to Konqueror/KHTML than to Safari/Desktop. Unfortunately, the way Jangaron grabs key strokes does not seem to work on Konqueror, and the iPhone does not even have (many) keys. So I set up a special iPhone version that uses on-screen buttons for turning. Speed and view control are not yet available, this is just a quick test whether it is playable at all. Please report back!
But most importantly, Jangaroo being Open Source allows me to release Jangaron as Open Source soon, too. I had to wait until Jangaroo was released, because nobody would have been able to produce a running version from the Jangaron source code without the Jangaroo compiler! Now, I have to figure out which license I'm going to use for Jangaron and where to put the source code repository. Developers, stay tuned!

Revamped the Settings User Interface
On my way from Hamburg to Augsburg to visit the 40th birthday party of a good friend of mine, I used the 2 x 6 hours to revamp Jangaron's settings UI and add a splash screen with a new logo including a smoothly increasing glow effect (again, pure JavaScript!).
To come back to the new features, the settings dialog now has
  • a large glowing lightcycle changing to the first user player's color and serving as the new "Enter the Grid" button,
  • a different color theme,
  • expandable, overhauled help texts for each tab,
  • it starts on the "Players" tab when visiting for the first time (since there you find the setting you most likely want to change),
  • there, it starts with the main two settings: game mode and number of players, and
  • in the background is now an optionally animated game grid (what else?), that can be switched on in the "Grid settings" tab. However, by default it is switched off, since the permanent redraw consumes quite some CPU. Also, you can get dizzy in the head from staring at the sliding grid.
One small visual change to the game is that the you win / you lose texts now even more look like old character-based terminal output. I added a PNG as an overlay that is slightly less transparent at every other line, which leads to this "analog monitor blur" font effect. You may need to take a closer look to recognize the difference (click the image above or lose the game, whatever you think is the faster option!), but still I think it was worth the effort since it adds to the 80-s look-and-feel of the game.

Of course, I also fixed some bugs. For example, combo box selections did not update correctly in Safari. Fortunately, someone else had identified and solved the problem before. The point is that Safari is very close to the spec here, which does not allow two options of a select element to be selected at the same time. So to select a different option, you have to deselect the currently selected one first, or the change is ignored in Safari. The fix was to simply use the selectIndex property of the select element, which avoids this problem completely.

Finally, you may ask yourself, and what about the 3rd person perspective? I have also been working on that, but there are still some performance issues in some browsers and some minor bugs and features (e.g. changing camera position), and I want to give you a good experience from the start when introducing that feature. Maybe I'll set up an alpha version of Jangaron 0.6 for curious and brave Jangaron fans, so let me know if you want me to!

Thursday, July 3, 2008

Jangaron 0.52 in Firefox 3 -- but slow

About 20% of all Firefox surfers that have visited www.jangaron.net during the last month already used Firefox 3 -- and couldn't start the game! After a really small patch, Jangaron 0.52 now works completely in Firefox 3.
My workmate Jan found a bug in the browser abstraction code: To let standard-compatible browsers simulate IE behavior (yes, I know, it should be the other way round!), I checked whether MouseEvent is defined. Since MouseEvent is supposed to be a constructor function, I used typeof MouseEvent=="function". For reasons beyond my imagination, Firefox 3 changes the type of MouseEvent to "object", so the check failed. Now, I simply use typeof MouseEvent!="undefined".
After quick-fixing the bug (no new version number, just reload / maybe clear browser cache), the full game now works in Firefox 3. However... it runs unbearably slow :-(. I started searching for similar problems and found many disappointed Firefox users who reported that version 3 is actually quite slower than 2 (at least in certain circumstances).
Currently, there is not much more I can, or better am willing to do about it. Maybe the guys over at Mozilla will come up with some performance tips or patches soon. Until then, I do not recommend using Firefox 3 to play Jangaron. If you a brave and try, I would really be interested in your experience. By the way, I didn't yet bother to patch the "stable version" 0.43, which has the same bug, so please use 0.52 with Firefox 3.
One last hint, if you want to use Firefox 3 for surfing and Firefox 2 to play Jangaron: just google for "firefox.2 firefox.3 parallel". Essentially, you create a separate profile for each Firefox version so the other one does not mess it up, and start the program with command line switches that tell it a) to use a certain profile and b) not to reuse the running Firefox instance.
After being a bit disappointed by Firefox 3, Opera 9.5 and Internet Explorer 8 are my next candidates...

Saturday, June 28, 2008

Play Jangaron 0.52 Offline!

Jangaron does not need a server connection, as it is not (yet) a network multiplayer game. However, it has not been so easy to play Jangaron offline - until now!
At the request of Brian, I just uploaded a zip of the Jangaron 0.52 files (only 57 KB, without sound files), including a small patch to make it run without sound locally. Just unpack the archive to some folder, and open jangaron.html in your favorite browser.
The problem with sound is that Flash (which I use for sound only) refuses to load sounds from local file-URLs. The simplest way to make it work locally is to install a Web-server like Apache (don't be afraid, download the binary release and it's really simple!) and put all Jangaron 0.52 files and the Jangaron 0.52 sound files (3.5 MB in two subfolders) below Apache's htdocs folder. Then, start Apache and browse to http://localhost:8080/jangaron.html, and you can play Jangaron with sound, even when you are not connected to the Internet!
Please tell me if you succeeded to install Jangaron (with or without sound) or contact me if you need more detailed instructions.

Sunday, June 15, 2008

From a New Perspective

While some users prefer the first person view, even after adding look left/right/aback, you sometimes miss a bit of overview in the game.
Thus, I started working on a third-person perspective for Jangaron, where you can look over the lightcycle walls. To give you an early preview of how it may look like, I used Wink to produce a video of a game played with my workspace version. What you can see right at the beginning is the "camera" moving gently from the usual mid-horizon perspective to a bird's eye view above the player's lightcycle. I plan to provide keys for toggling between those two modes. As you can also see in the video, even in the third-person view, you can look in all four directions!
What do you think?


The technical challenge of this new perspective is that CSS border slants per se can only draw trapezoids where the projection of one of the parallel sides is completely contained within the other (leftmost figure). If the projection has at least a non-empty intersection, two slants (a "real" slant and a triangle) suffice (middle figure).
But what about arbitrary trapezoids? The solution is to cut the trapezoid in
a zigzag, resulting in serveral right angle triangles and one terminal slant (rightmost figure).
The worst case concerning the number of triangles is a very thin, 45 degree trapezoid. This is why I used another trick for the grid lines, which is to draw a white right angle triangle and a slightly smaller black one, so that only the white sloping line remains. I could not use that trick for the lightcycle walls, because they are drawn on top of the grid.
The question was if using this drawing technique degrades performance, but the answer seems to be "no". I use highly optimized code to update the DOM and to create the zigzag (just some linear equations; note that many coordinates can be reused!), so the overhead of projecting the wall etc. seems to outplay creating additional triangle/slant shapes. I hope to be done with the feature soon, so that you can check it out yourselves!

Friday, June 13, 2008

Jangaron Promo Video Mania

It is really astonishing for me what can happen in a community: After Jangaron 0.5 was done and I made it run on the Wii again, I posted a rather kidding remark to TRON.dll, who, as you might remember, had already put together that great video of Jangaron on the Wii. I said, jokingly, "why don't you also produce a video of the new version", and he even topped that and created a fully-fledged Jangaron promotion video with titles and everything, showing all game modes etc., uploaded it on YouTube and posted it in the Tron-Sector forum thread. And all this happened without me lifting a finger -- amazing! I have to apologize, TRON.dll, it is long overdue to report about your great Jangaron promo video here: Everybody watch and enjoy!

Saturday, June 7, 2008

A Tiny New Feature for Jangaron (0.52)

This one I stole from Armagetron: The outer rim walls of the game grid can now be set to be infinitely high. I like it better for its claustrophobic ambiance, so I made it the default. If you don't like it, uncheck Grid settings | infinitely high outer rim, and you're back to the way it looked before. On any problems running the updated full game or Jangaron mini, please clear your browser cache.
Powered by WebRing.