Fallout 3

December 18th, 2008

I’ve been spending quite some time now playing Fallout 3, so I thought I’d drop some remarks about the game here.

A lot of people on the Tubes are complaining bitterly about Fallout 3: my guess is that it’s partly due to (a) the “hardcore” Fallout fans who will deride any sequel that isn’t exactly like Fallout 1 and 2, and (b) the fact that Bethesda made it, instantly fixating it as Morrowind/Oblivion With Guns in most people’s minds.

(As an aside, there was a particularly humorous Fallout 3 screenshot floating around a while ago, consisting of the starting cell of Oblivion with the Fallout 1/2 status bar tacked onto the bottom.)

I’ve been playing FO3 quite regularly the past few weeks, and while it has its problems, the game is really quite enjoyable. The quests don’t feel quite too Fed-Exy the way Morrowind and Oblivion’s were, and there’s plenty of interesting things to see in the Wasteland (wait, what?).

One problem I ran into which I cannot fathom is a throw-back from Oblivion, which entailed me falling into the inside of a boulder, forcing me to load from an earlier save. This has only happened once, fortunately. Why Bethesda didn’t bother fixing this problem is beyond me, though.

The hyped-up V.A.T.S. system isn’t all it’s cracked up to be, either. I perform head-shots more consistently shooting at single pixels than bothering to aim with V.A.T.S. Mostly I use V.A.T.S. in conjunction with my scoped .44 Magnum or sniper rifle to figure out exactly what the hell that little blob moving in the distance is.

Mostly, though, I’m ignoring the bulk of the more long-winded quests, including the main quest, settling for wandering the Wasteland, searching for Interesting Things To Look At and Fun Things To Shoot At.

Yeah, that’s about it for now.

Gears of War 2: Retrospect

December 17th, 2008

I finished Gears of War 2 last night with my girlfriend (we started playing the campaign in split-screen co-op mode a while ago). Now, having completed the game, I’m undecided as to which is actually the better game. Gears of War 2 is absolutely stunning visually, and the storyline is much more detailed and polished than its predecessor. On the other hand, the ending left me feeling vaguely disappointed. In Gears of War 1, taking down RAAM was ultimately a much more satisfying experience for me than its sequel’s ending, which basically consists of mowing down a horde of stock-standard Locust, culminating in you and Dom hijacking a Brumak and mowing down more Locust with the daft amount of firepower mounted on the beast. The final “boss battle” (and I surround that phrase in double quotes because it didn’t really feel like much of one) consists of you blasting the everliving shit out of the now-Lambent Brumak with the Hammer of Dawn. A couple of satellite beam blasts and you nuke Brumak, cutting to the ending cinematic.

Wait, what?

So yeah, while I did enjoy the game, the ending left me feeling a bit of a “okay, what’s next?” vibe.

Oh well, now to carry on with Fallout 3.

Google Reader

December 14th, 2008

I’ve been using RSS feeds to track updates for a few years now, and my reader of choice has been Liferea for most of that time. With the advent of me starting work, and not working on my laptop at the office, I moved over to Google Reader to share my feeds across all the computers I work on.

For some reason, I initially had an aversion to using Google Reader, probably because I wouldn’t have been able to read the summaries in any offline time I might have had. Now, though, that’s not so much of an issue anymore, since anywhere I have time to read feeds I have an Internet connection anyway.

Silly, really, because Google Reader is a top-notch feed-reading interface.

HP-UX SHM: initial results

December 2nd, 2008

This post is part two of my previous post, HP-UX, shared memory, and you.

I spent today implementing a shared library to override the C runtime library’s memory management routines: malloc, realloc and free, which passes the memory management requests along to the manager to allocate from the pool of shared memory. To test it, I wrote a small program that randomly performs allocations, reallocations, and deallocations for a set number of iterations to verify the correct operation of the shared library and the manager. For allocations and reallocations, the program also randomises the length of the memory block requested, with the upper limit to this random length set to 128MB. The results, surprisingly enough, showed that my shared memory implementation serviced the allocations significantly faster than using the base CRT methods. I’m not sure why this is yet.

With real world applications (i.e., standard UNIX programs such as ls and grep), however, my shared memory implementation falls behind the CRT. When I iron out the kinks left in the code tomorrow, I’ll be evaluating the performance of the shared memory implementation using the actual services on the development environment.

Friends With Benefits

December 1st, 2008

My girlfriend and I started playing Gears of War 2 in split-screen co-op mode yesterday, and 10 hours later (with one break for supper!) we’re 6 chapters away from completing the game.

All in all, Gears of War 2 is definitely a nice improvement on the first game, although some of the sections halfway through the game are a bit annoying, especially the Centaur driving section, which caused me a quite a bit of cussin’. Besides that, I’ll definitely have more memorable moments from this installment of Gears than the first game. Co-op mode is also a really cool way of playing the game, since you don’t have to deal with the sometimes idiotic computer player behaviour in your squad!

I still have to properly get into Fallout 3, since I’ve mostly been fucking around not really doing too much except exploring the Wasteland. I’m probably going to reload an earlier save and Do Things Properly.

Fable 2 screenshot

Fable 2 screenshot

The same applies for Fable 2, but in that game it’s actually a selling point that you can fuck around all you want! Such as murdering an entire village and feeling a warm, evil glow of satisfaction as your character’s appearance becomes oh so wonderfully demonic.

The Hero of Bowerstone? I prefer the title the Demon of Bowerstone, thank you very much!

HP-UX, shared memory, and you

December 1st, 2008

My current project at work involves doing some investigation into creating a daemon to allocate memory to processes using a pool of shared memory (SHM).

The reason for this is that the implementation of the C runtime (CRT) library’s memory management routines on HP-UX does not shrink the heap of a process. This effectively means that if you were to allocate a 512MB block of memory and then release that memory again, the operating system would still report your process as using 512MB of memory. Because of this, long-lived processes (such as services) that may use large amounts of memory to do processing at some point eventually dominate the memory usage of the system, even though they are actually using only a small part of this expanded heap on average. More specifically, the OS is basically reporting that there are 20 instances of a single service each using 1GB of RAM! Shared memory, on the other hand, obviously uses memory on the system, but since SHM isn’t tied to any specific process, it won’t cause the participating processes to display a huge amount of memory usage.

The other alternative is of course to change the way the service does processing, but this involves code changes in both the front and back-end parts of the software, so a shared memory allocator would be the path of least resistance in this case.

“But wait!”, you say, “Wouldn’t that involve changing the back-end code to make use of the new allocator anyway?” The answer to this is that, yes, it could, but there’s an easier option. The dynamic loader on UNIX uses a neat little environment variable called LD_PRELOAD which causes the shared libraries specified in it to be loaded before any other shared libraries. This allows you to easily override the CRT’s memory management routines, since yours get loaded first. This means that the amount of code that needs to be changed go from every memory allocation call to, effectively, none at all.

So we can have the manager allocate a big block of shared memory, and have the services communicate their requests for memory to the manager using UNIX domain sockets. The manager then attempts to service the request by reserving a block of shared memory for that process and passing the address back to the requesting process. The service can then map the shared memory segment into it’s own address space, use the memory for whatever it needs it for, and then tells the manager to release the memory again. Easy off bang!

Not quite, though.

HP-UX has support for both 32-bit and 64-bit operation. In 32-bit mode, the maximum size of a shared memory segment is 1GB, while in 64-bit mode, a shared memory segment may be up to 4TB in size. The systems we’re working on run a 64-bit kernel, so the maximum size of a segment isn’t the problem. The problem is that the processes themselves are 32-bit executables, and to understand why, I’ll need to talk about how HP-UX defines the memory space for a 32-bit executable.

