Jump to content

  • Log In with Google      Sign In   
  • Create Account

Finding a cross-platform, easy to use language


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 Peppit   Members   -  Reputation: 123

Like
0Likes
Like

Posted 12 April 2013 - 11:56 AM

I know this probably gets asked a ton, but I still haven't found a good answer from the tons of articles/posts on the topics that I have read. I'm really not sure which language to use to start developing games. To start off, I'm obviously going to make some 2D games. There are quite a few options for 2D engines, but I can't decide on which one to use. On top of that, I need a cross-platform option since I strongly prefer to develop/test on a linux machine.

 

Anyways, here are the languages/libraries I have looked at:

 

C++/SFML

Pros:

  • I use C++ for my classes so developing in C++ could help my academics too
  • Getting better at C++ could help my career options

Cons:

  • C++ can really suck to debug
  • You have to manage a lot of extra stuff in C++
  • Compile times

Python/PyGame/Pyglet

Pros:

  • Python is a great language and easy to program in

Cons:

  • Distributing python programs to windows is tough
  • It's difficult to "lock down" python programs and prevent people from having the source
  • I really have no idea how to make sure that the distributed game has all the dependencies met

Java

Pros:

  • Easy to distribute
  • "Enterprise" language that could translate to career skills

Cons:

  • I've never programmed in java before
  • I'm not sure how the performance is for games (minecraft horror stories)
  • I would have to learn Eclipse, which from what I hear is almost mandatory for java

I know that I should just pick whichever one I'm most comfortable with, but I'm not especially comfortable with any of them. And on top of that, I would be happy if I could translate any skills I learn to a career. I would really appreciate any advice.



Sponsor:

#2 EddieV223   Members   -  Reputation: 1407

Like
2Likes
Like

Posted 12 April 2013 - 12:13 PM

You should also have c# on that list.  I would suggest c++ or c# if you want to make games.  C++ is without a doubt more challenging but provides you with a lower level of control.  You have to know more about computers and code to write c++.  So if you learn c++ then you can pick up any language after that pretty easy.  And yes SFML2 is very good.

 

Also c#/xna is pretty good.  C# as a language makes programming easier and it has great OOP design.  XNA while no longer being developed is still a good library, monogame is good for 2d as well.


Edited by EddieV223, 12 April 2013 - 12:14 PM.

If this post or signature was helpful and/or constructive please give rep.

 

// C++ Video tutorials

http://www.youtube.com/watch?v=Wo60USYV9Ik

 

// Easy to learn 2D Game Library c++

SFML2.1 Download http://www.sfml-dev.org/download.php

SFML2.1 Tutorials http://www.sfml-dev.org/tutorials/2.1/

 

// SFML 2 book

http://www.amazon.com/gp/product/1849696845/ref=as_li_ss_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=1849696845&linkCode=as2&tag=gamer2creator-20

 


#3 tisdadd   Members   -  Reputation: 313

Like
2Likes
Like

Posted 12 April 2013 - 12:41 PM

Eddie has some very great points.

 

I myself was programming an android game using the native SDK, then hit  the point of rotation... and realized that while I know enough OpenGL to pull off what was needed, I would be writing my own library.

 

So, after looking around I found libgdx, which worked with my Eclipse environment and let me have stuff up and running extremely quickly. More importantly (to me) was that it was running without lagging down my phone... and that the code I looked at was written in a way that I would write my own library.

 

This article had a decent speed comparison across several platforms.

 

Of course, as soon as I finish my current app I will be working on some Wii Homebrew in C++...with SDL.


Edited by tisdadd, 12 April 2013 - 12:47 PM.


#4 AllEightUp   Moderators   -  Reputation: 4274

Like
2Likes
Like

Posted 12 April 2013 - 01:40 PM

The language debate should come down to what you personally feel most comfortable with.  All the Pro's and Con's are actually going to be shared by all the languages at different levels.  Distribution of a program for instance, all the languages have issues:

 

C++ does the user have DLL x, how did that DLL get on your system to start with, where can you find one to distribute, etc.

C# did you code against .NET 4.512344323423 whatever and the user only has 4.4?  How do you get them updated?

Python, same problems, different language and packaging.

Java, what runtime is on the machine?  Is it some old buggy version and you coded against a new version?

 

Performance.  Each language has it's share of problems.

Difficulty, yup C++ is probably the stand out here.  Though I find Java to be a nightmare personally because I'm not used to the pass by value versus ref rules and have little patience for them getting in my way, I prefer the C# model of being explicit with the ref keyword.

 

Anyway, I'll stick to what I initially said.  Choose your personal favorite and go from there.



