Skip to main content
GameDev.net gamedev.net
🔒 Locked

Using .NET framework in games?

Started by Quil Apr 19, 2009 at 1:33 PM 14 replies 3.4k views
Original Post
Quil
Quil
Heya all. Im Quil and I want to be a Game coder. Im currently learning C++, started from the basic, and I know pretty much (I think :P) now. I know Pointers, References, OOP, and ofcourse all basic things. My dream Goal is to make a MMORPG. I know its still a long way to get there, so I joined this community for some help. At school im doing the "HAVO/VWO" but im going for "VWO" (my marks are mainly 9s and 10s. 10's for math and English). It is the highest level of school we have here in Holland. (High school, as im 13). I have MUCH time to learn (10-14 hours a day) because im in the hospital for Leukemia. With all those extra Medicin's today feeling bad is not happening anymore.. So its alot of computering! =D Anyway, last night I was wondering. Is it wise to use the .NET framework (I already did C# and Visual Basic and PHP before I started learning C++) in the client or server? It has really nice functions, and they are all pretty easy to access. It is just Random rand = new random; (in C#) and then you have access to all random functions. Im learning from a Win32 command-line with the Visual C++ Compiler. That means there are no .NET features in. I want to use the same software the proffesionals do, as I have a photograpic memory (if its bad english: I can remember every detail without problems, I pwn the game Memory). So, what do you think? Is using the .NET framework in a server/client for a game nice?
Heya.
evolutional
evolutional
Have a look at XNA, I think you'd like it
Quil
Quil
I already did. It was around the time I used to program in C#. Was pretty newb back then. Wanted to make MMORPG without even knowing anything about XNA. Thats bad. I know better now. xD

Nah, I prefer DirectX more. Because it is more proffesionel, and I want to do real coding. I want a job in the Game Coding later. So im already learning today. ^^
Anyone has an other answer..?

[Edited by - Quil on April 19, 2009 2:44:58 PM]
Heya.
i_luv_cplusplus
i_luv_cplusplus
Quote:
Original post by Quil
I already did. It was around the time I used to program in C#. Was pretty newb back then. Wanted to make MMORPG without even knowing anything about XNA. Thats bad. I know better now. xD

Nah, I prefer DirectX more. Because it is more proffesionel, and I want to do real coding. I want a job in the Game Coding later. So im already learning today. ^^
Anyone has an other answer..?

First of all, when you're a beginner, you should use beginner tools, so that you learn the basics and proper techniques. DirectX isn't better than XNA on your level - with XNA you can focus on making a game and having fun, while with DirectX you will most likely be working on a low-level code, barely touching the game at all.

Also - even a MMORPG is doable on XNA, proof here
OpenGL fanboy.
Quil
Quil
Quote:
Original post by i_luv_cplusplus
First of all, when you're a beginner, you should use beginner tools, so that you learn the basics and proper techniques. DirectX isn't better than XNA on your level - with XNA you can focus on making a game and having fun, while with DirectX you will most likely be working on a low-level code, barely touching the game at all.

Also - even a MMORPG is doable on XNA, proof here


I would say.. Everyone here started out with low-level codes. I want to learn C++, not C#. I already know C#. And I want to learn DirectX. Not XNA. I already read some tutorials about DirectX, spitted though the code, trying to understand. I know you cant do DirectX well without knowing C++ well. But I have no idea what to know in C++ before I can do DirectX. Im not looking at XNA.

Maybe you can tell me some C++ points where I need to have knowledge about to be "ready for directx" in your eyes? (or someone else..?)
Add: I didnt say XNA could make a MMORPG. I said that when I tryed to, it was like install XNA and think you can make the MMORPG with your basic C# knowledge.

[Edited by - Quil on April 19, 2009 2:37:02 PM]
Heya.
kyoryu
kyoryu
Quote:
Original post by Quil
I already did. It was around the time I used to program in C#. Was pretty newb back then. Wanted to make MMORPG without even knowing anything about XNA. Thats bad. I know better now. xD

Nah, I prefer DirectX more. Because it is more proffesionel, and I want to do real coding. I want a job in the Game Coding later. So im already learning today. ^^
Anyone has an other answer..?


The basics of game programming are the same, whether you're using XNA, or DirectX, or OpenGL. The APIs may be slightly different, but the actual work that has to be done is the same - it's a function of the math needed to do the transforms, etc. It's like reading a file. The API may change in different languages, and you may have to do some low level stuff in some languages that others take care of for you, but the main tasks that you do are the same in any language.

If you really want to program in DirectX, use C++. If you want to use C#, use XNA.

If you're a beginner (and I don't mean that in an offensive way at all), I'd recommend C#/XNA, as it'll remove a ton of problems that you'd have to deal with in C++/DirectX.

Once you've got some basic stuff in C#, you can make a decision if you want to move to C++ or not. The knowledge you've gained will carry over, even if you have to relearn some specifics.
Cygon
Cygon
DirectX more professional? XNA is a .NET wrapper for Direct3D 9.0, plus its optional content pipeline some helper classes that make it easier for beginners to get something on the screen. Whether you use those helper classes is up to you.

The first thing you should do if you want to be professional is to not disregard technologies because of some gut feeling or because they're marketed as being "easy" - but to make an informed decision after knowing the facts.

If you want DirectX 10 and 64 bit, there's also SlimDX, a .NET wrapper for Direct3D that supports DirectX 10. Or Tao.OpenGL if you want to use OpenGL - as an added bonus, the Tao libraries work on linux as well.

.NET is a valid choice for an MMORPG, it has very good networking support, database integration, linux portability and its memory management will automatically prevent memory fragmentation and other issues you'll have to solve by hand in C++. The simple decompilation of .NET code might allow even novice programmers to attempt cheating

C++ on the other side gives you more control over your memory management, eg. object pooling or memory mapping of files, which - in the hands of someone with several years of programming experience - can be effective getting certain demanding algorithms into the real-time range. But this is mainly a concern in cutting-edge graphics or AI.

Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.
Quil
Quil
Quote:
Original post by kyoryu
Quote:
Original post by Quil
I already did. It was around the time I used to program in C#. Was pretty newb back then. Wanted to make MMORPG without even knowing anything about XNA. Thats bad. I know better now. xD

Nah, I prefer DirectX more. Because it is more proffesionel, and I want to do real coding. I want a job in the Game Coding later. So im already learning today. ^^
Anyone has an other answer..?


The basics of game programming are the same, whether you're using XNA, or DirectX, or OpenGL. The APIs may be slightly different, but the actual work that has to be done is the same - it's a function of the math needed to do the transforms, etc. It's like reading a file. The API may change in different languages, and you may have to do some low level stuff in some languages that others take care of for you, but the main tasks that you do are the same in any language.

If you really want to program in DirectX, use C++. If you want to use C#, use XNA.

If you're a beginner (and I don't mean that in an offensive way at all), I'd recommend C#/XNA, as it'll remove a ton of problems that you'd have to deal with in C++/DirectX.

