Thursday, October 29, 2009

New & Improved Memory Manager!

Here's something I was supposed to upload weeks ago - a better version of my memory manager (it would have been up sooner if ION wifi worked more often... I never remember this stuff when it does!) This one doesn't partition the available memory on startup - it dynamically sizes blocks, and provides the following replacements for the malloc.h functions:

qmalloc()
qfree()
qcalloc()
qrealloc()

Here is the source:


I've just used a volatile for locking so it's not threadsafe (read/write may get interleaved.) It should run basic applications without crashing though. See for yourself: Remove 'q' from the function names, compile it to a shared object and replace your system malloc.so on Linux. Alternatively, in your Bash profile you can set LD_PRELOAD to point to this shared object.

As for performance, this is faster than GCC's malloc for simple usecases.

On an unrelated note, if you're one of the unfortunates who have a PSP-2006 G (or any of the PSP 3000s), and want to play homebrew games, here are two useful links. The process has been tried successfully on two different PSPs. Tinkering with the PSP is risky so I'm glad Ishan (roomie) shared what he knew about it.

Sunday, October 25, 2009

Review of Skulltag Doom

I've always had a special place in my heart for Doom for many reasons. It introduced millions of gamers to the world of 3D graphics (Chex Quest and Ultima may have preceded it, but neither had an interface as simple and polished as Doom). It was the first action game to hook gamers to internet and LAN play.

But more than anything, I liked the Doom engine because it was a great introduction to what was happening behind the scenes of the game. The characters were simple sprites, the walls were tiled with textures, and all of it was replaceable by custom content. The world was built out of 2D areas called sectors which had a fixed floor and ceiling height. There were no sloped surfaces, no complicated graphical effects, and almost no physics to speak of. The lighting was sector based, and the graphics were rendered by raycasting (since the resolution was low enough for this to be practicable.) All of this made it a joy to download new user-made WADs, or even make a few yourself using simple tools like DoomBuilder. It was, truly, child's play.

So I always like to keep a copy of Doom on my HDD and play it the way some people play Solitaire or Minesweeper. Until recently, I was using the official Windows 95 port of the game. Open source Doom ports have existed for years, but I never saw a reason to switch. Until now.

Skulltag is a multiplayer oriented Doom source port based on GZDoom, and it's a pretty impressive package. Of course, the art is top notch - great level design, plus the new weapons and enemy sprites look great. It plays at a blistering pace, much faster than Quake III Arena (closer in fact, to Quake I.) But what really hooked me about Skulltag was the way they managed to combine the best features of all existing Doom source ports. Skulltag supports both software and OpenGL rendering modes, but remains true to the original game in spite of it's graphical and technical enhancements. For example, a filtering mode is included that smoothens the pixelated graphics without blurring sprites completely. I've tried Zdoom before, and I noticed that hardware accelerated graphics looked significantly better on Skulltag. But it's not just that. Skulltag allows you to play Doom in all it's 2.5D glory while adding amazing touches like dynamic lighting, fake radiosity lighting, transparent surfaces, jump/crouch and the option for Quake style mouselook.

All this new technology is used to great effect. The first time you see a Cacodemon fire a purple, luminescent orb of plasma at you in a dark hallway, or step into a pool of glowing lava, or watch an Archvile resurrect an imp it *just* killed, you WILL pause the game to admire how good it all looks. The outrageous game design elements (pentagrams and baphomets!) that we miss terribly in modern "realistic" games are only accentuated by the new graphical touches.

Not all the improvements are superficial. The netcode is borrowed from csDoom, and supports 32 players as opposed to the 4 that Doom could support in the old days. In addition, Skulltag provides a number of new game modes like Invasion, Capture The Flag, and the titular Skulltag mode. All of these are backed up by well designed and balanced maps. It also has bots, and they offer an adequate challenge. Creating and joining servers is handled by the bundled IDESE application. It's quite easy to use but not exactly feature rich. As a server admin you may want something more sophisticated, like IDE. Skulltag's internal server browser is not as reliable, and it simply didn't work on Windows 7. Stick with IDESE for now.

If you want to take a trip back in time, or just have a LAN party with a bunch of friends, you can't go wrong with Skulltag. It's fast, it's fresh and it's faithful to the original. So go get it now!