Jump to content

  • Log In with Google      Sign In   
  • Create Account


What now?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
18 replies to this topic

#1 Morrowa   Members   -  Reputation: 131

Like
1Likes
Like

Posted 23 July 2014 - 09:35 AM

Hello!

 

I have created some programs using Java, this year. (CD-Key Generator, Calculator with a GUI etc.)

However, I want to create games. The thing is, I don't know where I can learn to do this.

I understand how to program in Java to a certain level, and I know the basics of a game (Refreshing the screen 60 times each second, game loops etc.) I just don't know how to do this in Java.

 

So, my questions are:

- How can I learn to do this in Java?

- If I decide to use another language, like C++, would it be any different?

- I have also heard that if you are to use C++, you usually want to create your own engine, is this true?

- This is not very relevant yet, but if you are to create a 3D game, how do you load models etc.? (I am aiming at simple 2D games first though)



Sponsor:

#2 Glass_Knife   Moderators   -  Reputation: 4117

Like
11Likes
Like

Posted 23 July 2014 - 09:42 AM

You have programmed, so you understand that programming concepts remain the same, but the language you choose will impose restrictions or syntax that needs to be understood.  Making games is the same way.  There are core game programming concepts, and then you have the language/engine/platform stuff to worry about.  When you're just starting out, it can be hard to figure out where to start.

 

The good news is, the best way to start is to just make some games.  

 

If you're looking for Java stuff, check out my web site:  http://www.indiegameprogramming.com

 

Whatever language you choose, there will be stuff to learn.  You don't need to make your own engine.  People do this just to learn more about how engines work and to improve their programming experience.


I think, therefore I am. I think? - "George Carlin"
Indie Game Programming

#3 Glass_Knife   Moderators   -  Reputation: 4117

Like
8Likes
Like

Posted 23 July 2014 - 09:45 AM

I forgot these if you're ready to start right away.

 

http://www.gamedev.net/page/resources/_/technical/general-programming/java-games-active-rendering-r2418

http://www.gamedev.net/page/resources/_/technical/general-programming/java-games-keyboard-and-mouse-r2439


I think, therefore I am. I think? - "George Carlin"
Indie Game Programming

#4 GoCatGo   GDNet+   -  Reputation: 1619

Like
5Likes
Like

Posted 23 July 2014 - 09:54 AM

Hello!  Welcome!  Pull up a chair and read every link Glass_Knife suggested.

 

 

 


However, I want to create games. The thing is, I don't know where I can learn to do this.

 

Just start making games.  Really.  Jot down some ideas -- a simple Pong or maybe Space Invaders clone, whatever -- then use your programming experience to make them happen.  You've got the tools you need, just "woodshed" (a term we use when musicians spend time practicing) for a while.  Get some experience just working on anything that comes to mind.

 

Then re-read all of those links, shake out your hands, and start on another idea!

 

Edited to Add:  More specific thread titles will serve you better on this forum. 


Edited by GoCatGo, 23 July 2014 - 09:55 AM.

I don't even like games anymore.


#5 Morrowa   Members   -  Reputation: 131

Like
0Likes
Like

Posted 23 July 2014 - 10:09 AM

I have some ideas for some games, but they are too advanced for me to create at this point.

Still, I want to create the engine myself, for the knowledge.

Where can I possibly learn this?

 

I have also heard that to make games with C++ you need DirectX or OpenGL.

What are these, and why do you need them with C++, and not Java?

 

Also, thank you for the links! I will read them!



#6 ByteTroll   Crossbones+   -  Reputation: 1324

Like
4Likes
Like

Posted 23 July 2014 - 10:18 AM

Morrowa,

 

You never want to start off writing a "game engine."  A "game engine" is just a bunch of reusable and time-tested code.  Write a game.  When it comes time for a second game, recycle some of the code and improve upon in.  Repeat that cycle.  I have found that if you plan on building a "game engine" from the beginning, you end up wasting more time implementing features just for the sake of features.

 

OpenGL and DirectX are graphics API's.  They are the bridge between low-level rendering operations/talking to the hardware and you.

 

EDIT:

To answer one of the questions in your first post: learning to create games in Java is really no different from creating games in other languages.  As someone else noted, languages do different things.  Regardless, there are common "core" principals that drive games.  For example, all games (no matter what language) run in a loop.  This loop usually handles user input, updating, and rendering.  When a game starts up, some initial data is usually loaded to get ready for the game to run.  When a game shuts down, systems are usually released.  Regardless of the language, a loop is a loop.  Loading data is loading data.  Releasing data is releasing data.  How these things are done may change, however, the principals are the same for all languages.


Edited by ByteTroll, 23 July 2014 - 10:23 AM.

▬▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬▬▬▬▬▬
I see the future in 1's and 0's
▬▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬▬▬▬▬▬

"This is called programming. The art of typing shit into an editor/IDE is not programming, it's basically data entry. The part that makes a programmer a programmer is their problem solving skills." - Serapth

