Skip to main content
GameDev.net gamedev.net
🔒 Locked

How is 3d faked in the Game Boy Advance?

Started by dudedbz1 Nov 10, 2005 at 4:19 PM 16 replies 3.8k views
Original Post
dudedbz1
dudedbz1
Ok, now the Nintendo DS can handle 3d stuff, as much as I know(like Super Mario 64 DS). But there were some games for the GameBoy Advance that had 3d. I figured they faked it somehow because as much as I know the GBA cant handle 3d. Some games like DBZ: Buu's fury and NFS: Underground 2 faked it. Even take Doom for the GBA. It was ALL 3d, so most likely they faked it the most. My question is, how did they do it? Not from a programming perspective, jsut a simple explanation and maybe pseudocode. Thanks.
-----------------------------....::::DRAGON BALL Z::::....C<<"+"<<"+"; // Go C++ !!!-----------------------------
eedok
eedok
Quote:
Original post by dudedbz1
Ok, now the Nintendo DS can handle 3d stuff, as much as I know(like Super Mario 64 DS).

But there were some games for the GameBoy Advance that had 3d. I figured they faked it somehow because as much as I know the GBA cant handle 3d.

Some games like DBZ: Buu's fury and NFS: Underground 2 faked it. Even take Doom for the GBA. It was ALL 3d, so most likely they faked it the most.

My question is, how did they do it? Not from a programming perspective, jsut a simple explanation and maybe pseudocode.

Thanks.


The doom source code is available.. http://www.gamedev.net/reference/articles/article1770.asp
skyfire
skyfire
they used raycasting. i can't explain it very well because i don't know much about it. i think raycasting is a software based 3d engine.
TravelingCoder
TravelingCoder
It might of have been done using Raycasting. Which basically takes a bit of data and turns it into a 3D projection. I think it uses trigonometry in order to determine the size and angle of things. That link has some info.

An example is Wolfenstein 5k. A 3D shooter done in &#106avascript.
And Dave did see the ad of penis enlargement, and gazing upon His holy manhood, He did thrust the spam into the firey depths of hell.- Book of Dave, 1:7
capn_midnight
capn_midnight
when you limit the "camera" to only look straight towards the horizon (i.e. you only support turning the camera horizontally, you can't look up and down), you can make a few assumptions and optimizations that drastically increase the speed of the application. In fact, you only end up doing a "hard" calculation for the x axis, the y axis is scaled.

The graphics mode in which such 3Dish apps run on the gameboy advance is a very low res mode. 3D can be done because there isn't a whole lot that you can show.

Finally, if you look closely, lines don't match up exactly to pixels. The scene is rendered at an even lower resolution than the graphics mode can technically handle.

Generally speaking, terrain is not rendered, it's left as flat, or hills that run parallel to the screen surface no matter which direction you turn (for road racing games). Ceilings are also not rendered, it's just a flat color. This leaves just walls. Walls are placed at 90 degree angles (or if it's an advanced game, 45 degrees), allowing for more assumptions that lead to optimizations

So, it's a combination of data simplicity and and fakery.

Look up a technique called "ray casting".
I Like Bread
I Like Bread
Raycasting is all fine and good, but what about this game?
______Numbermind StudiosCurrently in hibernation.
dudedbz1
dudedbz1
Quote:
Original post by I Like Bread
Raycasting is all fine and good, but what about this game?


Yeah, that game is of high quality(atleast for the GBA). I dont think they used ray-casting. Any ideas?
-----------------------------....::::DRAGON BALL Z::::....C<<"+"<<"+"; // Go C++ !!!-----------------------------
bakery2k1
bakery2k1
Just because a machine does not have the hardware to perform full 3d calculations, it doesn't mean it can't do 3D in software. Just look at the original Quake.
Michalson
Michalson
Quote:
Original post by I Like Bread
Raycasting is all fine and good, but what about this game?


That looks like a combination of two/three things:

Billboard sprites (sprites that are seen face on, but scaled based on distance, this can use GBA sprite hardware acceleration)

Billboard sprites with fake angles - you have a 3D model that is rendered at multiple angles, to come up with a set of sprite images. You then show the image that most closely matches the objects angle (though I haven't seen the video, if it's really smooth it could be actual raytracing to make the cars).

The terrain itself is most likely voxel with some texturing, as most non-mode 7 GBA racers seem to use.
cowsarenotevil
cowsarenotevil
There's no reason you can't make a matrix-based polygon engine on a slower platform. It'd be no more "fake" than anything else, except that calculations would be done in the CPU, not the more specialized GPU.

This ancient book covers how it's all done on the inside.
-~-The Cow of Darkness-~-
boolean
boolean
Quote:
Original post by I Like Bread
Raycasting is all fine and good, but what about this game?


Are you sure it's proper 3D, and not just mode-7 3D?
Scet
Scet
Quote:
Original post by bakery2k1
Just because a machine does not have the hardware to perform full 3d calculations, it doesn't mean it can't do 3D in software. Just look at the original Quake.


The BIOS contains various FPU-like instructions such as sqrt,sin,cos,tan and some decompression hooha to deal with large sprites. Plus the LCD controller has built in functions for background / sprite rotation and scaling. Most 3D games perform calculations during HBLank and then copy to video RAM with a DMA transfer. Mabye it doesn't have "3D" hardware, but the designers implanted the needed features to make it work.
bakery2k1
bakery2k1
Yes, but you're not going to get real 3D with large sprites, 2D hardware rotation and slow SWIs into the BIOS.

Anyway, my point was that the GBA was perfectly capable of 3D in software - I myself have implemented a version of the Windows "3D flower box" screensaver on it.
Boder
Boder
Take a look at Yeti 3D for the GBA.
DrewGreen
DrewGreen
As Michalson mentioned, Mode 7 is a likely option. That rally game doesn't look like it was done that way though.

You can do pretty decent-looking software rendered 3d on a mobile phone with fixed point math, I'm sure a GBA can handle it easily. Check out this - Neat software rendering tutorials
"I must not fear. Fear is the mindkiller. Fear is the little death that brings total obliteration. I will face my fear. I will permit it to pass over me and through me. And when it has gone past me I will turn to see fear's path. Where the fear has gone there will be nothing. Only I will remain." ~Frank Herbert, DuneMy slice of the web
cowsarenotevil
cowsarenotevil
Banned? I wonder how that happened.
-~-The Cow of Darkness-~-
nullsquared
nullsquared
Sooo.... It is possible to do 3d stuff. Cool.

Kinda off-topic, but have any of you played Super Mario 64 DS for the NDS?

[Edited by - agi_shi on November 10, 2005 8:29:51 PM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.