Friday, March 24, 2006

Gamin' music

Any serious gamer (defined by one who plays most of the years best games) would have atleast one slot in their playlist dedicated to in-game music. Well, atleast I think so since I have quite a few slots dedicated in my mp3 database.

All games have intro music. But only a few games have that fabulous intro music that makes you want to leave your computer in the game's main menu screen with your speakers amped up. Right now, I can think of three games that did that to me: Hitman (Jesper Kyd's score), Age of Mythology ("A cat named mittens") and Civilization 4 ("Baba Yetu" by Christopher Tin).

Moving past the main menu screen, some games' in-game music that's supposed to reinforce the game's environment can do such a good job sometimes that you will want to take the experience to your desktop either by buying the sound track (costly AND redundant = Extravagant) or by ripping the sound track off of the game's sound files (resourceful :p). I have quite a collection of ripped game music with me. Here are some of the "most listened to" ones:

Civilization 4
Here are the top five higly rated tracks i listen to from this game:
  • "Baba yetu"
  • "Ancient soundtrack 2"
  • "El grillo"
  • "Ay Santa maria"
  • "The people are the heroes"

The first track, "Baba yetu", is like THE perfect song and made quite an impression the first time I heard it. It's an awesome intro song for an awesome game. The song itself is in Swahili (an African tongue) and features bold drums, a great voice and a soothing chorus. You wouldn't understand a word of it of course, but if you care to know, the song's supposed to be a famous christian prayer called "The Lord's Prayer" (weird that, in Tamil, 'Yesu' means 'Jesus'). For the lyrics, check this CivFanatics.com forum post. Don't let the religious nature of this song be a factor in keeping you from enjoy this song. I myself don't give a damn about the wordings or meaning of a song as long as the melody, rhythm and timbre are in harmony (say what?). I mean, I listen to hindi songs, german rap, romanian hits, french pop, etc in addition to those classical musical scores. And my german is not as great as my hindi or my romanian, which I am not familiar with. For that matter even english rap/hiphop isn't exactly legible to me sometimes. To me, there are no bad artists or bad genre or bad anything else, only bad songs.
Most of the other vocal numbers are by John Adams from 'Nixon in China'. There's quite a collection of classical music by Mozart, Bach, Beethoven, Brahms, Dvorak and the like. There are rather interesting songs/chants/opera as well. For music samples, check out this gamespy.com page for civ 4. Or, if you have the game or are planing to buy it, check the directory "<drive:>\Firaxis Games\Sid Meier's Civilization 4\Assets\Sounds/Soundtrack"
The sound tracks are in mp3 format for immediate listening without much ripping pleasure.


Age of Mythology
Here's my top five from this game:
  • "A cat named mittens" (Opening theme)
  • "Never mind the slacks and bashers"
  • "Adult swim"
  • "n. d. nile"
  • "Suture self"

This game has the most amazing original score among the other games that I've played. The music ranges from the intense intro music "A Cat Named Mittens" to the soothing "The Ballad of Ace Lebaron", and every shade tweeen. As you've noticed, all the tracks are named with creativity and light-heartedness. For example, "Suture self" when read would mean "Suit yourself". "n. d. nile" could mean "In the nile".
The sound track is, obviously, not meant as a stand alone album but as a background for the game's environment. This means that the tracks are not lengthy, average 2 minutes per track, and the album as a whole don't work together well.


Grand Theft Auto
The GTA series is all about in-game, or, more correctly, in-car radio stations. All of the songs are existing movie or hit songs, masterfully mixed and presented in the form of great radio stations along with great RJ voice acting. There's also one or two talk show stations per game with humourous content. There's been three GTA games out and my preference goes in this order:
-GTA III
-GTA Vice City
-GTA San Andreas

GTA 3's top of the spot for me would be Flashback FM featuring songs from the movie Scarface. I fell for the songs and then watched the movie Scarface (Al Pachino was great) which has become one of my all time favourites.
I forgot what my preferred radio station in GTA VC was, although I guess it was one of the talk shows. Truth is, I liked atmost a couple of songs in any given station.
GTA SA. AAh, GTA:SA. How can I ever forget K-Rose radio with RJ Mary-Beth Maybell. It was the in game radio that kick-started my passion for country and western music. Now I have quite a collection of country with me.


Need For Speed
Like GTA, Need for Speed also has in-car music, albeit not in a radio station format. And like GTA, NFS too is a series of games. Each NFS has a relatively small collection of both original and licensed hard hitting songs. I especially like the ones from NFS: underground, NFS: Underground 2, NFS: Hot pursuit 2 and NFS: Most Wanted. Here's the top 5 from each game:

NFS Underground
  • BT - Kimosabe
  • Eastside Boyz - Get Low
  • Nate Dogg - Keep it Coming
  • The Crystal Method - Born Too Slow
  • Fuel - Quarter

NFS Underground 2
  • Paul Van Dyk - Nothing But You (Cirrus Remix)
  • Chingy - I Do
  • Snoop Dogg feat. The Doors - Riders on the Storm (Fredwreck Remix)
  • Capone - I Need Speed
  • Rise Against - Give it All

NFS Hot Pursuit
  • Hot Action Cop - Fever for the Flava
  • The Buzzhorn - Ordinary
  • Uncle Kracker - Keep it Coming
  • Hot Action Cop - Going Down on It
  • Bush - The People that We Love

NFS Most Wanted
  • Styles of Beyond - Nine Thou (Superstars Remix)
  • Hush - Fired Up
  • Juvenile - Sets Go Up
  • Suni Clay - In A Hood Near You
  • The Perceptionists - Let's Move


Hitman
That leaves me with Hitman. The words "Hitman" and "music" would immediately spark the name Jesper Kyd in the minds of fans of this great game. JK has done many great scores for many other games as well. Check out his site, www.jesperkyd.com/, for some mind-bending samples. All of his music are totally cool and totally eligible for an intro music for totally any game.

Wednesday, March 15, 2006

Internet Boob Tubes

TV, Watch 300+ LIVE world TV stations for FREE
Besides visiting a country, one can learn a lot about the country's people via their TV programs as you get to see them, their habitat and also get to know their expectations via the programs produced to allure them. Back when 64kbps was broadband (I had 128kbps), someone from a forum directed me to a nice little program called TV.exe. The site, tv.exe.com, promised 100s of free online TV channels from around the world.

The app itself is a small, stand-alone exe, about 1 MB in size, that runs with no registry or documents or folder traces. But I was leery of downloading the program because, A, it was an exe, and B, it was from a cheesy looking site with flash and Ads (though my Adblock hid them). I don't have any active anti-spyware or an anti-virus as those goes against my active policy of increasing performance (which, by the way, is always won by Windows and ends up in me having to reformat/reinstall) and a whole slew of incomaptiblity problems among anti-whatevers and other applications. Besides, they are superfluous once you pay attention to what gets into your machine. Nonetheless, I get my monthly fix of anti-virus online at trendmicro and an occasional anti-spyware fix from AD-Aware. But since it had been "peer reviewed" by a forumer (and by softpedia.com, as pointed out by the homepage), I went on and downloaded it. The link with the most google PR has the freeware version. There's also a one-time paid version of the program that offers radio channels and, conspicously, webcam feeds. But with 128kbps advertised speed and 110kbps actual speed, most of the interesting sounding channels looked like a powerpoint presentation with audio. Though the range of stations available was nonetheless staggering, I preferred to use my puny bandwidth to download downloadable videos than to let it get insulted by trying to stream videos.

Now, though not much can be said about the Indian broadband situation, the bandwidth has doubled to 256kbps for the same cost. There's even this "double bandwidth at night" scheme where I get 512 kbps (actual speed 416 kbps. Pathetic.) from 10:50 PM to 8:10 AM (untimely timings eh?). In this setting, a few days back I stumbled upon this tv.exe in my software backup partition (aptly named "Store" [66GB]. The other partitions are OS [15GB], Runnables [134GB], Media [80GB] and Linux[the rest]. Yeah, you don't care).

The list of channels is retrieved from the tvexe.com server everytime the program is started so that new channels are found and at the same time dead channels are pruned. The prog doesn't have the best UI ever and features a fixed size media player window. Though the you can list stations by country, language or theme, all that the app does though, is contact the tvexe.com and list the tv stations already available on the net. You can google for Internet broadcast TV or something similar and reach all the channels directly via a browser. Though it's a bit tedious at first to google-find the channels, if you bookmark the ones you want then subsequent access will be one-click access. You may even write your own program to either periodically google and parse out movie file links for you, or a more simpler program which maintains a manually entered list of channels and a embedded player. This will take out unscrutinized third party exes from your life.

