Jump to content

  • Log In with Google      Sign In   
  • Create Account


Starting a game in Java, ideas on where to begin?


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
16 replies to this topic

#1 mk.jr.fan   Members   -  Reputation: 474

Like
0Likes
Like

Posted 13 April 2013 - 01:22 PM

Hi! I was going to start making my first game in Java and I was unsure of how I should plan this out. For now I am building the game for PC but if successful I will try to port it over to android so that my friends can also play as well. My java experience is some what new as I am taking a class in java now, but I have taken a summer course on it before. For game making experience I have worked with GameMaker (mostly coding not drag and drop) and about a year in Unity.

 

The point of this game is mostly be a learning experience of trying to make a game without an engine such as GM or Unity. Would it be a good idea to use just java or get other sdks or libraries? Also is there anything I should know or keep in mind if I am building as  a PC game first and then porting it over  to android or mac?

 

Any suggestions or tips would be helpful. Thanks!

 

This will be a 2d platforming game.


Edited by mk.jr.fan, 15 April 2013 - 04:35 PM.


Sponsor:

#2 Dennisvb   Members   -  Reputation: 160

Like
1Likes
Like

Posted 13 April 2013 - 02:01 PM

If you look around on the Web I am sure you can find some good libraries for java. I recommend http://www.slick2d.org I don't know if it will work on Android, but I know it will work on Windows, Linux and OSX if they have java installed.

#3 mk.jr.fan   Members   -  Reputation: 474

Like
0Likes
Like

Posted 13 April 2013 - 02:06 PM

If you look around on the Web I am sure you can find some good libraries for java. I recommend http://www.slick2d.org I don't know if it will work on Android, but I know it will work on Windows, Linux and OSX if they have java installed.

Well I am not just looking for libraries, I wondering if it would be a good idea to use just java instead of libraries to make a game. 

I am asking this because I want to know how much harder is it without a library or sdk to make a full game.



#4 Dennisvb   Members   -  Reputation: 160

Like
0Likes
Like

Posted 13 April 2013 - 02:54 PM


If you look around on the Web I am sure you can find some good libraries for java. I recommend http://www.slick2d.org I don't know if it will work on Android, but I know it will work on Windows, Linux and OSX if they have java installed.

Well I am not just looking for libraries, I wondering if it would be a good idea to use just java instead of libraries to make a game.
I am asking this because I want to know how much harder is it without a library or sdk to make a full game.
unless you know really much about graphic hardware and stuff, it's really hard to make a game, library or engine. And yes, java is a good language!

#5 Nercury   Crossbones+   -  Reputation: 766

Like
0Likes
Like

Posted 13 April 2013 - 03:00 PM

Also is there anything I should know or keep in mind if I am building as  a PC game first and then porting it over  to android or mac?

 

PC and Mac will be quite similar with Java and OpenGL. However, for android, you will most likely have to rewrite a huge portion of the game either for optimization reasons or because of different APIs. Android does not use Oracle's Java Virtual Machine.



#6 mk.jr.fan   Members   -  Reputation: 474

Like
0Likes
Like

Posted 13 April 2013 - 03:11 PM

unless you know really much about graphic hardware and stuff, it's really hard to make a game, library or engine. And yes, java is a good language!

So I guess a library or sdk will do the graphics thing for me or at least make it easier? Also would you know if that could be implemented for android if a library is used or would that be library specific?


Edited by mk.jr.fan, 13 April 2013 - 03:15 PM.


#7 Dennisvb   Members   -  Reputation: 160

Like
1Likes
Like

Posted 13 April 2013 - 03:56 PM



unless you know really much about graphic hardware and stuff, it's really hard to make a game, library or engine. And yes, java is a good language!

So I guess a library or sdk will do the graphics thing for me or at least make it easier? Also would you know if that could be implemented for android if a library is used or would that be library specific?
If you are going to use slick2d you have to keep in mind that it isn't going to work on Android, so if you really want that look for another library.

Because this is the first game you are making its better to just focus on getting a game working and worry about making games for phones, like android, later.

#8 Olaf Van Schlacht   Members   -  Reputation: 688

Like
0Likes
Like

Posted 13 April 2013 - 04:29 PM

Take a look at libgdx
http://libgdx.badlogicgames.com/

 

Really easy to create games with it. There is also a nice documentation and a tutorial for developers how to begin.

Libgdx is easy to configure for Desktop, Android and web games.


printf("Hello Signature");


#9 warnexus   Prime Members   -  Reputation: 1384

Like
1Likes
Like