32-bit mode implies a maximum addressable range of 232 bits, or 4GB of memory. In HP-UX, this 4GB virtual address space is divided into four quadrants of 1GB each. The first two quadrants are used for the process’ text and data segments. The third and fourth quadrants are used as a global shared memory space, with the final 250MB of the fourth quadrant being reserved for system I/O (my guess is that this is used for buffers when doing I/O operations). The global adjective means that any shared memory in the system will be (potentially) visible in any other process. Since shared memory does utilise access control when a process requests to map a segment into its address space, there aren’t any security concerns regarding that, though. What this does mean, though, is that the total amount of shared memory available in 32-bit processes is limited to 1.75GB. And by “32-bit processes” I mean all 32-bit processes currently running in the system.

Luckily, HP-UX has a feature known as memory windows. To use memory windows, the process to be executed is run using a wrapper called setmemwindow, which will execute the given command in a given memory window. The effect of this is that instead of the process having the normal 1GB global Quadrant 3, it receives a separate 1GB Quadrant 3 which is then shared by all processes belonging to the same memory window.

The idea I had is to use this feature by partitioning the services that require the shared memory pool into groups, and having them and their respective shared memory manager all belong to the same memory window. This frees up the global Q3 for other processes running on the system that might also use SHM, and allows multiple shared memory managers to execute in parallel with their own set of managed services.

The current status of my investigation, barring finding out about the above technical details, is that I’ve completed a basic manager process capable of reserving and releasing blocks of the shared memory segment to requesting processes, as well as a small test program that communicates requests to the manager. The next step is to write two programs that will perform random memory allocations, one using the SHM manager and another using the standard CRT, to get an idea of what the performance impact of the additional management layer will be.

Hopefully someone will find this useful, since I had to do quite a bit of Google-trawling to find out about all of this. If anyone wants a few of the references I used, feel free to leave a comment, and I’ll see if I can set you up.

Pay Day Has Come And Gone…

November 25th, 2008

…and I’ve joined the ranks of the white earbud elite.

Also, my order is in for Fallout 3, Gears of War 2 and Fable 2.

You can’t get your first real paycheck without blowing half of it in one fell swoop, now can you?

El Finito!

November 23rd, 2008

Five years later, I’m finally finished with my academic career. Friday was the day I went to Stellenbosch University for the last time as a student to give my year project’s presentation. It went exceedingly well: I received a mark of 85%. Coupled with the fact that I received high marks in the majority of my subjects, it means that I will be receiving my honours degree forged from pure, concentrated awesomeness next month.

I’ve spent the past weekend wondering what to do with myself now that I suddenly don’t have any other obligations to worry about anymore. Well, except work, but that’s for the week.

So right now, I’m just enjoying my first true free weekend, before I have to head back to the office tomorrow.

We out.

Identitron Assemble!

October 31st, 2008

Let’s make a long story short, and let’s just say that I lost my identity document recently.

Now, while we’re at it, we’ll make another long story short and say that I haven’t had time until today to go to the Department of Home Affairs and apply for a re-issue of my ID.

The spiffy thing is that I was in and out of the Somerset West DHA office in about half an hour. The other spiffy thing is is that the DHA now allows you to check up on the status of your request on their site. Neat.

Megatrader

October 16th, 2008
Megatrader Main Menu

Megatrader Main Menu

For the past week, when I haven’t been working, I’ve been spending a good deal of my free time developing a J2ME mobile game. The basic premise is Dope Wars in space, albeit with less drugs and more futuristic trade goods. The inset image is the main menu screen running in the WTK emulator. Right now, I’m more or less at the point where I can actually start on getting the game up and running, having spent the time thus far on getting all the support functionality down (such as drawing text using my custom fonts and being able to easily support different resolutions, since I’ll be targeting at least QVGA and QCIF+ displays).

Initially, the game will be fairly simple, featuring only simple trading: buy at planet A, travel to planet B and sell, rinse and repeat until the time limit is hit, with random price fluctuations as per the drug busts in Dope Wars. In the future, there are a couple of distinguishing features I want to add to the game, such as competing against computer-controlled traders and being able to buy different ships which affect their cargo space and travel speed, amongst other things.

Read the rest of this entry »