• Advertisement
Sign in to follow this  

Which language to choose?

This topic is 2998 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've decided to pick up game programming on my spare time but I can't decide on the language. I'm not planning to write anything that really needs the extra speed C++ provides, so first I thought I'd use Java. I pretty much finished a basic arcade engine I can use to write simple games, but the more I write the more I dislike the restrictions of Java.. My current goal is a multiplayer isometric game that can run with atleast 50 players at the same server, so not that massive. But I'm wondering if I should go with C# instead, what would you suggest, which language is better suited for game development?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Deprecated
but the more I write the more I dislike the restrictions of Java..


What restrictions of Java is keeping you from writing a 50 player online game?If those restrictions don't exists in C# then go ahead and switch.You won't lose anything by working on something.

Share this post


Link to post
Share on other sites
Quote:

I'm not planning to write anything that really needs the extra speed C++ provides

C++, as a language, provides no "extra speed" in general. Languages lack performance; performance is only relevant in specific scenarios. Do not fall into the trap of believing that C++ will perforce make all your projects faster. Furthermore, you will be the limiting factor in terms of performance of your projects for some time to come, not the language.

Quote:

so first I thought I'd use Java. I pretty much finished a basic arcade engine I can use to write simple games, but the more I write the more I dislike the restrictions of Java..

What restrictions are those?

In general you're going to be most productive with the language you know best, which seems to be Java at the moment.

Quote:

But I'm wondering if I should go with C# instead, what would you suggest, which language is better suited for game development?

I like C#. I would recommend it -- also Python -- in the general case. However, it's entirely possible that you'll discover you have the same dislikes of C# (or Python) that you do of Java. So you should supply an answer to my prior question concerning what you dislike about Java, and I or somebody else will be able to advise you further.

Share this post


Link to post
Share on other sites
As an old (mostly) C/C++ user, I have to say the Java style often did not match my likings, and sometimes provided unclear models... various friends of mine keep telling me that C# seems to have a much better ecosystem. The most intriguing part of this ecosystem to me is the X360... I'd give C# a go.

Share this post


Link to post
Share on other sites
Quote:
Original post by Black Knight
What restrictions of Java is keeping you from writing a 50 player online game?

There's no restrictions which keeps me from writing these kinds of games, I was referring to the restrictions of Java as a language, I'm not allowed to access functions provided by the OS unless they exist within the JVM. Naturally sun can't give this kind of access as the language wouldn't be platform independent anymore. This isn't that big of an issue, but it really irritates me.

Quote:
Original post by jpetrie
C++, as a language, provides no "extra speed" in general. Languages lack performance; performance is only relevant in specific scenarios. Do not fall into the trap of believing that C++ will perforce make all your projects faster.

C++ is compiled and therefore execute alot faster than a language like python, anyhow this doesn't matter for my project, I just tried to point out that I don't want to use C++ as that seems to be the usual suggestion here.

Quote:
Original post by jpetrie
Furthermore, you will be the limiting factor in terms of performance of your projects for some time to come, not the language.

I've got about ten years of experience with programming, most of it in malware and security programming. Something I'm no longer proud of, but I've got pretty good experience with very demanding programs and applications.

Quote:
Original post by jpetrie
I like C#. I would recommend it -- also Python -- in the general case. However, it's entirely possible that you'll discover you have the same dislikes of C# (or Python) that you do of Java. So you should supply an answer to my prior question concerning what you dislike about Java, and I or somebody else will be able to advise you further.

I want a language that will let me work with the OS pretty much unrestricted. I don't want to use some click-and-play-like game engine, I don't mind support for dubbelbuffering or HW access, but that's about it. Finally I want good support for threading and networking. Unless I have to I don't want to work too much with basic networking.

Share this post


Link to post
Share on other sites
What OS functions are there you must have? I'm certainly not a Java man but it allows you to read/write files, do directory operations, use sockets, use OpenGL. ie pretty much anything and everything you would really need to do.

C# isn't going to get you any closer to the OS then Java does. To a programmer the CLR isn't really much different then JVM.

If you are worried about being close to the OS then you should stick to assembly or whatever else it was you used before.

Share this post


Link to post
Share on other sites
If you want to have a close access to OS features, then your options are highly reduced. C# will give you a better integration with the Windows enviroment, but as pointed out, .Net languages and Java work in a similar way. Both C# and Java have ways to call native code though.

Share this post


Link to post
Share on other sites
Well I would really much like to position my own components, even if it's possible to do this with Java it's not ment to be done. I should position them relative to each other and then let the LookAndFeel decide how the should be positioned. Those nifty little features causes me more trouble than joy.

The inability to communicate with applications outside the JVM, that I'm unable to create a mutex or load a library at runtime. I'm not saying that those things have any major impact the kind of game I'm talking about, but it differs alot from what I'm used to. I didn't mean to offend you or any other Java programmer, I'm sure there are lots of great things about Java if you're more open-minded than I am.

Share this post


