12 Replies - 985 Views - Last Post: 30 May 2013 - 08:09 AM Rate Topic: -----

#1 Da1eyG  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 25-May 13

Do I want to switch to C++ Directx ?

Posted 29 May 2013 - 06:26 AM

Hi I read Kurt Jaegers book on learning XNA by example. On the back of it I have almost finished a fps tank battle game that Ive thoroughly enjoyed. I am a physics teacher I have considered trying to supplement my income writing some games in the future possibly. I was very saddened by microsofts decision about XNA when i felt i was really getting the hang of it. I have considered C++ and directx but with two small children I'm not sure I have the time to devote what I may need to it. If it takes me a few months of part time work to make a tank game to get a similar game using c++ i really dont think I could devote a year or so to it. I did find a tutorial on the net of creating a spinning cube in directx 11. Felt a bit lost by the complexity of the code compared to XNA. My maths is fine so Im fine with the concepts, vectors, matrices etc but just the complexity of the API ad thedifficulty of producing bug free code in C++ seems quite daunting.Would be very grateful if you give me some brief guidance. As a hobbyist with limited time available is c++ directx route a bit too ambitious?
Kind regards, Dale.

Is This A Good Question/Topic? 0
  • +

Replies To: Do I want to switch to C++ Directx ?

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9497
  • View blog
  • Posts: 35,844
  • Joined: 12-June 08

Re: Do I want to switch to C++ Directx ?

Posted 29 May 2013 - 06:55 AM

Yeah, you would - in theory - want to move to directx or what not, or you can see about waiting out another fiveish months until Microsoft makes some sort of straight up announcement on the programming framework for their new gen of devices, consoles, etc.

The other alternative is you can shuffle along with Monogame. It takes the XNA framework and open-ish-sources it so you can develop (with the same code) a game for windows, win8, android, ios, etc.

http://www.gamasutra...to_monogame.php
Was This Post Helpful? 1
  • +
  • -

#3 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 1
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Do I want to switch to C++ Directx ?

Posted 29 May 2013 - 09:10 AM

It's game development, so you are going to need patience. I'm an experienced game developer and producing anything like a game in DirectX takes a while. There are a number of things that you really need to learn before getting started with this:

1. Be comfortable with C++. You cannot ignore this - you must learn this language to a comfortable level if you want to write game written in it.
2. DirectX takes time learn not only because of the syntax, but because you will also have to familiarize yourself with the graphics pipeline and how DirectX represents and processes it.
3. The components of game engine architecture and how they all tie together in order to make a playable game.

There is a lot in those three points that will take you time to get up to speed with. If you were hoping for a tutorial of whatever kind to take you from ground zero to being able to make any game via this route, you will not find any.

Game development feels like an 80% effort spend learning with 20% actually spent making games.


Good luck.
Was This Post Helpful? 2
  • +
  • -

#4 Da1eyG  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 25-May 13

Re: Do I want to switch to C++ Directx ?

Posted 29 May 2013 - 01:13 PM

Very useful comments guys thanks very much....

I think I will continue to work on finishing my XNA game as I think it's useful to finish something I've started but also in parallel I have got a kindle copy of Ivor Horton's 2012 VC++ so I am going to start at chapter 1 and work my way through that before I delve into direct X (I've also got Luna's direct X 11 - Amazon 1-click will be the death of me).

Thanks again for the advice,

Dale.
Was This Post Helpful? 0
  • +
  • -

#5 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 1
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Do I want to switch to C++ Directx ?

Posted 29 May 2013 - 01:26 PM

I learned by doing. I have never read a game development book from cover to cover because you learn a lot more in applying your knowledge that no book can list. Get those books if you wish, but they offer no guarantees. How good you are at programming games ultimately cannot be taught by any book since every game project is vastly different and beyond a book's scope.

Sure, complete your XNA game, although I would not advise starting any new projects with that framework. No point wasting hard work! :)
Was This Post Helpful? 1
  • +
  • -

#6 BBeck  Icon User is offline

  • Here to help.
  • member icon


Reputation: 586
  • View blog
  • Posts: 1,306
  • Joined: 24-April 12

Re: Do I want to switch to C++ Directx ?

Posted 29 May 2013 - 06:41 PM

