hayward at slothmud.org wrote:
I’m working on a third person perspective game, the likes of warcraft,
diablo, etc. It is currently a 2D blitted game, but my graphics artist
is pushing to switch to 3D because of the flexibility we would gain from
doing so.
I’m considering the idea, but the concepts used in a 2D game don’t seem to
apply well to a 3D game. For specific examples, I know I can sort through
the source code of games, but now I’d just like to talk about design.
For example, internally I store the world/character state/etc in a flat
grid that specifies whether a spot is taken or not. I currently have very
little idea for how I would go about representing a 3D game in memory,
because this grid idea doesn’t seem to feasible for such a situation.
The first (and most trivial) thing that comes to mind is just storing a
linked list of characters/objects/etc in memory - with their coordinates
in the world, then just use that to build the scene/display it.
This idea of course makes me have to search through the lists everytime I
want to move a char to check for a collision. Much less efficient than
checking the grid spot next to a 2D sprite where you’d like to move the
char.
Depends on how you organize your world. The “2D” game Alpha Centauri
uses a 3D engine (albeit one with isometric projection) to draw its map,
complete with perspective texture mapping and lighting, but it’s still a
tile-based game. Think of 3D graphics as a way to visualize your game’s
world - not of your game’s world as a way to store your 3D graphics.
And remember that CPU’s these days are DAMN fast. They can handle a
significant amount of processing each frame. You’ll want to use smart
algorithms though - I suggest looking at the gamasutra.com article on
octrees. That can significantly reduce the work involved in
culling/colliding your scene.
Any other suggestions for someone who’s never done 3D programming?
Learn a 3D graphics API before you start designing - it’ll make your
life much easier once you know exactly how you’ll be doing the drawing.
I suggest OpenGL. It’s fast, portable, and it interoperates well with
SDL.
Thanks for your suggestions,
Brian
P.S. Reasons my graphics artist is pushing for a 3D game:
More customizable - e.g. wearing an item can show up visually.
That can be done in 2D also.
Spell affects can be much neater and complex.
I disagree. Lighting can be done very well in 2D (look at Crack.Com’s
Abuse title - underpublicized, but a VERY advanced game). With lighting
and alpha blending, effects are limited only by your imagination.
Lighting, shadows is much more realistic.
“Realistic” means nothing in some game genres.
It's where the world seems to be going with games! :-(
I personally prefer 2D games to 3D games most of the time. The last 3D
game I really enjoyed was Half-Life.
This is obviously a hot topic of debate.
Personally, I think “hybrid” games are underrated. Why not use 3D
rendering to draw the characters, but standard 2D techniques to draw the
world? You could benefit from both excellent character animation and the
speed typical of 2D blitting.
-John