Posted 13 April 2013 - 05:19 PM

I would recommend focusing on game mechanics: health system, collision detection and moving objects around. Java has a built-in library to do this. I spend time coding Java for 3 months really helps build my algorithmic problem solving skills in Java.

 

Take a look at the Canvas, JPanel, Component and Graphics2D class in the Java API. You will need these classes to form the base of a 2D game.



#10 TheChubu   Crossbones+   -  Reputation: 3728

Like
0Likes
Like

Posted 13 April 2013 - 05:47 PM

unless you know really much about graphic hardware and stuff, it's really hard to make a game, library or engine. And yes, java is a good language!

So I guess a library or sdk will do the graphics thing for me or at least make it easier? Also would you know if that could be implemented for android if a library is used or would that be library specific?

It is quite complicated to make a multi platform title with a low level library. Say that you want to do it all yourself, grab LWJGL and code the OpenGL stuff by your own. You'd have to make several renderers for your target platforms (mobile, desktop, etc) which it gets complicated really fast.

 

If you're going for multi platform from the start, better grab a library that already can do that stuff for you (I've heard good things from what Olaf Van Schlacht suggested, libgdx, though I haven't used it).


"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

 

My journals: dustArtemis ECS framework and Making a Terrain Generator


#11 mk.jr.fan   Members   -  Reputation: 474

Like
0Likes
Like

Posted 13 April 2013 - 09:48 PM

I would recommend focusing on game mechanics: health system, collision detection and moving objects around. Java has a built-in library to do this. I spend time coding Java for 3 months really helps build my algorithmic problem solving skills in Java.

 

Take a look at the Canvas, JPanel, Component and Graphics2D class in the Java API. You will need these classes to form the base of a 2D game.

Interesting, I like your idea of just using plain java. I think what I might do is like you said get the basic game mechanics down first and maybe later on use the libraries and other stuff later on for the graphics.



#12 mk.jr.fan   Members   -  Reputation: 474

Like
0Likes
Like

Posted 13 April 2013 - 09:49 PM

It is quite complicated to make a multi platform title with a low level library. Say that you want to do it all yourself, grab LWJGL and code the OpenGL stuff by your own. You'd have to make several renderers for your target platforms (mobile, desktop, etc) which it gets complicated really fast.
 
If you're going for multi platform from the start, better grab a library that already can do that stuff for you (I've heard good things from what Olaf Van Schlacht suggested, libgdx, though I haven't used it).

 

Well I was thinking of coding just for pc and was wondering if I needed to keep anything else in mind if I were to later port to mac or android.



#13 minibutmany   Members   -  Reputation: 1482

Like
1Likes
Like

Posted 14 April 2013 - 09:29 AM

To port to Android, you must use the Android SDK or LibGDX or similar library. LibGDX is specially made for porting to multiple platforms. Trying to port a PC version to the MAC is one thing...they are fairly similar systems...but moving a PC version to Android is completely different because you have to worry about touch screens and lots of other Android "stuff". If you want to port to Android, that is something you need to think about now because then you should use LibGDX. In my opinion, since this is your first project in Java(even though you have some prior experience with games) you probably shouldn't worry about being cross platform and just getting your game out there, in which case I would recommend Slick2D over anything else.

So I guess a library or sdk will do the graphics thing for me or at least make it easier? Also would you know if that could be implemented for android if a library is used or would that be library specific?

Slick2D makes the graphics easier and is less laggy than "vanilla" java graphics because Slick has hardware acceleration. Games made in slick are "state based"...your menu, game, game over screen, high score screen, etc. would be different states that have their own independent update and render loops. Slick has lots of cool lighting effects and fade transitions that can make your game look way more polished. (My one problem with Slick is that it has trouble playing MP3 files so you will have to use a separate library for you audio playback and processing)


Edited by minibutmany, 14 April 2013 - 09:33 AM.

Stay gold, Pony Boy.

#14 mk.jr.fan   Members   -  Reputation: 474

Like
0Likes
Like

Posted 14 April 2013 - 04:19 PM

To port to Android, you must use the Android SDK or LibGDX or similar library. LibGDX is specially made for porting to multiple platforms. Trying to port a PC version to the MAC is one thing...they are fairly similar systems...but moving a PC version to Android is completely different because you have to worry about touch screens and lots of other Android "stuff". If you want to port to Android, that is something you need to think about now because then you should use LibGDX. In my opinion, since this is your first project in Java(even though you have some prior experience with games) you probably shouldn't worry about being cross platform and just getting your game out there, in which case I would recommend Slick2D over anything else.

