Newbie to Game Development

Hi everyone!

As stated, I have studied the basics of Java and I want to get into game development using Java. That being said, I understand I should start small . I’m currently following beginner java game tutorials but there some things I don’t understand.1) Should I continue even if I don’t understand or should I do something even simpler? 2)I am curious how you guys started, 3)what was your approach and 4) how did you feel through out it and how did you see yourself developing to actually writing your own game?Oh and one more question :P,5) do you recommend I do my own game or should I see others and copy from them?

P.S. If you have in mind, What game would you suggest starting with?

Many thanks! :slight_smile:

Copy an existing, tiny, simple game. If you can get that right, and finish it you’ve figured out a hell of a lot.

Assuming you’re talking about a “real time arcade game” and not something with discrete turns like solitaire or a roguelike, you could do worse than trying to create Space Invaders or Breakout first. These are simple single-screen games, with trivial graphics and very few “things” going on.

You should be able to make either of those in pure Java using plain Java AWT APIs, or fancier JavaFX APIs. JavaFX is the new hotness and probably more long-term useful.

Cas :slight_smile:

thanks a bunch man, will do! :smiley:

What are the parts that you are struggling to understand? (Don’t worry, for me its been about every step of the way)

Are you using any libraries (like libgdx)?

I’ve started with a tetris, and other similar small projects. Now, I’m working on a turn based rpg, it is VERY small, 3 maps, 20 characters, random monsters, some quests and a boss.

My approach has been to figure out the basic principles, keeping in mind the big idea that I have, and by building up and learning more I think that the big one will start once I have this project to a point where I can not feel embarrassed adding to WIP. I havent done that because about 3 times I started a project and realized part way through that the foundations were not setup in a way that coulld be scaled.

Most of the time is a bit of a frustration and research, I work full time so, programming is more like a hobby.

I don’t want to tell you the best way to proceed.

To start, think NES games or earlier, breakout or tetris is great to start. the way I did tetris was c++ directx from scratch… that turned into about 4000 lines of code, and was just done by array manipulation, lines and squares… but that was also before I changed to java.

Hi, thank you very much for the detailed response! I appreciate it :slight_smile:

I was told not to use libraries so as to not two things simultaneously ( engine & gaming logic). What do you think?
What I am struggling with is really the game logic, not the syntax or any of that. i.e update,repaint,render etc.
These are the fundamentals, I think, but no one explains the logic behind them and everyone just implements them :stuck_out_tongue:
So is there a resource where you can understand the gaming logic you would recommend?

Many thanks :slight_smile:

Definitely use a library. Learn the basics of it, study small library examples.
You get working lifecycle and render hooks that are actually working and are able to concentrate on your game.

Hi and welcome!

There are resources listed via a Java Gaming Resources link that is just under the Logo on the top left. That section hasn’t been updated in a while, though.

I’d like to plug my tutorial Getting Started with JavaFX Game Programming. With JavaFX, the “game loop” structure is somewhat simplified as the loop timing (maintained at 60fps) and rendering are handled pretty much automatically. Coding mostly involves game logic and manipulating properties. I also like that the coding is closer to being able to take advantage of tech like CSS, given JavaFX’s FXML.

We have many other good tutorials in that section (Game Development/Articles and Tutorials), like Eli Delventhal’s Game loops! I remember that was helpful when I first started out about 8 years ago. The older tutorials will often be AWT, Swing, Java2D which are becoming more and more “legacy”.

And the Wiki area is worth exploring.

Mostly, though, if you have a question, someone here will probably be able to steer you to something pertinent and helpful. Or else they will steer you to something that they are passionate about but which may be tangential. (I’ve been guilty of this, too.) Such is the nature of public forums!
8)

Honestly, thank you guys for the info. I very much appreciate your input :slight_smile:

I recommend starting from the sources of an existing game, the closest
you can find to the kind of game you want to develop first. It will in effect
have a library of all the things you need, whether that is from a formally defined
library or just the things coded within the game.

By starting with an existing game, you skip the hardest step for a newb, which
is going from a blank page to a functioning framework.

Awesome, thanks man! Will do :slight_smile:

If you ask 10 programmers a question, you’ll get 11 different answers. Do whatever seems right to you.

I respectfully disagree with 65K’s advice to use a library. You should stick with the absolute basics. Use Swing to get a simple GUI up and running. Think rock-paper-scissors or tic-tac-toe, or a higher/lower guessing game.

That will help you learn the basics of Java, OOP, events, user input, etc. You need to know all of that before you use a library like libGDX.

In my humble opinion, you should actually start with something simpler than Java. I really like Processing, and I’ve written a series of tutorials that go from Processing to Java (and soon libGDX) available at HappyCoding.io.

I generally disagree with you on this…

Unless you are talking about someone needing to understand how a render loop works, then sure, get a ball bouncing around the screen.

I went with libgdx because it meant not needing to know how to configure things for various platforms, there’s all sorts of functionality where it comes down to “provide these inputs and you get what you need.”

So, I don’t need to learn how a* works, I just need to know how to set up the graph, nodes and connections and the algorithm provides useful results.

Unless your motivation is to learn how those systems work from the ground up, I don’t see a point in reinventing the wheel…

THIS JUST IN! New Advice.

If you want to learn to write games and code in general… get Pico-8 from Lexaloffle.

Moving from there to Java will be a cinch. And it’s the most fun I’ve had programming for years.

Cas :slight_smile:

I just looked it up, seems really interesting! Thanks for the update :smiley:

I agree with you. Having started to work with libgdx it really lets you focus on building your game (the amount of tools that it provides is just amazing) rather than the very meticulous details that are not beginner friendly at all and you might not even need to know for simple 2D games. That being said, I think he also had said a great point. If the goal is to learn coding(Java) and
developing games as medium rather than actually developing a game then that’s the way to go. That’s my humble opinion on the matter. Thank you both for your input, I appreciate it :smiley:

That is what I’m talking about.

LibGDX is great. I love libGDX. I’m looking forward to creating my own libGDX game in 2018.

But libGDX is great for people who already know Java, how rendering works, OOP, events, etc. It’s not great for people who are just learning how to code.

I don’t know how far along OP is in their career. But if the general question is “how do I get started learning how to program games?” then the answer is not to dive head first into libGDX. The answer is to learn the fundamentals first, and then graduate to libGDX after you know what you’re doing.

I disagree.

With libgdx, you know where the initialization takes place, how to handle and know that the the render loop is run continuously.

Aside from learning how to write if, switch, loops, make a class and a function… you can learn alot by just stepping through the app.

Then again, I knew c++, so there’s a lot that transfers.

Exactly. It’s easy for people who have been programming for a while to underestimate how hard it is to learn the basics.

If you already know the basics, then by all means check out libGDX. It’s truly great.

But if you’re still learning the basics, you should probably start with something simpler.

I say again… Pico-8. It’s as close as you’ll ever get to turning on a C64 and just typing in code that Does Stuff On The Screen. I can’t recommend it highly enough.

Cas :slight_smile:

If you are THAT deep into basics, but know you want to learn java (not the worst place to start, imo), it’s almost best to just get a book or a simple tutorial where you can see what it takes to make a window…

If you can make a window with buttons, you can use buttons and captions to create a tic tac toe game… the will force you to grasp the logic flow.

Wish I could offer something better… but unless you are going to school for That, there’s limited options in HOA to learn.