Butch's comment about games being 80% learning and 20% making is so true. Personally, I've committed to at least that much time learning. Even my doing is more about learning. I'm working on building a 3D boat simulator right now; it's part of an effort for future projects of a more advanced but similar nature. I'm spending most of my time trying to learn to model in Blender and understanding boat physics so that I can code the physics model.

However, I disagree that working in XNA right now would be a waste of hard work. If you're trying to make games to sell or even to get your friends to play, then I absolutely agree with Butch's statement. But if you're like me, you aren't really trying to sell anything or even necessarily get someone else to play what you're working on; you're ultimate goal is to learn. And for that, XNA is really the perfect environment, as you've already discovered. I suspect there is much left for you to learn in XNA yet. XNA really allows you to go as deep as you want to go with it. I've been learning High Level Shader Language in XNA. My boat program that I mentioned has a water shader done in HLSL. For learning, I would recommend sticking with XNA as long as you can stand it until something comes out to replace it. There is just so much to learn in XNA that you have to be pretty accomplished before you exhaust all of the learning possibilities in XNA.

But assuming that no one will ever replace XNA, we all eventually have to move on. I'm planning on moving on. I've been going through some of the same dilemma as you. I want to do tutorials for other people, but the XNA community is all but dead now. There's not a lot of point in doing tutorials for a language/framework that no one else uses. So, I've been weighing my options.

I'm so mad at Microsoft over XNA that I about half don't want to have anything more to do with them. I would like to promote the Linux community. So, along those lines, I've been considering moving over to C++ with OpenGL. I'm not too worried about that as I came from C++ and DirectX before I discovered C# and XNA. With everything I've learned in XNA it makes it 100 times easier to jump back into DirectX or OpenGL.

On the other hand, there just really isn't any other environment like XNA out there. RB Whitiker talks about where one might go next after XNA on his website. He, incidentally, has a lot of good XNA tutorials and I suggest you understand everything in his tutorials before even thinking about moving on from XNA.

When you go into the world of C++ and DirectX/OpenGl, you suddenly have all sorts of things to manage that C# takes care of for you (almost none of which has anything to do with game creation really). Once you jump off in the deep end of the pool there you have to start thinking about how the operating system works under the hood. You're probably going to need to write your own memory manager and know Windows (or whatever OS you're using) inside and out under the hood. This isn't "managed" code any more and you have to worry about a lot of stuff that .Net did for you that has almost nothing to do with making a game. And you don't have the rich library of .Net. So you'll have to learn ATL and Win32 programming (or whatever they're doing in Windows 8 these days) and even then it still won't be as rich of a library as .Net is.

C++ even by itself is a little bit of a learning curve from C#. I mean C# gets you thinking in the right direction and is a great preparation for learning C++, but C++ is much more low level than C#. I did Assembler for awhile and what I learned is that C++ is basically Assembler with automatic stack management ... basically. C++ is so close to Assembler its not even funny. (Visual C++ is such a highly optimized compiler that if you disassemble the code you will see that most C++ commands translate into just a couple of machine instructions. The biggest difference is that you aren't working directly with registers and C++ handles the stack and whatnot for you when you make function calls. If you really want a deep understanding of C++, learn Assembler.)

Anyway, I would say, "Spend as much time as you can in XNA before its gone. Your goal should be just to soak up as much game programming knowledge as you can until you feel you can do just about anything. And XNA is the place to do that.

XNA's days are numbered and the community supporting it is all but dead. But even though I have plans on going elsewhere in the near future, I'm really trying to make sure I learn every last thing I can in XNA before moving on. I just know trying to learn the same things elsewhere is not going to be near as easy.

And I hope Modi is right about there being a "Next Gen Framework" from Microsoft in the next year. But personally, I'm not holding my breath on that one. I've gotten the feeling that Microsoft is trying to become more proprietary and controlling of their game platforms. I'm getting the picture they don't want open platforms like the PC; they want something closed that they can control like Xbox professional games. I think they have decided they have no interest in working with independent game makers and want to focus on the "big money". So, while I hope Modi's right, I just don't see that happening unless the failure of Windows 8 suddenly wakes them up and puts some sense back into Steve Balmer's head.

This post has been edited by BBeck: 29 May 2013 - 07:00 PM