Link to post
Share on other sites
As far as good support for threading and networking, it doesn't get much easier than Java and C#. In both of these languages, the support is built into the core language libraries themselves, so you can do tasks in fewer lines with less fuss than what it would take in other languages. You definitely won't be messing with "basic networking". It is all pretty streamlined.

If you want to make extensive use of networking and threads, I think you may need to weigh how important these OS functions are to your game development. Besides those mentioned by the poster above (file access, etc.), which are all built in to Java and .NET, I am not sure what else game development needs. The added benefits of VM threading and networking may be more than worth the loss of these OS functions which are rarely used in game development.

Share this post


Link to post
Share on other sites
Quote:

C++ is compiled and therefore execute alot faster than a language like python

Being "compiled" has about as much to do with its performance, in the general case, as being written by a fellow with a funny name. In general, making relative assertions like this is just masturbation. What matters is what you're actually doing. Furthermore, this is not the forum to be making these sorts of declarations in, as it is frequented by impressionable neophytes. If you want to instigate a discussion about performance, take it to General Programming or some such. I expect there to be no further discussion of the matter in this thread.

Quote:

I've got about ten years of experience with programming, most of it in malware and security programming. Something I'm no longer proud of, but I've got pretty good experience with very demanding programs and applications.

Okay, then you should be capable of making any suitable (non-toy) language run efficiently enough to make a good game.

Quote:

I want a language that will let me work with the OS pretty much unrestricted.

C# will let you use platform-invoke to access OS capabilities that are not directly exposed by the BCL, although you will of course be sacrificing cross-platform capability in doing so. However, mono doesn't have the greatest support for the non-core aspects of .NET anyway (such as Windows Forms), so maybe this won't be a big deal.

So it sounds like C# will work for you if you really want to abandon Java. I'd still vote for sticking with what you know best, but the transition to C# will likely be painless (if you don't know it already).

Share this post


Link to post
Share on other sites
Quote:
Original post by Deprecated
Well I would really much like to position my own components, even if it's possible to do this with Java it's not ment to be done. I should position them relative to each other and then let the LookAndFeel decide how the should be positioned. Those nifty little features causes me more trouble than joy.
That's not really an OS thing. And I'm not sure what you're referring to -- Java allows you to use AWT/Swing without a layout manager with no problems.
Quote:
The inability to communicate with applications outside the JVM

What particular sort of communication do you want? Java can read/write named pipes just fine, and there are interfaces for using COM and suchlike.
Quote:
that I'm unable to create a mutex

java.util.concurrent.locks.
Quote:
or load a library at runtime.

java.lang.loadLibrary().

It sounds like you might want to learn more about Java before passing final judgment on it. The Java environment takes quite a bit of getting to know. Presuming that it must not have a given feature just because you haven't found is odd, given the number of other people who program in Java and would have use for such a feature.

Share this post


Link to post
Share on other sites
Quote:

There's no restrictions which keeps me from writing these kinds of games, I was referring to the restrictions of Java as a language, I'm not allowed to access functions provided by the OS unless they exist within the JVM. Naturally sun can't give this kind of access as the language wouldn't be platform independent anymore. This isn't that big of an issue, but it really irritates me.


Its true java offers no direct access to Native libraries. But it does offer access indirectly through some wrapping. JNI is the basic framework for this , which is difficult to use and on top of it is JNA which much easier and simpler, both offer access to native libraries and there are many libraries that use both , even though most programmers obviously prefer JNA.

Quote:

C++ is compiled and therefore execute alot faster than a language like python, anyhow this doesn't matter for my project, I just tried to point out that I don't want to use C++ as that seems to be the usual suggestion here.


True C and C++ are not only compiled but also statically typed. Py code is also complied to python bytecode but it can become alot slower up to 1000 times (eventhough the number fluctuate quite alot, and there are cases that the slow up can be minimum) according to some benchmarks because is dynamically typed and so the interpreter waste alot of time guessing what is what.

However there are means to speed python up . You can wrap C libraries . You can call C libraries directly with ctypes. And lastly there is Cython.

Cython is basically python syntax language that can take a python source code and converted to c code , it also offer optional statical typing so its the perfect cross C/C++ with python with almost no loss at speed(actually Cython in some case has been reported to be faster than C/C++ but is usually less than 30% slower ). You can take then the C source file generated by the python code through cython and compile it like any other C app. Cython can be used to complile whole python apps or export c functions to python or python functions to c.

So there you have it several solutions to a single problem. Of course in the end good profiling is all that it takes to speed things up for any kind of language.If you know where the problem is , you can attack it properly.

You should be not worried with the choice of language so much, each one has the ups and downs. Its more like a personal choice than a practical one.

But yes I recommend python , it very easy to learn and use. In the end use the one that makes you happy and help you enjoy the process. If you dont have fun then you do not do it right.

Share this post


Link to post
Share on other sites
C# and XNA are widely popular.

I would go there, since it provides you with the means of creating your game for the most part.

there is no popular equivalent that exists.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement