gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Pokemon Diamond like GFX engine

#137409 - nio101 - Sat Aug 11, 2007 2:00 pm

Hello,

Seeing the gfx engine behind pokemon Diamond/Perl versions, I was wondering if anybody had an idea about how it was working ?

It seems to be real 3D now, not some kind of 2D tile engine.

Could it be a software only engine ?

I guess some could have a classical tiled map of 3D objects references and the engine using this map to render in 3D with the hardware (and mixing with some 2D)...?

If anybody could help me guessing how it is done, that would be cool, since I'd like to make some demo using the same 2D/3D effect...

Thanks!

#137410 - Lick - Sat Aug 11, 2007 2:19 pm

It's a (software) 3D tile engine, rendered with the (hardware) 3D graphics API.

Not that hard to imagine? Try looking up '3D tile engine' or '3D terrains'.
_________________
http://licklick.wordpress.com

#137442 - tepples - Sat Aug 11, 2007 9:24 pm

There are two ways to render tiled terrain. One involves a high camera and can be used in games that act like Pok?mon Pearl Version (whose engine I'm 99.44% sure is not coded in Perl), Pok?mon Diamond Version (not the Telefang hack), and Animal Crossing: Wild World:
  1. Find a rectangle centered on the camera that contains all tiles that could be visible on the screen. This rectangle is called a "potential visible set". ACWW seems to use a rectangle 16x16 cells in size for this.
  2. For each tile in this rectangle, look up a 3D model that represents the tile's contents.
  3. Draw these models to the screen.

But if the camera is low, such as in a game that uses first-person view, the potential visible set is much larger, needing a different algorithm to narrow it down. This algorithm is called ray casting, and it is used by Wolfenstein 3D and Rise of the Triad. A conceptual extension of ray casting to non-square tiles results in portal rendering, used by Duke Nukem 3D and Serious Sam.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#137455 - Lick - Sat Aug 11, 2007 11:09 pm

Tepples: maybe a quad-tree would be better suited for the DS hardware, and the cases you mention.
_________________
http://licklick.wordpress.com

#137536 - M3d10n - Mon Aug 13, 2007 2:36 am

If the level is build in an uniform 2D grid of 3D tiles, and the camera is mostly top-down, then using a grid-based visibility test should be faster than a quad-tree since you can quickly calculate which are the minimum and maximum grid coordinates visible from the camera.

Of course a quad-tree would be more suited for non-tiled levels and if the camera is mostly on a lower angle (first, third person, like tepples mentioned.)

#138545 - nio101 - Sat Aug 25, 2007 9:17 am

Thanks for your help, it's very interesting...

Now I have to improve my 3D skills and find good tutorials to find out how to import 3D models and mix with 2D on NDS hardware...