Who is using C# to write games?

Started by
95 comments, last by Telamon 20 years, 1 month ago
I took a class in C# last Spring and it is rapidly becoming my language of choice for all my projects. Previously, I''ve been using C++ for writing real code, or Visual Basic when I needed to do fancy user interfaces (MFC is garbage). And while I know Java, I''ve never considered it to be a real development tool - though I know lots and lots of serious developers use it. I used it this summer working on IBM''s grid services toolkit. The idea of using Java for realtime games is laughable. And while there are lots of Java-to-machine code compilers the idea seems to have fizzled out years ago (Jikes is the last serious attempt I''ve seen that''s been made freely available). With respect to execution strategy, I like to think of C# as Java done right. Say what you want about Microsoft''s Consumate Evil, their dev tools are top notch. At the moment I''m using C# to clone the game Tetris Attack (http://www.tetrisattack.net) from the SNES. I''ve never had a project come together so fast. I had a working prototype up in a couple of hours. I''ve never had a bug in C# that took longer than two minutes to fix. It''s perhaps a more RAD language than VB. I will complain about the quality of the Managed DirectX9 Docs - they are absolute crap. But, all in all, my project is coming together nicely. I was wondering whether anyone else out there had discovered it''s possible to throw games together really fast with C#, I don''t really see many posts about it. I was also wondering if anyone knew of any websites devoted to C# game programming issues. Maybe the language is too new to have much of a following online - it''s difficult to find information on it. I''d also be interested in finding any game-related benchmarks between C# vs. C/C++. The DirectX people at Microsoft are claiming that Managed DirectX is 98% as fast in C# as regular DirectX is from C++. This is a small price to pay to cut COM, reference counts, and other DX nastiness out of the picture. I''ll get off my C# soapbox now...

Shedletsky's Bits: A Blog | ROBLOX | Twitter
Time held me green and dying
Though I sang in my chains like the sea...

Advertisement
I''ve recently got into doing C# game programming after doing a few apps in it. The language i work with most is java as i do a lot of server side programming, for which Java is ideal.

C# was easy to pick up, and all my dx knowledge from C++ has been easily translated to it.

d3d9 docs suck tho.

-jonnii
=========
jon@voodooextreme.com
www.voodooextreme.com
-jonnii=========jon@voodooextreme.comwww.voodooextreme.com
I''ve recently got into doing C# game programming after doing a few apps in it. The language i work with most is java as i do a lot of server side programming, for which Java is ideal.

C# was easy to pick up, and all my dx knowledge from C++ has been easily translated to it.

d3d9 docs suck tho.

-jonnii
=========
jon@voodooextreme.com
www.voodooextreme.com
-jonnii=========jon@voodooextreme.comwww.voodooextreme.com
I have been exploring C# for tools, not the acutal game engine though. I just don''t like state machines(which I think C# has feel free to correct me if im wrong). Some people say it runs very fast, but I still preffer my unmanaged C/C++ code. However I also want to spend more time on learning skills that will allow me to develope for more platforms than just windows, without the .net framwork.
"I don''t care what you think unless it is about me"
quote:Original post by dead_roses
I just don''t like state machines(which I think C# has feel free to correct me if im wrong).

That made no sense at all. Please elaborate on why you think C# "has a state machine".

--
AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.
[Project site] [Blog] [RSS] [Browse the source] [IRC channel]
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
quote:Original post by Arild Fines
quote:Original post by dead_roses
I just don''t like state machines(which I think C# has feel free to correct me if im wrong).

That made no sense at all. Please elaborate on why you think C# "has a state machine".

--
AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.
[Project site] [Blog] [RSS] [Browse the source] [IRC channel]


Indeed that made no sense, but I think what he means is the virtual machine.

Ive been using C# for games dev, since the time I save in development more then makes up for performance drop.
If your not aiming to write a huge revolutionary game, you do not really need the extra performance of unmanaged code. (although i guess this is subjective, maybe it isnt true for everyone?)
There''s an old addage in object orientated programming design which is: "code to an interface, not an implementation". Being heavily object orientated with simple syntax C# is ideal for this.

Writing a framework in C# is simple and rewarding and it doesnt stop you from creating managed C++ classes to write a fast, optimised implementation.

-jonnii=========jon@voodooextreme.comwww.voodooextreme.com
I''ve been using C# for at least a year now and I suggest everyone gives it a try. I have several small mostly graphics related C# projects online at http://www.msu.edu/~furtwan1/

A couple things worth note:
Telamon mentioned how easy it is to track bugs. I think this is true with all of .NET as an example I found a bug in the managed version of Quake 2 (sorry lost my link, try google) and it only took about 2 minutes. This was managed C++ but the exceptions were the key to finding it. (the unmanaged version mearly crashes and closes)

Also, performance wise, I haven''t noticed much impact at all. The only exception has been when using DX9 because it must do interop. Even then 15% or so is livable with all that C# adds.

Finally, I''ve recently written a C like compiler so I know first hand how hard optimization can be. That being said, I DO in fact believe that C# performance will one day beat C++ hands down. JIT compiling is relatively young compared to pre-compiling so it may take some time before new algorithims to do agressive machine specific optimizations are developed and tested. The ability to obtain statistical information that may aid in future JIT''s is key here.
I am about to embark on a tetris clone in C#.

I find C# is very user-friendly. I''m adept with C++ and Java, and in some cases prefer them, but if someone said "write a program, use whatever you want" I''d choose C# most of the time just because of the great library, clean syntax, intellisense, documentation, fast compile times, and all it''s other goodies.

Dropping down to unsafe mode if i really need pointers is always an option and if i ever really need a feature from another language, I can always just export an assembly or DLL written in said language.
I think JIT has lots of future potential, because Intel/AMD can develop plug-in JIT compilers specific to each CPU. Then a user can install the JIT compiler for their specific CPU for the CLR to use. I''m no compiler programmer (well a little, but nothing advanced) but I would expect this to allow much more aggressive optimizations than your typical non-JIT compilers allow. Add to this the option of "JIT" compiling for the specific CPU at install-time rather than run-time and I think managed code will be able to surpass unmanaged code performance before long.

This topic is closed to new replies.

Advertisement