473,385 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Game Programing. C++ or C# ?

Atli
5,058 Expert 4TB
Hi.

I'm designing a 3D game with DirectX and thats all good, except I'm not sure wether to write it in C# or C++.

C# is obviously much easier to write, since the syntax is so much simpler than C++ syntax. Also Visual Studio offers much better tools for C# than C++.

Then again C# is managed code and I've read claims that ppl have seen up to 50% drop in framerates porting to C#, tho I'm sure a majority of that drop is the developers fault rather than the C# compiler's.

Others claim that the managed compilers can increase performance, that well written C# code would infact out-perform well written C++ code.

Also, DirectX is available in a managed version for .Net, as opposed to the overly capitalized, unclear mess that it is in C++.

Any thoughts?
Apr 15 '07 #1
4 1798
I'd write it in C++ just because C# requires the .net framework and all that other stuff to get it going. Look at the load time for an average C# application. I have a 40k program which loads for nearly 20 seconds just because it in turn loads the .net environment objects every time you start it. C# is powerful but damn slow (at least now). I'd do it in C++. At least you'll know it's going to be portable. Besides, there is a game dev. class at my university and there is a group of people who showed me their final project. it was almost a full-blown 3D action game. Not as detailed as what's out there on the market of course, but i saw what an amazing thing they've accomplished with C++.
Apr 15 '07 #2
weaknessforcats
9,208 Expert Mod 8TB
Are you going to run the game on a web page?

If so, C# will be the better choice. Most likely your C++ code on a web page will have to be a COM object and those are slower than C#.
Apr 15 '07 #3
Most 3D game programmers would probably write a 3D game in C++

There's nothing wrong with C#, but the reason it's simpler to use is because Microsoft sacrificed efficiency for ease. C# is analogous to Java, and most Java games are not 3D, they're cell-phone games.
Apr 15 '07 #4
Atli
5,058 Expert 4TB
Thank you guys for the input.

The game I'm designing would be a windows application, not on a web page.

I've been testing this myself, created an exctemely simple test app in both C# and C++. It loads the same model with all the same textures and a single light.

The difference is so minor it was almost not noticable. The most noticable is that the C++ app shot up to 100% CPU usage every now and then, and the C# app's memory usage was rising most of the time, then it would drop, but then start climbing again.
(I'm talking like 13kb - 16kb while the C++ app is steady at 14,5kb)

The main difference for me would probbly be that the C# app took me like an hour to write without ever having to open any refrence book or google or anything.
The C++ app took most of the day to write, and that time was mostly spent on msdn and in refrence books an pages looking up object names and mehods.

I'm leaning towards C# at the moment, mainly because it is easier to write and debug, which would give me more time to extend and improve the game.

So thanks guys, im of to code something!
Apr 16 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: cyshao | last post by:
How to reset Router by programing? For some resean, we need usually reset our Router. Now, we have to Reset Router manually(shot down and reopen). Are there any method to control and reset...
1
by: fowle040 | last post by:
I underlined and bold print my files. I need to know how to make this code into a working game. The object of the game is to have two players 1- belle and 2-beast. I want them to lose and gain...
7
by: Gasten | last post by:
Hello. The last weeks I've been coding a roguelike (you know, like nethack) in python using the nCurses library. Some week ago I ran into a problem: When I made the object for messagebar-output, I...
5
by: ProlificBean | last post by:
Hey, I'm new to this C++ programing, but very very interested in learning how to create a video game. I'm currently in an intro C++ class, but not learning anything about gaming whatsoever. I know...
12
by: Xah Lee | last post by:
Of Interest: Introduction to 3D Graphics Programing http://xahlee.org/3d/index.html Currently, this introduction introduces you to the graphics format of Mathematica, and two Java Applet...
15
by: Xah Lee | last post by:
On Java's Interface Xah Lee, 20050223 In Java the language, there's this a keyword “interface”. In a functional language, a function can be specified by its name and parameter specs....
2
by: sengpg345 | last post by:
hi everybody. i have a project in colage for messanger but i haven't idea of socket programing in c#.net . so plz give me the guidence i socket programing. if u have row matirial or tutorial then...
10
by: aboolamoola | last post by:
hi, I recently started programing about a month ago. my teacher ask me to make a game. A connect 4 game. I try to make, but failed. I need help. here is my code: import java.awt.*; import...
4
by: BbEsy | last post by:
I finding some book about 2d game programing. Exactly the graphic engine part.. anyone have idea ?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...

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.