Archive for June 2008

Wii (Not Really a) Sensor Bar

Joystiq.com has a story about using a couple candles to replace the “sensor” bar. It works because candles are hot and therefore emit infrared light.

I don’t know why they call it a sensor bar. Probably because “invisible light bar” would probably just confuse people more. All the bar contains is 10 infrared LEDs. I’m not sure why there are 10 of them. Only two sources of IR light are actually needed. If I had to guess it’s because the bar will last 10 times longer. Also, what are the odds of 9 LEDs being bad?

Fun with the Wii Remote

I finally picked up a cheap USB Bluetooth adapter for my computer.  If you havn’t seen this video yet, you should watch it. It’s headtracking using the Wii Remote.

I have a Wii and a couple remotes but I needed the Bluetooth adapter to be able to start playing with it. The Wii Remote is actually a bluetooth device and software has been developed so anyone can develop games using the various Wii controllers (even the balance board now). The next step is of course to start coming up with projects.

The Wii remote works by tracking infrared LEDs. I wonder how difficult it would be to create a webcam app that would track say your eyebrows or your eyes. Eyetracking software exists but the way it works is that the camera is put close to the eye. The Wii Bar that goes on top of the TV simply contains some infrared LEDs and the controller has a screen that filters out everything except the light from those LEDs. Tracking any two locations will allow you to calculate distance and rotations. If you could track eyebrows or the general location of the eyes you could accomplish the same 3D trick that is done in the video with just a webcam.

TopDuels Game Show

Top Duels now has a game show “Deal or Suck It, Banker” you can play to win (or lose) money.  You will need an account to play.  All accounts start off with 25 gold.  It costs at least 20 gold to play. You can double your money.  The amounts that are in each of the 23 cases is entirely random.  If you’re lucky you could have multiple cases equal to twice your wager.

To play simply type “.play <wager>” into the text entry box where <wager> is the amount you are wagering.  You will switch to game show mode where you can begin play.  Your initial offer will be at most $1 less than your wager.  So if the amounts in the cases are terrible you can take the offer and lose only $1.  If you leave without taking the offer (click on “DEAL”) or selecting all the cases you will lose your entire wager.

You then must pick one case at a time.  After each pick the offer will adjust based on the remaining amounts.  You can take the deal at any time.

MyDollarPlan.com features a simple equation that estimates the offer the banker will make on Deal or No Deal.  That equation is used in “Deal or Suck It, Banker.”  The equation calculates the average value your case holds.

In “Deal or No Deal” the banker can use that as a baseline and then adjust however they want.  Sometimes they offer more than the average, sometimes they offer less.

Chatter is now TopDuels.com

TopDuels.com has been through a number of incarnations and I’ve had it for less than a year. The latest incarnation is a graphical browser based MUD using the “chatter” engine.

The latest feature is that it is integrated with phpBB. The biggest issue with this I’ve found so far is the insistance of phpBB passing around a session id and using cookies. Maybe this was needed back in 1996 but PHP has this new invention called a session. Sessions have replaced cookies. Instead of putting data on the user side in a cookie, data is stored server side in a session. The only cookie that the client gets is a php session id. The forum session id is no longer passed around in the url. That makes the forum experience much better.

It took me a bit to switch phpBB over but now it is and it works great.

For those that also want to make the switch, just put a session_start() at the top of session.php and then where cookies are set add some code that will set the session value when the timestamp is greater than or equal to the current time and unset the
session value when the timestamp is less than the current time.

Don’t delete any cookie creating code.

The next step is to change the code so that sid, k, and u are grabbed from $_SESSION rather than $_GET and $_COOKIE.

And finally, change the append_sid function to not actually append the sid value to the url.

You could try to remove cookies entirely and get rid of append_sid all together but that’s a lot more work than needed. The biggest issue is getting SID into $_SESSION so that it doesn’t need to be in the URL and can be used elsewhere.

The Directory

I’ve decided to host The Directory again. This time the “adult” section redirects to the home page. Once the database is done being populated I’ll just delete the adult top link and the top links that have no content.

It was actually a pretty painless process to set up the site. I just had to download the latest RDF files from dmoz.org and get the PHP script that parses them and populates the initial database. It has bugs in it which is lame considering the latest version is three years old. They prevent the script from running but I was able to fix them easily enough.

The second problem is getting the actual link information. There is a table with basic information that is joined to another table based on the url. The problem is that the URL is a TEXT field which can’t have an index. This means it takes a very very very long time to get URL information. I did some quick queries and determined that only about 1000 of 4.5 million links had a URL longer than 255 characters. So I deleted all those URLs and changed the field to a 255 character VARCHAR and gave it an index.

The final step is to go through the structure and pull down all the information for each directory. That information is then serialized and stuffed into a simple table with the title MD5′d as the index. So when you visit a page, the directory you’re in is MD5′d and the information is pulled from the database in a single fast query. This avoids expensive joins for all the URLs since it’s already done.

What isn’t fast is populating that table. The entire directory should be up in about 3-4 hours. There are nearly 750,000 directories that have to be processed.

IcarusIndie.com Closing

After 7 years IcarusIndie.com is closing. Sometime last year Google decided to block AdSense from the domain because I hosted all of DMOZ (Open Directory) including the adult section. I’d been running DMOZ for years so that was pretty lame. That’s why DawnoftheGeeks.com came about. On July 24th 2008, IcarusIndie.com expires. There’s no point in renewing it.

There is no bandwidth fairy. While individual sites on DawnoftheGeeks.com may be ad free, ads are used on the domain to cover the costs of running all the sites. And since I have no interest in splitting ad revenue between Google and Yahoo I’ve decided to just let the domain go and focus on building up a new brand.

Chatter Battle Math

Most RPGs have around 6 stats that are mucked around with to determine whether or not you hit an enemy and how much damage to inflict. Years are spent researching how to balance those stats and how to come up with items that improve or hinder them fairly. You can purchase a huge book on the Dungeons and Dragons rules to learn all about it.

I don’t have time for that nonsense. Chatter (yes, it will get a real name eventually) is a casual RPG. The idea is to have a game where you can just chat with your friends or go out and defeat some enemies if you feel like it. So chatter has essentially two stats: health and strength. The lower your health the less damage you will inflict on a successful hit. The stronger you are compared to your opponent the more likely you are to hit them and do more damage.

On the flip side, the more you dominate your opponent in strength the less you will get for beating them. If your enemy is much stronger than you then if you beat them you get a bigger reward. The first release of the Chatter battle system will only allow you to battle NPCs. It’s turn based. You attack and then the enemy attacks. All battles are logged. If you abandon a fight the battle is labeled “fail” and that sort of thing will be available for others to see.

It’s all very slick but there is currently no math in place for rewards. Because the purpose of a game is to advance I’m thinking that the rewards will be some amount of gold and some amount of XP. Also to be determined are items that boost health and strength.

There will most likely be a shop of some sort where you can purchase items but I may also have them dropped around the Chatter universe.