Live data from Hacker News

How I failed to make a game: Raycasting on the GBA

mcejp.github.io

31–36 of 36 posts

Re: How I failed to make a game: Raycasting on the GBA

#31
post #9

Shockingly enough it is actually possible to do decent ray casting and much more on the GBA despite the incredibly minimal compute budget. Joshua Barretto has been working on a GBA port of Super Mario 64 with entire 3D levels, characters, and movements. In my opinion just incredible work: https://youtu.be/9mUsgJ-HiDM

Amazing - a purely software rasterizer on 16MHz, no floating point, 16-bit data bus, at most 512k of RAM? That’s the original 68k! What’s everyone’s excuse for not getting SM64 running on a Macintosh Plus?

Re: How I failed to make a game: Raycasting on the GBA

#32
post #9

Shockingly enough it is actually possible to do decent ray casting and much more on the GBA despite the incredibly minimal compute budget. Joshua Barretto has been working on a GBA port of Super Mario 64 with entire 3D levels, characters, and movements. In my opinion just incredible work: https://youtu.be/9mUsgJ-HiDM

Amazing - a purely software rasterizer on 16MHz, no floating point, 16-bit data bus, at most 512k of RAM? That’s the original 68k! What’s everyone’s excuse for not getting SM64 running on a Macintosh Plus?

I guess you're probably joking, but in case there's any actual confusion:

ARM7 is fully pipelined, and GBA connects it to 32K of on-chip zero-wait-state SRAM, so it's possible for optimized code to approach 16 MIPS with 32-bit operations. The original 68K is a multi-cycle processor and Mac Plus runs it at 8 MHz, which tops out at more like 2 MIPS for 16-bit operations, less for 32-bit operations (the ALUs are only 16-bit).

Re: How I failed to make a game: Raycasting on the GBA

#33

Not sure if you care at this point, given that you stopped working on project, but there's a better way to find the ray direction for each column than using sin/cos for every one, which will also get rid of the slightly warped look: Calculate the two vectors from the camera at the very left and right of the screen (using your fov angles and sin/cos, that's fine). Then, to find the ray direction vectors for each colum…

In my experience there are two mistakes people sometimes make that leads to the fisheye lens look. The first, as parent mentioned, when calculating the ray directions you should linearly sample a line rather than interpolating view angles. Second, when doing per-column perspective division, you should divide by dot product of the forward vector and the difference between the ray intersection and the camera location. Often if someone is making the first mistake they are also making the second.

Following this will give you the normal pinhole camera 3d projection that we all expect to see from a 3D game.

Rule of thumb I found as a beginner in 3D graphics: any time polar coordinates seem like the obvious solution, there's usually a better way.

Re: How I failed to make a game: Raycasting on the GBA

#34
post #9

Shockingly enough it is actually possible to do decent ray casting and much more on the GBA despite the incredibly minimal compute budget. Joshua Barretto has been working on a GBA port of Super Mario 64 with entire 3D levels, characters, and movements. In my opinion just incredible work: https://youtu.be/9mUsgJ-HiDM

The one that blew my mind as a kid was Need for speed underground: https://youtu.be/36U2xN-196c?si=T7xSCeKxss_at3S0

The one that blew my mind was Payback: https://www.youtube.com/watch?v=9wApAbxZY9k

It's GTA1/2 clone with an overhead view of a full 3D world.

Re: How I failed to make a game: Raycasting on the GBA

#35
post #9

Shockingly enough it is actually possible to do decent ray casting and much more on the GBA despite the incredibly minimal compute budget. Joshua Barretto has been working on a GBA port of Super Mario 64 with entire 3D levels, characters, and movements. In my opinion just incredible work: https://youtu.be/9mUsgJ-HiDM

That SM64 port is incredible, thank you for sharing it!

Re: How I failed to make a game: Raycasting on the GBA

#36
post #9

Shockingly enough it is actually possible to do decent ray casting and much more on the GBA despite the incredibly minimal compute budget. Joshua Barretto has been working on a GBA port of Super Mario 64 with entire 3D levels, characters, and movements. In my opinion just incredible work: https://youtu.be/9mUsgJ-HiDM

There was actually a fully 3d platformer released for the system during it's production run, Asterix & Obelix XXL: https://www.youtube.com/watch?v=b0pknb4ghUA

There was also a Tomb Raider port (and probably other examples of the genre).
Post reply on HN