<<Previous Archive | Next Archive>>

Postal - The Movie

Postal trailer on youtube just appeared.



assert( dynamic_cast<Siberia*>( Vienna ) != 0 );

Last weekend I had not much time to program stuff because I was assigned the task to carry boxes and furniture through the city of Vienna (german link). Hurra. At least I had some time to think about a nice way to write a software mixer. Unfortunately, the weather decided to remember the season named 'winter' which was completely missing until now and it started to snow heavily. Within several minutes, everything was white and although we were standing in Vienna, in the middle of the Altes AKH, it looked like we were in Siberia. But I was able to make some nice pictures to capture the snow:

So if you ever wondered how a tired thinking-of-software-mixer-implementations and snowily programmer looks like, now you know.



C++ vs. Java 1.6 - A fair Benchmark

For one of my small private projects, I wanted to know if I could implement the program in Java instead of C++. The only critical feature for this program was speed, so I needed to know how fast Java is today using the latest VM, compared to C++ using a modern optimizing compiler.
There are lots of tests and benchmarks available on the web, but usually I don't trust any statistics I did not fake myself. So I did my own benchmark with 3 simple real-world test cases and one additional academic test. The tests I found on the web have been mostly usesless, especially if you are programming games. These are the ones I used:
I tried to be very fair because I really needed realistic results to base my decision on. You can get the source code of my tests here to verify or review my tests here: benchmark.zip. If you like, extend it or use it for whatever you like.

The results
To make it short: As I expected C++ outperforms Java in every single test. But interestingly Java is getting closer now, here are my average results:

Java C++
Fibonacci 10767 ms 7468 ms
Heapsort 5454 ms 4344 ms
NestedLoops 8022 ms 3453 ms
CopyData 1204 ms 1125 ms

Details and Findings
Knowing a bit about the C++ and Java optimizers, I was also able to revert the results completely. For example although using equivalent Java and C++ code, I was able to make the C++ version take 16 seconds for the nested loops-test while Java only needed 1 second by adding some virtual method calls which I knew Java could optimize. I also was able to make the C++ version run in only 78 ms while the equivalent Java version needed even 10 seconds by only using static loops - the C++ optimizer then would not even loop anything and just add the values together. This is partially what some of the wrong benchmarks out there are doing - even if not intentional. If you take a look at the sourcecode of my benchmark, you'll also see that I only measured the actual calculations, I was not interested in the start up times at all. This would have been very unfair because java needs some more time to start up, and it doesn't matter at all if an end user program (especially game) needs some extra seconds in the beginning. That's also the reason I used the client and not the server java VM: No end user is using the server VM at all. Another detail was interesting: Java was running out of heap memory very fast. I even had to reduce the sizes of the arrays in the tests, Java wasn't even able to allocate two arrays of several million doubles. Of course this wasn't a problem on the C++ side at all.

My conclusion: Java is not as fast as C++ although asserted by several people. Simply as that. But with today's incredible hardware, nothing will prevent you from writing simple games with it, unless you are not trying to create a fast Software Rasterizer or similar.



Dear dispelled readers

Sometimes I am blogging about my political views, private ideas and other projects here next to my software projects. But recently, this blog has become a little bit too technical. People in my social environment started to complain that they didn't understand a word I was blogging about :) Realtime 3d graphics programming and software development isn't for everyone, and I forgot that I also have some of non-technical readers (Hello, you two or three! :) ). So I hope those readers are not gone for ever now, and I'm going to post more mixed content again. Which isn't that easy if you don't write very personal stuff at all and nothing about your daily job either, BTW.
Yay, so this was a non-technical entry already. So now I've some time before the next one, right?



Pope: Brutal computergames are sick

As I just read on mediabiz.de (german link) (didn't find another source for this), now even the pope basically says FPS games are evil. He obviously is choosing his words with caution, but as you can read in his statements he sounds a bit like the local politicans who obviously not really know about what games they are talking about:

"Jeder Trend, Programme - einschlie▀lich Filme und Videospiele - zu produzieren, die im Namen der Unterhaltung Gewalt verherrlichendes und asoziales Verhalten oder die Banalisierung menschlicher Sexualitńt darstellt, ist eine Perversion - umso absto▀ender, wenn diese Programme fŘr Kinder und Jugendliche gemacht werden"

He says the church could be an 'inspiring example' for those media. Ok, how about a game about the crusades? No - wait - better: the inquisition? Just a thought.



Hardware Ray Tracing Using Irrlicht

Sio2 posted some great Irrlicht Engine demos on his webpage. One of them shows up with hardware raytraced Irrlicht scenes: Sphere and light scene nodes animated by irrlicht animators raytraced on the GPU in realtime. Great stuff :)
The other ones are impressive as well: They show Irrlicht integrated with Newton Physics, Dynamic Water Reflections, a 3D mesh fader, a toon shader demo, a Doom model loader and - hey even an irrKlang demo! And all demos with source - useful for beginners. Very nice work (related forum post).
I think I should update irrlicht.sf.net a bit with all the demos and games people already created with Irrlicht again. With some of the old crappy screenshots up there it's understandable people believe Irrlicht is for beginners only.



Webpage fixed, Interesting list of game development libraries

The irrKlang and irrEdit webpages are repaired now, for IE6. I used the stand alone browser from evolt, worked just fine. Wow, and the download rate is increasing again since the fix, very interesting.
While surfing around, I found this game development libray and tool list. I'm not sure, but the blog strangely looks like spam for me. But the page makes sense and lists Irrlicht and irrKlang. Strange. BTW: would be cool if you could link my new free audio library. The more people are using it or asking questions and making suggestions about it, the better it might become :)



Of New and Dead Game Development Studios

SEK, german game development studio and developer of Paraworld and Wiggles seems to be dead now. Too bad.
But there are good news as well: After Rockstar Vienna did the same several months ago, some of their employees are rising from the dead again, as something like maybe neo Software 3.0, naming themselves "Games That Matter Productions". A pity that all this is nothing unusual, what we are observating here is the usual circle of life of game development. :)



Trying to debug IE6 without having IE6

People are reporting the download page of irrEdit and half of ambiera.com is blank/destroyed instead of showing its content properly in IE6. And I was wondering why the download stats are lower since the last website update :) (Thanks for reporting, btw!)
Unfortunately, Microsoft decided to remove IE6 when it forced people to update to IE7. None of the 4 PCs in my close vicinity still has IE6 installed. There are multiple ways to get a working IE6 again: The official, Microsoft way is to install VirtualPC with a whole WinXP and IE6 on it. Which means downloading 20 MB for the program and an 495.8 MB image file just to work around a rendering bug of IE6. Another option is to install the IE6 from evolt (a cool website btw, collecting ALL browsers which ever existed) or the similar solution from tredosoft, which I will do, if I'll find some time.



MEL is (nearly) dead, long live Python!

Because surprisingly many people are coming to this blog after they typed something like "MEL sucks!!!!!" into google, this may appear interesting for them: Autodesk is adding python as scripting language to Maya. Hurra! I won't think twice which scripting language to choose once I will write a Maya exporter or enhancement again :)



Starting with cross platform development again

Last weekend, I started to port irrKlang to Linux. But as I already wrote my freshly set up Ubuntu wasn't very usable. So I invested 4-5 hours to configure everything for my needs, installed drivers and needed software until I really liked it. I was a bit surprised that afterwards I didn't really mind if I was working in Windows or Linux.
My desktop now looks like this:


To summarize, only some very few installed software components made the difference between a comfortable environment and a crappy one: So I'm happy now again, time to start writing the Linux port.



Inbox worked off

Finally, worked off my inbox. I even scanned my spam folder and found several false positives from December. If you wrote a mail and I didn't answer until now, it probably ended up in the data nirvana. Please try again :)



To drop or not to drop?

