473,503 Members | 1,657 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is C# too slow for real game programming?

jm
I know one can make games in C#, but are any software companies really
using C# to produce anything? What do you think? I use a lot of C#
at work, but would like to use it for play/work on my own. I don't
want to use regular c++ if I don't have to. I just not that good. Is
c# just to slow with current technology? Thanks for opinions.
Nov 16 '05 #1
5 6869
jm,
I'm sure that C# is just fine for developing games. I have some
friends/excoworkers that have developed a driving simulator application
purely in c# and directx. The physics engine I'm pretty sure wasn't managed
code, but the application worked just fine.

HTH

--
Lateralus [MCAD]
"jm" <jo*************@yahoo.com> wrote in message
news:c6**************************@posting.google.c om...
I know one can make games in C#, but are any software companies really
using C# to produce anything? What do you think? I use a lot of C#
at work, but would like to use it for play/work on my own. I don't
want to use regular c++ if I don't have to. I just not that good. Is
c# just to slow with current technology? Thanks for opinions.

Nov 16 '05 #2
On 3 Sep 2004 19:31:22 -0700, jo*************@yahoo.com (jm) wrote:
I know one can make games in C#, but are any software companies really
using C# to produce anything? What do you think? I use a lot of C#
at work, but would like to use it for play/work on my own. I don't
want to use regular c++ if I don't have to. I just not that good. Is
c# just to slow with current technology? Thanks for opinions.


It would be easy if microsoft had a decent managed version of direct x
and actually documented it.
Nov 16 '05 #3
jm wrote:
I know one can make games in C#, but are any software companies really
using C# to produce anything? What do you think? I use a lot of C#
at work, but would like to use it for play/work on my own. I don't
want to use regular c++ if I don't have to. I just not that good. Is
c# just to slow with current technology? Thanks for opinions.


Have you heard of Arena Wars? It's supposedly written entirely in C#. See
http://arenawars.krawall.de/com/

Cheers,

--
Joerg Jooss
jo*********@gmx.net
Nov 16 '05 #4
Hi JM,

Here's an .NET Show episode talking about directX:

http://msdn.microsoft.com/theshow/Ep...37/default.asp

Here's another .NET Show where Nick Hodapp demos a version of Quake II that
was written with C#:

http://msdn.microsoft.com/theshow/Ep...35/default.asp

This particular episode is good to watch anyway because it talks about the
benefits of managed code.

Joe
--
Joe Mayo, Author/Instructor
Need C#/.NET training?
visit www.mayosoftware.com
C# Tutorial - www.csharp-station.com

"jm" <jo*************@yahoo.com> wrote in message
news:c6**************************@posting.google.c om...
I know one can make games in C#, but are any software companies really
using C# to produce anything? What do you think? I use a lot of C#
at work, but would like to use it for play/work on my own. I don't
want to use regular c++ if I don't have to. I just not that good. Is
c# just to slow with current technology? Thanks for opinions.

Nov 16 '05 #5
Joe Mayo [C# MVP] wrote:
Here's another .NET Show where Nick Hodapp demos a version of Quake
II that was written with C#:

http://msdn.microsoft.com/theshow/Ep...35/default.asp


Not quite <g>

The Quake demo was written in C++ ported from C and then compiled as Managed
C++ using the /clr switch.

"NICK HODDAP [sic]: So what I have here, we're going to run the native
version
first, the native version of Quake. So this is really just the source code
that you could download off of idSoftware, and Vertigo is hosting this out
on their website so you can download this and build it yourself. The one
thing that they did in addition to just rebuilding it for .NET and the CLR
is they ported it from strictly a C-based application to C++. And the reason
they did that - it didn't involve a whole lot of work - was because in order
to enable that feature of the compiler that allows you to recompile for
Managed, it has to be in C++ syntax. And so there are only a few minor
differences: C++ is really a superset of C, but you can do things in C that
break that transition. So they fixed that up. So what we're looking at here
is the native version, and we can drop into a mode that allows us to see the
frame rate that we're getting. "

However, there is a bigger story here. The language is just the input to the
compiler, its largely irrelevant (largely, but not completely). What's
important is that the output of the compiler is IL. Now bear in mind that
guys from the VC team wrote the JIT compiler so all the experience from
years of writing C++ optimization code has gone into the JIT compiler. So
once the IL has been JITted (that's the caveat) the native code created by
the JIT compiler will run as fast as native code produced by the native C++
compiler. (Actually, my tests have shown that for some optimization
switches, managed C++ can run faster than native C++).

The demo shows that the managed Quake (ie compiled with /clr) runs at 50
frames/sec and the native version (same code without /clr) runs at 60
frames/sec. I haven't looked the code so I cannot conclusively identify why
this is the case, but I suspect there's some marshalling betweem managed and
unmanaged types for calls to the Win32 API, and I suspect the optimization
swiches used are not the most optimal for managed C++ <g>. Note that the
graphics don't use WinForms.

BTW Nick Hodapp mentions that with some tweaking of the Quake code you can
get to 100% the performance of the native version, and I believe him.

Richard
--
..NET training, development, consulting and mentoring
my email ev******@zicf.bet is encrypted with ROT13 (www.rot13.org)
sign up for my free .NET newsletter at
http://www.wd-mag.com/newsletters/

Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
3860
by: the_philospher | last post by:
I am a beginner programmer learning c++. i have read some useful information about programming games (which is my goal) on gamedev.net, particularly "how do i program games"...
2
2577
by: Hans Kamp | last post by:
As a programming exercise I try to program a game. In my case it is called BugEater. The purpose is that you are a snake. It moves automatically but you can control it with the keys on your...
50
5651
by: diffuser78 | last post by:
I have just started to learn python. Some said that its slow. Can somebody pin point the issue. Thans
0
1824
by: Jeff Rush | last post by:
At PyCon this year we're going to have a multi-day game programming clinic and challenge. This is a first-time event and an experiment to find those in the Python community who enjoy playing and...
2
1864
by: hg | last post by:
Hi, I have started to work on a python-based robot, and am interested in your feedback: http://realtimebattle.sourceforge.net/ www.snakecard.com/rtb hg
4
4420
by: COHENMARVIN | last post by:
Are there any good sources on video game programming in vb.net? Is "DirectX" a set of libraries for video game programmers? The reason I ask is that I'd like to convert a board game into a...
39
2818
by: cm_gui | last post by:
Python is slow. Almost all of the web applications written in Python are slow. Zope/Plone is slow, sloow, so very slooow. Even Google Apps is not faster. Neither is Youtube. Facebook and...
10
1978
by: Michael Lubker | last post by:
Any people that use Python as the predominant language for their game development here? ~Michael
0
1010
by: smartx | last post by:
Hi, I would like to share my knowledge as a game programmer, really game programming is hard, I don't want to disappoint you, the important point to become a game programmer is to love game...
0
7198
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7072
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7271
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7319
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6979
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5570
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3149
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.