General 3D game design questions

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.

Any other suggestions for someone who’s never done 3D programming? :slight_smile:

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.
Spell affects can be much neater and complex.
Lighting, shadows is much more realistic.
It’s where the world seems to be going with games! :frowning:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.

You could generalize it, actually. I’ve imagined a situation where the
entire 3-D world is laid out in three-dimensional “tiles,” or voxels,
which are cubes, of a certain size. Your sprites, terrain objects, and
all the rest would fit into this 3-D grid the same way 2-D sprites and
objects would fit in a tile-based game.

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.

Collisions would be trivial to manage. You can easily determine the
neighboring voxels to a char and determine occupancy, right?

Other ways of representing your world would include stuff like BSP trees
(which are used by most first-person 3-D games) and octrees…


Rafael R. Sevilla <@Rafael_R_Sevilla> +63 (2) 4342217
ICSM-F Development Team, UP Diliman +63 (917) 4458925
PGP Key available at http://home.pacific.net.ph/~dido/dido.pgp

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.1i
Filter: gpg4pine 4.1 (http://azzie.robotics.net)

iQA/AwUBOX/Lo2qsapcaCwm7EQLLrwCfaLqSTemfSpnTLTitqfnG5nSBtoUAninR
nHCelM0GRe9RcFBtJ81nnJid
=9exB
-----END PGP SIGNATURE-----On Wed, 26 Jul 2000 hayward at slothmud.org wrote:

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.

Well, if you are doing an iso game like diablo, you are in essence
still working with a 2D map, even if there is the concept of
’depth’ in how the characters interact or the shape of the terrain.
I would stick with a 2D terrain map, but have X/Y/Z coordinate
info for the game characters, missles, etc. This is how I do it
in my gridslammer game SDK.

Check out GridSlammer at http://www.gridslammer.org

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.

My approach in gridslammer was to create a sparse array. I have
a two dimensional grid of pointers. Each pointer is the head of
a link list of objects that are located somewhere in that grid
square. This means objects must remove and add themselves from
the link lists as they move between squares, but in practice this
is not that bad because squares usually do not have multiple
objects in them. There is a side benefit in that you can sort
the objects in the list by render order, making your render phase
much easier and faster.

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.

The REALLY nice thing about the sparse array approach is that
it vastly simplifies collision detection. You no longer need
to iterate the list of all objects, just the objects in the
squares near you. Note that this data model is equally
useful for both 2D and 3D rendering engines (something that
has been discussed on gridslammer-dev).

I really recommend you check out gridslammer to see what I
mean. GridSlammer is released under LGPL, so perhaps you can
even use it for you project and save yourself some coding.
This post is wandering a little off topic for the SDL list,
but I would love discuss this further in private email or on
the gridslammer-dev mailing list.

Cheers,

Thad

P.S. In case you hadn’t guessed, GridSlammer uses SDL as one
of its targets, which is why I subscribe to this list. It also
can use GGI or DirectX.

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? :slight_smile:

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

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.

Then your artist has fallen into a far too common trap, the 3D Is Cool
And 2D Is Oldhat And Out trap.

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.

Design is everything!

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.

This is where the design comes in. Do you want your characters to move
around in three dimensions? Then you need data structures to allow for
such movement, to detect collisions and help presentation. If not,
you only have to worry about the presentation. And you can of course
have a 3D-view using 2D-graphics (think Diablo or any other isometric
game). Or look at GLTron - an extremely flat 2D game, with 3D presentation.

Any other suggestions for someone who’s never done 3D programming? :slight_smile:

Plan it from the ground up. Make sure you know some basic linear
vector algebra (nothing fancy, just the basics you probably learned in
school, linear transformation matrices and that kind of stuff). Do
some 3D toys to get a feeling for it. Think about data appropriate
data structures, such as 3D trees and octtrees.

And do not, NOT, try to retrofit a 3D engine onto a 2D game that’s
already halfway done. It invariably ends with disaster.

P.S. Reasons my graphics artist is pushing for a 3D game:
More customizable - e.g. wearing an item can show up visually.
Spell affects can be much neater and complex.
Lighting, shadows is much more realistic.

Bogus. All these can be easily done in any pure 2D or 2D/3D hybrid,
and has been done so for decades. Also remember that 2D rendition is
never limited to using polygons, so 2D games can be far more
graphically detailed and smoother than any 3D game on today’s
hardware.

  It's where the world seems to be going with games! :-(

Alas, yes. People who can’t design games think that new technology is
going to save them, and that Bad Things will happen if they don’t follow
the herd. But if you look at the most successful games the last few years,
you may be surprised to see how many of them do not use 3D at all.

3D modeling and rendering_ is frequently used for 2D graphics, so
your artist can still use his favourite 3D toys to generate your
images.

I’m working on a third person perspective game, the likes of
warcraft,
diablo, etc.

Good for you, I really like those types of games :slight_smile:

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.

That’s the reason that I publically admitted to when I decided to
switch from from 2D to 3D graphics design, my actual reason was that I
was too lazy to do all the art required for a 2D game and wanted to
cut down on the work I had to do :slight_smile:

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.

2D concepts don’t apply to well to a pure 3D game, just do a hybrid.
Only your graphics drawing will really be affected by that.

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.

Again, if you are doing a hybrid you don’t have to worry about little
3d details such as height :slight_smile: You can safely use your old 2D
world/character state/etc stuff and only the drawing will be affected.

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.

Any other suggestions for someone who’s never done 3D programming? :slight_smile:

Just pretend it’s a 2d game until you get the basics down :slight_smile: Alot of
great 3d games have been 2d at heart. Wolfenstein, Doom, and gltron
are all esentially 2D. Console hits such as R-Type Delta and Kirby 64
(Which is the number 1 selling console game on the market currently)
have pure 2d gameplay in a 3d world. As many people have already
said, the effects you are going for can be done easily in a pure 2d
game also, Abuse proved lighting was feasible. Diablo II has
lighting, alpha, characters who’s equipment is visible while you walk
around, neat spell effects and decent shadows, and not only is it 2d
but it uses an 8 bit colordepth too, so it can be done. A 2d game
running on a 3d engine will probably end up in less work though, which
gives you more time to focus on game play issues over graphic
subsystems, which for us small time developers is a good thing ™

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.
Spell affects can be much neater and complex.
Lighting, shadows is much more realistic.
It’s where the world seems to be going with games! :frowning:

Sounds like your graphics artist has been playing Diablo II :slight_smile:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1On Thu, 27 Jul 2000, Mattias Engdeg?rd wrote:

And do not, NOT, try to retrofit a 3D engine onto a 2D game that’s
already halfway done. It invariably ends with disaster.

Ever hear of Ultima IX? I think that game is the perfect example of this
syndrome. I suppose that’s what Origin did with it. I remember plans back
in 1996 for a “2.5-dimensional” game for Ultima IX, a sort of compromise
between 2-D and 3-D, to get around the problems that arose in Ultima VII
where objects could get lost under walls and things like that. Never
learned what their actual plans were, because in all their enthusiasm for
3-D technology, they retrofitted a 3-D engine onto it. Now, admittedly
Ultima IX has to have the most impressive graphics I’ve ever seen in any
game for the PC I’ve ever seen, but along the way, so much was lost, so
many compromises had to be made. The game lost its soul…what it meant to
be an Ultima game! I’ve been playing Ultimas for fourteen years (they’re
the games that inspired me to try to make my own), and U9 is not the saga
ending I hoped for…

This has nothing to do with graphics: it’s the overall game design.
Ultima IX’s graphics are second to none. But as for overall design,
nothing is second to it. If you already have a 2-D game that’s already
halfway done, don’t try to change in mid-stride. Redesign it from the
ground up if you want a 3-D game, lest you fall into the same trap that
got Richard Garriott and Origin Systems…


Rafael R. Sevilla <@Rafael_R_Sevilla> +63 (2) 4342217
ICSM-F Development Team, UP Diliman +63 (917) 4458925
PGP Key available at http://home.pacific.net.ph/~dido/dido.pgp

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.1i
Filter: gpg4pine 4.1 (http://azzie.robotics.net)

iQA/AwUBOYBe/mqsapcaCwm7EQKfOQCcC9PzRp4DjSkWSMLwsDCTzo3ac6UAoN8g
nzxdw/H9JzJgdNgCi1umFBX+
=Fg9X
-----END PGP SIGNATURE-----

Sounds like your graphics artist has been playing Diablo II :slight_smile:

Yes, exactly! argh! :slight_smile:

Thanks everyone for your wonderful suggestions and comments, your help is
genuinely appreciated.–
Brian

Ya, not to mention that the game refuses to run because of its bugs on my
machine, and I can’t get a hold of tech support at Origin. ~,^

Sean Middleditch

“Rafael R. Sevilla” wrote:> Ever hear of Ultima IX? I think that game is the perfect example of this

syndrome. I suppose that’s what Origin did with it. I remember plans back
in 1996 for a “2.5-dimensional” game for Ultima IX, a sort of compromise
between 2-D and 3-D, to get around the problems that arose in Ultima VII
where objects could get lost under walls and things like that. Never
learned what their actual plans were, because in all their enthusiasm for
3-D technology, they retrofitted a 3-D engine onto it. Now, admittedly
Ultima IX has to have the most impressive graphics I’ve ever seen in any
game for the PC I’ve ever seen, but along the way, so much was lost, so
many compromises had to be made. The game lost its soul…what it meant to
be an Ultima game! I’ve been playing Ultimas for fourteen years (they’re
the games that inspired me to try to make my own), and U9 is not the saga
ending I hoped for…

This has nothing to do with graphics: it’s the overall game design.
Ultima IX’s graphics are second to none. But as for overall design,
nothing is second to it. If you already have a 2-D game that’s already
halfway done, don’t try to change in mid-stride. Redesign it from the
ground up if you want a 3-D game, lest you fall into the same trap that
got Richard Garriott and Origin Systems…


Rafael R. Sevilla +63 (2) 4342217
ICSM-F Development Team, UP Diliman +63 (917) 4458925
PGP Key available at http://home.pacific.net.ph/~dido/dido.pgp

-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.1i
Filter: gpg4pine 4.1 (http://azzie.robotics.net)

iQA/AwUBOYBe/mqsapcaCwm7EQKfOQCcC9PzRp4DjSkWSMLwsDCTzo3ac6UAoN8g
nzxdw/H9JzJgdNgCi1umFBX+
=Fg9X
-----END PGP SIGNATURE-----