jsbarretto,
@jsbarretto@social.coop avatar

A few days ago I suddenly had a desire to port Super Mario 64 to the Gameboy Advance.

I quickly realised that a straight port was going to be impossible given that the GBA:

  • Is about an order of magnitude slower than the N64
  • Lacks a GPU or any sort of hardware parallelism (you get about 10 cycles per pixel, per frame to rasterise everything in software, and that's it)
  • Has no hardware support for floating point maths

So, I guess I'm rewriting the whole thing from scratch.

video/mp4

jsbarretto,
@jsbarretto@social.coop avatar
jsbarretto,
@jsbarretto@social.coop avatar

I have implemented collision detection and resolution with the geometry mesh including wall and floor sliding...

...all without a single division operation (they're slow).

I spent ages trying to fix a mystery unsolid floor bug only to realise that the triangle frustum check was overflowing internally. Fixed-point maths sucks, makes me realise how painless and elegant floating point is in comparison.

jsbarretto,
@jsbarretto@social.coop avatar

Are there any 3D modelling gurus that feel like taking a stab at an ultra low-poly Mario? I'm abysmal with Blender. Here's my attempt at simplifying the existing model, down to 172 polygons. Ideally, I'd like to get below 100.

jsbarretto,
@jsbarretto@social.coop avatar

Texture mapping, mipmaps, and transparency support for today. Oh, and the game can now switch between stages.

I'm surprised by how performant these ended up being. Texture mapping roughly doubles the cost of the rasteriser inner loop but nothing else, mipmapping is basically free, and transparency support - after a lot of prodding - compiles down to a single assembly instruction in the inner loop.

That said, none of them are free so the game is gradually slowing down despite my best efforts.

A zoomed out view of Peach's castle with mipmapping enabled. Because of this, the textures in the scene are less noisy and the shape of the castle is clearer and easier on the eye (less visual noise).
A close up screenshot in front of the castle showing textured walls, a semi-transparent fence, and shaded textures.

jsbarretto,
@jsbarretto@social.coop avatar

Here's a video of it all in action (minus mipmapping, I got that working less than an hour ago): https://youtu.be/K0ye--qxt-w

jsbarretto,
@jsbarretto@social.coop avatar

Found some more time to work on this over the past week. The rasteriser is now significantly faster, the physics code is more rugged, I added a proper player model, and am now experimenting with some basic animations. It's starting to feel like... a thing?

A short video of a very low-poly Mario running around Peach's Castle. He has a very simple running animation.

eniko,
@eniko@peoplemaking.games avatar

@jsbarretto low poly Mario is a delightfully weird lil guy

jsbarretto,
@jsbarretto@social.coop avatar

@eniko Animation interpolation done entirely with shifts and adds, it's so janky. Good fun though.

eniko,
@eniko@peoplemaking.games avatar

@jsbarretto oh man I hope you post a whole workup on how you did all of those one day

jsbarretto,
@jsbarretto@social.coop avatar

@eniko If I find the energy and time, I'd like to do that. There are some really neat tricks that went into making it all run at somewhat playable speeds. Video or blog post?

eniko,
@eniko@peoplemaking.games avatar

@jsbarretto I'll consume either but a video would probably do gangbusters on YouTube

dragfyre,
@dragfyre@mastodon.sandwich.net avatar

@jsbarretto um you wut now

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • kavyap
  • thenastyranch
  • ethstaker
  • DreamBathrooms
  • osvaldo12
  • magazineikmin
  • tacticalgear
  • Youngstown
  • everett
  • mdbf
  • slotface
  • ngwrru68w68
  • rosin
  • Durango
  • JUstTest
  • InstantRegret
  • GTA5RPClips
  • tester
  • cubers
  • cisconetworking
  • normalnudes
  • khanakhh
  • modclub
  • anitta
  • Leos
  • megavids
  • provamag3
  • lostlight
  • All magazines