How to make a game that is restricted to 2 dimensional gameplay, but has 3d graphics? If it is possible then what library can i use to do the same?
Your question can have different meanings:
-
Are you looking for a 2D Game with Isometric view (like for example Age of Empires)?
Then you need to adjust your Textures, they need to be Isometric. Also, you need to draw 1 version for each direction you want to support, usually, as much as i know, 8 versions (North, Northwest, West, Southwest, South, Southeast, East, Northeast). -
Are you looking for a real 3D game, with 2D logic, for eaxmple a First-Person Game without jumping/flying? Then your library needs to support 3D stuff, like Model-loading and so on.
Usually you separate logic and view, so it shouldn’t be a big problem to project the 2D logic in a 3D space.
Just use LWJGL and restrict your camera to 2 axes.
As far as I know, there aren’t any popular libraries built for 2.5D gameplay out there.
- Jev
yeah i guess i dont have any other option other than lightweight java lib.
You have plenty of other options. I highly suggest you do some research.
could you give me the name of any such high-level library?
Already been doing it from yesterday and extremely tired :-X
Sorry to tell you this, but it’s going to take much longer than 1 day to become familiar with what you’re looking for.
You need to take a step back and go over the basics instead of trying to find a tool that does the work for you.
That’s alright ;D you mean i have to learn 3d stuffs?
I mean it’s really hard for us to answer the types of questions you’ve been asking, other than to point you to google and the basic tutorials.
There are a bunch of libraries out there to help you out (LWJGL, JOGL, libGDX, JMonkeyEngine, Processing, Slick, etc), but which one is right for you isn’t really something we can decide for you. It all depends on which library fits inside your head the best, which one jives with your programming style and way of thinking.
That’s why I think you need to run through some basic tutorials. Go through the basic tutorials of LWJGL, see what you like. Then go through the basic tutorials of JOGL, see what you like. Then repeat with libGDX. Keep doing that until you have a basic understanding of the libraries and some idea of which one works for your goals. We can’t give you this information, because it depends entirely on you.
But yeah, if you want to display stuff in 3D, you’re going to have to learn “3D stuffs”.
Your question is extremely vague, you could at least give an example of the effect you’re looking for.
You might be interested in what’s called 3D Projection
I did this with nothing other than the equations on the page and Java2D: (back before I knew anything else)
I tryed that with libgdx. It is pretty easy to use, but you have to read some tutorials (i suggest Xoppas (http://blog.xoppa.com) tutorials, as he is the creator of the 3D part of libgdx).
But don’t expect to much, you need a lot of experience and a lot of time and you will definitely run into some issues, which will hurt your motivation!
I also tryed to create a 3D game with 2D logic (first person game without jumping/flying, so movement and collision detection was only in 2D), but after some time i ran into performance issues, beacuse i just did not have enough knowledge.
You can choose almost any library for 3D graphics, and then choose an orthographic projection.
You will still have to learn how to make basic 3D, but your game renders are going to look really neat and 2.5D-ish. Learning OpenGL is not a necessity for this though.
- LibGDX has a decent scene graph for 3D, but I felt that it fell short in lighting (it’s under development). Maybe you don’t find this a problem. No OpenGL needed.
- JME definitely doesn’t fall short in functionality, and you can definitely render what you need. It might be overkill though. No OpenGL needed.
- jPCT is a simple 3D API. It doesn’t feature orthographic projection though, which may be a problem for you. No OpenGL needed.
- LWJGL is “just” an OpenGL binding, meaning that you’ll be geting dirty with the GL yourself.
- JOGL I have never used, but I figure it should be very similar to LWJGL.
There are other 3D libraries that I know nothing about, but maybe someone else does?? Anyway, they might be of interest to you.
- Ogre4j
- Java3D
- Bindenlicht
- 3DzzD
- Jake2
- Ardor3D
- Xith3D
Most of the other 3D libs you’ve mentioned are dead, and Jake 2 is just a Quake II port for Java. :
JOGL is also just an OpenGL binding.
- Jev