So I guess a library or sdk will do the graphics thing for me or at least make it easier? Also would you know if that could be implemented for android if a library is used or would that be library specific?

Slick2D makes the graphics easier and is less laggy than "vanilla" java graphics because Slick has hardware acceleration. Games made in slick are "state based"...your menu, game, game over screen, high score screen, etc. would be different states that have their own independent update and render loops. Slick has lots of cool lighting effects and fade transitions that can make your game look way more polished. (My one problem with Slick is that it has trouble playing MP3 files so you will have to use a separate library for you audio playback and processing)

Thank you for the response! I think what I am going to do is make the basic concept of the game first just strictly with java. Later on when the game is pretty much complete I will try using a library later on for the graphics.

 

When that's done I will then try slimming it down for Android(but lets see how far I go first).



#15 minibutmany   Members   -  Reputation: 1482

Like
0Likes
Like

Posted 15 April 2013 - 02:15 PM

Later on when the game is pretty much complete I will try using a library later on for the graphics.

 

I wouldn't recommend this. Just go with a library from the start. A library such as slick doesn't just turn graphics into an image that you can willy nilly paint on a JFrame....it has its own windowing system. There is little advantage, even an educational advantage, with trying to go "vanilla" java at the beginning...especially with Sick because it is designed to resemble the Java 2D graphics API and is even easier to use than regular Java. Even if you are just trying to make a basic working plan, Slick and similar libraries are designed for fast development(they write the code so you don't have to), which is what you want in a learning or prototyping environment. 


Edited by minibutmany, 15 April 2013 - 02:17 PM.

Stay gold, Pony Boy.

#16 mk.jr.fan   Members   -  Reputation: 474

Like
0Likes
Like

Posted 15 April 2013 - 04:39 PM

I wouldn't recommend this. Just go with a library from the start. A library such as slick doesn't just turn graphics into an image that you can willy nilly paint on a JFrame....it has its own windowing system. There is little advantage, even an educational advantage, with trying to go "vanilla" java at the beginning...especially with Sick because it is designed to resemble the Java 2D graphics API and is even easier to use than regular Java. Even if you are just trying to make a basic working plan, Slick and similar libraries are designed for fast development(they write the code so you don't have to), which is what you want in a learning or prototyping environment. 

 

From what you said it sounds like, by using premade scripts it will help me learn how to code games in java.

 

The reason for me making this game is not the game in itself. The game is like the icing on the cake. The cake is that I become a better program so I don't always have to rely on libraries. Now the reason I mention the use of a library is that it seems that coding for graphics is different from coding game logic (I don't know for sure since I have never had a chance to look at it). I feel that it would be best to learn from the ground up, and instead of using premade methods that don't always do what is intended, I can instead make games with my knowledge instead of using someone else's hard work.

 

Now if you disagree that learning from "vanilla" java is not the best solution please tell me why.



#17 3Ddreamer   Crossbones+   -  Reputation: 2967

Like
0Likes
Like

Posted 15 April 2013 - 06:43 PM

Hi,

 

 

Okay, let me cover the basics as they connect to one another and also help set your mind at ease on a few things.

 

Sure, Java is a "good" language, whether certain programmers like it or not. Java is powerful and broad in capabilities.  In my opinion it is the best cross-platform language, but I must say that game engines and libraries really make quite a bunch of languages suitable for cross-platform implementation according to what they are designed to use.  This is why many languages are of serious consideration, being that game engines, SDKs, and specialized libraries put ability in your hands.  These tools help you to better learn a language because they frame your coding habits and pipeline.  This is one of the most important strategic thinking points in your whole career to remember and exploit. What makes a language effective for you will be all the support around it, software, tools that you learn to make, and community help - far more than the language itself. 

 

Take a look at jMonkey, for example.  It has some very standard libraries which you really need to learn eventually anyhow, track record of games which demonstrate the game engine, cross-platform built into the development pipeline, and made to guide you in learning version iterations and modularization so you can reuse a lot of existing code which you create.

 

mk.jr.fan, you have some coding experience with languages, so go right to a framework and not flicker around the fundamentals of coding anymore.  Make a very simple 2D game, get it playable ASAP, and implement it cross-platform.  From there, make a second, third, forth game, and so forth.  Rabbit hopping is no good, so lay a foundation and get to building on it.  


Edited by 3Ddreamer, 15 April 2013 - 06:48 PM.

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software.  The better the workflow pipeline, then the greater the potential output for a quality game.  Completing projects is the last but finest order.

 

by Clinton, 3Ddreamer





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