Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Java?.....

xaritscinxaritscin CaliMember Posts: 350 Uncommon

im learning Java as programming language in the college and im interested in getting started to do some prototipes or that stuff, right now i just have the most basic knowledge but i found a nice site to learn how to do 3D programs with it, right now the question which comes to my mind is ¿would Java as a programming language a viable option for an MMO?.....

i expect to get comments from the C++ lovers, just want to know which would be the pros and cons of using it, or if Java cannot support that type of work...

Comments

  • anemoanemo Member Posts: 1,006 Uncommon

    An indy game should not be able to reach the point where programming language becomes the limiting factor.   Really at the college experience level your limiting factor will be time and programming logic efficency.    Programming language efficency becomes a factor in large team projects where you have many people working 40+ hours a week.

     

    As for examples

    Runescape(original version), but mostly WurmOnline, and Haven and Hearth

    and If you haven't even done 2D yet try this: http://www.cokeandcode.com/info/tut2d.html

    You as the programmer have the option to essentially just turn 2D vs. 3D as more of a matter of UI instead of "OMG nothing I've learned is the same".  

    If you're already there here's an old article from javaworld for getting a basic core understanding, though not anything you would use in production since it's not accelerated.  http://www.javaworld.com/javaworld/jw-12-1998/jw-12-media.html

    Practice doesn't make perfect, practice makes permanent.

    "At one point technology meant making tech that could get to the moon, now it means making tech that could get you a taxi."

  • VagelispVagelisp AthensMember Posts: 448 Uncommon

    Originally posted by xaritscin

    im learning Java as programming language in the college and im interested in getting started to do some prototipes or that stuff, right now i just have the most basic knowledge but i found a nice site to learn how to do 3D programs with it, right now the question which comes to my mind is ¿would Java as a programming language a viable option for an MMO?.....
    i expect to get comments from the C++ lovers, just want to know which would be the pros and cons of using it, or if Java cannot support that type of work...

     

    Yes, it is a viable option, Darkfall comes to mind. It is written in Java (scripting, logic etc) , using a framework developed in C++, it really depends on how "deep" you want to go.

    There have been numerous discussions and comparisons between C++,C#, Java etc but the real question is why these comparisons take place and why don't you consider C++ as an option?

    When it comes to any part of game programming, 3d, physics, AI, shaders etc game programmers sacrifice even code readability in order to achieve the desired perfomance and many  times they avoid even using C++ and use plain C instead.

    Managed programming is fine and  Java or the .net platform for example are ideal for rapid application development and there are some cases when they even offer similar perfomance compared to a c++ application. However there are still some important factors which determine the choice of c or c++ over java or .net especially when it comes to real time applications.

    1. GC is non deterministic and you will get bottlenecks at random times since there is no idle time in a game loop (even if the GC runs on a separate thread).

    2. Resources used by a c++ application are far less than an application written in .net for example.

    3. In order to produce safer code, modern languages check everything from variable bounds to security pitfalls.

    The afore mentioned "drawbacks" compared to what a c++ programmer can do by  manipulating memory directly offer unmatched perfomance and the proof of these arguments is that there is still no top game or engine  written in Java or .net. Users don't care if we use java or c# and they will always compare our  applications to Skyrim or Batman arkham city ....

    Learn C++ along with java, you will have an advantage over people who don't know c++ and always keep in mind that game programming is not a 5 days a week 9 to 5pm job, mmorpgs struggle to survive and you may end up writing catch the ball applications for smart phones.

  • anemoanemo Member Posts: 1,006 Uncommon

    http://www.learn-cocos2d.com/2012/05/the-game-engine-dating-guide-how-to-find-the-right-engine-for-your-game/

     


    The other aspect about performance is best explained with another car analogy. A sports car that can go past 200 mph will not live to its performance promises if you drive it on open roads across to United States (assuming you don’t have a knack for speeding). It may be more fun to drive in germany – but even then only on select routes and certain times of the day (err, night).


     


    For a game engine that means that the code you write has a far greater impact on performance than the game engine itself. You can easily bring a super-duper fast game engine to its knees with a few lines of inconspicuous code. If you know what causes slow performance, you can squeeze a fair amount of awesomeness out of even a very unoptimized game engine.

    similar to your issue but this one is a few steps higher in the developement process.   SInce if you start with java you're starting with essentially good threading tools, ease of use, documentation, and massive developer base.

    If you do have to learn a new programming language, prefer the one that’s easy to learn and not the one that’s faster. Because even if you use the potentially faster language, you will only be able to start leveraging that performance advantage after you’ve completed several projects. Potentially faster programming languages tend to make it a whole lot easier for new developers to waste a lot of performance while struggling to make things work in the first place.

    And then there's this.

    Practice doesn't make perfect, practice makes permanent.

    "At one point technology meant making tech that could get to the moon, now it means making tech that could get you a taxi."

  • Look into HTML5. 

     

    http://browserquest.mozilla.org/

     

    That example is 2D and uses a canvas etc.  But WebGL will do 3D.

     

    In the end Java is capable of teaching you the basic architectures you need to know and you can make indie games in it.   I think minecraft is java.  I beleive Java graphics are usually OpenGL based which also fits in nicely with the new WebGL standards being implemnented.

  • SmartMonstersSmartMonsters Watsonville, CAMember Posts: 3
    Originally posted by Vagelisp

    When it comes to any part of game programming, 3d, physics, AI, shaders etc game programmers sacrifice even code readability in order to achieve the desired perfomance and many  times they avoid even using C++ and use plain C instead.

    Managed programming is fine and  Java or the .net platform for example are ideal for rapid application development and there are some cases when they even offer similar perfomance compared to a c++ application. However there are still some important factors which determine the choice of c or c++ over java or .net especially when it comes to real time applications. 1. GC is non deterministic and you will get bottlenecks at random times since there is no idle time in a game loop (even if the GC runs on a separate thread). 2. Resources used by a c++ application are far less than an application written in .net for example. 3. In order to produce safer code, modern languages check everything from variable bounds to security pitfalls. The afore mentioned "drawbacks" compared to what a c++ programmer can do by  manipulating memory directly offer unmatched perfomance and the proof of these arguments is that there is still no top game or engine  written in Java or .net. Users don't care if we use java or c# and they will always compare our  applications to Skyrim or Batman arkham city .... Learn C++ along with java, you will have an advantage over people who don't know c++ and always keep in mind that game programming is not a 5 days a week 9 to 5pm job, mmorpgs struggle to survive and you may end up writing catch the ball applications for smart phones.

     

    Java can be a better choice for scalability for certain types of massively-loaded applications.  This is a major reason why J2EE dominates the market for enterprise application servers in the business world.  Although it may seem counterintuitive at first, GC is a big part of the reason.  If you profile a heavily stressed Apache web server you'll find it spending up to a third of its CPU cycles allocating and reclaiming memory.  If you think about what it's doing, you'll understand: it's basically just chopping up and constructing Strings, and because it makes a malloc() call for every one, it burns cycles in micro increments multiplied by a gazillion under load.  By contrast the JVM grabs memory all at once at startup and reclaims it in optimized ways in the background.  Additionally the JVM can be clever about dynamically recompiling at runtime the specific code paths which are most heavily called.  Naturally the app has to be designed properly but these are some of the reasons for J2EE's popularity in very large enterprises - along with lesser likelihood that large distributed teams of developers at varying skill levels will produce memory leaks.

     

    One other thought, if you're contemplating a MMOG server accessed over the Internet, GC pauses are unlikely to be noticed compared to routine 'net lags and glitches. 

     

    So: horses for courses.  Depends what you're building and how you're designing it.

     

    Hope this helps!

    I am a developer of TriadCity, an advanced text-based virtual world. Please take my bias into account when you read my posts. Link: http://www.smartmonsters.com/TriadCity/index.jsp

  • QuizzicalQuizzical Member Posts: 16,742 Epic

    I realize this is an old thread, but if you want to do 3D graphics in Java, you should look into JOGL:

    http://jogamp.org/

    That will give you access to all of OpenGL--the full OpenGL, not some gimpy derivative of it like OpenGL ES or WebGL.  That way, the limiting factor on what you can do will be you, as opposed to the API or computer language you're working with.

  • anemoanemo Member Posts: 1,006 Uncommon

    Practice doesn't make perfect, practice makes permanent.

    "At one point technology meant making tech that could get to the moon, now it means making tech that could get you a taxi."

Sign In or Register to comment.