Fog Creek Software
Discussion Board

Quake II ported to .NET

Here's an interesting project:  Vertigo Software has ported Quake II to .NET via Managed C++.

I haven't had a chance to run it yet, but it apparently performs "without noticeable performance delays".

Monday, July 14, 2003

Quake II was release in 1997.  In 1997, a 300Mhz Pentium IIs was the top of the line processor.  We were also running Windows 95, usually with 16 to 32 MB RAM.  There have been four Moore's Law's doubling since in the past six years.

So I'm not too terribly shocked / impressed.

Monday, July 14, 2003

Well, for one, has it been ported to java?

Belly laughs
Monday, July 14, 2003

Quake 1 has been ported to Java, not sure about quake 2.

The "porting" involved is hardly the same though. It's not like this is C# code or anything.

It's running unsafe C++ code as managed code.

Big freaking deal really, all it really involves from the porting side is to load the project up into Visual Studio and hit the compile button, and fix up any minor errors the newer C++ compiler gives.

The fact the managed version runs nearly as fast as the unmanaged version is also not a huge surprise, given that it uses basically zero features of the .NET runtime. Doesn't really tell us whether you can write a fast, modern game in safe C# code.

And the horse you rode in on
Tuesday, July 15, 2003

They did add managed code for a new heads-up display, though. As they say, "Once running as a .NET managed application, adding new features is easy and fun."

I agree that this doesn't say anything about the performance of a state-of-the-art game written in C# but the point that they did prove -- that it's possible to port a commercial 3D game to unmanaged .NET code and then extend it with managed code -- wasn't all that trivial or obvious. Yeah, Microsoft said it should be possible but...

Chris Nahr
Tuesday, July 15, 2003

Well, I just read the whitepaper provided by these guys, and I'm confused.

They claim to "mix native and managed code" but don't elaborate on where and how -- from the paper it seems that all of the code was managed but none of the data. Are they merely referring to the different (and entirely separate) output binaries?

They claim to have "control over memory management" which I assume refers to not having managed data in a .NET application. Okay, but we already knew that this is possible...

They claim to use "existing libraries as well as .NET Framework classes" but I only see them mentioning non-.NET libraries in the paper. Their radar extension doesn't seem to use any .NET classes or managed data.

Can anyone be bothered to look at the source code and see what's up? It seems like these guys are a bit unclear on what they were actually doing.

Chris Nahr
Tuesday, July 15, 2003

"Can anyone be bothered to look at the source code and see what's up? It seems like these guys are a bit unclear on what they were actually doing. "

I can see how this project happened now
first guy: Like, wouldn't it be cool, and stuff, if we made a .net version of a game then people would think we were l33t

second guy: Like yeah, mario or something. That would rock. You know i could never complete that game. That sucks.

first guy: dude you want us to get sued or something?  Lets do something like Quake ii cos thats free

Second Guy: duuuuuuuuuuuuuuuuuuuude

Robert Moir
Wednesday, July 16, 2003

Quake II does very little dynamic memory allocation at all (most "dynamic" objects are really just in fixed-size arrays).  Also you have to be careful using this codebase as an example because it was designed from the start to be *extremely* portable. 90% of today's games are written to DirectX, Win32, or other non-portable APIs.

Dan Maas
Friday, July 18, 2003

DirectX or GDI wouldn't pose any compatibility problems as long as you don't try to run your .NET port on Mono. Managed C++ can use unmanaged COM libraries and DLLs just fine. There's no need to change anything if you don't use managed data.  That's exactly how they made this Quake 2 port (which used OpenGL, right?).

A port of a DirectX game to Managed DirectX would be interesting, though.

Chris Nahr
Saturday, July 19, 2003

*  Recent Topics

*  Fog Creek Home