Greg Merideth said:
That and you can turn any .exe or .dll back into its readable code
pretty easy in c#. Being runtime code you can reverse engineer it and
see whats going on. You can obfuscate it but over all, your codes easy
to be read. I dont know to many game designers want people to have the
ability to reverse their code so easily.
How about all of the game designers that provide the general public with the
SOURCE CODE anyway?
I know that sometimes the graphics rendering and network parts of the game
engine is not made public, and I would still almost recommend doing that in
MC++ with some unmanaged code (or at the very least unsafe C# code--since
drawing to textures directly and filling out vertex buffers is much faster
with pointers). But writing the code in C++ doesn't mean that nobody will
be able to reverse engineer it.
I'm pretty sure that most of the Quake 3 source code is up for grabs, with
the exception of a few lower-level graphics libraries that John Carmack
likes to keep to himself. And if you want THAT code, you can get it pretty
easily (but with a heavy price tag for the license).
Also, take the Unreal and Unreal Tournament games: A lot of the
higher-level code is written in UnrealScript--an OOP language that is
INTERPRETED at runtime. And if you want to modify the game for fun, this
code is easily available, and the developers even ENCOURAGE you to look at
it.
So wouldn't it stand to reason that a game could be written with it's logic
being in managed code? C# would make a hell of a scripting language for
games. Better yet, any .NET language could be used to add
user-modifications to the game. This seems to me to be the greatest reason
to want to have a game using .NET. Plus, the code certainly wouldn't be
interpreted. I would wager the CLR could run circles around UnrealScript's
interpreter.
And if somebody stole a game developer's engine and sold it to a wide
market, I'm pretty sure that game developer would have it's huge legal team
busting down doors....There is almost no need to obfuscate most of the game
code. You might want to hide your network code to prevent cheating in
multiplayer, but you are just delaying the inevitable. Your game WILL be
cracked. People WILL cheat. It's a never-ending battle.
Right now, a good solution may be for part of the game to be written in pure
unmanaged C++ that hosts the CLR for running the higher-level code (such as
UI, AI, character interaction, game events, etc.). But I see no reason why
an entire game couldn't be written in C#. It certainly would make for a
clean design. Plus, Managed DirectX is pretty good, speed-wise.
And if you wanted to go as far as to P/Invoke OpenGL, SDL, etc. instead of
using DirectX, then you'd probably have no trouble getting your game to run
on Mono. So you'd have an instant Linux and Mac ports of your game. That
can't be a bad thing.
--Matthew W. Jackson