XNA vs Love2D vs Java performance

Started by
6 comments, last by Digivance 11 years, 3 months ago

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!

Advertisement

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.)

- Jason Astle-Adams

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.

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.

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.

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.

Dan Mayor

Professional Programmer & Hobbyist Game Developer

Seeking team for indie development opportunities, see my classifieds post

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!

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.

Dan Mayor

Professional Programmer & Hobbyist Game Developer

Seeking team for indie development opportunities, see my classifieds post

This topic is closed to new replies.

Advertisement