Was This Post Helpful? 1
  • +
  • -

#7 BBeck  Icon User is offline

  • Here to help.
  • member icon


Reputation: 586
  • View blog
  • Posts: 1,306
  • Joined: 24-April 12

Re: Do I want to switch to C++ Directx ?

Posted 29 May 2013 - 07:11 PM

Oh. One possibility for you is to do DirectX programming C#. That's kind of an intermediary compromise. Below is a link to a book on just that subject. I'm not certain how that works with Windows 8 though. RB Whitiker talks about C# with DirectX a bit on the link I posted.

This is not something I'm particularly excited about. For one thing, I'm not sure you can even really do this in Windows 8 as a Metro app, or whatever. And while I love the .Net library, I think I might as well go back to C++ if I'm going to do DirectX/OpenGl. But for someone wanting to learn DirectX who doesn't already know C++ this might be a good stepping stone.


http://www.amazon.co...ds=C%23+directX
Was This Post Helpful? 0
  • +
  • -

#8 Da1eyG  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 25-May 13

Re: Do I want to switch to C++ Directx ?

Posted 30 May 2013 - 12:36 AM

Thanks for that also BBeck. Another option is monogame, you've probably heard of it. Kurt Jaegers allegedly very easily ported his c# XNA projects across to it and got it working in Windows RT.

Sure many of the current C# XNA programmers will consider the cross platform advantages of monogame as an alternative to going down C++ route.
Was This Post Helpful? 0
  • +
  • -

#9 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 1009
  • View blog
  • Posts: 4,209
  • Joined: 14-February 08

Re: Do I want to switch to C++ Directx ?

Posted 30 May 2013 - 01:25 AM

Quote

cross platform advantages of monogame as an alternative to going down C++ route


Um...C++ is definitely cross platform :online2long:
Was This Post Helpful? 0
  • +
  • -

#10 Da1eyG  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 25-May 13

Re: Do I want to switch to C++ Directx ?

Posted 30 May 2013 - 01:55 AM

View Poststayscrisp, on 30 May 2013 - 01:25 AM, said:

Quote

cross platform advantages of monogame as an alternative to going down C++ route


Um...C++ is definitely cross platform :online2long:/>

Of course it is, didnt mean it like that. I meant as an alternative to having to learn c++ and Dx they can continue using XNA experience but via monogame.
Was This Post Helpful? 0
  • +
  • -

#11 BBeck  Icon User is offline

  • Here to help.
  • member icon


Reputation: 586
  • View blog
  • Posts: 1,306
  • Joined: 24-April 12

Re: Do I want to switch to C++ Directx ?

Posted 30 May 2013 - 06:25 AM

For me, I'm not personally interested in Monogame. It does allow XNA programmers to move forward somewhat, and Microsoft promoted it as the answer for XNA programmers, but I don't think it really fills the gap. I hear its lacking a content pipeline and I'm afraid there are going to be all kinds of "bugs" like that. One of the advantages of XNA was that it was a solid and mostly bug free platform. Generally, if something didn't work, it was because you didn't know what you were doing and not some untraceable bug.

But for me, it doesn't solve the problem at all.

The biggest advantage of XNA is that there are a lot of (relatively) easy to understand tutorials, and especially books, out there to learn from. As the language dies, that ends. No more books to explain things. Granted, there is already a lot out there published. But I don't need Mono to keep using what I've already got. I'm skeptical that the Mono community is going to be writing a bunch of XNA books.

