Java Question on what text-based Java devs are using

Emperor_Arcturus

Well-Known Member
Jul 18, 2017
1,467
1,263
Hello. I've recently started to try and learn Java to try and expand my knowledge of programming, as well as flesh out my resume in the hopes of getting employed somewhere as a junior software dev. Anyway, I've seen and played a few games on here, like the title says text based ones, that were made with Java and I'm just curious as to what engine or how they were making them. So, if anyone knows, are they using something like OpenGL? Or are they making the GUI's and everything else all in just Java? Thanks for any guidance!
 

Saki_Sliz

Well-Known Member
May 3, 2018
1,403
1,011
To be honest, I don't know what java is used for anymore, I don't think I really see any programs use java other than specalty tools (like modding tools for games) but then I only know those are java because they use the default java graphics library. I think most cases, on a really pro level, people are probably using lots of dependencies and relying on some other api. But for the most part I don't know who codes in raw java anymore. The closest I gotten to making game engines with java is just messing around with Processing which is java with a graphics API. but not something for 'professional' programs.

Usually when I think of any programming language that is close to internet related, because the languages are so abstract, that when something says 'Webgl' or 'OpenGL' its not something they actually program in (I mean, unless you want to program your own graphics engine, which is not fun and takes years, and is kind of the reason I stopped using both java, and monogame framework, because I wanted more graphic functionality than what the default API could provide). Most cases, people are using a tool to 'build' with, that has implemented some form of graphics API. In my case, I try to program only in C#, because it's microsoft's version of Java (a type of program that is high level, has automatic garbage collection, cross platform support) and way powerful, it is supported by Unity game engine and Godot, I use Unity for it WebGL export (to allow the game to be 1 file, and work on all devices, and work in web browser).

Now I'm not a computer scientist, am an electrical engineer, so I can't say what the market is for programming jobs right now. However, if you are looking for a computer science career, with the few interviews I've don in the field, you may want to switch over to C# (ignore C and C++, C# is its own thing). and more importantly, since you are asking what people are using, if you switch to C# the reason it is much more powerful is due to the ".NET" (dot net) eco system. Basically, since microsoft has a lot of money, they did a lot of work developing C# to kick java's ass. there is .Net Core, which are various C# library to give C# more features (basically different kinds of API's) and the focus is to universal, so it works on any device or operating system. However, most developers I've interviewed with looked for .Net Framework, which is even more powerful than .Net Core, but only because these are libraries that work only on Windows (either because they can interface with existing programs better, or because they want to nudge everyone to stay on a window's based platform). and microsoft has done extensive documentation and walkthroughs on their site to get devs started and make them masters, while last I checked with Java its still just refence type documents and what ever books or videos you can find.

anyways, that's all I can think of to say related to the topic. C# > Java, more you can do with it, unless you are trying to aim for a particular market (like using the FX library to make custom gui's? idk what people use java for anymore)
 

Alcahest

Engaged Member
Donor
Game Developer
Jul 28, 2017
3,486
4,331
Hello. I've recently started to try and learn Java to try and expand my knowledge of programming, as well as flesh out my resume in the hopes of getting employed somewhere as a junior software dev. Anyway, I've seen and played a few games on here, like the title says text based ones, that were made with Java and I'm just curious as to what engine or how they were making them. So, if anyone knows, are they using something like OpenGL? Or are they making the GUI's and everything else all in just Java? Thanks for any guidance!
If the game is just text plus images, no videos or realtime rendering, it's perfectly fine to just use Swing. I've seen a couple of the games you probably mean that seem to be coded with this alone, or even just AWT. For a bit more advanced/modern graphical look, JavaFX could be better. Lilith's Throne uses JavaFX for the UI, though that could easily be done in Swing as well. My game Paradise Found has a lot of text but includes a lot of videos too, so I incorporated the JavaFX mediaplayer into the game, but the rest of the game I coded from scratch purely with Java Swing, using Eclipse, if you're asking about tools.
If your aim is to learn something that might look good on a resume, JavaFX is probably better than Swing.

I don't see a reason to use OpenGL or anything better suited for more advanced graphics if you're just doing a text-based game, unless for learning purposes.
 
  • Like
Reactions: Emperor_Arcturus

Tompte

Member
Dec 22, 2017
216
157
My impression is that they either use built-in libraries for rasterizing 2D art (PNGs and text) or they're using OpenGL or something similar.

Using OpenGL to render is actually not that hard. You can be very productive going that route. The only annoyance is you have to do the boilerplate stuff that no one wants to do, like managing assets and figuring out how to get your models and textures in there.

The one thing I would highly recommend against is to require players to install the Java JRE. That's an enormous barrier of entry for regular people. No one wants to do that shit and most wouldn't bother for a curiosity.
 
Last edited:
  • Like
Reactions: Emperor_Arcturus

shark_inna_hat

Active Member
Game Developer
Dec 25, 2018
705
2,766
The whole of the Android ecosystem runs on (sort of) Java, so I can't say that learning Java is a bad career choice, but there's one problem with Java - if you want to code Java, you have to write Java and that's awful unless you like writing interfaces, implenenting class hierarchy, repeating 'public static void main' over and over, and words like polymorphism and 'separation of concerns' don't scare you.

If you don't want to use one of the many, many, free engines out there and just want something 'modern', stable, game oriented and not bloated - try googling 'raylib'. This applies for C, C++, C#, Go, Python, Ruby, Lua, Rust... [insert your fav language here]
 

Tompte