#5 Nick Gravelyn   Members   -  Reputation: 851

Like
0Likes
Like

Posted 12 April 2013 - 01:44 PM

If you don't mind a more ActionScript/JavaScript style syntax, you could look into Haxe: http://haxe.org/. In my limited toying with it, it seems rather nice. They have NME, HaxePunk, and HaxeFlixel for getting going on 2D games. Not sure what 3D support you could find. Haxe is nice in that it cross compiles into other code (C++ for Windows, JavaScript for the web, etc) so there's no runtimes to worry about. Seems like a good idea for someone looking to use the same code across a lot of platforms.


Edited by Nick Gravelyn, 12 April 2013 - 01:45 PM.


#6 mhagain   Crossbones+   -  Reputation: 8286

Like
0Likes
Like

Posted 12 April 2013 - 04:40 PM

The other option for you is C.  C compilers are available for just about anything that has a micro-chip, so platform support is not a concern, but it is rather low-level and may present the same debugging difficulties you find with C++.  That really depends on what those difficulties are, of course.  You also need to be aware that you won't find many of the more modern programming constructs you may be used to in C, which is a bit of a double-edged sword; on the one hand it's an extremely minimal language, on the other it may involve a good deal more work (and a good deal more danger) to get stuff that you may otherwise take for granted done than a higher-level/more modern language.


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#7 ultramailman   Prime Members   -  Reputation: 1587

Like
0Likes
Like

Posted 12 April 2013 - 05:08 PM

There is also Lua to consider.



#8 maxgpgpu   Crossbones+   -  Reputation: 281

Like
0Likes
Like

Posted 12 April 2013 - 07:20 PM

My answer is plain old C.  You can write virtually any kind of program on any platform in C.  C is a bit more cryptic than some languages.  The close-brace "}" can close just about anything and everything, and you can't tell what without working back through the open braces that came before (not difficult if you indent wisely, and modern IDEs highlight matching braces for you).

 

C is vastly easier than C++, because C can do anything and everything with only:

  - statements

  - variables (including structure-type variables)

  - functions

 

Since you do everything with so few mechanisms in C, you totally habituate those mechanisms in short order.  At the start, if you haven't programmed in assembly-language first, habituating pointers will take a bit of time and effort.  But this mechanism is so completely general, you can implement unlimited constructs and organizations with them.  So once you've habituated these very few language mechanisms, plus allocation via malloc() and free() or equivalent, you can literally do anything without any new language mechanisms.  You can, of course, create as many high-level mechanisms as you want in C, and where they make sense, go for it.

 

Once you start down the C++ road, forever it will control your destiny... with many, then dozens, then endless other constructs, all of which are supposed to make your life and programming easier, but unavoidably make your life and programming vastly more complex --- just to remember what everything is.  Of course, if you have a great memory, and you program with C++ for hours every day (in a full-time job or equivalent), you can memorize and internalize quite a bit reasonably well.

 

Another problem with C++ is, the tendency towards fads, most of which are called and sold-as "standards", then later replaced by other "standards", then later replaced by other "standards", and so forth, ad-infinitum.  If you want your programs to work in 5 years, 10 years, 15 years... program in C.  If you don't mind if your programs are obsoleted in 5 years, and you have a great memory, and you love fads, and you love to adopt 23 external "standards"... then try to make them all work together in something resembling a coherent manner, then C++ is your perfect choice.

 