Because people are already speculating about my sudden death, here is a short new blog entry. :) (There'll be a more interesting one tomorrow, I hope)

A frequently asked question I've received several times by mail now: Using irrklang's reference counted objects, when do I have to use drop() and when not?
The answer is very easy: Just as in Irrlicht, you only need to call drop() to an object if you received it by calling a method starting with 'create' or when creating it yourself via the C++ 'new'.
After you don't need the object anymore, just call drop() to let the reference counter handle the object descruction automaticly. There is one little single exception to this rule in irrKlang: If you recieved a pointer to an ISound interface, you always have to call drop() after you don't need it any more. Why?
ISound objects are the only public objects which are pushed and used between multiple threads, and you can never know if another thread already has deleted it in between. That's why ISound is also derived from IVirtualUnknown instead of IUnknown.
So maybe a more future prove rule would be: If you get a pointer to an object derived from IVirtualObject, always call drop() if you don't need it anymore. But don't despair: If you are still unsure, just don't call drop() temporarily. Nothing really bad will happen then, you will only waste some small amount of memory used for storing some file names and positions etc.
IrrKlang will still free huge and critical system resources itself in this situation automaticly behind the scenes. Going to add this to the FAQ soon.



Demonstrations in Austria

Just went home from work and to my surprise I came across a starting demonstration against our new government. The new austrian government just was officially announced this morning, and lots of people are angry already because the biggest party, SPÍ, is going to break their main pre-election promises, as I already wrote.

Demonstrators starting to gather
This street is usually full of cars, at this time

This morning, the new government even ordered about 1000 policemen to protect them from the "ready to use violence" demsonstrants. (Weicheier (=mollycoddles) if you ask me :) )

Vienna townhall near ÍVP
Not a big demo

I moved along a bit, to see if they blocked the SPÍ and ÍVP headquarters as well, but it didn't look like it. I shortly thought about staying and taking part in the demo, but I was too hungry and tired from work. Because it looked that nice, I took a picture of the Vienna townhall near the ÍVP headquarters at least. :)



OpenBC, Xing

Finally I've an Xing or OpenBC profile too, after people pushed me into that direction multiple times. Don't know if this one will last longer than my Orkut profile, this social network-thing is not for me, being used to work alone typing tons of cryptic words into the machines while sitting in dark rooms. :)



OpenBC, Xing

Finally I've an Xing or OpenBC profile too, after people pushed me into that direction multiple times. Don't know if this one will last longer than my Orkut profile, this social network-thing is not for me, being used to work alone typing tons of cryptic words into the machines while sitting in dark rooms. :)



Tip on how to reduce the size of GCC executables

Recently I was wondering about the huge size of the GCC executables which had a size of >200 KB for just printing out some text. As bubu rightly pointed out, this is just because of a statically linked runtime library.
At the weekend, I wrote some additional examples for the next release of irrKlang (to be released this week), and was able to reduce the size of the .exe files from about 250 KB to just 7 KB: I just removed the #include <iostream> statement and replaced the few calls to c++ streams with fprintf()'s and getch()'s.
update:the comment section in this entry is a bit destroyed somehow. TBD: repair.



Want to go to University in Austria? Do 120 hours social service a year.

Since nearly today, Austria has a new Government and Prime Minister. And surprise, surprise, after the elections and the negotiations are over, not much is left over from their pre-election promises. Best example: The main party who got most of the votes promised to abandon the tuition fees, and a lot of students voted for them because of that. And now, after they gained the power partially because of this, they are saying that if you don't want to pay tuition fees, you will have to do social services for 60 hours each semester. WTF!??
I've never heard of something stupid like that. What do they think we are? Idiots? Ok, they are right. We are idiots, we, the common vulgar stupid people voted for them.
I know some students who have a hard time paying their tuition fees although they are not that expensive today, working their ass off to get enough for living, books and the fees and have time to study at the same time. Those would have profited if the fees whould have been abandoned as they promised, and they really cannot afford working additional 60 hours twice a year for this. Totally absurd. Although they didn't even start governing the country it looks like they are already going to break several other pre-election promises. This is another perfect example on how politicans don't care about anything unless they can gain more power.
I'm quite angry now.



Gothic 3 finished in 53 minutes

