Another topic about isometric / 2d / 2,5d / mixing 2d and 3d assets

After seeing some of the games created with jme, I decided to give it a try for a little project that’s been haunting my brain for a while. First of all I was amazed at how fast the setup of jme was (the tutorial on jme in eclipse helped me out with the few problems I encountered).



So after trying some of the test programs, I focused on getting some sprite animation going. I found a class for texture animation on the forums (http://www.jmonkeyengine.com/jmeforum/index.php?topic=4037.0) and after modifying it a bit (it showed the entire panorama on the quad) I had the result I was looking for. A bit later I found the TextureAnimationController in the API which probably can do the same thing but lacks documentation.



Now I’m trying to get a nice camera setup. The only thing fixed is that my units are 2D (in my sprite tests I have them on billboards), the background can be either 2d or 3d. I want to have an isometric view (haven’t decided on whether it should be parallel or have some perspective in it, it depends on how it looks with the units). I found a couple of topics on this: http://www.jmonkeyengine.com/jmeforum/index.php?topic=1197.0,

http://www.jmonkeyengine.com/jmeforum/index.php?topic=222.0,

http://www.jmonkeyengine.com/jmeforum/index.php?topic=1707.0.

But I haven’t seen a lot of results (besides the setParallelProjection function in the Camera class).



I was wondering if the people working on something similar could show some screenshots of their solution and explain the camera setup. Even better would be some code or maybe a demo class that shows a small scene with a particular strategy for mixing 2d and 3d.

I’m not sure whether this is what you’re after, but I use orthographically projected 3D dials in my HUD, using setParallelProjection. The ORTHO queue clips to -1<z<1, so I needed to make a simple render pass that sets the camera to parallel projection and the correct parameters for the hud node, then sets it back again afterwards. This seems to work fine, except for Text, which I haven’t quite worked out yet :slight_smile: The code is very simple, it’s in net.java.dev.aircarrier.pass.AlternateCameraRenderPass and net.java.dev.aircarrier.pass.TestAlternateCameraRenderPass at http://aircarrier.dev.java.net. It’s not that great, really it should accept an alternate camera that it would set up for that one pass, then reinstate the camera that was there before the pass - I tried this but for some reason it didn’t work, I should have fixed it but I forgot :slight_smile:

It's one of the things I was trying to accomplish, thx for the demo :D. I am going to play around with it for a while.



Do you think it will be able to mix 2d units with a 3d landscape? I think it is more suited for a texture background with 3d units moving on it, but I'm not sure.



I'd also like to explore the possibility of having units running around as billboards on a 3d map (where the camera has a fixed direction and height), has anyone taken such an approach?

Ah I see what you mean now :slight_smile: Yup I'm not sure that what I pointed you to is what you need, although I hope it's useful in general (it's more for stuff like HUDs).

Sprite billboards should be fine I think, although I haven't used them myself yet (I've used particles that work similarly though). If you want an isometric view, then I think the right settings would be those used for the parallel projection camera in that render pass. That will give you coords corresponding to pixels, which might be convenient to work with if you want to make sure the sprites always have one texture pixel per screen pixel (just make the billboards have the same width in units as the sprite images in pixels), which should look best. Not sure how you would get the sprites to always be aligned to screen pixels in terms of translation, I guess you could transform them into camera coordinates each frame, then shift them in camera x/y to the nearest whole value, but that would be complex and I don't know if you want to do that :slight_smile:



I'm picturing something that looks a little like Final Fantasy Tactics, is that about right? I seem to remember that having 2D sprites on 3D background, can't remember if they were orthographic, but they had a limited view angle so that it looked pretty much isometric. That looked pretty cool :slight_smile:

I'm starting to realize the drawbacks of the 2d units approach :roll:



I wanted to use high quality renders (created with Poser), but after loading a few of those with animation frames, the VM ran out of memory. So I reduced the quality, but now I might as well use a low poly 3d model.



Also if I want to have similar units with different colors/weapons I would need separate animations for all of those.



From now on 3d models in 3d world (and maybe a nice high quality render for a title or inventory screen :P)

I did exactly the same thing :slight_smile:



I wrote a puzzle game in pure 2d, but opengl accelerated (puzzlebeans.sf.net), which worked great. Then I tried to use the same engine with some tweaks for a strategy game where I could have planes flying around at different angles, I was going to render an image for each rotation (to a certain accuracy - a bit like the old wing commander games). But I worked out how much image data that would be, and decided to just go 3D :slight_smile:



That said, for some game types I think 2D sprites would be great, mainly for stuff like Final Fantasy Tactics or Disgaea, with hand drawn sprites. But then hand drawn sprites take a loooong time to do to, and I'm very bad at that kind of thing. So I always come back to either rendered 2D or real 3D, and real 3D seems to win :slight_smile: