Wednesday, March 30, 2011

Ryan C. Gordon

a.k.a icculus is a name that Linux gamers will probably know. He's been responsible in porting games such as Quake 3, the Unreal Tournament series, ... well, you can just read about him here.

The Czech website made an interview with that guy recently, asking about his work porting software 'n stuff. Reading it gave me a little of my hope back I lost with the last post I made.
Luckily there's an English translation available:

I can't quite make out when that interview was held, but since the iPad is mentioned it can't be longer ago than a year.

On a side note, I'm thinking of reviving my dead twitter-account I never really used to follow a bunch of interesting channels (or however they're called in twitter).
Or perhaps a new one, if I can't remember my old twitter nick.

Thursday, March 17, 2011

Carmack on Direct3D

Direct3D supposedly better than OpenGL
Gallium3Ds D3D state tracker might make it easier to convince others to switch to my favorite platform: Linux

John Carmack is a very well known name in the gaming industry. He's co-funder of id Software, famous for the Quake and Doom series (where he was lead programmer), which is supported by the in-house produced id Tech engines, which themselves are also well known.

Carmack is also an advocate of free software. While not releasing it immediately (or before) the release of the software, after around 6 years passing he has taken care. Examples include the id Tech 3 engine and promises, that id Tech 4 will be open source somewhat soonish.
He also contributed to open source projects.

In the past, Carmack has complimented OpenGL as being superior to Direct3D, though the tides have turned.
I can't make a statement on my own, since I've only gotten my hands dirty with some basic OpenGL, but from what I hear and deducing via common sense it really seems that Direct3D and the related DirectX helper libraries have become the stronger competitor.
OpenGLs strong point is still that it's an open API, but if you look solely at the interface, Direct3D got ahead.

From what I gathered, OpenGL has been superior and faster, Direct3D had to catch up. When then OpenGL froze at 2.1, Direct3D could take a leap forward.
Major API changes, making the OpenGL interface easier, were promised for OpenGL 3, but after two years it turned out to be just another revision. The reason given was backwards compatibility and I believe this is what gave Direct3D another advantage.

Instead of leaving the backwards compatibility to using an old OpenGL version, the features were left and a deprication model was designed. Basically, the application will warn the developer of features that are getting removed and in the next revision they might not be present.
The though is very sensible of course, but IMO this is not a reason not to 'restart' OpenGL.

afaik Direct3D does not care that much about backwards compatibility. If you want to use old stuff, use an old version. Makes sense, really.
And now OpenGL is the one playing catch-up to Direct3D.

I wonder when the tides will turn again. I'm stubborn and will be staying on Linux. This will probably not make it easier to get a job when I finished university.
I'm not saying develop solely for Linux, I think the sensible route is to develop using open APIs and cross-platform code and libraries, only using platform-specific code where you need it or you gain reasonable benefits, while keeping code-switches (hidden behind a uniform interface) to target different platforms.

All the new AAA games (with exception of Rage if we're lucky) use Direct3D, which I believe is the main blocker for potential Linux portage.

Sure, the WinAPI is also a bigger deal, but apart from graphics, we've got left sound, input and filesystem I/O.
I don't think sound is a big deal, for the input you merely need to change to different functions to get the current key states and filesystem I/O also can't be that big of a deal. All if they were properly abstracted of course.

Of course the market is orientated to where they can get the most money out of, which Linux is certainly not.

The best I can do is try to promote Linux, but how do you convince the average Joe that free software is better than his software that 'just works'?
Saying you won't catch much viruses and your system won't get slower the longer you use it probably won't outweigh his software not running on Linux.
Wine is the best bet here, but it's certainly not an option for gamers. Gallium3Ds D3D state tracker might come in useful here. Let's hope they'll get somewhere!

Damn, that was a huge rant. I did not intend that. I actually just wanted to post that link:
Well, I added a tl;dr up there; if you read through till here, I hope you enjoyed it!

Thursday, March 3, 2011


It's time to update my blog and LLVM is the only thing I can think of writing about.

The 'main'-project of LLVM is a compiler backend. It reads code in a special assembly language (LLVM assembly) and can turn that into bytecode or native code.
There's also a library that helps in writing that assembly-code, so you don't have to know the instructions yourself.

The assembly is rather high-level, so that LLVM can perform optimizations on that. If you let LLVM JIT-compile it can also do run-time optimizations.

LLVM is cross-platform and written in mostly standard C++, making it quite portable. This also means that LLVM bytecode applications can be run on multiple platforms without recompiling, like Java and C#.

Apparently the developers consist of Apple-people, or at least are sponsored by them.

Personally I don't like Apple with the restrictions they place on their hardware and APIs, but LLVM is a darn fine piece of work - well, it started as a college project, not related to Apple.

Anyways, this also means that the early builds are only available for the OS X system, but clang in C++03 mode (gccs C++0x mode is far more advanced) and LLVM Core works fine on a big variety of Unix-like systems.

I've began working a bit with LLVM, and this is what I have so far:
My work:

Int a = 42
Int aA/*comment*/==4/*heh*/2 //another comment
Int Nothin
Keyword: Int
Identifier: a
Operator: =
Literal: 42

Keyword: Int
Identifier: aA
Operator: ==
Literal: 4
Literal: 2

Keyword: Int
Identifier: Nothin

And the part where LLVM jumps in:
Int a = 4
Float f = 5.678
Int b = a
Compilation went fine.
; ModuleID = 'stdin'

define i32 @main() {
%b = alloca i32
%f = alloca float
%a = alloca i32
store i32 4, i32* %a
store float 0x4016B645A0000000, float* %f
store i32* %a, i32* %b

The language seen in the input is one I intend to invent. It's going to draw its main influences from C++ and I'll see where it goes from there.
I'll just improve my current code a bit and then move on to writing a documentation about the yet nameless language.