Anyways, so far I've been able only to watch some of the channels and only at night when its 512kbps on th pipe. I haven't seen all the channels from around the countries yet, and I don't intend to. Almost 90% of them are religious propaganda bullshit. There are only a handfull of great learning channels and music video channels, almost no smut or soap channels AFAIK, and quite a few home shopping channels, news channels, traffic cam feeds, senatorial meeting videos, etc. And most of channels are from the US. The following english channels (from the US) are in my favourites playlist: NASA TV, Strawberry TV, Research Channel and UW TV (University of Washington TV). Here's a small review of my experience in these channels:

  • In NASA TV, I got to see a never-before-seen (by me) footage of a launch and of the last moon-walk.There was also an in-depth program on auroras, which was as much interesting as it was useless to me.
  • On Strawberry TV (I know), I had an arm-chair-travel to Natchitoches, Louisiana with a native tour-guide giving commentries on the various building and landmarks as we cruised the streets of the state. Another place was Natchez, Mississippi, though it wasn't as interesting as the Louisiana one. I've never quite gotten round to read who the so-called Confederates were all about, so it was nice when there was a short interview with American civil war researchers was on.
  • On Research channel, I saw a meeting of podcast gurus talking about, well, podcasts. There was also a face-to-face with a wearable computer manufacturer (I believe). But most of the time there was only biology related talk.
  • UWTV is my favourite so far. There were quite a few professional presentations on various tech topics. One was User Interface for the future Information Worker by a Microsoft research lady, and another was on Security framework in Applications (IIRC) by Microsoft's Cheif Security Strategist.

As you can see, I was excited with what I saw on the channels. It was a welcome change considering I had stopped watching TV since the stupid cable situation started and I lost all the quality channels. Sure I watch the TV programs I miss, movies and other videos via BT, but that's another story :)

If my rants have lured you into downloading the exe, I would recommend you search for other programs. I found one other program that was waay better than tv.exe. It's called Online TV Player and it's supposed to have 850+ channels and 1000+ radio channels by default, although I suspect they count the high and low bandwidth stream of the same channel as two channels. Well atleast this program HAS the high and low bandwidth options of the same channel unlike the tv.exe thing, so I guess it works out OK. And, BTW, if you are wondering about the title, Boob Tube = Goggle Box = TV ;)

Thursday, March 09, 2006

How hard could it be?

Imagine that you have a 18px wide by 1px high tileable gradient png/gif. You also have a horizontally centered div holding your content. You want to tile the 1px high image along the vertical length on both sides of your div. I found myself in exactly such a situation only a few days ago. I could've used a large tile, say like a 6000 px by 1 px image and tiled it in the body's background, like how gamespot.com did it. But, my gradient is double-edged. Meaning, the 18px gradient goes from completely non-transparent around middle to 100% transparent in the left and the right ends. This is done so that I can overlap one part of the gradient over the content while the other part hangs outside the content. The final effect is shown farther below. Come back up after you've seen it.

For those who didn't get the few words above, here's a thousand words of the same:
The 'double-edged' gradient, enlarged.

The image is scaled 1000 times proportionally. So if you want to use them, just scale them down and use it. The center is around 10px. This is the left-side shadow. For the right side one, just flip it horizontally. You then need to find a way to tile the image vertically along and over both sides of your content. For this, I used floated divs. It had to be a div as I had swore to keep tables out of my XHTML life. So, I added two floated divs with IDs "shadow-left" and "shadow-right". Here are the HTML structure and the css:


<body>
<div id="main">
<div id="shadow-left"></div>
<div id="header1"></div>
<div id="menu"></div>
<div id="content">
<hr id="footer" />
<div id="shadow-right"></div>
<hr class="clear" />
</div>
</body>
The HTML structure



#shadow-left {
margin: 0 auto 0 -9px;
position:absolute;
min-height:100%;
height:100%;
left:5%;
top:0px;
width:18px;
background:url(shadow-left.png) repeat-y;
}