I know several brilliant people who program in C++.  All they want to talk about with me is the latest fads for C++, and seemingly that's almost all they ever do.  In contrast, I spend all my time focusing on what my applications need to accomplish, and the best way to accomplish it.  I don't need to think about C (the language), because I can do anything in C, and "everything is the same" (meaning, I don't need new language features to implement new application features).  Fact is, many if not most of my applications are highly object oriented in one way or other, and I have no problem whatsoever implementing that object orientation in C, in the way most suitable for each application.

 

BTW, I learned C++ first, then backed into C after being burned by C++ too many times.  The transition was such a relief, it is almost impossible to describe.  But prepare for most folks to look down on you, criticize you, call you neanderthal, and so forth.  You'll win no popularity contents programming in C.  And if you happen to write a world-class popular application in C, like Linux for instance, be prepared for everyone to accidentally forget to mention what language you wrote in.


Edited by maxgpgpu, 12 April 2013 - 07:27 PM.


#9 Álvaro   Crossbones+   -  Reputation: 13936

Like
0Likes
Like

Posted 12 April 2013 - 08:52 PM

C is vastly easier than C++, because C can do anything and everything with only:
  - statements
  - variables (including structure-type variables)
  - functions

By that token, binary lambda calculus is even easier. smile.png

Seriously, I think people should learn C before C++, precisely because it is simpler and less overwhelming. But there are lots of things that are easier to do in C++, many of which are very useful. As a simple example, making a mapping between arbitrary-length strings and doubles (say, parameters read from a configuration file) is trivial in C++ (std::unordered_map<std::string,double>) and a pain in the butt in C.

#10 TheChubu   Crossbones+   -  Reputation: 4839

Like
0Likes
Like

Posted 12 April 2013 - 09:12 PM

Java

Pros:

  • Easy to distribute
  • "Enterprise" language that could translate to career skills

Cons:

  • I've never programmed in java before
  • I'm not sure how the performance is for games (minecraft horror stories)
  • I would have to learn Eclipse, which from what I hear is almost mandatory for java

There are two main options for an IDE, Eclipse or Netbeans. I hear Netbeans is easier, but I like Eclipse so I haven't tried Netbeans.

 

Java has some important Pros you havent mentioned:

 

  • It's a generally easy language to pick up because its pretty simple. You don't have lots of syntax sugar, nor many crazy tricks with pointers/counters/etc that you might encounter inside code in the wild.

 

  • It has a massive standard library with all sort of things. For example, ImageIO.read() and you got your png/bmp/jpg loaded (no matter if its greyscale, rgb, alpha or no alpha, etc). IO is really easy, threading is really easy, etc.

 

  • On performance critical stuff (ie, parts of Math library), there is a native implementation instead of a Java one.

 

  • JDK sources available. Want to check out how something is implemented? Want to use a particular class of some library? Check the sources, import what you need.

 

  • It has a common naming scheme convention (classes start with uppercase, variables with lower case, and so on, that means mostly no "__varXYZ" stuff).

 

  • It's very well documented. Not only that but documentation seamlessly integrates with your IDE. Hover the mouse over something you don't understand and bam! Official documentation as fast as your internet connection can deliver. No checking forum posts that half know what stuff actually does. Once you get the hang of the syntax, you can explore, learn and use (most of) the libraries easily with the documentation at hand.

 

  • As long as you're not using native stuff, porting is really easy. As easy as launching the thing on a different OS. And you get the same result too. If you're using native libraries, then you're limited to what platforms those libraries support.

 

I think Minecraft's problems aren't an issue with Java but just poor design choices  Uses very old fixed function OpenGL, it looks horrible to extends since every mob has a dedicated class that knows how to render it specifically (so you have CreeperRender class, PigRender class and so on), it didn't cull cubes for a very long time (and "advanced OpenGL" option that did cull them was buggy as hell) and so on. Thats just my opinion though.

 

 

And a few Cons I would consider:

 

  • Its very easy to do "stupid" things. If you want your code to perform well, you can't ignore memory even if you're in a managed environment. "newing" stuff is a very easy thing to do and a very fast way to get you into making overweight applications.

 

  • Again, no syntax sugar. This might be a bad thing for you if you're used to operator overloading for example.

 

  • "protected" is... Not what you'd think it is. Useless if you're developing on a single package.

 

  • Some consider "static final void method()" madness biggrin.png

 

  • "Every file is a single class" (except for nested ones) is annoying sometimes.

 

  • Buffer madness. Using some native stuff (ie, OpenGL through LWJGL) requires passing things around in Buffer classes, which means duplicate data and additional operations (in some sense, you end up using arrays in a even lower level than arrays in compiled languages, by setting up position pointers by hand, endianess, etc).

 

And things I'm forgetting probably biggrin.png


Edited by TheChubu, 12 April 2013 - 09:18 PM.

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

 

My journals: dustArtemis ECS framework and Making a Terrain Generator


#11 AllEightUp   Moderators   -  Reputation: 4274

Like
0Likes
Like

Posted 16 April 2013 - 09:15 PM

 

I think Minecraft's problems aren't an issue with Java but just poor design choices  Uses very old fixed function OpenGL, it looks horrible to extends since every mob has a dedicated class that knows how to render it specifically (so you have CreeperRender class, PigRender class and so on), it didn't cull cubes for a very long time (and "advanced OpenGL" option that did cull them was buggy as hell) and so on. Thats just my opinion though.

In saying this, you are basically confirming my point.  All languages have problems, if you are new and don't have a clue, you might think this is all good and poor design choices etc will happen.  You can shoot yourself in the foot no matter the language.  I don't care to argue such topics, I'm just pointing out that you basically made my point from a learning point of view. :)  My opinion is be comfortable and if you shoot yourself in the foot, learn from it and move forward.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS