Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Sunday, December 21, 2008

The age of beauty

Some final results of my computer graphics project. I implemented a graphics rasterizer, which is the implementation one would follow if you wanted hardware-accelerated graphics on today's GPU's, which have pipelines dedicated to vertex transformations. The other option was a raytracer, which is not (yet) suitable for real-time applications due to calculation complexity.

2 light sources, diffuse (gouraud) shading, phong (interpolated), 5000ish polygons. First without, then with bump mapping. Thanks a lot to this Nvidia Developer's Zone paper about Perlin Noise.

Implemented in Java from scratch, I'll drop the source code online soon.



Saturday, November 1, 2008

Venus, dinosaurs and tablecloths

For my course in Computer Graphics, we had to implement the two basic algorithms in CG: Ray Tracing (using physics theory of viewing and lighting rays to evaluate the color of each pixel) and Rasterization (slap all triangles down to the screen using Matrix transformations).

It can be frustrating at times - one small error can have disastrous consequences, but that's more of a general problem when I code. We got some example objects to render, and I must say the results are great. It's pretty incredible that with these - relatively simple - algorithms, one can render quite a realistic (geometry-wise) image of an object.

Saturday, August 9, 2008

Flox

A project I saw scrolling by on #thepiratebay.org on Efnet caught my attention a couple of weeks ago. Flox is an enhancement on several existing traditional P2P techniques.

"Flox is a technique in development which will identify the same parts from similar files and download those when needed. This will certainly increase speed, for slightly different files. This will also make the technique to strip off metadata from media files obsolete, since Flox will do it universally for ALL sorts of files, whether they have ID3 tags, ApeTags, or something completely new."

The current development draft contains some very interesting stuff about palindrome pattern file splitting and hashing. I'll surely get my hands on this when I have the time.

Monday, August 4, 2008

Unfinished Robbery

Hoping to see them this wednesday at the Lokerse Feesten (update: I missed them, bummer !), I thought this was the right time to release a remix I've been wrestling with during the last months. Danny The Dog (international title: Unleashed) was a mediocre thriller by Luc Besson (Taxi, The Fifth Element, ...), but the soundtrack was composed by Massive Attack. For me, the title track really stood out.

