Java, Can You Be Any Lamer?

October 23rd, 2007

I’m working on making Bunnies an on-line multiplayer game now. In the process I was implementing my messaging system which has one byte for the message type and two bytes for the data length. So data length is equal to byte[1] * 256 + byte[2]. This works on the server side which is written in PHP. This doesn’t work in Java which doesn’t understand unsigned values. For example one message has a length of 400 bytes. So byte[1] = 1 and byte[2] = 144 on the PHP side. When it comes across and Java reads it, it claims that byte[1] = 1 and byte[2] = 253. I have looked at the binary representation of those two numbers and cannot figure out any logical mathematical way to get from 144 to 253 just by manipulating bits.

To verify I’m not going crazy, I changed the length values to be mod 127 instead of 256. Lo and behold it works.


Java uses unicode as the default character set. So when you read in bytes they are converted to unicode values. To fix this you simply use

in = new BufferedReader(new InputStreamReader(conn.getInputStream(), “ISO-8859-1″));


September 14th, 2007

Duels is the hot new online RPG. MyDuels is the hot new site for checking out the latest Top 10 lists and for tracking your avatars’ progress. You can also view charts and graphs showing how well every player is doing. You can see how many wins and loses they have and other stats to help plan your attack.

Free Ringtone Heaven Updated

August 24th, 2007

Free Ringtone Heaven has finally been updated. Clicking on the ID of the ringtone will now take you to a page to enter your phone number and select your service provider to have the ringtone sent to your phone. Your phone number is not stored. You will not be spammed and you WILL NOT be subscribed to any service. There is NO COST to having the ringtone sent to you through our service outside the fees charged by your service provider.

This service is not compatible with all phone.

Suntasia Marketing Shut Down by Feds

August 16th, 2007

LARGO - The Federal Trade Commission Wednesday shut down a Bay area telemarketing company, claiming it was scamming consumers nationwide.

The FTC worked with the Largo Police Department and U.S. Postal Inspection Service, to close Suntasia Marketing Inc., 8751 Ulmerton Road.

The FTC alleges that over the past several years, Suntasia used at least 15 business names to defraud consumers across the country. The commission said it has collected and reviewed more than 5,000 formal consumer complaints against Suntasia that were submitted to various law enforcement agencies and the Better Business Bureau.


According to the FTC, many consumers disclosed their account numbers because they believed they were simply verifying information that the telemarketers already had. The FTC also alleges that consumers frequently thought their account number was being “verified” solely to confirm their eligibility to receive the free gifts, not to authorize any future charges to their accounts.

According to the FTC’s court documents, after consumers divulged their bank account number, the telemarketers began recording a “verification,” asking consumers to repeat the account number they had just “provided.”

At the end of the recording, Suntasia telemarketers quickly offered consumers two additional negative option programs, commonly referred to as “upsells.” The FTC alleges, however, that these “upsell” offers were presented in such a way that consumers did not realize they were being asked to authorize the purchase of additional products and services.

For additional information on suing telemarketing companies see

The Anonymous Mailer

July 4th, 2007

Today I decided to whip up The Anonymous Mailer. I run a proxy so I might as well provide e-mail as well. Just fill in who its from (or leave the default), who’s its for, the subject and your message and hit send. Fast and easy.

It’s the Silly Mistakes

June 29th, 2007

After looking at my shadow rendering code looking for ways to speed it up I discovered I had a rather silly bug in the code. In order to get out of the loop when a wall was hit I was setting the loop variable to less than the amount needed. I don’t know how this didn’t create an infinite loop or maybe it did but Java was smart enough to exit the loop.

I also lowered the accuracy to 8 pixels instead of 16. The maximum accuracy is 64 which would be pixel perfect. Another speed boost came from disallowing pixels with the color 0xFF000000 to be plotted. Instead they’re changed to 0xFF010101. For some bizzaro reason Java choaks on that pixel color.

The result is that without any non-global lighting, Bunnies now runs up to 40FPS on the test map instead of 30. Having lights that cast shadows is still expensive. I havn’t created particularly large or complicated maps yet so I don’t know how much different lighting will affect the framerate.

Bunnies Update

June 29th, 2007

One of the issues I was having was making the map editor easy to use. There are three layers of the map: floors, walls and ceilings and obviously they stack. The solution to the problem was having the tiles shift for the cell when the mouse is over it. That way you can easily see the tiles that make up that cell.

Also, since the ceiling hides everything and the walls hide the floor, it’s possible to hide one or more layers.

Also, I’m going to be getting rid of the word “tracks” and replacing it with “maps” because this tool is useful for any tile based game. Bunnies is a shooter and Bunny Racers will be a racing game. There’s no reason to pretend the tool is only good for one of them.

The next challenge is the object editor. I havn’t figured out exactly how I want to handle that one. Bunnies doesn’t really allow for much customizing when it comes to objects. That’s going to have to change. The first release of the Bunnies site will probably only allow for placing of objects. They’ll already be predefined. We’ll see though. It may turn out to be a very easy task to make it more customizable.

Intermission: File Store

June 26th, 2007

While working on Bunnies I was interrupted for a bit by a request to build a file sharing site. I took up the challenge and a week later here it is. File Store is a free and easy way to share your files. You can upload large files up to 256MB and e-mail links to friends so they can download them. You can also hotlink JPG and PNG files.

The site supports an unlimited number of harddrives so I can just add them as needed. While I stress test the site out, paid accounts are free. Just sign up and you’ll be given the resources of a paid account. One of the cool features of the site is a progress bar that tells you how far along your upload is. It uses PHPs recently completed plugin so it’s very accurate and doesn’t rely on silly hacks involving perl.

The site doesn’t look like much yet but that will be improved in the coming weeks. Right now the focus is on features.

The Bunnies are Coming

June 17th, 2007

In 1992 Wolfenstein 3D was released on an unsuspecting public.

Wolfenstein 3D

In 2006 Bunnies was born


With true color graphics, unlimited texture sizes. colored lighting with shadows, floor and ceilings, a Wolf3D clone has never looked so good.

Soon a web-site will be unleashed that will allow you to upload any number of graphics files and create custom levels. You’ll be able to easily download them to play and share them with your friends. The web-site is free and compatible with all the latest browsers.

Built with the power of Java you’ll be able to play Bunnies with any Java enabled device.

Java Hates 0xFF000000

June 14th, 2007

In my previous post I noted that Java seemed unsuitable for Bunnies since I was demanding more textures, etc. But behind the scenes I noticed something very odd. When I was on a large grassy patch in the middle of the track the framerate was fine. However, when I neared the large patch of pure black track tiles the framerate plummeted to around 2fps. Changing the tile from pure black to not black brought the framerate back up.

Bunnies now runs at 30fps at 320x240 with the following addition of code to the texture loading routine:

int k =0;
int m = textures[num].w * textures[num].h;
for(k = 0;k<m ;k++)
textures[num].pixels[k] = 0xFF010101;

That’s right, every pure black pixel is changed to not quite black and now Java is cruising along. Another side effect is that the mystery gaps between floor tiles has also disappeared.

Maybe there’s some logical explaination to this mystery but I havn’t figured it out yet. Silly me thinking black would be treated just like every other color. Apparently, Java thinks differently.