Talking about Speedruns, here is another very interesting one published today: Someone finished Gothic 3 in 53 minutes (german link, videos). Impressive, especially because it is a RPG. I bought Oblivion instead of G3, so maybe a chance to see most of the G3 world :) But I guess someone will finish Oblivion quite fast as well, as someone finished its precedessor, Morrowind in about 7 minutes already.



VisualStudio / GCC compatibility

Because lots of people already were asking, I just tried out to use irrKlang with the GCC compiler. There are always two problems when trying to use C++ binaries together produced by both compilers: ABI and name mangling. Fortunately, because irrKlang is currently only exposing very simple pure virtual COM-like classes, the ABI is not a very big problem: When manually loading the createIrrKlangDevice()-method from irrKlang via LoadLibrary and GetProcAdress to circumvent the name mangling problem, you can use irrKlang 0.3 from GCC compiled programs, but this is very dangerous (I also only tried it out very shortly with a very simple example program) and still might lead to unexpected crashes.
So I recompiled the irrKlang source using GCC (surprisingly without the need to change much of the code) which I will upload in the next few days, for all the GCC users out there. Interesting is the huge difference in size of the binaries:

Even with size optimizations and stripped symbols, I don't know how GCC is able to produce that huge programs. Maybe some performance comparison would be interesting as well.



VisualStudio / GCC compatibility

Because lots of people already were asking, I just tried out to use irrKlang with the GCC compiler. There are always two problems when trying to use C++ binaries together produced by both compilers: ABI and name mangling. Fortunately, because irrKlang is currently only exposing very simple pure virtual COM-like classes, the ABI is not a very big problem: When manually loading the createIrrKlangDevice()-method from irrKlang via LoadLibrary and GetProcAdress to circumvent the name mangling problem, you can use irrKlang 0.3 from GCC compiled programs, but this is very dangerous (I also only tried it out very shortly with a very simple example program) and still might lead to unexpected crashes.
So I recompiled the irrKlang source using GCC (surprisingly without the need to change much of the code) which I will upload in the next few days, for all the GCC users out there. Interesting is the huge difference in size of the binaries:

Even with size optimizations and stripped symbols, I don't know how GCC is able to produce that huge programs. Maybe some performance comparison would be interesting as well.



D

Yay, D 1.0 (wikipedia) (looks like the official D page is down now) has been finished today. I know, there are a lot of new programming languages, but as far as I've seen, D may be worth a look, especially if you are a C++ prorammer like me. I'm trying to learn (or better: play around with) at least one new programming language per year, so maybe D would be a nice target for 2007. And it sounds promising: It tries to combine the power of modern languages like C# and it's slow brother and the performance of C and C++. It has a GC but you can use manual memory management via new and delete if wished, C libraries can be directly used, it has a fast compiler by design (there are two implementations already, DMD and GCC) and lots of this modern useful stuff like delegates, closures, static ifs, contracts, built-in threads, is expressions etc which I personally miss in C++. If you take a look at some example code, you can easily see that they really thought about the syntax when designing the language. I think I can live without multiple inheritance for most projects, but it hurts a bit. And first I thought that a systems programming language without a preprocessor is quite senseless, but then I learned that D provides a nice conditional compilation mechanism similar to C# which is ok for me. I hope I've some time to play around with it soon.



irrKlang 0.3 released

I'm back from holidays refreshed and relaxed, hello in the new year 2007. As I promised I'm going to continue with full speed now, and as kind of proof here is a new release of irrKlang, the free sound library: It features mp3 support (via plugin which comes with full source and which represents now my first LGPL software, including code from ffmpeg and Matt Campbell), a plugin system, various built-in rolloff models, 3D sound buffer support, two tutorials, debugger support, several bug fixes and more.
irrKlang now has so much features and is very stable so I thought about tagging this release with 'version 1.0', but maybe it's better to wait with this and make it available on other platforms first as well. Hope you like it and thanks for the overwhelming interest in that library.
I also reworked the website for irrKlang and irrEdit and made it resolution independent, hope it works with all browsers. If you discover any problems, please tell me.