Hello, I've had lots of game programming experence with the blitz and other languages. Now I'm considering to learn C++ or Java; I know that these languages are not for a beginner programmers so thats why I'm glad to took the time with blitz! I have a few questions about these languages and which one to choose from... I know that both languages are very powerful for games. Do any of these languages have directx 10 or 9 support?(I need some directx 10 support becouse blitz only has dx7 support)

Mattias_Gustavsson
—
2009-09-26T13:49:10Z —
#2

It depends a bit on what your goal is. If you want to work in the games industry, you need to know C++, and you need to know DirectX (not OpenGL).

If you're learning just to make your own little games, then Java is as good a choice as C++. There's differences of course, but you'll be able to make games with both. If you're interested in DirectX 10 support though, I'd say C++ is the better choice, as DirectX is configured for C++ use out-of-the-box, while on Java you probably (?) need some sort of wrapper...

MMO
—
2009-09-26T15:31:29Z —
#3

@Mattias Gustavsson

It depends a bit on what your goal is. If you want to work in the games industry, you need to know C++, and you need to know DirectX (not OpenGL). If you're learning just to make your own little games, then Java is as good a choice as C++. There's differences of course, but you'll be able to make games with both. If you're interested in DirectX 10 support though, I'd say C++ is the better choice, as DirectX is configured for C++ use out-of-the-box, while on Java you probably (?) need some sort of wrapper...

Well I guess i should go with c++ then. Since that c++ supports directx 10 the graphics wont come out fuzzy like in the blitz3d. Also when I start learning c++ do you think I should start with 2d or 3d?(I have experience with both 2d and 3d)

Since that c++ supports directx 10 the graphics wont come out fuzzy like in the blitz3d

Hmm, I don't understand what you mean here... if you use 2d-sprites and linear interpolation, things will look just as blurred in DirectX10 as in DirectX7... If you use 3D objects, it will look just as sharp in both DirectX7 as it will in DirectX10.

Perhaps it will be easier for us to advise you if you describe what type of game you're making, and what the reasons are that you feel that Blitz might be inadequate...

fireside
—
2009-09-27T03:34:25Z —
#5

If you have experience in 3d, then you can probably just stick with 3d. As far as language, the choice is really if you want to use a scripted language, and there are quite a few, or use c++. The reasons for using a scripted language are that you won't be hunting down memory errors and you can edit the game and run it rather than re-compiling every time you make changes. You were already using scripting when you were using Blitz3d. It doesn't take long to learn another scripting language if it's different. The reason for using later versions of Directx or Opengl is for better shadowing and shaders mostly, and also speed. If you are a hobbyist, it's going to be a lot faster using one of the engines and probably a scripted language to develop your game. Using c++ with an engine like Ogre or Irrlicht or something isn't bad either because most of the memory management is taken care of, you just make a few calls. There are a few complete engines written in Java which are pretty nice, but there will be a slight speed hit since it's not as fast as c++. There are also some engines using c# which eliminates memory management and has a lot of extra libraries. Personally, I would look at engines first and find one that did what you wanted and then think about the language after. When you do learn a language, however, you should study it without the engine first. On the other hand, if you want to get into the game industry, you should probably study c++ and possibly directX like Matt said. You could also look at XNA, I think they call it, after learning c++ or any of the engines that use c++. XNA can also use c# which is a lot like java but it has a very large developer community and it can be used to possibly sell your game. It's pretty tough to actually write a game in 3d by yourself without an engine or higher library than directX. When you say you have experience in 2d and 3d, hopefully this means you have written complete games with menus, levels, etc. If you haven't done that, it would probably be better to use 2d.

you can edit the game and run it rather than re-compiling every time you make changes.

There's also Edit-and-continue in visual studio: set a breakpoint, make your changes, resume execution. Works a treat most of the time. I don't think using a scripting language is useful for the lone dev/hobbyist.

