Jump to content
Xtreme .Net Talk

Recommended Posts

Guest mutant
Posted

None of the ones you mentioned :D

C++ - speed. All of todays commercial games are written in c++.

Posted

If your looking for speed, use VC++ NONMANAGED code. This means, if your using VC++.NET, make sure you are not using managed code, or you will not get the speed you need for a 3D game.

 

If your not making a 3d game, aka doing 2d or "5d", vb6/.net or c# is more then adequate for coding.

 

If your planning on making money from your game, stay away from all of the .net scripting languages (aka, all .net languages), unless you want your source code shown to the world :)

Posted

Shannara: .NET languages are _not_ scripting languages.

 

Managed code is somewhat more vulnerable to reverse-engineering than non-managed code, but it's not like you're giving it away. If you're that paranoid, get a code obfuscator.

 

3D games certainly need unmanaged C++ (unless your gamers all have lightning machines :) ). For all other games, I would recommend .NET languages simply for shorter development times.

 

I've heard a lot of great things about DirectX 9. Since anyone who's asking the question "What is a good game programming language" is obviously at square one, you may want to play around with this just for fun.

 

.steve

 

PS: I don't recommend writing a game in VB6. I did this in high school, and it's disgusting. Learn a real programming language.

zig?
  • *Experts*
Posted

I won't argue about the "best" language to use - it's pointless. Instead, since you're obviously new to programming I'd suggest either C# or VB.NET as the best language for you. They're much easier to pick up than C++ (managed or not) and you don't have to start with DirectX, which is difficult by itself even if you're really good at programming (regardless of language).

 

I'd play around with pictureboxes and learn the language first, then move onto some GDI+ functions (for painting 2d pictures around the screen). Then move onto 3D if it suits you - this will probably be a few weeks/months depending on your investment in time and patience.

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

That's true. If you've never even done anything with graphics before, GDI is certainly easier than DirectX. Getting an understanding of how to mess around with device contexts and drawing functions is a definite must.

 

If you're serious about game programming, though, you'll need to learn DirectX (or OpenGL) at some point. It sounds like Managed DirectX makes things much easier - compared to the DirectX of the past. If you're adventurous, don't feel like you can't jump in the deep end. But expect to swallow a bit of water on a topic as difficult as DirectX. And expect to be in there for many moons before you can swim. :)

zig?
Posted

*tosses in his nickle of advice*

 

The absolute best language for game programming is a toss up between C and C++ (I'm not talking about .NET here, I'm talking about unmanaged C++).

 

HOWEVER! If you are new to programming, then starting off with C# is probably best. (yes, C#, starting off in VB will only make the transition to C/C++ harder if you want to write a serious 3D game later down t he road). If you're not new to programming and consider yourself intermediate, then just use C or C++.

 

What you really need to do is start off with a really simple game, such as tic-tac-toe or something using GDI+ (or picture boxes I suppose if you're really THAT new), that way it gives you the basic idea of how to load and use graphics, and a little about AI. Then move on to say, Tetris, so you can learn about the game loop and player interaction with moving objects. After that some funky 2d game of your own creation, then you're probably ready to move on to DirectX and simple 3D stuff. Down the road, if you become serious about gaming, you'll want to start making the transition to C or C++.

 

EDIT:

And to actually answer your question, C or C++ (unmanaged) is best because of pure speed and total freedom with what you can do.

Gamer extraordinaire. Programmer wannabe.
Posted
I agree with wyrd, C and C++ is the best choice. I was big time into graphics years ago and used C, C++ and assembler to create a snazzy space invaders type game, pity I never finished it! I also used these to create image file viewers, jpeg, gif etc.
My website
Posted

From Microsoft's DirectX Site

 

Benefits of Managed DirectX

 

By eliminating the Component Object Model (COM) interoperability layer, Managed DirectX improves performance. Managed code can reduce the volume of code and increase productivity. The interface is more intuitive, inheriting from the powerful and easy-to-use Microsoft .NET Framework common types. Managed code also frees you from having to deal with most memory management tasks, such as releasing objects. In the SDK you will find managed Visual Basic .NET and Visual C# samples and tutorials that duplicate nearly all of the unmanaged code samples.

  • 1 month later...
Posted

As far as pure speed unmanaged C/C++ will of course win. However, if the majority of the program time is spent on something like Direct3D calls then after the first call C# and VB come very close in speed. Some Direct3D speed tests actually indicate that C# gets an overall higher framerate than C++, and I believe Microsoft's prediction was 98% of total speed compared to C++. If you need every last percent then C++ is the way to go, otherwise you most likely won't be able to tell (other than possibly startup time). C# is much easier as well, I know C++ but after using Managed DirectX 9 I refuse to go back to it unless I'm trying to render millions of polygons or something.

 

Or you could use one of the languages I currently have in development :)