I tried to add a subtle dubby feel to it, by overlooping the beats two or three times (it's random), much like Portishead did in its recent single, Machine Gun. I also played around a lot with the echo/cutoff on the parts without drums.

I overlooped the piano synths by accident, but never corrected my mistake because I thought it sounded quite nice. There's clipping and misplaced frames all over the place, including the odd vinyl crack here and there.

Download

I'll probably never finish this, so I'd better get it out the door. Most of the reverb/pitch effects and rough cutting were done using Audacity, with some additional drumkit programming in Hydrogen and strings generation by the ZynAddSubFX Synthesizer. Those are all free, open source applications.

Saturday, July 19, 2008

Men write code from Mars ...

and Women Write More Helpful Code from Venus, quoting the Wall Street Journal.

Women are more touchy-feely and considerate of those who will use the code later, she says. They’ll intersperse their code–those strings of instructions that result in nifty applications and programs–with helpful comments and directions, explaining why they wrote the lines the way they did and exactly how they did it.


So it is true. Javadoc was invented by a woman, because all Sun (planetary pun intended) guys were too stubborn to ask eachother for directions. If it wasn't for women, we'd all be writing unindented lines of assembly. Bless them and their coding skills !

Friday, July 18, 2008

PmWiki

One of my activities these months is setting up a community-oriented wiki for the improvisational theater group Preparee (which I'll be captaining next academic year. Oh, the suspense !). I went for the PmWiki distribution, developed by Patrick Michaud. Since quite a lot of customization went into converting the base installation to a user-oriented / CMS-like system I thought I'd better share some of the tricks and snippets I've been writing.

Always check the PmWiki cookbook before you start hacking away yourself: there are tons of available recipes which might already offer the functionality you wish.

Installation is a piece of cake, it's a matter of unpacking the source files and making the right directories writable by the webserver process (by using chmod on the wiki.d directory). I installed pmwiki on a Linux box. All the further customization is done in the local/config.php file, in separate skins or on the wiki pages themselves. Make sure not to touch the files that came with the core distribution (scripts, default skin ...), it makes upgrading a lot easier. I learned it the hard way :)

Users

The first part consisted of converting the wiki into a private one with several accounts which had different permissions. Setting the site-wide privacy settings (which can be finetuned per page or group by using ?action=attr in the URL) is done in the config.php file:

$DefaultPasswords['read'] = 'id:*';
$DefaultPasswords['edit'] = 'id:*';

This only allows logged-in users to read and edit pages. The site-wide admin password is bound to one account name (mine, in this case), but can be bound to a group too.

The accounts themselves can be defined in the SiteAdmin/Authuser page, in the config file, ... I soon realised that this was cumbersome, since I had to create all of the accounts by hand. By moving the accounts to a .htpasswd file and the group definitions to a .htgroup file I was able to automate the registration process :

  • Install the excellent htpasswdform recipe. It shows regular users a change password form, unregistered users a new user form and admin users a group/user management tool. Prevent account spam by installing the Captcha recipe too.
  • New users get added to a unchecked group. They get restricted privileges. Authorizing them is simply transferring them to the users group. This allows admin to check user accounts first.
  • The next part is letting pages display different links for each group. This is done by adding some custom Conditional Markup to the config file: $Conditions['authgroup'] = '$GLOBALS["AuthList"][$condparm] > 0';
    This allows you to check a current users group by using (:if authgroup=groupname:) and thus showing different content. I managed to write a quite complicated sidebar / AuthForm chock-full of checks. Dirty, but it works wonderfully well. Other interesting checks: (:if enabled AuthId:) (:if auth admin:) (:if auth read:)
Usability

The next step was to add functionality. It's pretty easy to edit the standard edit-form GUI buttons:

$GUIButtons ['textred'] = array($ArrayCount++, '%25red%25', '%25%25', '$[Red Text]','$GUIButtonDirUrlFmt/hightextred.gif"$[Red Text]"');

Adds an extra button which allows the user to color text. Check this page for more info.

Another thing I wrote was a simple shoutbox using Fox forms. This allows people, just by using standard button interaction, to post content to a page (in this case: a shoutbox). I wrote several fox scripts to allow users with no wiki knowledge whatsoever to perform basic tasks (shoutbox, adding themselves to an event, ...) by just using buttons and standard forms. It doesn't always result in pretty code, though ...

Shoutbox

I submitted this to the PmWiki cookbook. You can find the code here. This block was implemented as a page in a permanent div block I added to my custom skin. It's pretty straightforward from there. Don't forget: do not edit the default pmwiki skin, it will get replaced by a new version on the next upgrade.

Event attending/not attending list

This one's a bit uglier:

%comment% Start enroll/disroll code '''Attending''' %comment% enrolllist '''Not attending''' %comment% disrolllist (:fox enroll:) (:foxreplace template=Site.EnrollRemove target={$FullName} put=all mark="* [[Profiles/{$$author}]]" foxsuccess='[[<<]]' foxfailure='[[<<]]':) (:foxadd template=Site.EnrollAdd target='{$FullName}' put=below mark=enrolllist foxsuccess='Attending!' foxfailure='Probleem !':) (:input hidden author value='{$Author}' :) (:input hidden csum value='is attending':) %center%(:input submit post 'Im attending':) (:foxend enroll:) (:fox disroll:) (:foxreplace template=Site.EnrollRemove target='{$FullName}' put=all mark="* [[Profiles/{$$author}]]" foxsuccess='[[<<]]' foxfailure='[[<<]]':) (:foxadd template=Site.EnrollAdd target='{$FullName}' put=below mark=disrolllist foxsuccess='Not attending' foxfailure='Problem !':) (:input hidden author value='{$Author}' :) (:input hidden csum value='is not attending':) %center%(:input submit post 'Im not attending':) (:foxend disroll:) (:foxmessage enroll:)
(:foxmessage disroll:)

As you can see, both of the buttons are in a different fox form, each with two actions: replace the current occurences of the author name on the page, and add it to the right list. Disadvantage: you can't use more than one of these on the same page, only the first will get updated. Makes you wonder ... what if people were actually good enough to simply use the edit button and add their name ? :)

Tuesday, July 15, 2008

Voxel Trouble

Some interesting bits up at Google Code : it's my second Radiohead-related post this week, I know. For the recording of the House of Cards video clip they did not use any camera's. Yes, that's right. Instead, they used specialised hardware that can register 3D geometry at a very fast rate, and manipulated the information - not only in post-capture processing, though. You can see in the making-of video how they distort the 3D measurements by using reflective surfaces or water.

From a free-software point of view, this project is pretty interesting too: by using the Processing programming language and the data sets (a singing Thom Yorke and a lot of captured architecture) people can remix the video. It's no straightforward task, but if only I had the time, I'd give it a try ...

Saturday, May 3, 2008

Steamworks

Steamworks went live today. I've requested my API key, have you ?

On a lighter note, here are some interesting articles I've stumbled upon during the last few weeks. Cracked compiled a list of 7 commandments all video games should obey. (#3 is my favorite). Another - more serious - article was posted on Eurogamer by Rob Fahey, concerning the interactivity and freedom users get from the latest closed console systems. It really is an interesting viewpoint on how the gaming industry should evolve.

User-created content on the Internet, everything from YouTube to Flickr, from blogs to MySpace, from Flash games to MP3 mash-ups, is absorbing more and more time from the generation videogaming would like to have called its own. If this industry is going to sit back en masse and act as though encouraging a select few to put shareware-style games on consoles is enough of a response to this revolution, then gaming risks taking a serious blow - knocked off its perch, ironically, because the most interactive medium of all refused to let its audience interact.

Wednesday, April 9, 2008

Interview on ND

There's a small interview up on the independent gaming industry blog Pariah's Guild about the project I'm working on, Nuclear Dawn. It's an interesting read, although my lack of English vocabulary makes me sound like a five year old from time to time.
The blog itself has a bit of an amateur feel too it (lack of markup and image scaling), but you've got to start somewhere, and I'm in no position to criticize someone else's blog skills.

Tuesday, April 1, 2008

The long dark teatime of Dist-Upgrade

Every six months, it's that time again ... upgrading to the newest Ubuntu release. I don't know which department is in charge of the release branding, but with the label for release 8.04 (The year 2008, fourth month) they have outdone themselves: Hardy Heron. I really hope Mark Shuttleworth opens an Ubuntu Zoo out there in South Africa. Screw PETA, it would be horribly nice of him. The man's been into space, is there anything he can't afford ? A couple of drakes, fawns and herons would do the trick.

Back to the dist-upgrading then. The great thing about Unix is that all of your settings are stored in a central place: the Home folder (trademark). Backing up your system is a simple matter of backing up one directory. Even if it all goes bottoms up, it's just a matter of an hour (I/O wait time, mostly) to get your system back into the exact state it was.

After the obligatory reboot - yes, the only necessary reboot is when your kernel has changed - all seemed to work, except for a few Gnome panels. I'm 23 days early, the release is still in beta, so I was expecting some trouble either way.

Let's go quickly over the big changes in this release:

  • Firefox 3 beta: A huge improvement. The overall feel is a lot smoother, pages render blazingly fast, regardless of how many flash elements, poorly structured chunks of HTML or high-resolution pictures the page holds. The interface (and the download dialog) had a necessary cleanup, and the bookmarks system is a lot clearer now.
  • Gnome 2.22: Simple, yet elegant, Gnome remains my favorite desktop manager, although I'm going to check out the spectacular-looking KDE4 too. The most noticable improvement probably is the bundling of file transfer dialogs. When you're moving a lot of files between disks, the task bar used to get cluttered with "copying files" or "moving files" dialogs. Now, they are all bundled into one convenient dialog. It's a detail, but it sure makes a difference.
  • CFS (Completely Fair Scheduler): Since kernel 2.6.23, the standard Linux schedular has switched to CFS mode, which is an intelligent way of distributing processor time over several processes. It improves desktop reaction time, and makes the overall experience of working with GUI's feel smoother. You can read the (nerdy at first glance, extremely interesting at a second look) lengthy discussion Mr. Torvalds had with the other kernel developers here.
I'm very satisfied with the new release overall ! Also, very interesting for windows users: you can try out Ubuntu from within windows now, thanks to the new Wubi installation system !

(warning: next section is extremely boring if you don't have an Intel Proset Wireless chipset in your laptop, if any :) )

And now, on to the slightly bad news: this update bricked my wireless connectivity, partially. Since the 2.6.24 kernel version, ubuntu has switched from ipw3945 to ilw3945 as kernel module for Intel Proset Wireless interfaces. This new module seems to have several quirks, which hopefully will be ironed out before Hardy goes out of beta. Here's a couple of things you can do if you're experiencing troubles with given card:
  • Launchpad #204709: Solution for network interface wlan0 changing to wlan0_rename and useless activation of eth1 after performing an upgrade.
  • This thread offers a solution which is connected to a broken CAPA implementation, but that seems to be resolved in the latest Network-Manager updates.
  • Launchpad: #210005: My bugreport about the issue

Thursday, March 27, 2008

Level Designers wanted

Just a quick word to note that the Source Engine modification I'm working on, Nuclear Dawn, is looking for fresh level designers. If you've got a fair amount of experience with VHE and some kickass work to show, don't hesitate to apply !

Development has been a bit slow at Nuclear Dawn, but the mod is still on the public radar (we were mentioned in Moddb's Modcast Episode 3 last week), and we're trying our very best to get it out the door. The team consists of a fair amount of industry professionals, and they tend to have their precious time sucked up by other projects. The team leader, for example, is working on the very promising Battlefield: Heroes.

Check out the newspost for some new shiny media, too !

Update: the newspost was featured at:

Monday, February 11, 2008

Autoviewer XML Generator

For my webdesign activities, I sometimes use the great Autoviewer, which is a handy flash application to quickly display images in a slideshow fashion. Recently, I implemented this in a small website for a company.

They were going to add photo's every day, and don't know how to edit XML files to include the new pictures. I added a handy python script to generate an XML file based on all the images contained in a folder. All comments are left blank, so if you want comments on every picture, you still have to edit the XML. Alltogether, it's better than nothing. Enjoy, hope it's of good use somewhere.

Update Dec 30 2008:

This script seems to be very popular. Possible enhancements are proper image scaling using the python image library. Let me know if you have implemented this.

Tuesday, January 29, 2008

ModDB MOTY Results

The results are up !

Some surprises in there though. When it comes to indie games, there's a strong move towards the ID Tech 3 engine, which was GPL'ed recently. It's nice to see that because of ID's engines are OpenGL-based most of these new games run multi-platform.

In the unreleased mod section, mods based on Half-Life 2 traditionally perform well, but the next-gen technologies (Crysis engine, Unreal2k7) are gaining interest of developers.

Overall, it's been a great year for modding. Congratulations to all participating teams !

Thursday, January 24, 2008

ModDB Mod Of The Year Awards

In 4 days, the results of the ModDB 2007 Mod of the Year Contest are announced. These awards showcase the best game modifications and indie games of the last year. It's the first year I'm participating in the contest too, with my work on the mod Nuclear Dawn. After a first round, we received a nomination for the top100 mods, which then was showcased on the ModDB website and on AMD Game.

Nuclear Dawn is a total conversion mod in development for the Valve Source Engine (the engine powering the popular FPS Half-Life 2), aiming at fast-paced action in a post-nuclear world. Yes, although the theme might seem a bit generic, the artwork and attention to detail in the mod is pretty incredible. Most of the people working on the assets and maps are industry professionals, have a look at some of the more recent media releases:








I'm working on the Linux server build and some things for the HUD and in-game dialogs, and I have to say I have learned more than I could imagine working with this talented bunch. I don't think we stand a chance to win anything in the Most Promising category, where Black Mesa might win again.

When it comes to released Source mods this year, it's been a fan-tas-tic-u-lar year. A short overview of the ones I've tried:

  • Dystopia: After a solid U4, this mod still is the best Source mod in my book, although the player count has dropped lately. Lovely futuristic theme, top-quality polish (shiny body armor is sexy, period) and balanced maps.
  • Minerva: Hats off for mister Adam Foster. A one-man, three-episode single-player adventure with lovely writing and great puzzles. Valve: hire this man !
  • Sourceforts: One of the first mods making full use of the multiplayer physics which were enabled in one of the earlier SDK updates. It's fun to play, but has one major flaw: there always has to be an admin on the server to verify the built forts. I don't even want to think about the deep-space math involved to check this automagically, so no harm done.
  • Empires: The closest to Battlefield you can come. When you're playing this on a server with people who know what they're doing, it's fun. Otherwise you'll be running around desert environments for ages.
  • Pirates, Vikings and Knights II : It has all that is promised in the mod's name. Honestly, how could this fail ?
  • Zombie Master: One of the new mods that faced this year. Lovely idea, great programming for the overview mode, but somehow I'm getting tired of seeing the same City17 player models.
  • Fortress Forever: A very unlucky release date (very close to the release of Team Fortress 2, the "official" sequal to Team Fortress Classic) might have killed this mod. It's fun to play, has all the polish it needs, but the playercount never peaks. Also, the absence of the quintessential Fortress classic 2fort in the release only makes me think this was rushed out.
  • Insurgency: Somehow the first release (beta 1) ruined it for me. I don't have any problem with full-realism mods, but the complete lack of objective waypointing or a map makes the learning curve very steep. Also, for no apparent reason, this mod has severe performance problems on my box.
I wish the best of luck to all participating mod teams, let's make 2008 even better !

Monday, January 14, 2008

Never leave the chair

In my never-ending quest to make life even lazier than it is, I decided to fiddle around a bit with my Bluetooth-enabled phone. I have a Nokia 6600, which only downside I've found so far is it's clunky size and weight. Then again, the weight has its upsides too. Within a 10-yard radius, I'm deadly with this phone.

Back to the Bluetooth-goodness then. Although it was hyped up by the telecom sector around the year 2000, it's most common use field today is still in the business section. You've seen them, those fancy headsets. Have a look at the advert on the left. It's hard to neglect the pure joy of wearing a headset, even when you're a businesswoman with curly hair. Most people have Bluetooth-enabled phones nowadays, but don't realize the tremendous fun and excitement it brings.

For instance, I was at a concert once, and a guy in front of me was trying to capture the whole experience using his cell phone. I fail to see how much joy he would have afterwards when watching the blurry VGA 30-second clip, bundled with the sound equivalent of farts in a box, but hey, who am I to judge. He was, however, blocking my view with the desperate cell-phone waving.

So I flipped out my mobile, scanned for Bluetooth devices, and found his gadget. When I sent him the Bluetooth connection invitation, the video recording application on his phone quit. He spent the next 10 minutes figuring out what the hell happened, and I was the concert hero. Well, not exactly, at least I could see the stage again.

Today, I managed to control my Linux music player using my cell phone. Using Remuco, an open-source server/client(java) bundle, I'm now capable of switching tracks, changing the volume and rating tracks, all without leaving the chair.

And that, my friends, is holy.