Jump to content

  • Log In with Google      Sign In   
  • Create Account


XNA vs Love2D vs Java performance


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
7 replies to this topic

#1 vladmihail   Members   -  Reputation: 312

Like
0Likes
Like

Posted 09 January 2013 - 05:03 AM

Hello guys !

 

     For quit a long time i am trying to decide what language and engine should i choose! I learnd Java for 7 mounths and i know almost everything about the syntacks and how its works.But i heard that Java is slow for making games (PC games) and very good for Android. After that i search for C# and Xna and i heard a lote of good things about it but i cant find any tutu for Xna 4.0 for making games.My plan its to read tutus and after that i start  making games on my own. 

    Because i could not find any tut i started making simple games in Love2D but as i know Lua its just a script language and because of that i think its not fast enought to make big projects.

   My goal its to make just 2D games where i can draw many objects whitout be worried of performance issues. 

  Thanks for reading!



Sponsor:

#2 jbadams   Senior Staff   -  Reputation: 17970

Like
3Likes
Like

Posted 09 January 2013 - 06:59 AM

clicktobegin.net/programming/myth-java-not-suitable-for-games/

Java is perfectly capable of a performant 2d game with a high object count, I'd suggest sticking with it given the time you've already put in. :-)

(Posted from mobile.)


Edited by rip-off, 09 January 2013 - 08:45 AM.


#3 rip-off   Moderators   -  Reputation: 8114

Like
2Likes
Like

Posted 09 January 2013 - 08:44 AM

It depends on what you want to achieve. I wouldn't try to write the core engine Doom (N + 1) in Java, or Lua. That said, I wouldn't try to write it in any language because it would be an unreasonable goal for a hobby project.

 

So when people talk about performance and languages you have to bear in mind what they are coming from. For example. if John Carmack doesn't use these languages, it is because they are technically unsuitable for what he is trying to achieve. However ID's gameplay programmers are probably using some kind of scripting language with performance characteristics similar to Lua. However Markus Persson finds Java perfectly adequate for what he is trying to achieve.

 

The real question becomes, is Technology X suitable for the game you want to make and can make? For beginner developers, the technology is rarely the limiting factor.



#4 Alan C   Members   -  Reputation: 137

Like
1Likes
Like

Posted 09 January 2013 - 08:56 AM

Java can do the job, just off the top of my head I can think of 2 big games

http://www.runescape.com/

https://minecraft.net/

 

XNA is a good platform too, and since C# and Java are very similar you may have no trouble learning it.  Here is one basic tutorial, and there are many other's on the same site:

http://xbox.create.msdn.com/en-US/education/tutorial/2dgame/getting_started

I know it says for xbox, but C# XNA can be compiled for Windows too.  You can choose to ignore all the steps concerning xbox.  On the bottom, just download the one that says: Project and Content - Windows.


Edited by Alan C, 09 January 2013 - 09:16 AM.


#5 Serapth   Crossbones+   -  Reputation: 5326

Like
2Likes
Like

Posted 09 January 2013 - 09:32 AM

Since this is posted in the beginners forum, I will say at that level, the performance difference is more likely to be the programmer than the platform.

 

Otherwise, I would actually look at those platforms as all being somewhat comprable in performance.  I've not got a lot of experience with LOVE, but Lua is capable of being exceptionally quick for a scripting language.  Between C# and Java, I give C# the speed nod simply because it's native invocation system is faster.  That is often the achilles heel of Java titles, but again to beginners, will be a very small, almost unimportant factor.



#6 Dan Mayor   Crossbones+   -  Reputation: 1712

Like
3Likes
Like

Posted 09 January 2013 - 11:06 AM