Posted

Don't get me wrong, I love .NET. However I refuse to just believe pure hearsay about how C# is equivalent (or close to) in speed to C++. Biased comments from the Microsoft site isn't something I tend to believe either as they're trying to sell their product.

 

What I'm trying to get at, is this; If you are going to say that one language is equivalent (or close to) in speed as another, you need to provide us with some proof. A link to a web site, source code of your own benchmarking, your own article written up in about the insides of both languages and why it is so, anything.

 

Whether realizing it or not, the worst thing one can do is provide faulty information. I would personally love to see undisputable proof that C# can compete with C++ in terms of speed.

 

Stopping for a second and reading what I've just typed, I realize that my comments may seem harsh or rude. They are not intended as such, and I am not attacking anyone.

Gamer extraordinaire. Programmer wannabe.
  • *Experts*
Posted

I doubt any .NET language can compete. However, I believe C# as a standard will most likely be available outside of .NET; I think Borland is doing an implementation of it or something.

 

C# and C++ are completely different languages; the only thing the same is the syntax.

  • *Experts*
Posted

C# Builder...lol

 

Anyway :), I will not belive that C# can come this close to the speed of C++, give me all the proof you want and I wont believe until I do it on my own :p.

  • *Gurus*
Posted

.NET code can beat C++ code when it comes to raw number crunching because of JIT optimizations performed on the code for the specific processor the code is running on.

 

To satisfy my conscience for saying this, I just created two tests - one with C++ and one with C#. In the test I run a loop 2 billion times, each iteration increasing another integer's value by one. I turn off optimizations (which would stop such a pointless loop from running at all) and these are the results:

 

C++: 10.405 seconds

C#: 10.044 seconds

 

And they say JIT compiled code is slow.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

  • *Experts*
Posted

I didnt say that that code is slow :).

Ok, I did the same test, now I believe, :rolleyes: , enlightment. :p

Funny that I didnt do this kind of test before :)

  • *Gurus*
Posted
The reason .NET programs are generally slower than their C++ counterparts is not because of slow executing code, but because a lot of .NET is still a wrapper to win32 functions. This won't always be the case though.

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

  • *Experts*
Posted

And remeber, just because .NET is not as fast as C++, it is not "slow"; I saw a platformer game divil made in .NET, and it was running very smoothly indeed (and that included scaling, and rotating and stuff, not to mention the pseudo-realistic physics engine. Heh.)

 

.NET, if coded correctly, can be quite fast, and as noted above in this thread, some uses of the API can make it even faster.

Posted

Yoinks! How to you guys get into all the nitty gritty of this stuff?

 

I spend my time learning bits and bob here and there to develop new or existing apps, I never seem to get to all this stuff!

 

Do you spend eons reading or is there a secret club:)

My website
  • *Experts*
Posted (edited)
I know its not slow, its fast compared to other ones like Java. I dont tend to use Win32 API in .NET unless there is no class for the task in .NET. Anyway :) , I find C++ a lot better to work with than C#, not becuase of speed really, but its just better to program :p, and more freedom :p. Edited by mutant
Posted

divil: What version of Visual Studio did you run the C++ test on?

 

Yoinks! How to you guys get into all the nitty gritty of this stuff?

 

I spend my time learning bits and bob here and there to develop new or existing apps, I never seem to get to all this stuff!

 

Do you spend eons reading or is there a secret club:)

 

Same here. There must be some secret we have yet to figure out.

Gamer extraordinaire. Programmer wannabe.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...