#shadow-right {
margin: 0 -9px 0 auto;
position:absolute;
height:100%;
min-height:100%;
right:5%;
top:0px;
width:18px;
background:url(shadow-right.png) repeat-y;
}

/* \*/

* html #shadow-left {
display: none;
}

* html #shadow-right {
display: none;
}

/* */

My sloppy CSS



You might've noticed from the last few lines that I had decided to hide the neat transparent gradient thing from Internet Explorer. This is because among the web image formats, only in png can a pixel have a 24bit color value as well as an 8bit alpha value. Gif do support alpha value, but in gif a pixel is either 100% transparent or not. This is not the only place I had to account for IE's ignorance. IE has to be constantly kept from it's own ignorance, missing features, incomplete standards conformance, buggy implementation and other asprin-sellers. If ever I get hold of the neck of the person responsible for CSS implementation in IE 5 (or 5.5, 6.0, 5.5 for mac), I won't hesitate to close my hand. CSS is a very easy and neat language to learn and code. But IE takes all the fun and intuitiveness out of it. How hard could it be to read the CSS specification and implement it? That's such a monky job, or a no-brainer. Suddenly, though I never liked them, all those 'Promote Firefox' and 'Promote Opera' campaigns seem to make sense from a developer perspective. Of course, all browser implementations have bugs. Richinstyle.com lists all bugs. But I don't care as long as I don't notice them.

Switching to the thousand words mode, here's a lame website with no gradients attached:
A lame page with no gradients

...and here's the same lame page with glitzy gradients attached:
The lame page with extra fancy gradients

So, the above CSS + XHTML combination will work as promised and you get a gradient the height of the page. Or do you? What you get is a gradient that extends only to the height of the viewport/browser window. Meaning, if your page has a vertical scrollbar, then scrolling down will reveal that the newly uncovered portion was not covered by the gradient. What trick is this? Actually, it seems that it is the specification.

While searching around, I found that if you set the heights of all the parent elements (here, they are #main, #body, #html), then your gradient will have a hight equal to the height of the entire page. It didn't work for me and worse, making #main's "height:100%" messed up the already messed up display in IE still more. So I went into hack mode and used javascript to do a little trick. Here's the simple javascript I conjured up:


<script type="text/javascript">
<!--
function doOnScroll()
{
document.getElementById('shadow-right').style.top = window.scrollY + "px";
document.getElementById('shadow-left').style.top = window.scrollY + "px";
}

window.onscroll = doOnScroll;
//-->
</script>
The javascript hack



Javascript allows you to hook onto the onscroll event. This is the event that happens everytime you scroll down/up/left/right. So I just shift the gradient div's 'top' value to the scrolled value of the window. This trick, of course, requires your visitor to have javascript enabled and have Mozilla Firefox. There will be a very small and, hopefully, unobstrusive flicker near the divs as the divs gets realigned. I myself want to use some other trick for my site as, as google analytics points out, more than 78% of the visitors browse my site on IE. I remeber those <table> times when webpages had the "Viewed best in IE" in their footers. With the <div> times, the tables (pardon the pun) might've been turned.

[Edit]
Here's a spot of trouble I ran into. Though I was smart enough to hide the translucent gradient flanges from IE, I forgot to turn off the javascript that moved the gradients as the user scrolled the webpage. It is necessary to hide the javascript too from Internet Explorer as otherwise a script error occurs for every tick the scroll bar scrolls, which is pretty lame. So here's the same javascript hack as above, but only nicely wrapped inside a IE proofed if block:


<script type="text/javascript">
<!--
if (navigator.userAgent.toLowerCase().indexOf('msie') == -1)
{
function doOnScroll()
{
document.getElementById('shadow-right').style.top = window.scrollY + "px";
document.getElementById('shadow-left').style.top = window.scrollY + "px";
}

window.onscroll = doOnScroll;
}
//-->
</script>
The javascript hack



What I had done is pretty simple. Every browser has a userAgent property that contains everything that the browser has to say for itself, including it's version, name, operating system and maybe a few other stuff. I just check for the occurence of the string 'msie' in the userAgent property of the browser being rendered on, and if there be no such vile term in the user agent name, we get on with the trick show.
[/Edit]