Category Archives: Game Projects

Light Propagation Volumes

I've finally finished my lab course last week - thanks to my supervisor Matthäus G. Chajdas - you can read his blog here -, it wasn't your usual lab course with work sheets and boring homework, instead I've been allowed to implement a nice paper about a Global Illumination approximation algorithm called (Cascaded) Light Propagation Volumes. It's been developed by Crytek and you can find more information (including some presentations and videos) on their server. (Note: this is an implementation of the I3D paper, not the earlier SIGGRAPH one.)

Sponza scene (direct + indirect lighting w/ occlusion)

Sponza scene (only indirect lighting w/ occlusion)

Sponza scene (ony direct lighting)

Sponza scene (boosted indirect lighting w/ occlusion)

Sponza scene (boosted indirect lighting w/o occlusion)

The algorithm approximates global illumination by rendering the light into a reflective shadow map, injecting it into a volume (using a spherical harmonics representation) and propagates the light flux in this volume (hence the name of the algorithm) and taking into account occlusion as possible extension.

The whole algorithm is physically motivated but corners everywhere, of course, to be more efficient. The paper also contains a few errors and doesn't explain everything needed to implement it in great detail (like eg the solid angles of the side faces), so I've written two documents detailing the mistakes I've found and the additional calculations I've performed.

You can find the mistakes here (including suggested corrections) and the full annotations document here.

Finally I've also uploaded the whole prototype (including my code licensed under the FreeBSD license and the media files) here - it's 68 MB big (and it's been compressed with 7zip with a compression mode that might not be supported by WinZIP. The Sponza model is from Crytek, too. You can download the original model and textures here.
The project uses DirectX 10.1 and by default it won't run in DirectX 10, because it uses a texture format that is deprecated in D3D10 but supported again 10.1 (BGRA). See the comment by FatGarfield for the location that needs to be changed for it work in DX10, too. (However red and blue will be swapped then.)

I haven't implemented cascaded LPVs and I also use only one light/RSM and only inject its depth into the occlusion volume, but the results already look very nice in my opinion.

Stay tuned for more :-)
Cheers,
Andreas

Sploidz Revisited (Unofficially)

I've already written about the semi-conductor project and how I've written some Flash animations/applications for it. Of course, I'm more interested in making fun stuff´, so I decided to put my knowledge to good use and write a small game to see how difficult/awkward Flash actually is.

To sum it up, it is somewhat awkward, at least if you use the IDE itself. FlashDevelop still is as nice as ever, but you can quickly develop games nonetheless. I prefer Torque Game Builder though in retrospect.

Before I continue talking about the development itself, let's take a look at the actual game. Sploidz was the first game I wrote using Torque Game Builder for Joshua Dallman, and since I still had all the assets in my subversion repository, it was an easy decision to try and port this game. If you want to play it, you can download it for free here.
I haven't ported everything: I've just rewritten the main characteristic features that make up Sploidz's code in ActionScript.

Without further ado´ here is the game:

Click to open Sploidz in its own window

Because the art is still copyrighted and I haven't heard back from Joshua yet ´, I decided to create a free version that only uses "coder art" - in this hand-drawn coder art :-)

Some´ have said that this version looks cuter, decide for yourself:

Click to open SploidzCC in its own window

Below you'll find a description of the development and at least one helpful trick and most importantly a link to the source code of the "copyright-free" version.

Because the orginal version is way too difficult to be really fun, I actually sat down one more time and added code to make the platform slower if you're in danger of losing (up to 3 times slower):

Click to open SploidzMoreFun in its own window

Read more »

Edu2 Postmortem

I think I've been talking about Edu2 a lot already and I don't really feel like giving a huge overview again - probably I will end up doing so nonetheless. Edu2 is finished, over, done. I'm not going to touch it again - ever! That said, I think there are a few nice things and lots of bad things to say and tell about it. I usually paint bleak pictures and I won't stop here, because I try to be honest with the negative side of things.

I guess this is going to be a bigger postmortem because there are many different topics that I should mention to give the reader a fair impression.

To begin with, a few links first for those interested in Edu1 and Edu2:

Interesting fact: google for Edu2 and you'll find a project that is almost about the same things that we worked on - except it's 2D only.