On the other hand, this is why I'm continuing to work in XNA alone to finish getting everything I can out of the books that I've got. I don't see much point in doing XNA tutorials, if the community is dying out and it appears that everyone else who's been writing XNA tutorials is thinking the same thing. It looked like RB is focusing on writing tutorials on how to convert to Mono rather than writing new XNA tutorials. I let my domain "XNA3D101" expire. I purchased "VirtuallyProgramming.com" with the intent to eventually move away from XNA to something else (which I haven't really determined exactly what that will be). And I think a lot of the people who were writing tutorials for XNA will be moving on in various random directions.

And maybe its time to take the plunge and just do C++. C++ isn't going anywhere. Like I was saying, it's basically Assembly language and machine language will be around as long as the machines exist. C++ can be a little intimidating, but your local community college probably has a class on it that you can take at night or on Saturdays. Really though, dealing with memory is the hardest part of C++. (Memory) Pointers are the thing that really trip people up in learning C++, that and memory leaks which is where you lose track of a pointer. Or memory overwrites where you write data outside of the memory block you intended (C++ - like Assembler - allows you to do anything including shooting yourself in the foot).

But I think that you will find that once you actually learn C++, you'll be like "What was all the fuss about? This wasn't so hard as everyone made it out to be." I know I stayed away from it for many years, being intimidated by it, and then I took a class on it and then I wished I had of learned it years earlier, kicking myself for being so intimidated by it. It does kind of take on mythical proportions due to its advanced nature; I think a lot of people probably think its more difficult than it really is.

For me, if I'm going to have to learn something new, like Mono, I feel like I might as well learn something new like OpenGL. I actually started learning OpenGL many years ago and found it considerably easier than DirectX, but that was so many years ago that things may have changed and I wouldn't know the first thing about OpenGL these days.


I don't know if this is a crazy approach or not, but you might consider spending some time learning Assembly language before attacking C++. Assembly is a 1 for 1 matchup with machine code, which is what the computer speaks natively. So, for all practical purposes you are manipulating the machine at its lowest level. Every other language you come across after that will ultimately be translating its code into machine code. Nothing happens on a computer that isn't happening in machine code. So getting that deep understanding of what's going on may help make C++ make more sense. Certainly, if you can understand Assembler, you can understand C++. Just reading a couple of Assembly language books and making 5 or 10 fairly simple Assembly language programs will likely go a long ways in helping you understand all the difficult computer related topics you will face as you try and learn more. Learning Assembler is kind of "grabbing the bull by the horns instead of being afraid of it". C++ topics like pointers and pointer indirection are likely to make a lot more sense once you understand how things work in Assembler. And in your spare time, you might be able to work through learning the basics of Assembler in just a couple of months. The knowledge is likely to pay dividends later even if you never write a single serious program in Assembler. One of the biggest things you'll learn is how computer memory works. And it puts you in a good place to learn C++, because all C++ is doing is making what you're doing in Assembler a bit easier (not that much easier actually - mostly just easier to read). You don't deal directly with the registers or the system stack, but knowing what they are may help you get deeper into C++. Again, most C++ commands translate into about 3 Assembler commands on average. I don't know. It's something worth considering. I would recommend a couple of books, although they're out of print. The first is Kip Irvine's Assembly language book. This is the one that got me writing Windows (Win32) programs in Assembly language. It's a really good book. It's out of print now it looks like; so it's gotten ridiculously expensive. But maybe you can find a similar book or find a copy in a library. The other book is Jeff Duntemann's book which was written in 1992. That's the first book that made Assembly language clear to me. It's written in a super simple style that makes Assembler easy for anyone to understand. It's a little out of date. I think it was written when 16 bit registers were "all the craze". So, you're not dealing with modern 64 bit registers. But the basics that he explains haven't really changed. That's a reasonably priced book and it should make reading a more modern Assembly language book afterwards much easier.

I know it's a little crazy learning Assembler, but if you're ever going to be a serious programmer, it's well worth the time invested when you move on to learn other things like C++ and Windows (or Linux) internals.

This post has been edited by BBeck: 30 May 2013 - 06:31 AM

Was This Post Helpful? 1
  • +
  • -

#12 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9497
  • View blog
  • Posts: 35,844
  • Joined: 12-June 08

Re: Do I want to switch to C++ Directx ?

Posted 30 May 2013 - 08:02 AM

Quote

I hear its lacking a content pipeline and I'm afraid there are going to be all kinds of "bugs" like that.

It actually does have a content pipe.. and you can also use the existing XNA one as well.
Was This Post Helpful? 1
  • +
  • -

#13 Da1eyG  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 25-May 13

Re: Do I want to switch to C++ Directx ?

Posted 30 May 2013 - 08:09 AM

You seem to be able to use the xna pipeline and the developers are making one solely for mono. I believe mono will become quite big as time goes on. Esp. If you have a finite amount of time to give to programming. I wish I'd got thebug in my twenties when i had so much time, would have been for the c++ journey them im sure.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1