rouncer
—
2009-09-27T10:56:59Z —
#7

Java kinda has advantages of its own, if you want really neat applets that can play straight out of a web page, wasnt that what java was invented for? Cause c++ cant do what java can do in that respect.

I see your name is "MMO" and maybe in the near to far future youd like to have a networked game for people to connect to (i am not concerned, if its just a dream of yours to have, at least you sound like you honestly want to do a bit of work yourself.), im quite sure java has in it the networking stuff you need. But of course c++ has it too.

You could write a mini mmo with both.

Java is technically a little less of a performer than c, but if you cut the game down in a few areas, im pretty sure java can impress.

If you were writing in java, youd be using their 3d library, which is not direct x, but its still quite impressive...

Hertta
—
2009-09-27T13:01:10Z —
#8

It does not matter which language you use. What matters is HOW you use it.

fireside
—
2009-09-27T13:22:58Z —
#9

I don't think using a scripting language is useful for the lone dev/hobbyist.

There isn't a big advantage. A lot of engines compile to a dll so it's very much like a scripted engine except you can go back and recompile the dll with your own changes. Still, it's easy to make memory errors with c++ and time gets wasted finding the errors which isn't necessary with a scripted language. C++ has a longer learning curve because of the memory issue and pointers so it takes more time to get started making a game, so I would argue the point. A lone developer needs to worry about art work and game design, so it's a very large agenda already. It's going to mostly boil down to personal preference. People who are more technical will choose c++ and generally have a lot more problem doing art work. People who are a little more artistic will generally choose a script language. If you take a look at the more productive engines like Unity, Torque, and many others, you can see that a lot of people are doing better with a scripted engine. It would be interesting to get XNA statistics, but I would be willing to bet that the majority of lone developers and hobbyists are using c#. Memory issues are a pain in the neck and if you aren't in that type of mind frame, it's better to avoid the issue by using a memory managed language. Most of the engines are written in c, so the speed difference is minimal for the amount of script used.

poita
—
2009-09-27T13:59:51Z —
#10

Honestly, I think the whole "memory errors in C++" thing is really over-exaggerated. You rarely need to use pointers in C++ and when you do, for 99% of those cases the STL auto_ptr and Boost's shared_ptr handle everything for you.

I do agree with the longer learning curve though. It takes a very, very long time before you can start using C++ well.

Mattias_Gustavsson
—
2009-09-27T14:53:10Z —
#11

also, the built-in CrtDebug stuff makes it dead easy to stay on top of memory leaks even without smartpointers

SamuraiCrow
—
2009-09-28T00:19:25Z —
#12

@Mattias Gustavsson

It depends a bit on what your goal is. If you want to work in the games industry, you need to know C++, and you need to know DirectX (not OpenGL).

The Mac users on this forum burn with wrath as they look in your general direction. :dry:

Mattias_Gustavsson
—
2009-09-28T08:55:14Z —
#13

Well, I'm not knocking Mac, or OpenGL. It's just that games companies ask for people who know DirectX, so it wouldn't make sense to tell someone who wants to get into the industry to focus on OpenGL, even though it would work just fine to make games with.

poita
—
2009-09-28T10:09:52Z —
#14

@Mattias Gustavsson

Well, I'm not knocking Mac, or OpenGL. It's just that games companies ask for people who know DirectX, so it wouldn't make sense to tell someone who wants to get into the industry to focus on OpenGL, even though it would work just fine to make games with.

Well, the PS3 and many (most?) mobile devices use OpenGL, so I don't think it's all about DirectX anymore.

In any case, it's not like someone who knows one is going to have a really hard time learning the other. I think employers would be mainly just looking for someone who can make stuff - their API of choice is really a secondary consideration.

SyntaxError
—
2009-09-30T02:34:45Z —
#15

I have been building stuff with my own higher level graphics API so I can support both OpenGL and DirectX. I'm sure I'll need to update it in the future when newer versions of DirectX come out but at least I'll have a good starting point.