Read more »

Edu2 is finally done o/

Edu2 is finally over (at least for me). I've uploaded a 99% final build - the only thing that is missing are correct credits, but I hope to receive them ASAP and then I'm really really really done with it. Which means lots of free space on my harddisk - the beast is over 2 GB bigs here...

On the other hand lots of new awesome projects are out there waiting for me to contribute and I've already joined two new projects (WoWar and SemuruC) and also finally have time to concentrate on another one (with the mysterious name "DasProjekt"). More news, links and information about them later.

First I have to come up with a Post Mortem for Edu2.
Cheers,
Black

PS: On different other news I hope that I have been able to convince the head of PR of EA Germany to use Nexuiz as FPS example game at one of their public discussion rounds. More on that later, too -hopefully!

Final Java Homework at uni.

This is the final Java homework in our Java introductory course at university. Enjoy :-)
Click here to play the game
Greetings,
Black

Edu2p Stuff

Finally, I've found some time to write a tiny post linking to a couple of pics of Edu2 (the prototype) - the project that has kept me busy for the last 3-4 months and burned me out pretty badly from what I can tell..

First a small animation that shows the terminal:

Working terminals in edu2

This was an awesome step in my opinion and it's really great to see it live (especially in a real level).

Nexuiz's Homepage in its (new) default menu

Res2k aka Frank Richter hacked that into Nexuiz's new menu (written by div0 - kudos to him for fixing/rewriting the broken piece of shit that my old menu was after all). It's pretty nice but of course Nexuiz doesn't support Gecko atm (and won't either in the near future due to potential security vulnerabilities), and that feature only existed in our branch for some time. I guess I'll add it back soon, too, because it was really useful.

Next comes Edu2's chat window which is really a big step forward because it uses client-side code and the menu to replace engine features (ie. the normal messagemode input line when you want to chat). This should be an example for more serious projects, too, because it was really easy and clean and it's really a lot more professional than the usual DarkPlaces Quake1 look.

The first version of the Edu2 chat window

Of course, it wasn't finished and still isn't fully, so I added a button to view a chat log of different sizes (apparently I don't have a screenshot of that and I'm too lazy to grab one so here it is without the varying chat log size feature):

Chat window with chat log

Next we spent some time adding model rendering support to the menu. Poor res2k spent a few days writing lots of code and doing many changes in a separate branch that got mostly thrown away by me later and/or rewritten due to bad management (that would be) but that prototype code was used as a base and was probably cleaner than the current result hiding in DP's codebase.

Anyway a nice first pic after the "hack":

Model rendering in the menu

And even with alpha-blending support - that required some "clever" thinking on my side - and maybe div0 will add that to Nexuiz at least because it was on his wish-list:

Alpha-Blending Support When Rendering Models

We also wanted to feature at least one mini-game (actually we wanted to design something proper but in the end it was our job again to do it and in the very end I volunteered due to having a similar task in my introductory computer science course at university). Guess the game:

The GameAnother Pic of The GameLast Pic of The Game at That stage

Guessed? Yeah pure, good, simple ol' MineSweeper!
It looks like that in its final version though:
The Game FinishedThe Game in Export Mode

Even div0 didn't think that such things (resizeable and moveable(!) windows and dynamic items) would be possible in his menu but I hacked that in pretty quickly and it's not even that big a hack to be honest :-) ).

In the mean-time res2k and I have worked on the player model in the game itself - res2k did the groundwork and it's a very good one to say this and when he was away for a weekend I simply added animation support from Zymotic and adapted it to our needs somewhat- res2k was a bit angry with me when he came back and found animations somewhat working already but I let him - I didn't really have any spare time either - finish the rest of course and he also added some code to allow taunts to be sent from clients to server which broadcasts it to all clients which does pretty awesome things using temporary entities in QuakeC - which I'm pretty proud of coming up with to be sincere.
Another big TODO which res2k worked on and which shall not go unmentioned here is all the gecko stuff - except for the dynamic texture code in DP and the first set of gecko builtins and wrappers, he created all of our Gecko backend - which is a free sourceforge project called OffscreenGecko - and even added support for JavaScript interaction with Darkplaces (the various VMs). A major task and because he's currently in the Amsterdam working on CrystalSpace and the like, it's up to me to kick some asses and use that in Edu2p for some new ueber-awesome features.

