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.

Wednesday, May 28, 2008

Fixed Flash detection for Opera / Wii

Some folks over at the Jangaron Tron-Sector thread reported that version 0.5 does not work in certain browsers and under certain circumstances.
The good news: I fixed a bug in my Flash detection code so that it now works in Opera without the right (and still without any) Flash plug-in. That fix (version 0.51) should make it work on the Wii, too ("work" in this case means "no sound, but at least you can play the game").
Concerning other browsers, some people seem to have tried IE6 and very old Safari versions which I cannot test, and both do not work. Let me quote from my own post over at Tron-Sector:
Jangaron is based on CSS border slants, which are not fully functional in IE6. One crucial feature, namely transparent borders, is missing in older IE versions, and Jangaron heavily relies on that feature.
Besides Firefox and IE7, there are many other alternative browsers that are supported by Jangaron: all other Gecko-based browsers should work (Iceweasel, Netscape, Camino, ...), Safari 3.1 (I think 3.0 also, but I am not sure) and other WebKit-based browsers, Opera 9.25 and thus the Wii browser. Unfortunately, there are still problems with browsers based on KHTML (the WebKit predecessor), like Konqueror 3.x. Jangaron's stable version seems to run on Konqueror 4, though, because some serious bugs in KHTML's JavaScript engine were fixed (or was it even replaced completely?).
Jangaron's claim "The Tron Lightcycle Game in any modern browser" is to be emphasized on modern, and is also rather a vision than a completely proven fact. I need help for testing and debugging Jangaron in this multitude of browsers, so all you JavaScript / DHTML gurus out there, feel welcome to support!
Thank you for starting to report problems; now, let's analyse and fix them if possible!

Saturday, May 24, 2008

Jangaron 0.5 is out!

Finally, its done! We arrived at a level where Jangaron version 0.5 seems stable enough to announce it to the public and offer you an updated version packed with new features!
"We", in this case, are David "Avi" Scott and Frank "Joo" Wienberg and all the others who gave valuable feedback.
Note that version 0.43 is still available at the well-know location www.jangaron.net/jangaron.html. The index page www.jangaron.net now lets you choose between the stable (0.43) and the experimental (0.5) version.
Night of the Feature Creep
The most important feature for the new version turned out to be something that wasn't even mentioned in the voting (sorry, guys, no grassroots democracy yet): Sound and music! And David is the one who contributed his own compositions to Jangaron. Thank you again, David, for your excellent "labor of love"!
To give you a quick overview of what to expect from Jangaron 0.5:
  • Look Left/Right/Aback - One of the most-voted features is now available, and even in the extended version that you can also take a look behind, watching out for lightcycles chasing you! This gives you more overview and allows new strategies. The keyboard setup has been extended by three columns for the corresponding keys.
  • Sound and Music - This one is the real feature creep. I revamped Gustavo Ribeiro Amigo's Javascript Sound Kit for Jangaroo (no, this is not a typo: as faithful readers might remember, Jangaroo is the language Jangaron is developed in). Sound is only available when you have a Flash plug-in which must be version 8 or higher, but the game remains true to not requiring any plug-in, you just have no sound then. This technical feature allowed to enrich the game with sound and David's great music. Pump up the volume and enjoy!
  • Team Play and Presets - I promised Brian to include teams in the next Jangaron release, and as I tend to keep my promises, you all had to wait a little bit longer ;-). But it turned out great (at least I think so!) and was worth the effort. Team play allows a variety of modes and so that you do not get lost in configuration space, we included presets for classical setups: you can replay the famous original movie scene (User vs. MCP), fight one on one (on one on one...), setup pairs, or face your destiny as a Lone Hero against one big MCP squadron. Starting from one of these presets, you can create your own personal setup. Please let me know your favorite team play mode!
  • Save Settings - a feature you did not know you wanted. Now that there are various ways to set up the game, it would be a pity if you always had to start from scratch when reloading or revisiting. All settings are saved to a browser cookie. Note that the in-game statistics (wins, deaths) are not stored.
  • More Accurate Lightcycle Control - I noticed that especially in critical situations where there is a lot work for the rendering engine, the lightcycle control became inaccurate. I improved this by recording the key event time and computing a more precise turn position. This change improves gameplay a lot and increases your chances to beat the stupid, but fast-reacting program players (they somehow remind me of Matrix Agents).
I hope you enjoy the new version as much as I do myself. Jangaron started more or less as a proof-of-concept for the Jangaroo language tools and was nice, but probably not long-lasting fun to play in the previous versions. Version 0.5 offers music, sound, and much more variety in gameplay, in particular for multiplayer sessions, so I hope you'll all become Jangaronies! Let me know of your preferences, ideas, feature requests, or if you are willing to contribute! Just leave a comment here or drop me a mail (joo[AT]jangaron[DOT]net).
More about the technical challenges, pitfalls we had to overcome, and solutions later...
See you on the Grid!

Tuesday, May 13, 2008

Playing Jangaron with a Gamepad

I've been quite busy working on the next game release, but to jolly you along, I have something from the "tips & tricks" section.
For two or more players, sharing the keyboard takes Jangaron's game goal that you have to elbow your way through a bit too literally. Also, using the keyboard for an arcade game is not everyone's cup of tea.
I remembered the tool that accompanied good old M$'s precision pro joystick, which could make any joystick button simulate any key press (even sequences!), and thought there must be a similar, free tool that works for any joystick or gamepad. I searched, and of course, there are many such tools.
I tried Xpadder, because at first glance, it looked the most convincing and is free (but don't you forget to donate, pal!), and I must say it really works neat with Jangaron!
You can choose two approaches: Either, you map the buttons and axis of your gamepad or joystick to any key and then adapt the settings in Jangaron, which I would not recommend until the next Jangaron version which saves settings. Or, you map the buttons / axis to the preconfigured keys of some Jangaron user player and optionally space (for pause) and return (for confirming the "game over" dialog) -- that's what I did. There is no noticeable performance impact, and if you chose the buttons wisely, you will be rewarded with a new gameplay feeling of Jangaron, especially for multiplayer sessions!

Saturday, April 19, 2008

User's Voices II: And the Winner is...

The "next features"-poll is closed, thank you for participating! As you can see, there is no clear winner: Both "look left / right" and "2D grid overview" received exactly the same number of votes (4), while the other two candidates, "save settings" and "configure acceleration", have been defeated. In my previous post about the poll, I voiced my doubts about the "2D grid overview" feature, so I am going to take the liberty to start with "look left / right". To be honest, in the meantime I already implemented one of the "loser" features, namely "save settings", since it turned out to be quite a quick-win.
While we're at it, I'd like to congratulate Brian (USA) for being the first and (so far) only visitor to actually leave a comment in the Jangaron blog! Why are you other 124 people (at least that's what Googalytics tells me...) so quiet? Brian, in return for your commitment and commendation, I am going to implement your feature request, too, and introduce configuration of teams and start positions in the next Jangaron version!
But please be patient, I have to steal some more time until it's ready to show. Maybe I'll offer a "beta" (wow, isn't that Web-2.0-ish?) before the next stable version, since I have some more surprises up my sleeve...