Java? Why not a different programming language?

    Joined
    Nov 16, 2013
    Messages
    1,169
    Reaction score
    48
    • Top Forum Contributor
    • Legacy Citizen 2
    With the exception of maybe a couple games, of all the hundreds of games I've played on steam, all I've had to do to launch a game was double click the name, and it ran fine. This is including the many Early Access games.

    Most games don't need a guide on the front page because they don't NEED the guide. They simply work.[DOUBLEPOST=1418071211,1418071146][/DOUBLEPOST]

    A quick search for me says that it's C++, at least on the Xbox's.
    And c#
     

    Winterhome

    Way gayer than originally thought.
    Joined
    Jun 29, 2013
    Messages
    1,929
    Reaction score
    636
    Gonna have to go with der_scheme's argument on this.

    Also, if you know a programming language sufficiently well, you can jury rig functions that aren't possible in a straightforward manner, even in other programming languages. Just so happens that schema knows Java particularly well. If he were as comfortable with C/C++/C#, then he'd be using that instead.
     

    jorgekorke

    bottom text
    Joined
    Sep 6, 2013
    Messages
    642
    Reaction score
    157
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen 9
    Point is, if the game had used C++ instead of Java, it would be superior in terms of performace, but it's impossible for schema doing that alone. One day, when he creates his own medium-sized studio with lots of developers, who knows ?
     
    Joined
    Sep 28, 2013
    Messages
    11
    Reaction score
    2
    With regards to why Rockstar Games does not use java, there are many reasons. One is when they starting making their engine for GTA 1997, java was not a language suitable for gaming. c/c++ was the way to go as it was what most game programmers used and it offers very good performance with the opportunity to be very close to the hardware. Since then rockstar has evolved their engine with each release of GTA (which creates problems as they now have old legacy code).

    Currently, I would say c/c++ is faster and does not suffer from memory bloat that java does. One also does not have to worry about mismatching java versions. For the most part, java is very cross platform, but there are still differences and incompatibilities between platforms. One of the Java jokes is that Java is "Write once, debug everywhere". It is possible to uses something like libSDL to make cross platform c/c++ software.
     
    • Like
    Reactions: Ithirahad
    Joined
    Aug 23, 2013
    Messages
    379
    Reaction score
    65
    For performance; the JIT compiling does have some overhead, and Java's memory management isn't great (slower and more wasteful, but possibly more importantly there's unavoidable "lag spikes" caused by the garbage collector).

    In addition, Java currently doesn't support SIMD properly (which, for a game like StarMade, could give a massive performance boost). Fortunately (at least from what I've heard) SIMD/vectorisation intrinsics are coming soon (in Java 9) so this may not be a problem by the time StarMade gets closer to the end of beta.

    However; I "strongly suspect" that 90% of the performance problems in StarMade have nothing to do with Java whatsoever (and are simply the result of "not optimised yet" code).

    Also note that C++ is probably one of the single most hideous languages that has ever existed. There are many very good reasons why so many people have designed (or are designing - search for "Jon Blow programming language") alternatives like C# (Microsoft), D, golang (Google), Rust (Mozilla), Objective C (Apple), etc.
     
    Joined
    Jun 24, 2013
    Messages
    270
    Reaction score
    43
    There is so much misinformation flying around this thread...

    Look, I've been developing since somewhere around 1984 on everything from a TRS-80 BASIC to Mainframe systems in COBOL/JCL. I've developed in JavaScript, ActionScript, Lisp, Lua, Java, Clojure, C/C++, C#, F#, Visual Basic, MSSQL, Assembly languages, and some really obscure Aspect Script language for a phone switch. I keep seeing people refer to "enterprise" and some I formation on bug counts and memory leaks all around.

    Let's just clear some shit up. The language that Starmade is written in doesn't make it more vulnerable to bugs, memory leaks, or (really) performance problems for the most part. Given enough time, experience and skill Java can be a capable language. I stopped using it because I didn't enjoy the verbosity and limitations on some things, but that doesn't mean it's a bug ridden or slow language. Those are programming (and/or technology) zealots trying to pimp their preferred language of choice and frankly, it gets tiring. Are there some instructions that it doesn't currently support? Sure. Are there a plentitude of unskilled Java Devs kicked out of schools every year spitting out billions of lines of terrible code? Sure. Does that make Java look bad? You bet. Does it mean that Java is flawed? No.

    I've seen more C/C++ bugs and memory leaks than I care to mention. In fact, it's much easier to do both of those in both C and C++ because it gives you all the rope in the world to hang yourself with. I can't tell you the number of times I've kernel dumped Linux and Blue Screened Windows because I typed the wrong thing in both these languages.

    And as far as Enterprise... What makes a language enterprise anyway? Is it because corporations use it? Is EA a corporation? Is Enterprise only for those curmudgeons at UPS who are only concerned with crunching tracking data? I can tell you from experience that C++ is heavily used there. Does that mean C++ is "enterprise"? How about JavaScript? Is that "enterprise"? How many billions of page requests are fulfilled on a daily basis and how many user actions are serviced by it per hour? Does that make it "enterprise"? Want about the millions (or is it billions now?) of Android phones out there using a form of Java to handle all the texts, phone calls and notifications daily?

    I know this is a ranting, but Schema chose Java because he knows Java and that's the only reason you need to accept it and quit complaining. If you feel like it's an error, then you can do what the minetest people have done and create a half ass clone of Minecraft in C (or was it C++? I can't remember.) Let Schema keep trucking on with what he knows. It's his project, his rules.[DOUBLEPOST=1418112025,1418110464][/DOUBLEPOST]
    You must be one of those who are afraid of change and new ideas.. it's ok, change is the only thing constant. War, you can be the very best programmer, but a game is limited by its skill of a programmer and his language of choice. Java is known for memory leaks. While C++ performs much better for games, and is the most commonly used language for higher in and better performing games. It also performs rendering and graphics better as well. Since most of this game(code) is centered around its graphics, the game would run alot better if the language could support the game's graphics better.
    I also wanted to reply to this. Graphics today don't even really use C++. They rely on heavy use of shaders and specialty libraries to do most of the heavy lifting. C++ is mainly used as glue and logic to make it all work together. Heck, some of the games coming out now use scripting in dedicated engines to do most of the processing and graphics. The fact of the matter is that this game is written by one man. He has the task of multiple people and to compare it to so ething like GTA is a bullshit example. They have entire teams dedicated to shader development, mission scripting, various engines to tie these together, and most likely an entire floor dedicated to QA testing so you never see their system halting bugs.
     
    • Like
    Reactions: Bench

    Winterhome

    Way gayer than originally thought.
    Joined
    Jun 29, 2013
    Messages
    1,929
    Reaction score
    636
    I demand that Starmade be written entirely in Ook! or Haskell for the glory of the gods of code.
     
    Joined
    Jun 24, 2013
    Messages
    270
    Reaction score
    43
    You had me at Haskell... that would be an interesting project to work on.
     
    Joined
    Jul 14, 2013
    Messages
    98
    Reaction score
    27
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen
    I also wanted to reply to this. Graphics today don't even really use C++. They rely on heavy use of shaders and specialty libraries to do most of the heavy lifting. C++ is mainly used as glue and logic to make it all work together. Heck, some of the games coming out now use scripting in dedicated engines to do most of the processing and graphics. The fact of the matter is that this game is written by one man. He has the task of multiple people and to compare it to so ething like GTA is a bullshit example. They have entire teams dedicated to shader development, mission scripting, various engines to tie these together, and most likely an entire floor dedicated to QA testing so you never see their system halting bugs.
    Wow, despite your background even you seem to have a lot of misinformation. Typically you write shaders through C or more commonly some scripting language that has a backend to C. C++ will typically be used for logic in rendering as well, but you end up using other frameworks to handle increasingly low level tasks (IE OpenGL). You would then use a scripting language on top of C++ for game logic (IE Lua), or at least this has been the trend recently (it certainly was not the way things were coded in the past, half life 1 was written in C for example, Doom 3 in c++).

    Surprisingly it works this way for Schine as well. Schine uses LWJGL, which links OpenGL to Java allowing those who use java to use OpenGL (among other things), the actual rendering in terms of what you, and most people in this thread are thinking is not actually written in java, but typically C. In terms of optimization, Schema can change how objects are managed, when and where calls to rendering functions are made, and how parallel the schine engine is, in addition to many other things. Schema does not actually change how something is rendered (in the sense that he can change the openGL function he uses)
     
    Joined
    Nov 21, 2013
    Messages
    278
    Reaction score
    31
    I think a certain block-based game's bad code makes people think Java is junk:p(according to the alioth benchmark, it's somewhat slower and takes a large amount of memory, but isn't awful).

    In a perfect world, it would probably be coded in something faster and far more memory efficient.
    But really, the time it would take Schema to learn C++, after having learnt Java(even if he switched before starting on the engine), would probably be a big waste.:schema:
    It is probably because Schema knows Java that he used Java.

    A rewrite would probably only happen if StarMade became as big as Minecraft(at that point, it may be worth it, but there'd be so many mods, and computers would be more powerful, so it might not). That's like 10 years in the future sort of thing, if it would ever happen.

    Just my non-coder 2 cents on things.

    (When people say 2 cents, it's probably more than that, 2 cents was probably a lot more when the metaphor was *ahem* coined.:D)
     
    Last edited:
    Joined
    Jul 6, 2013
    Messages
    48
    Reaction score
    7
    • Purchased!
    Shaders for OpenGL are written in GLSL, that is the OpenGL Shading Language. The syntax is based on C, but the syntax for Java is based on C++ too.

    And almost the entire point of writing shaders is so that the developer CAN change how the primitives are rendered.