Member
Dec 22, 2017
216
157
if you want to code Java, you have to write Java and that's awful unless you like writing interfaces, implenenting class hierarchy, repeating 'public static void main' over and over, and words like polymorphism and 'separation of concerns' don't scare you.
But I LOVE separation of concerns!

I don't think learning Java is a bad idea if you're looking for a job. It's rarely used in game development (on Android it's usually C++/JDK with a thin Java layer for passing OS events or launching ads) but Java is very popular in enterprise for business applications. If you're a project manager and don't want to worry about hardware or code being re-written every other year, then Java ranks pretty high.

I'd say go for it. You'll probably need to look up some guides on how to render some graphics in a window and get the ball rolling from there.
 
Last edited:
  • Like
Reactions: shark_inna_hat

Emperor_Arcturus

Well-Known Member
Jul 18, 2017
1,467
1,263
If the game is just text plus images, no videos or realtime rendering, it's perfectly fine to just use Swing. I've seen a couple of the games you probably mean that seem to be coded with this alone, or even just AWT. For a bit more advanced/modern graphical look, JavaFX could be better. Lilith's Throne uses JavaFX for the UI, though that could easily be done in Swing as well. My game Paradise Found has a lot of text but includes a lot of videos too, so I incorporated the JavaFX mediaplayer into the game, but the rest of the game I coded from scratch purely with Java Swing, using Eclipse, if you're asking about tools.
If your aim is to learn something that might look good on a resume, JavaFX is probably better than Swing.

I don't see a reason to use OpenGL or anything better suited for more advanced graphics if you're just doing a text-based game, unless for learning purposes.
Thanks for the advice everyone, this is basically the answer I was looking for! Also, not learning Java to get into game development, don't wanna get a job in game development at all, I've heard about how awful the industry is and have no real intention to work there unless I need to. I've already dabbled in C# and C++, as well as JS and Python years ago, can't remember anything about Python now though, lol. Only reason I've started to actually look into Java is it's still very much in demand for a large variety of different things, and they seem to be at least looking for people with little previous professional software dev experience, moreso than the other languages anyway. Also in my job search I was very much surprised at how much Java is still used for a variety of different things. Shark already said it, but it's still very big in Android, though Kotlin is also out there now too. There's web dev stuff, I think Netflix still uses a Java backend, or recently switched to one, one of the two. It's still very prominent in the field apparently. Anyway, thanks again for the advice everyone!
 

quarzo

Active Member
Aug 25, 2017
926
817
Hello. I've recently started to try and learn Java to try and expand my knowledge of programming, as well as flesh out my resume in the hopes of getting employed somewhere as a junior software dev. Anyway, I've seen and played a few games on here, like the title says text based ones, that were made with Java and I'm just curious as to what engine or how they were making them. So, if anyone knows, are they using something like OpenGL? Or are they making the GUI's and everything else all in just Java? Thanks for any guidance!
(firts of all sorry my bad english)
this seems like these games are pure java swing library. about dialogs, i read they tend to use a lot of xml files for manage it.

i am in the same way that you, creating a game for self experience.

can you improve your coding skills? yes.

specially learning how to manage yourself, self study on reading code guide users etc. and adquire some long time vision about how code grown.

for work? i think companys valorate better on a java junior the databases skills and front end skills.


actually libgdx is a framework for do games on java, if you see my firm, the remake i am doing is in java too.

where i learn it? i follow a tutorial of youtube of how to make a mario bros game on libgdx :D
 

papel

Member
Game Developer
Sep 2, 2018
435
603
The one thing I would highly recommend against is to require players to install the Java JRE. That's an enormous barrier of entry for regular people. No one wants to do that shit and most wouldn't bother for a curiosity.
Agreed. I've had my fair share of problems with something not running because I had the wrong JRE installed
Luckily, Netbeans can package whatever your project is as a self contained, native package -

The main problem with learning programming by making a game is that corporate stuff hardly intersects with game stuff. Corporate usually goes for database connections and web requests, while games direct you at events, threads and multimedia. Still, having something to show is better than just putting "experience with X language"
 

Alcahest

Engaged Member
Donor
Game Developer
Jul 28, 2017
3,486
4,331
Agreed. I've had my fair share of problems with something not running because I had the wrong JRE installed
Luckily, Netbeans can package whatever your project is as a self contained, native package -

The main problem with learning programming by making a game is that corporate stuff hardly intersects with game stuff. Corporate usually goes for database connections and web requests, while games direct you at events, threads and multimedia. Still, having something to show is better than just putting "experience with X language"
Why bother with installing stuff when you can just supply the jdk and call it from the exe.
 

CorvusCorax

New Member
Nov 12, 2019
12
21
@Saki_Sliz

There is a big demand for Java. It's one one the top 5 languages with more demand. Plenty of stuff runs on Java.
Also, saying C# > Java is like saying Hammer > Saw. They are different tools, that can be used for different purposes. Each language has different advantages and disavantages.

That being said, Java is far from being the easiest language to use in developing games, unless you just want text. And even then, there are far better choices.

And yeah coding games get a LOT easier if you just use frameworks and/or a game engine to help you out.



@Emperor_Arcturus If you want to code a text game in Java, you can use a JavaGUI framework to help you out:
  • JavaFX
  • AWT. Abstract Window Toolkit
  • Apache Pivot.
  • Swing and SwingX.
  • SWT.
But while you can use Java for games, it is better for Enterprise solutions, and to work in large teams. You should use Java only if your main goal is to learn more about the language itself.

For coding a game alone, you would go much faster with a language like python (a good language for beginners). Another alternative is Javascript. But all depends on what you want

If you want to learn a language used in gaming industry, then C++ or C# are usually favored.