views:

229

answers:

4

Hi all. I have recently been developing a sim game in java, as many of my questions show, and it's come a long way! Graphically, it is somewhat lacking, and at current I'm using shapes for items, people, rooms ect.

I was looking at other similar projects, and noticed that one was using OpenGL. I have been reading CokeAndCode "space invaders 103 - refactoring and OpenGL", and I still don't know if it is something I need in my game or not.

Here is a video that I used for a previous question, but it still shows basically what I have so far (http://www.screenjelly.com/watch/Bd7d7pObyFo), although I have done a lot of refactoring and re coding over the last few weeks, but graphically, nothing has changed. As I understand it, I'm currently using java2D to do this.

I really don't know how I should continue graphically with this game. This is my first project I have done outside of learning for my own enjoyment, and so I'm still rather new to this.

Thanks in advance!

+1  A: 

According to this, it's still largely possible to implement a working graphical game in Java2D with decent performance, as long as you make sure not to do a certain number of bad things.

It might help you to check and see how your approach is, compared to this.

I have no idea how far along Java has come with OpenGL support, so were I in your place I would probably just see how much refactoring of the Java2D code I could do, and figure out what to do from there.

Hope this helps, at least a bit.

Platinum Azure
Thanks, I shall indeed read that link there. I need to re implement elements of the game now to make it work, as I now know alot more than when I started. I just feel no one would want to play it with shapes and no graphics per say, when 2 similar projects are expanding from the original graphics of the game, which I don't really want to, or have the expertise to do yet.
Relequestual
Read. I can't say I have done ANY of the things it says to do. humm.
Relequestual
Well, I've only halfway implemented some of those things. But the article does seem to specialize on real-time graphics, which is to say they claim that their strategies lead to optimal speed. Your call on whether or not to try them.
Platinum Azure
A: 

How to continue graphically: use textures, more interesting animations (implement a simple physics engine and/or collision detection, that always looks nice).

When you go 3d (for example using opengl) you can add lighting effects to the equation, that usually does a lot to the aesthetics of the whole. For example if the moving circle was a sphere with a nice texture (marble or something), then you could make it really role over the board, and you could specify diffuse and specular reflection values to vary the lighting like for example here.

Camera movement can also beef up the graphics.

Emile Vrijdags
If im honest, I think going 3d maybe slightly out of my depth atm. The circle is supposed to be a person hehe. i wasn't planning to have collsion detection with other moving objects, i planned to allow the people to walk through each other like the original game (Theme Hospital btw). Thanks for your input though, appreciated.
Relequestual
lol, yes i just saw the video again and read the text on the buttons :)
Emile Vrijdags
3d might not be as hard as it seems, when you keep one axis zero for all objects and do orthogonal projection the math stays about the same, but you get the added benefits of using lighting and 3d objects. Maybe just do some java 3d tutorials, and start mini sideproject to get feeling with it (and have fun with it), it will maybe help you refactor better so you could add it in later.
Emile Vrijdags
Hum. Possibly. Interesting. I may look into implementing that later, but I plan to keep to 2D for now, but maybe making the images look slightly 3D, by which i mean not top down, but still a single set of images. I just don't want to have to re code all the graphics at a later date. I'm only just managing as it is, and performance is poor, but thats due to my code. LOTS of work to do :)
Relequestual
A: 

This could turn into a long subjective conversation quickly but I want to state the fact that you don't need openGL. Your application doesn't need to be the best looking one out there. Nethack still attracts people and between you and me : the graphics sucks.

Do you want to learn about 2D and 3D graphics and textures and so on ? Then try stuff... best way to learn. Then you can add this to your resume.

There are a lot of tutorial to do your first steps in OpenGL or some other graphic library. You can even try Qt Jambi. But once you start, you're in for a ride ;)

Silence
Yeh, your right. I think I'll work on this in 2D for now, and then once its petty much there, look at a simpler project to get to grips with openGL. I is indeed something else I would then be able to do. I would like to know some stuff about graphics, yeh, but I'm really bad at making graphics. ah well
Relequestual
+1  A: 

One good side of using opengl (even for 2D graphics) is that you will get (if properly done) hardware graphics acceleration for your scenes.

Also, you can use orthogonal projection and keep one of the axis (Z) as zero to do your 2D graphics. It will be easy if you want to add a 3D effect (like lightning or something) if you use OpenGL.

However it all depends on how much you want to improve the graphics, since adding OpenGL might make things a little more complicated than plain Java2D.

Edison Gustavo Muenz
Yeh, thanks for the info. I think it would be really awesome, but very complicated. I think once I've got almost a working game with java2D, i'll look into it more.
Relequestual