Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I've read tons of different threads about XNA, but I still have some questions.

First of all: I have 2 years of experience programming and C# is my main language, so XNA would fit perfectly for me, but I have some concerns.

  1. People mentioned that C# has a performance loss compared to C++. Is this true?

  2. XNA only supports DirectX 9. I found the ANX framework which is pretty similar to XNA but it is capable of DirectX 11. Would this be a good alternative ?

  3. Because I'm worried about the performance loss of C#, I searched for a C++ framework and found SFML. It's based on C++ but can be integrated into C#.

I already have some experience with UDK, but I am really interested in creating more by myself ( lighting physics etc ).

I didn't start yet, what would you recommend me to use / learn ?

I am going to create a first person shooter (3D) and I have plenty of time for this. My aim is realtime lighting, realtime global illumination, image-based reflections etc. I want to develop for Windows.

Edit: I found something interesting: OpenTK. It supports the latest version of OpenGL which is on the same level as DX11 (if my knowledge is correct). It makes use of mono.

share|improve this question

closed as off-topic by Byte56 May 10 at 14:15

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about "how to get started," "what to learn next," or "which technology to use" are discussion-oriented questions which involve answers that are either based on opinion, or which are all equally valid. Those kinds of questions are outside the scope of this site. Visit our help center for more information." – Byte56
If this question can be reworded to fit the rules in the help center, please edit the question.

    
If you want to make a FSP why not use an engine tailored for the genre such as source, cryengine, or unreal engine? Competition in the FPS market is very competitive and you not going to be able reinvent the wheel better than its already been made. –  ClassicThunder Mar 26 '12 at 0:38
    
i want to create something by my own. i don't need to rush a game –  Maik Klein Mar 26 '12 at 0:40
    
I understand but you are missing my point. Even if you have an infinite amount of time you are not going to be able to compete with the features offered by these engines and even using them its going to be hard and time consuming to create a game worth buying among all the FPS games currently available. –  ClassicThunder Mar 26 '12 at 0:43
    
yeah maybe you are right. i will develop my game in ce or udk. but after that im trying to think of somthing siimpler like bastion. and than i will create this is XNA etc . thanks –  Maik Klein Mar 26 '12 at 1:07
1  
Although 3d support is not complete yet, monogame is yet another c# & opengl host to be considered. –  HuseyinUslu Mar 26 '12 at 7:47

1 Answer 1

up vote 12 down vote accepted

People mentioned that C# has a performance loss compared to C++. Is this true?

I'll comment on this from a game developers perspective. The author of SharpDX ran a benchmark last year in which he compared the relative performance between using a native D3D11 application written in C++ and several managed alternatives written in C# such as SharpDX, SlimDX and XNA. I'm not sure how accurate these tests really are but the results were:

  • SharpDX performed 1.52x slower than native code
  • SlimDX performed 2.45x slower than native code
  • XNA performed 9.72x slower than native code

So obviously it's true that there's a performance loss. But whether that affects you or not depends a lot the needs of your game. Several commercial games have been created and shipped successfully with XNA (e.g. Bastion, Terraria, Magicka). For the sort of game and the requirements that you listed, it might not be the best choice though.

XNA only supports DirectX 9. I found the ANX framework which is pretty similar to XNA but it is capable of DirectX 11. Would this be a good alternative ?

Last time I checked ANX was still under development. So I'd recommend maybe looking into either SharpDX or SlimDX for now. In fact, ANX is being built on top of SharpDX anyway. And from the benchmark above you can see that SharpDX seems to be the fastest implementation, and not that much slower than native code. But I think SlimDX is more mature and popular though, although I've never used either of them.

I am going to create a first person shooter (3D) and I have plenty time for this. My aim is realtime lighting, realtime global illumination, image-based reflections etc. I want to develop for Windows.

But seriously, from these requirements, I really think that the best choice would be for you to keep working with the UDK or the CryEngine.

share|improve this answer
    
SharpDX is as mature as SlimDX. SlimDX has 'perceived maturity' because it's a manual wrapping process: where SharpDX is automatic and is therefore (in theory) always 100% up-to-date (in fact, in the case that new DX features are added it will be ahead of SlimDX). ANX also has some O(n) operations - which worries me. –  Jonathan Dickinson Mar 26 '12 at 8:38
    
In saying that I mean that SlimDX seems more mature because more work is actually being done on it. SharpDX is essentially a script that does all the work automatically, more reliably and generates much faster code. –  Jonathan Dickinson Mar 26 '12 at 8:52
    
@JonathanDickinson Yes, that's pretty much it! But another aspect that I considered as a part of maturity was documentation. SharpDX states that documentation will be released for RTM, so for now you must rely on the MSDN and the code samples in order to figure things out. The site is also pretty much just a code repository. On the other hand SlimDX lists has full documentation on the website, plus a couple of tutorials for beginners. Personally I'm also more inclined towards SharpDX but I think it would benefit from having the same sort of outer skin as SlimDX. –  David Gouveia Mar 26 '12 at 10:15
    
I agree completely - the documentation is pretty bad. I remember the author saying that there is API-level compatibility between the two (except for different namespaces and other subtle differences) and indicated that the SlimDX documentation would also be usable (in addition to MSDN). –  Jonathan Dickinson Mar 26 '12 at 10:57
    
That benchmark is useful but not entirely relevant here without noting that using native code will not give you 9.72 as much fps as using XNA. The benchmark only describes the overhead of calling the native DirectX functions from a managed context. Most of your code will not deal with DirectX functions and will be 'fast' (it's up to debate if managed is really slower than native at this point). –  Roy T. Mar 26 '12 at 15:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.