#7 GoCatGo   GDNet+   -  Reputation: 1619

Like
3Likes
Like

Posted 23 July 2014 - 10:20 AM

This:

 


I have some ideas for some games, but they are too advanced for me to create at this point.

 

doesn't fit with this:

 


Still, I want to create the engine myself, for the knowledge.

 

I'd worry about your ability to make an entire game engine if you can't blast out a Pong clone in Java. 

 

Best of luck!


I don't even like games anymore.


#8 Morrowa   Members   -  Reputation: 131

Like
0Likes
Like

Posted 23 July 2014 - 11:03 AM

Still, if I am going to make a pong game, I need in one way or another to load sprites etc.

Wouldn't that be a very primitive engine if the code does all the basic stuff?

 

When it comes to engines like Unity, I have no idea how they are made.

(Could anybody explain how?)

 

Either way, I guess I will start out simple with some Tic Tac Toe, Tetris and Pong.



#9 GoCatGo   GDNet+   -  Reputation: 1619

Like
0Likes
Like

Posted 23 July 2014 - 11:47 AM


Still, if I am going to make a pong game, I need in one way or another to load sprites etc.

Wouldn't that be a very primitive engine if the code does all the basic stuff?

 

Someone didn't read the provided links.

 


If you're looking for Java stuff, check out my web site: http://www.indiegameprogramming.com

 

Click that.  Your answers are there.  If you can't make a game with your Java experience and the information on that site, then nothing I can type will be of value.


I don't even like games anymore.


#10 tp9   Members   -  Reputation: 532

Like
5Likes
Like

Posted 23 July 2014 - 12:36 PM

Thanks for asking this question. I actually learned a lot from the links given.



#11 Morrowa   Members   -  Reputation: 131

Like
4Likes
Like

Posted 23 July 2014 - 01:05 PM

The same here. I have been reading for an hour now.



#12 aregee   Members   -  Reputation: 1018

Like
1Likes
Like

Posted 23 July 2014 - 01:30 PM

I have some ideas for some games, but they are too advanced for me to create at this point.

Still, I want to create the engine myself, for the knowledge.

Where can I possibly learn this?

 

I have also heard that to make games with C++ you need DirectX or OpenGL.

What are these, and why do you need them with C++, and not Java?

 

Also, thank you for the links! I will read them!

 

Actually, depending on what kind of game you are making, you won't necessarily need either Direct X or Open GL.  Have a look at NetHack, for instance.  That is a full game where all you need is the console.  Also, if you are making a Othello, Chess, Mine Sweeper kind of game, you can just use a normal canvas type of GUI object for your operating system.

 

Of course, Direct X and Open GL are graphics libraries that are closer to the hardware itself, and are much faster than any canvas any GUI component can give you, at least it were so in the past.  It is also specialised in processing graphical data, wether it is 3D or 2D, so it beats anything you would do in pure software.  Nowadays you can even offload computations formerly done on the CPU to the processor on the graphics card.  It is also much more complex (but not necessarily so much more complex than to write graphics application in pure software, which is slow), so it really depends on which aspect of game creation you are looking into at the moment.  You don't explicitly need C or C++ to use Open GL, I believe you can nicely make Open GL applications in Java.  Here is one project aimed to enable that, that I know nothing about: http://jogamp.org/jogl/www/

 

If you start small, you will slowly master the art of making games.  It is much more fun to make a Mine Sweeper clone than you think.  There are some hidden things that are not apparent right from the start, for instance, what if you click a large area that has no surrounding mines?  There you would stumble across making a recursive search to find all the adjacent safe slots on the map.  Recursion is not really hard once you have learnt it, but it may be hard entry point, just like the concept of pointers, for instance (which Java doesn't have, just references).  

 

Good luck!  You are into a lot of fun learning. :)



#13 Servant of the Lord   Crossbones+   -  Reputation: 18579

Like
11Likes
Like

Posted 23 July 2014 - 02:31 PM

Still, if I am going to make a pong game, I need in one way or another to load sprites etc.

Wouldn't that be a very primitive engine if the code does all the basic stuff?

 

When it comes to engines like Unity, I have no idea how they are made.

(Could anybody explain how?)

 

Either way, I guess I will start out simple with some Tic Tac Toe, Tetris and Pong.

 

'Engines' are siren songs to new programmers lured by the idea, but they just lead to you crashing on rocks.

 

Games don't require 'engines'. What even is an 'engine'? Some mythical concept you once heard somewhere that sounds appealing and impressive? smile.png

 

Games are made out of code.

 

After making several games, you start to realize that that you are re-writing a few of the same portions of code (how to load an image, how to open a window, how to play a song, and so on).

 

You then realize that these pieces of code that you've rewritten several times could be written in a way that they can be reused by multiple games, instead of being recreated over and over. So you start collecting these reusable pieces together in a 'library'.

 