As for C++ vs Java, I've never been enamored with byte code/JIT languages for stuff that needs to run fast, so I tend to stick to C++. Also my personal experience with Java has been sub-optimal but I'll have to admit I haven't tried it in a few years.

Also I'm a bit confused by the entire programming language fear factor that seems to go around these days. At some point in the not so distant past you rarely heard talk of language X being too complex for someone. If you needed to program in X you got a book, took a class etc. Now I sometimes get yelled at for recommending C++ to someone because It's "too hard" for them. My opinion is if Java, C#, Visual Basic or some scripting language makes sense in a given case use them, but don't be afraid of C++ or any other language. There is no computer language that should scare anyone.

Reedbeta
—
2009-09-30T03:52:56Z —
#16

I don't know...APL scares me a lot.

In all seriousness, though: while C++ certainly can be learned by anyone with a modicum of programming experience, I think the general consensus is that C++ is not the best choice for a first language. We usually recommend Python or some such as a first language, because when you're just getting familiar with how computer languages work and learning to think like a programmer, it's a lot less confusing and frustrating if you don't have to worry about memory management, the funny ways C/C++ treat strings and arrays, the idiosyncrasies and gotchas of the standard library and STL, and so on. I think possibly the disapproval of C++ as a first language may be what you are encountering when people say it's too hard for someone.

fireside
—
2009-09-30T19:41:47Z —
#17

Languages keep moving to simpler models as computers get faster. I can use c++, and I have for a few almost games I've done with it, but I don't particularly like it and I wouldn't use it unless I felt it was necessary, which it really isn't for anything I plan to do anymore. It used to be you couldn't write any kind of serious game except in c++, but that is kind of changing. I think it can sometimes be a hindrance for some people because they insist on using DirectX or Opengl rather than a higher library and they end up basically re-inventing the wheel to write games. You could kind of do that in the old days but now with physics libraries, etc, everyone is dependent on using higher libraries or writing extremely simple games. As far as I'm concerned, if I don't have to bother with memory management, that's one less chore I have to do. C++ really has become a low level tool. If someone enjoys that kind of thing, that's great, but it doesn't have much to do with game design or graphics design or much of anything, really. If you want to do it professionally, it's a necessity. If you're a hobbyist or indy, it isn't. If you don't think it's harder, you probably haven't used higher languages much. Most of the exploits done for viruses, etc, are done with c or c++ code because it's easy to screw it up. Most game crashes will be because of an inexperienced c or c++ coder. I think Ogre is a cool engine, but one of the complaints about it is that the games that are written with it crash a lot. I personally doubt that has anything to do with the engine but the c++ coders that used it to write the game. Play some Unity games and you will find them to be solid and written by much less competent coders.

Hertta
—
2009-09-30T21:11:55Z —
#18

Thats it. C or C++ does not hold your hand. It does not care what you try to do with it. For example, it does not stop you from trying to access data which is out of scope. It tries, and it fails. Your fault.

With great power comes the great responsibility.

oisyn
—
2009-09-30T22:41:51Z —
#19

@Mattias Gustavsson

Well, I'm not knocking Mac, or OpenGL. It's just that games companies ask for people who know DirectX, so it wouldn't make sense to tell someone who wants to get into the industry to focus on OpenGL, even though it would work just fine to make games with.

What serious game company asks it's applicants for DirectX knowledge? Sure, if you're interested in a graphics programmer on PC, then DirectX is a plus. But otherwise I don't think I've ever seen that as a requirement.

I'm sorry, but this is just plain bullshit. Java and .Net allow you to make the exact same mistakes as C++ does. The only difference is that in C++ everything blows up (if you're lucky), while .Net and Java throw an exception. It's not that if you're using a managed language, you can no longer dereference a null pointer, access an array beyond it's bounds, or leak memory. The programming errors are exactly the same, and the result is exactly the same: a crashing game.