Once you've got some basic stuff in C#, you can make a decision if you want to move to C++ or not. The knowledge you've gained will carry over, even if you have to relearn some specifics.


Yes. I really want to program in DirectX. I think it is an challenge to do something more hard, and that will keep me satisfied. And, when I do C#/XNA, I wont be learning anything about some subjects that only are in C++, like pointers. (Yes I already know them, but the best is to also put them in practice right? Not only in a learning program..)

Quote:
Orginal post by Cygon
DirectX more professional? XNA is a .NET wrapper for Direct3D 9.0, plus its optional content pipeline some helper classes that make it easier for beginners to get something on the screen. Whether you use those helper classes is up to you.

The first thing you should do if you want to be professional is to not disregard technologies because of some gut feeling or because they're marketed as being "easy" - but to make an informed decision after knowing the facts.

If you want DirectX 10 and 64 bit, there's also SlimDX, a .NET wrapper for Direct3D that supports DirectX 10. Or Tao.OpenGL if you want to use OpenGL - as an added bonus, the Tao libraries work on linux as well.

.NET is a valid choice for an MMORPG, it has very good networking support, database integration, linux portability and its memory management will automatically prevent memory fragmentation and other issues you'll have to solve by hand in C++. The simple decompilation of .NET code might allow even novice programmers to attempt cheating

C++ on the other side gives you more control over your memory management, eg. object pooling or memory mapping of files, which - in the hands of someone with several years of programming experience - can be effective getting certain demanding algorithms into the real-time range. But this is mainly a concern in cutting-edge graphics or AI.


Yes, I think DirectX is more proffesional. Firstly because you use DirectX with C++, and C++ is, as you said, a more advanced language as C#. Secondly, because it is more harder to do. Like initializing the whole thing. XNA doesnt have to do that, I know.

But okay, I promise I dont disregard anything anymore because it is 'easy' or 'the proffesionals dont use it'. Im here to learn after all, right? Well learning shouldnt be a problem. :P

As I said before in this post, I rather do C++ with DirectX. And besides 'the proffesionals do it' I will tell you why.

Firstly, because I want to do something that is harder. It will get myself the feeling its a challenge, which will get me satisfied, which will make me learn faster. If I can learn faster as im doing already. If im doing C# and XNA, I probaly (Altough it isnt true, but I have autism, and a feeling can mean alot to me..) get the feeling im wasting time because it isnt that hard. (I said it will be pretty false! xD).
So: I will get a feeling im wasting time because it isnt hard. Feeling means alot for me, so I get bored quickly. But I know it isnt true. But im still bored. I know it sounds really strange, but Autism ís really strange.

Secondly, because I know it is more rewarding on Longtime. As you said a programmer with a few years of experience can do alot more with C++ and directX then with C# and XNA. So if I learn C++ and DirectX, and I wont quit it, it will give me an advance in a few years. When those Cutting-edge graphics and very advanced AI come in :P
Heya.
CadetUmfer
CadetUmfer
I think it's best to work with the same language for both the client and server. You can share types and structures and some code, and it's easier to maintain.

You can certainly write in C#. You'll likely be more productive, and learn a lot--the core concepts (of eg a 3d renderer, or network synchronization) are the same. When you get down to it, APIs like D3D or Sockets aren't that much "higher level" in C#. Just safer and easier to manage.

But like you said, if you're trying to learn C++, learn C++. The Direct3D API is good. There'll be a lot of win32 cruft to work through, and you'll have at least 1 segfault that you can't track down, but it'll be fun. Read this http://www.parashift.com/c++-faq-lite/. Once a week.
Anthony Umfer
jrk
jrk
if you don't mind being limited to the windows/xbox platform then go with c#/net.
for hobbyists and fast prototyping c#/net is really awesome.

if you're more serious about gamedev (and maybe want to port your games to other platforms) you should learn c++ :(
Quil
Quil
Quote:
Original post by jrk
if you don't mind being limited to the windows/xbox platform then go with c#/net.
for hobbyists and fast prototyping c#/net is really awesome.

if you're more serious about gamedev (and maybe want to port your games to other platforms) you should learn c++ :(


Yea, I am really serious about gamedev :P I want a job in the game industry later, want to make games, thats just my true dream! And im not giving it up anywhere, next 40 years! Maybe I'll pwn asses (40 year experience, lol) then, but not now. I know im still a beginner. But everyone was once a beginner. And they learned it too. =)
Heya.
Lord_Evil
Lord_Evil
Quote:
Original post by jrk
if you don't mind being limited to the windows/xbox platform then go with c#/net.
for hobbyists and fast prototyping c#/net is really awesome.

if you're more serious about gamedev (and maybe want to port your games to other platforms) you should learn c++ :(

Well, I used to use C++ and DirectX but switched to OpenGL some years ago, mainly for Linux compatibility reasons. Besides the syntax the algorithms are mostly the same.

Recently I started to port my engine from C++ to C# for productivity reasons. C# allows me to quickly write code that runs on windows and linux as well. And some of C#'s features help productivity a lot if used correctly, like automatic memory management along with GC, delegates and events, etc.
If I was helpful, feel free to rate me up ;)If I wasn't and you feel to rate me down, please let me know why!
Cygon
Cygon
Quote:
Original post by jrk
if you don't mind being limited to the windows/xbox platform then go with c#/net.
for hobbyists and fast prototyping c#/net is really awesome.


...add Linux, Windows Mobile based PDAs, iPhone, MacOS and Zune to that list.

Of course, .NET will probably never see the light of day on the PS3, which is a complete show-stopper for usage of .NET in AAA titles.

@Quil:
All valid reasons!

Just for the books: XNA is at it's core really just a wrapper around DirectX. Initializing the whole thing can be done automatically if you use Microsoft's "Game" class, but also manually by creating the GraphicsAdapter yourself, which includes all the gory details involved in normal DirectX initialization.

Maybe I have lost some perspective over the years -- for me wrestling with an API has become menial work and if something lets me avoid it without breaking any of my requirements, I'm happy to comply. I do remember the time when I was excited over creating the most OS-conformant and efficient rendering window, main loop or Direct3D setup, but over time, that became less and less interesting =)

You can certainly learn a lot about reference counting, resource management and meticulous attention to correct API usage with Direct3D. Good luck on your way!
Professional C++ and .NET developer trying to break into indie game development.
Follow my progress: http://blog.nuclex-games.com/ or Twitter - Topics: Ogre3D, Blender, game architecture tips & code snippets.
yaustar
yaustar
In my professional career, I have never used DirectX or OpenGL directly. Like Cygon, I avoid having to get close to the graphics API because it doesn't interest me.

If you intend to use the .NET frame with C++, you have to use Managed C++ at which point you may as well use C#.

Where is your focus on the MMORPG? Is it the networking? Rendering? Gameplay? Personally, I would focus on one area and take as many shortcuts as possible with other areas to minimise the amount of time to spend on it.
Steven Yau
[Blog] [Portfolio]
Poku
Poku
Im new at gamedeveloping too and im in the same situation. Which language to pick. I think i have been convinced to go with the C#/XNA, but there is only one problem. Where is the books!?!

Which C#/XNA books would you guys recommed for a newbie game programmer like me? There have to been something about how to implement 3D models made in for example 3D Max.
Glak
Glak
Poku,

books have always been a bad way to learn about gamedev. The XNA tutorials are amazing. I'm actually porting my C++/DirectX game over to C#/XNA because of the lack of documentation for XAudio2 (the replacement for DirectSound).

Quil,

When I was a hobbyist I programmed in C++ because I loved it. Then I became a professional programmer (not gamedev though) and now I program my games in C#. Why? Because professionals aren't concerned with showing off talent. We'd rather do things the easy way, enjoy the fruits of our labors, and move on.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.