Games in managed code


A guy on my team just noticed that Arena Wars! is new game writing in managed code…. Has anyone tried it?  How is the perf?  Does managed code make a good gaming platform?

 

What are some other grames written in managed code?  

Comments (23)

  1. matthew says:

    let’s hope it’s better than ATI’s horrible new managed graphics driver software…. It’s slow on my dual xeon machine

  2. I wouldn’t exactly call it a game, in that it isn’t complete, but I have the beginnings of a little Joust clone available from my site.

  3. Arena Wars is pretty solid. I tried the free demo a week or two ago and I didn’t notice any problems related to it being managed code. The graphics ran smooth and looked really nice. I hope to see more managed games coming out soon.

    I’ve got a few graphic demos in C# on my website: http://www.brandonfurtwangler.com but I always wondered if I’d run into trouble on a larger scale. Apparently Arena Wars proves that it could be done.

  4. Robert Kozak says:

    Nice work Brandon.

    — Robert

  5. ShadowChaser says:

    Managed code makes a great gaming platform for anything less than the most intensive games.

    I’ve found that you can spend more time actually writing the game and writing a clean architecture for it – as opposed to a hacked up, buggy mess in C.

    That said, the System.Windows.Forms namespace is VERY bad when it comes to a game engine. Games require that you have full control over the application loop – something that the Application class does not let you do.

    Many game developers try to "hack" the system by using Timers or Application.DoEvents, but cause more harm than good (DoEvents is really nasty, for example.).

    I resorted to doing all the Win32 API stuff by hand using interop. Other than that, it’s great.

  6. leighsword says:

    Managed code means open your source code,do you really want to?

  7. rpopescu says:

    i don’t think it means opening up, you can ngen can’t you ?

  8. A reply to matthew – ATI did not create managed driver software, just a control panel utility to change settings that affect how driver works. Essentially, you start it, change few switches off<->on, and close it – settings get saved, driver starts using them.

    There are some rumours that nVidia is working on managed drivers. I think these people are confused and expect this to be nVidia’s answer to ATI’s managed drivers (that don’t exist, see above).

    My personal experience shows that in a scenario where modern cards are used (with latest Vertex and Pixel Shaders) most of the time is spent on the video card, and VERY little on the processor itself, except in AI-heavy scenarios.

    I think managed code is quite a viable alternative for developing many games, but for those needing absolute best performance NOW, C++ is still probably a better choice (note that I say now, not in the future).

  9. On the opening up of your code issue. It is true that it is easier to reverse engineer managed code than native CC++ code because the IL is higher level and the rich metadata. The right answer to this is obfuscation.. here is an option: http://preemptive.com/products/dotfuscator/index.html

    NGen is not a good option as it requires the IL to be shipped as well for resilience reasons.

  10. On the opening up of your code issue. It is true that it is easier to reverse engineer managed code than native CC++ code because the IL is higher level and the rich metadata. The right answer to this is obfuscation.. here is an option: http://preemptive.com/products/dotfuscator/index.html

    NGen is not a good option as it requires the IL to be shipped as well for resilience reasons.

  11. Chris Maughan's Jorvik Utopia says:
  12. That’s cool! Brad did you ever knoe that the great game Quake is re-written in managed C++? I have it and I dont see ANY performance difference.

  13. That’s cool! Brad did you ever knoe that the great game Quake is re-written in managed C++? I have it and I dont see ANY performance difference.

  14. Steve Hiner says:

    I tried out the Arena Wars demo. I really only did it because I heard it was managed code. I was quite impressed. It looks as good as any game I’ve seen (better than most).

    The 3D graphics run quite smoothly and look great. I’d love to know more about how they built it. I’m assuming they used mananged Direct3D for the graphics. If that’s the case then I see no reason not to write a game in .NET unless you’re going for ultimate performance like Doom 3 (on my system Doom 3 doesn’t ultimately perform though).

    You really should try it out. It’s fun to watch the tutorials. They’re in German but all the vehicle and building names are still in English. My son gets a kick out of listening to them.

    For those of you that haven’t looked it up yet – it’s a 3D multi-player sci-fi real time strategy game. It has modes I haven’t seen in an RTS before like capture the flag.

  15. I’m interested in the making of this game too.

    I don’t know if a paralelism with QuakeII.net is viable because the only thing the id software people did was to turn on the managed switch of the c++ compiler and add a "preety-nasty" stuff like the Radar (hosting the clr and using System.Windows.Forms and System.Drawing BCLs). They didn’t port the entire game to the managed-world.

    On the other hand, i’m still not sure that, by the this time, an intensive game like Doom3 or Far Cry may be managed-written and give the same user experience like they do as native implementations but I find the CLR and Jitter to be a pretty good hosting environment/engine for most of the other games. Other excellent use for Managed Code is the implementation of Game Servers because of the CLR acting as an officer-in-the-middle to prevent many sort of damages very difficult to prevent in native-writing.

  16. id didn’t do Quake II .NET, Veritgo Software did:

    http://www.vertigosoftware.com/Quake2.htm

    They used the GPL’ed code from id software to do so.

  17. Joshua Bair says:

    I’ve also tried the ArenaWars demo. Looks very professional, and I couldn’t see any noticable difference between this and any other RTS games I’ve seen written in other, non-managed languages.

    If anyone is interested, I am also working on a C#/DirectX9 action shooter, similar to StarFox, but with multi-player support (eventually). You can check out the latest info at http://joshuabair.dyndns.org/blog.

    – Joshua

  18. Jason Olson says:

    From what I’ve read on their forums, some of the low level optimizations are done in unsafe code and I believe I saw a mention of Managed C++ (just for the low level stuff). The creators said that the majority of the game code though is in C#.

  19. Chad Myers says:

    Point of clarification about the Quake II in MEC++.

    All they did was compile the unmanaged code in VS.NET 2003. They showed that you could run Quake II and host the CLR and do add-ons to Quake II using the .NET features of MEC++.

    They did not, however "rewrite" it to be all .NET/OO.

  20. Eric Newton says:

    Optimally the "critical" code should be in C++ just for performance, but the rest, like the "monster" objects and the engine’s architecture should be in C#, which will make building mods for these managed games a TON easier because of the rich metadata.

    In addition, scripting languages like "UnrealScript" [for the Unreal engine] are no longer neccesary because you could just expose the engine’s API to managed code, and viola… C# mod? VB.Net mod? or even UnrealScript.net mod? 😉

    I love the whole idea of the CLR being language agnostic.

  21. Matthew W. Jackson says:

    Good point about UnrealScript. And C# code would certainly execute faster than UnrealScript. Still, you’ve got to really admire Epic for coming up with such a nice OOP scripting language for their games. (Of course, these guys also came up with ZZT back in the day…a big feat at the time).

    Maybe they should write UnrealScript.NET for the next Unreal/UT. This way, old scripts could be ported, and new ones written in C# or VB or F# or Delphi or C++. I LOVE the idea of managed APIs for a game. Let people use their language of choice! The Unreal "Mutator" concept could be done very well in .NET.

    As for decompilation, I don’t see that as a problem. In many modern engines, the source code ends up being free as part of the SDK, and the game content itself is basically what you buy (the textures, models, maps, sounds, music, etc.). Most of the Quake III source is available, except for the rendering engine. That’s just as well, too, as a game’s rendering engine might warrant being written in unsafe C++ anyway.

    As for decompiling the script that runs the enemy characters or controls how a weapon fires? Big whoop! More power to you!

    As for cheating? Let single-player gamers cheat, and in multi-player, NEVER trust the client.