Java is slightly slower than C++ across all platforms, however the rendering of your game is done in the graphics API not Java.  For instance, to make a nice fast game on windows you would invoke the DirectX API (yes it's true DirectX is faster on windows than Open GL is.  On every other platform Open GL is faster, it's a little known fact that windows since Vista has been actively hindering OpenGL to favor Direct X.  The underlying operating system some how impairs the path to the video card for anything that isn't Direct X.)

 

C# is faster on Windows than Java in most cases but still just slightly slower than C++ in some areas.  In some other areas C# is actually faster (namely when making direct hardware calls, but this isn't to be confused with DirectX still having control over your video card.  C# will perform faster directly reading hardware such as say a USB input device because of the nature of the two part compilation wherein C# programs self optimize themselves to your specific hardware).

 

We also have come to the point where computers are fast, even the old ones.  It's rare you will find anyone who has anything less than a dual core processor, most game players tend to have at least a 1gig video card and 3 - 4gigs of ram.  Your serious players, well you probably couldn't lag their system if you tried.  So the minor speed losses on some of the lowest level calculations are never really noticable any more.  Sometimes the effective performance is actually faster in these "Safer" languages like Java and C# because they protect you from silly memory leaks and in the case of C# on windows it actually molds itself to the hardware it's running on.

 

I must point out a VERY VERY important fact about Java and it's multi platform capabilities though.  Java on Android is NOT the same as Java on PC.  Yes Java is the language of android the the majority of the dependency libraries you will be using (Such as OpenGL) are lite or stripped down versions that are tailored to the specific hardwares of the phone.  Not everything you can do on PC will be available on the android, be very careful if you are targeting both and make sure you do your research and test frequently.  It is not as simple as clicking "Build for Android" to turn your PC game into a droid game!

 

All in all, most if not all modern computers and I would even risk saying every single one of your potential players computers are plenty powerful enough to muscle through a 2D game in pretty much any language.  The limitation would come in to play with the amount of effects and "moving parts" in your visuals.  At this point you want to ensure that you are using either Direct X or Open GL.  Open GL is the fastest video card API around but windows will limit it to make Direct X work better.  Open GL is plenty fast enough on every platform to run a 2D game at the same visual speed as Direct X.  If you intend to go multi platform and you are not using a game engine then go Open GL.  If you are using an engine or your a perfectionist like me then you want to make make Direct X builds for windows based os' and Open GL builds for everything else.  Be aware though, the human eye only see's things at around 33 - 36fps.  So when you have Open GL running 90fps on windows and you have Direct X running at 110fps on windows the player will never notice either one being faster no matter how hard they look.  (That same game may run at 130fps using Open GL on Mac or Linux but again it is not noticable to the human eye ball).

 

In short if your comftorable with Java already continue to learn young padiwan, just be aware that your not going to make an MMO out of it.  Stick to 2D games and moderate 3D games you'll be fine.


Digivance Game Studios Founder:

Dan Mayor - Dan@Digivance.com
 www.Digivance.com


#7 vladmihail   Members   -  Reputation: 312

Like
0Likes
Like

Posted 09 January 2013 - 11:44 AM

Java is slightly slower than C++ across all platforms, however the rendering of your game is done in the graphics API not Java. For instance, to make a nice fast game on windows you would invoke the DirectX API (yes it's true DirectX is faster on windows than Open GL is. On every other platform Open GL is faster, it's a little known fact that windows since Vista has been actively hindering OpenGL to favor Direct X. The underlying operating system some how impairs the path to the video card for anything that isn't Direct X.)

C# is faster on Windows than Java in most cases but still just slightly slower than C++ in some areas. In some other areas C# is actually faster (namely when making direct hardware calls, but this isn't to be confused with DirectX still having control over your video card. C# will perform faster directly reading hardware such as say a USB input device because of the nature of the two part compilation wherein C# programs self optimize themselves to your specific hardware).

We also have come to the point where computers are fast, even the old ones. It's rare you will find anyone who has anything less than a dual core processor, most game players tend to have at least a 1gig video card and 3 - 4gigs of ram. Your serious players, well you probably couldn't lag their system if you tried. So the minor speed losses on some of the lowest level calculations are never really noticable any more. Sometimes the effective performance is actually faster in these "Safer" languages like Java and C# because they protect you from silly memory leaks and in the case of C# on windows it actually molds itself to the hardware it's running on.

I must point out a VERY VERY important fact about Java and it's multi platform capabilities though. Java on Android is NOT the same as Java on PC. Yes Java is the language of android the the majority of the dependency libraries you will be using (Such as OpenGL) are lite or stripped down versions that are tailored to the specific hardwares of the phone. Not everything you can do on PC will be available on the android, be very careful if you are targeting both and make sure you do your research and test frequently. It is not as simple as clicking "Build for Android" to turn your PC game into a droid game!

All in all, most if not all modern computers and I would even risk saying every single one of your potential players computers are plenty powerful enough to muscle through a 2D game in pretty much any language. The limitation would come in to play with the amount of effects and "moving parts" in your visuals. At this point you want to ensure that you are using either Direct X or Open GL. Open GL is the fastest video card API around but windows will limit it to make Direct X work better. Open GL is plenty fast enough on every platform to run a 2D game at the same visual speed as Direct X. If you intend to go multi platform and you are not using a game engine then go Open GL. If you are using an engine or your a perfectionist like me then you want to make make Direct X builds for windows based os' and Open GL builds for everything else. Be aware though, the human eye only see's things at around 33 - 36fps. So when you have Open GL running 90fps on windows and you have Direct X running at 110fps on windows the player will never notice either one being faster no matter how hard they look. (That same game may run at 130fps using Open GL on Mac or Linux but again it is not noticable to the human eye ball).

In short if your comftorable with Java already continue to learn young padiwan, just be aware that your not going to make an MMO out of it. Stick to 2D games and moderate 3D games you'll be fine.



Sir! You've opened my eyes.Thank you very much.No i am not going to make a MMO :)) In the best case i am going to make a roguelike game!

Edited by vladmihail, 09 January 2013 - 11:46 AM.


#8 Dan Mayor   Crossbones+   -  Reputation: 1712

Like
1Likes
Like

Posted 09 January 2013 - 12:28 PM

Glad I could help, best of luck with your project.  Look me up on the messengers some time, I like to hear what other coders are working on and see their progress.


Digivance Game Studios Founder:

Dan Mayor - Dan@Digivance.com
 www.Digivance.com





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