Anyway, what I've been working on lately is skin support in edu2p - thus another contribution to the playermodel code :P - and intergrating it with the menu plus allowing the users to select different models for the player's legs, torso and head. I think it looks pretty great with Quake3's models but sadly we can't use them and many of the free ones that can be found on ioquake3's homepage are incompatible and badly tagged (or rather Darkplaces has problems with them that Quake3 has not).

the menu with multi-part player selectionanother model mix

In-game another mix ingame

Now imagine that with more WoW-like models and you can see where Edu2(p) is heading. Sadly we have no player modeler right now, who could create such models and the modeler/animator we had that was capable of this was - I sadly have to conclude in retrospect - a complete jerk and arrogant retard - and yes that is mean and probably uncalled for in this public blog but I'm not naming him and I'm pretty pissed off that he still hasn't replied to 10 emails from me, hasn't done the work he was more than once politely asked to and agreed to, didn't give any feedback though we were more than willing to help and adjust requirements if needed and used way too many repeated exclamation and question marks for my taste in his emails and simply dropped of my radar. I'll still try to see if I can fix the models that we can use but there's a grim perspective to it with little more than two weeks till the final presentation.

Anyway this is it from me and stay tuned for a really final update on edu2p and more stories and rants and disclosures  - no NDA! \o/

Black

Nice Comparison of Free-Software Shooters

On http://www.linux-gamers.net/smartsection.item.81/comparison-of-free-software-shooters.html you can find a very nice comparison, which is pretty extensive and to my shame I have to admit that I haven't played many of them - I really ought to try War§ow soon.

Nexuiz gets a pretty good review (in your face, AlienArena :P ) but still note:

While most of the game is cleaned up far beyond its Quake 1 roots, it is still lacking in presentation with the menu being very circa 1990s.

/me sighs

I officially suck...

This Evening's Worklog

Today I've decided to work on BSS again - finally.

And I've even come up with a few neat bullet points to help me clean-up the codebase and I really feel like sharing them with the world today (although everybody can come up with them in a few minutes, too, but hey - now I can say that you've only copied my thoughts :-P ):

How to fix and clean-up stuff quickly:

What do I want?
  • remove unnecessary code
  • clean-up the design
  • untangle tight couplings

How do I do that???

Hack & Polish

  • look at a specific code section
  • rewrite it quickly while keeping the behavior the same
  • don't look at the overall design concepts - to KISS (to keep it simple STUPID)
  • as soon as the new code actually seems to work, go and polish it slightly (to make it readable again)

Repeat these steps a few times..

Now look at the "overall picture" and try to identify common patterns and remove duplicate code again by writing generic helper code - but this time keep it decoupled and make it less messy!

Rinse and repeat...

OK... sounds great? Yes, it does! And it even works to some degree. I've tried it this evening and although I - like always :-( - lose too much time browsing around and getting lost in the WWW, I still made some progress.

Here's my worklog as proof (and to annoy Joshua a bit ;-P):

18:32 starting to work on BSS's cleanup
19:20 removed some Sploidz-specific code from the items module
20:00 removed more files, tracked down Joshua's new coder (wtf didnt he tell me?!?) and found out that two files were missing in the SVN repository (added them from a backup that I have with me here)
20:30 changed bits of EventFSM and t2dFSM
21:00 reworking BlockItem
21:45 BlockItem now uses a FSM
22:45 BlockGame now is decoupled from Grid (gamelogic-wise) and BlockItem from BaseItem (the latter might be reverted later though)
23:00 trying to rewrite BlockGame's setupItem function again but deciding that it's pretty late

Enough for today. One more Dexter episode for me now (actually the first today) and then good night!

Good night,
Black

Blender2md5 Exporter

Update: I've (sadly) worked on it some more today and there's a new version online. You can find it on icculus again: http://svn.icculus.org/darkwar/trunk/base/scripts/Latest interface

For the past 4 days I've been working on and off on some changes to der_ton's blender2md5 exporter - big thanks to him for developing the exporter in the first place - and in doing so I've finally learnt Python, which is an awesome scripting language to say at least.