As that library grows, and you reorganize it multiple times, you start to realize that some of the reusable components actually describe common game logic at a higher level. Things like movement and collision and cameras and scripting and AI. You also start to realize that some common architectures (higher-level code structures) are taking shape.

So this game logic and architecture is organized to form an 'engine' that is specific to certain types of games.

 

  • Games don't require engines (especially smaller games). Games are made out of code. 
  • When you start to build up your own library of reusable code functions and classes, they help speed up development (allowing you to use the extra time to make bigger games).
  • When the code library starts to gain game logic and higher-level architecture, then it should be reorganized into an 'engine'.
  • An 'engine' is a fancy term to mean pre-boxed game architecture and logic.
  • Different games require different architecture and logic, so it is possible that for some game projects choosing the wrong engine will leave you fighting against the engine to make the game.
  • Some pre-boxed architectures are more generic (like Unity or GameMaker), and some pre-boxed architectures are more genre-specific (like RPG Maker).
  • You don't set out to build an engine, you set out to build a game. After several games, you can refactor out common components.
  • Engines aren't built from scratch apart from games, unless you've already built so many games (and by extension, game-specific engines) that you're really experienced at it. Otherwise, people tend to have the habit to put in all the things they think they need, or write architecture the way they think it should go, without the experience (from dozens of completed game projects) of knowing what they actually need or what actually works.

 

Some people build engines for fun, instead of building games for fun. That's fine! If that's what you enjoy (the architecture side of things), go for it!

 

But if you think you need to build an engine to make your game, you probably aren't seeing the forest because all the trees are in the way. wink.png

 

If you want to learn how to make good engines, then write (and finish) lots of games and then observe what features and architectural structures you find are common between their codebases.


Edited by Servant of the Lord, 23 July 2014 - 02:48 PM.

It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal

[Fly with me on Twitter] [Google+] [My broken website]

[Need web hosting? I personally like A Small Orange]


#14 Glass_Knife   Moderators   -  Reputation: 4117

Like
5Likes
Like

Posted 23 July 2014 - 02:46 PM


'Engines' are siren songs to new programmers lured by the idea, but they just lead to you crashing on rocks.

 

This should be a tee shirt.


I think, therefore I am. I think? - "George Carlin"
Indie Game Programming

#15 ByteTroll   Crossbones+   -  Reputation: 1324

Like
1Likes
Like

Posted 23 July 2014 - 06:27 PM

 


'Engines' are siren songs to new programmers lured by the idea, but they just lead to you crashing on rocks.

 

This should be a tee shirt.

 

 

I'd buy it.


▬▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬▬▬▬▬▬
I see the future in 1's and 0's
▬▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬▬▬▬▬▬

"This is called programming. The art of typing shit into an editor/IDE is not programming, it's basically data entry. The part that makes a programmer a programmer is their problem solving skills." - Serapth

#16 Morrowa   Members   -  Reputation: 131

Like
0Likes
Like

Posted 24 July 2014 - 02:56 AM

Thank you!

I guess I will wait with creating an engine then.

 

However, I was thinking:

I have started on a Tetris clone.

However, I have the problem of collision detection.

 

I have made the graphics for the blocks myself.

The blocks shaped like this:

 

XXXX  XX

           XX

 

Is fine with collision detection. However, with these:

 

  X        XX

XXX        XX

 

Where you have these transparent spots, gets a little more nasty for me.

Is the best way to do collision detection here to check first if there is a sprite-sprite collision, then check if the part

the sprite is colliding is transparent?



#17 SmkViper   Members   -  Reputation: 657

Like
0Likes
Like

Posted 24 July 2014 - 07:15 AM

Thank you!
I guess I will wait with creating an engine then.
 
However, I was thinking:
I have started on a Tetris clone.
However, I have the problem of collision detection.
 
I have made the graphics for the blocks myself.
The blocks shaped like this:
 
XXXX  XX
           XX
 
Is fine with collision detection. However, with these:
 
  X        XX
XXX        XX
 
Where you have these transparent spots, gets a little more nasty for me.
Is the best way to do collision detection here to check first if there is a sprite-sprite collision, then check if the part
the sprite is colliding is transparent?


Most tetris games don't use single sprites for each of the tetriminos, but use block sprites arranged in the shape of the pieces (note how each one is made up of four blocks?).

That way you don't have to worry about collision between pieces with "transparent" parts, you just have to see if moving the piece in the desired direction would cause two blocks to overlap.

This also makes line removal easier, because you can just remove a line of blocks rather then trying to dynamically cut up your sprites.

Edited by SmkViper, 24 July 2014 - 07:15 AM.


#18 Morrowa   Members   -  Reputation: 131

Like
0Likes
Like

Posted 24 July 2014 - 07:24 AM

Clever. 

Thank you!



#19 realh   Members   -  Reputation: 185

Like
0Likes
Like

Posted 24 July 2014 - 04:59 PM

Even if you want to write your own engine, learning how to use an existing one would be a good start, then you'll know what sort of features to put in yours.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS