views:

364

answers:

4

Due to lack of capital and time we are having to do our game in 2D even though me (the developer) would prefer if it was done in 3D. I would hate for users to join the game, only to think the graphics look bad and leave. Though I suppose we just have to try and do our best.

That being said, I would like to develop the game in such a way that, should the time come, we can port to 3D as easily as possible. I know of games that had to rewrite the entire thing from scratch. I'd hate to do that, so I'd like some tips / guidelines to use when programming the game so that, when we move to 3D, it will be as simple as changing the code of 1-5 graphics rendering classes (or close) and the 3D graphics would run.

P.S It is a multiplayer roleplaying game (Not an MMORPG, much smaller in scope for now)

+1  A: 

An MVC pattern should help.

And I guess you're aware already, but have you looked at Java3D? Perhaps having a plug replaceable 3D rendering view based on that (but which is not necessarily polished and production ready) will keep you honest so that you don't wind up tied to 2D in some horrible way. It could be as simple as rendering your 2D stuff with some Z positioning added.

frankodwyer
+5  A: 

The simplest way to achieve this is to write the game in 3D, and render the views using a 3d to 2d projection, e.g. in plan or elevation. If the games internal mechanics are 2D and you try to move to a true 3d frame, you would probably better off with a rewrite. It also depends to an extent on what you mean by 3D, and whether you have an effective mapping option. For example, Microsofts Age of Empires is rendered in 3D, but would work perfectly well as a 2D plan. A first person shooter such as Half Life or Quake on the other hand would not.

Shane MacLaughlin
Its not a first person shooter, the player would mostly walk around, talk to NPCs, trade/fight other players, etc. 3D would only give shadows to players, objects and buildings, make graphics better, and the camera would be better (i.e from diff. directions). Do you think this would demand a rewrite?
Click Upvote
I don't think so, insofar as your action is essentially taking place on a surface that can be viewed from above as a plan. In this case adding 3d graphics should be quite straightforward. Just keep all your rendering code seperate and loosely coupled from the rest of the app.
Shane MacLaughlin
+3  A: 

Due to lack of capital and time we are having to do our game in 2D even though me (the developer) would prefer if it was done in 3D. I would hate for users to join the game, only to think the graphics look bad and leave. Though I suppose we just have to try and do our best.

I don't think everything has to be 3D to look good. Well done 2D can look many times better than some standard 3D graphics. To have great 3D graphics you have to invest some serious effort. If your budget doesn't allow for this, I would rather try to put a lot effort into gameplay development.

Just think of (somewhat dated) Diablo II which is not 3D but still has some nice and good looking graphics.

It is certainly possible to build an architecture which could make it easier to change the graphical representation, but I think it will almost never be as simple as you described. Of course, if you just want 3D for the sake of 3D it could be done (instead of bitmaps you now render 3D models) but this is somewhat pointless. If you want to use 3D the player should be able to make use of it (e.g. by moving the camera, having more degrees of freedom, ...) but this would have to be considered in the whole design of the game and thus seriously affects gameplay.

Simon Lehmann
Diablo's models are 3d renders though.For really fine examples of good locking 2d games you'd have to look for crafty pixel art.
Wouter Lievens
When deciding to do a 2D game it doesn't really matter how the 2D sprites are generated, as long as they are fitting in the general style of the game. Pixel art can be fine, but rendering 3D models can have some advantages (e.g. it's easier to generate animations in 8-16 directions)
Simon Lehmann
+2  A: 

You can use the GL ortho view. This will allow you to draw on screen using only 2D coordinates, if you want 3D later on, switch from Ortho to Perspective view and you have 3D, however i don't think it will help you reuse the code, since the 2D ortho view is usually done with textures, and you cannot transform a texture to a 3D mesh.

Maybe a better approach is to do everything in 3D, and setup your camera to look from above, if you do that later you can switch to 3D just by relocating the camera and making better models and textures. This options sounds nicer but gives you more work with the trade-off 2D to 3D portability without code changes.