19th February 2008, 04:24 am

I hunted down some textures from the original Wolfenstein 3D and put them to work. This allows me to test animated sprites without having to muck around with creating the sprites myself. It was pretty trivial to add in the basic soldier from Wolf3D and have him walk around the map. Currently only the walk animation is used but I will be adding in the “hit” state and the “dead” state as well. Also available is the “shoot” state which will be added a little later.
I also have all the stationary object sprites ready to go. I just need to add them to the Bunnies web-site. This will allow levels to be a bit more decorated.
Eventually more advanced levels in Bunnies will have enemies shooting at you, you’ll have health and maybe even a variety of weapons. I’m not sure when the next release of Bunnies will be. The current public release only supports Bunny and Player objects. Bunnies should run even if non-supported objects are in the map. They will just be ignored.
It’s starting to look like a real game.
16th February 2008, 04:32 am
using System.Net;
…
WebClient wc = new WebClient();
…
if(!File.Exists(root + “/” + tile_info[2]))
wc.DownloadFile(”http://…/index.php?action=view&t=tile&hash=” + tile_info[3] + “&full=1″,
root + “/” + tile_info[2]);
Seriously, that’s all the C# it took to add automated tile downloads. The bunnies server was modified to include the MD5 hash of the tile to the texture list. The bunnies web-site was modified so that the hash can be used to download the whole tile file. Previously you could only get a small thumbnail using the hash.
So now, when it goes through the list of textures that the server told it to load, it sees if the file exists and if it doesn’t, it downloads the tile from the web-site.
Of course that just leaves being able to browse your maps and the maps that are public. Then you’ll be able to change the settings file to use the map number you want, load up bunnies and auto download everything you need to play the map.
I found a handy dandy file downloader at http://schmidt.devlib.org/java/file-download.html for Java which I’ve now plugged in. The Java version will also now download any missing textures automatically.
Time to rethink the resources zip file. It will probably just be a static file now with the default sprite, font, background and status textures for the game.
16th February 2008, 03:10 am
Getting the Java version of Bunnies working with the modified game server was a breeze. I’ll be updating the Bunnies web-site to link to the current Java and C# releases which both include the complete source code. Eclipse is used for the Java version and Visual Studio Express is being used for the C# version.
The web-site will no longer support an off-line version of Bunnies. You must have a valid username and password for the Bunnies web-site in order to play the game. Instructions will also be posted on how to use the releases. There is a configuration file (INI for C# and Props for java) for each version that you will need to put your username and password into.
The web-site is going to need some adjustments. Currently you can only download resource files for your maps. That won’t do considering the demo map is my map. It hasn’t been a problem since all the tiles for the demo map are included with the downloads. I’ll be changing that around so maps can be public or private and you’ll be able to download the resource files for any map you have access to.
The on-line version automatically downloads all the map files for you.
C# provides the tools needed to download files from a web-site so it shouldn’t be too long before you can just run Bunnies C# and it will download everything it needs to play the level.
16th February 2008, 12:43 am
Bunnies C# now has sockets. Rather than having to download map files manually, Bunnies C# can now log into the bunnies server and download the map. Unlike Java, which is retarded, C# has a “byte” type which is an unsigned byte. Java only has “char” which is a signed byte. Also, unlike Java, C# does not try to interpret characters into unicode. When the server sends over a byte with value 30, C# gets a byte with the value 30.
One “gotcha” I found though is that if you add a byte to a string you get the numeric representation.
byte b = 50;
String s = “”;
s += b; // s = “50″
s = “”;
s += (char)b; //s = “2″
Since “2″ is the ASCII character 50. The final step in the “on-line” portion is to rip out all the unnecessary file loading code.
Because the C# version is slightly different than the Java version I will have to tweak the Java version to get it to work with the server. The Java version had some bad design choices that the C# version fixed. Depending on how much work that is, I may or may not fix the issue.
Hopefully this weekend I’ll get everything ready to go and Bunnies will officially be launched. Once the code is finalized then it will be finally time to put together a real map and improve the textures and sprites.
14th February 2008, 04:00 am

The C# version of bunnies now allows you to resize the window to whatever you want. It defaults to 320×240. You can also now apply a texture to the generated fonts. There are a few different methods. The method currently in use by the font class stretches the texture to fit each character. You can also repeat a texture across all the characters or stretch a single texture to fit across all the characters.
I could also add a method to color the font a solid color.
I’ve also added in the status bar which tells you how many bunnies are left and the amount of time. Bunnies bounce around and so do the beach balls. I should probably add some decay to the beachballs so the longer they bounce the lower and slower they go. There is no winning or losing yet or title screens. Those will be coming soon.
14th February 2008, 02:33 am
The idiots are at it again. Digg has a story about knuckledraggers starting up an “Imagine no Religion” campaign.
Lenin, Mao and Hilter murdered well over 100 million people trying to establish their government.
Millions were killed over slavery.
3 million people were killed in the crusades.
About 1 million people were killed in the inquisition.
1 person was killed from an abortion clinic bomber.
Gee, what could be the biggest source of problems in the world. Must be religion.
12th February 2008, 11:26 pm

Every language has a different way of rendering fonts. C# is no different. Graphics.MeasureString doesn’t measure the number of pixels wide and high a character actually renders. It takes into account other things which makes no sense whatsoever. It does however get the height of the character correct. So I had to use a method written by someone else to get a more accurate width using the MeasureCharacterRanges method. There is still quite a bit of space between characters although a lot less than using the MeasureString method alone.
The lights are now off by default. F12 turns them on. There is a huge speed improvement when the lights are off. I’ll look into optimizations later after I finish the C# clone of the Java version of Bunnies. I think the last things to do are to make the bunnies hop and add in title screens and the status bar.
12th February 2008, 02:54 am
Happens all the time in the midwest.
Of cables and conspiracies
The Economist examines the “cut cables conspiracy” and finds nothing amiss. 50 cables were broken last year. 5 in a week may be unusual but no sign of anything.
12th February 2008, 02:41 am
Now that McCain is very certainly the nominee for the Republican party there has been a non-stop high pitched whine from the far right (aka ultra-conservatives).
If you were to add up all the voters that really supported the democratic candidate and all the voters that really supported the republican candidate they would never ever ever add up to the total number of voters no matter who the candidates were.
Don’t even pretend that such a pair of candidates could theoretically exist.
I don’t want to see your stupid “nose plug” bumper stickers. Listening to these conservatives (oh and just wait until a democrat is chosen) act like it’s the end of the world is revolting.
The President is elected to represent all Americans. Not just one faction of them. If you have to hold your nose because some guy only agrees with you 70% of the time then you’re a selfish jerk. Other people live here, too. You should support him for agreeing with you on some things and respect him for allowing other people to get their way sometimes.
I’m sure that the whining will stop once the democrats figure out who they want and they go into strategery mode. But in the meantime, some of them really just need to be punched in the nose.
12th February 2008, 02:03 am

I finally got the time to add lights to Bunnies C#. They pretty much cut the framerate in half. If you want lights to cast shadows it’s significantly slower. I’ll probably add in a toggle key to turn lights on and off.
The next step is adding in a font class so I can render text.