I haven't really changed much of the exporter's internal workings (only a few clean-ups here and there which hopefully didn't break it) because I mainly concentrated on GUI changes. fleeky, a nice circus fellow who is DarkWar's only active modeller at the moment, pestered me long enough to add support for exporting multiple animations from Blender to md5, that I finally gave in and started working.

Thank God, Python's tutorial page is excellent, too - especially 'Learn Python in 10 Minutes', which really does a very good job at showing you many language features very fast - which arguably isn't useful for total newbies but it gives a nice overview and invites you to play around.. and is really helpful when you start to code because you already know about some "advanced" language features early-on and can look them up when you think that they might help you solve a problem more elegantly (in contrast to not knowing about the features at all).

Another tip for Python beginners: get ActivePython and Komodo Edit (or even the IDE if you have the money and/or are a student and willing to go through their registration process, which I might if I'll happen to work more with Python). Both are free and will get you started with Python coding quickly. They really helped me a lot while learning and coding the new features.

Anyway, so what did I code? First let's take a look at the original exporter interface:Old blender2md5 Interface

My first changes were about adding a simple batch system that allows you to set the properties for one animation and mesh to export and then specify a batch file and append them to it. Then you can export all "jobs" from the specified batch file or directly specify it and export from it:

Interface with first change set

This was ok but it didn't feel that nice - since you'd have to manually edit the batch file if you wanted to change export properties, etc.

Today then I've decided to spend one last day on the project and rewrite most of the GUI:
it now displays all default buttons at the bottom and allows one to insert as many animations to export as one wishes. It displays the animations each with their own target filename, start and end frame and action dropdown menu in a table and now also exports all other settings to settings files (batch files don't really describe it correctly).
Even better I've added support for automatically saving the settings to Blender's .blend files which should really help automate exporting a lot.

Just open the scene file, open the plugin, hit export and you're done!

Right now I have disabled (commented out) exporting camera animations because they don't really fit anymore, but if there's a need for them, I'll put them back in).

And finally, here's the new interface:

New Blender2md5 Interface

Give a try. You can find the python script in Darkwar's repository: http://svn.icculus.org/darkwar/trunk/base/scripts/
Mirror for now: http://home.in.tum.de/~kirschan/blender2md5.py (out-dated but I'm leaving it in case icculus.org is down again and someone badly needs a mostly working exporter)

Either copy it into your Blender plugin directory or manually open it in Blender's text editor and run it with Alt/Meta-P.

Enjoy and Merry Christmas!

Alientrap Application Email

Funny, I've just found the original email (at least the text) that I've sent to Lee Vermeulen when I applied at Alientrap after I saw a screenshot of Nexdm something on flipcode - RIP :-(

Note that this dates back to: Saturday, 23. August 2003, 19:25:14

I'll just tell the truth :

I'm almost 16 years old and live in Germany, but I do understand matrices, etc.
I have 8 years of programming experience but only 2 in c/c++.
I just learnt OpenGL, so don't expect me to be a John Carmack.

Now let's get to the positive aspects.
I want to learn, learn, learn - so give me a problem and I'll work until I've got a solution.
Math is not a problem to me, I like it pretty much (especially when I finished calculating some formula).

I've got a adsl flatrate, so I can always search the internet for additional informations.

Perhaps I could be tester, or help finding bugs, etc., until I learnt more opengl and other programming technics.

Sincerely yours,
Andreas Kirsch

Also observe the cute mistakes - which I'm still making today, too >_>

But anyway, there were forty applicants and only three 'who survived the "look at the code and try to implement one of the features on the TODO list" test, out of 40+ applicants?' (LordHavoc in IRC). Two of them got jobs in the game industry shortly afterwards, so I was the only one left out of 40 applicants!

Well guys (the 37 of them), you clearly suck, because you didn't even try. I have tried and although LordHavoc pretty much dismissed all of my changes as useless or not committable, I still got onto the team and I honestly have never regretted it.

So always: try your best, even if it looks as if you're failing, because you're not the only one and your attempt already is a success compared to simply giving-up up-front!

Now enough of that, enjoy your weekend!
Greetings,
Black

PS: Always a nice read - http://www.thejonjones.com/2005/08/24/smart-people-are-dumb-failure-is-awesome/