News for hackers. Stuff that matters.
Re:The Super Nintendo Cartridges by solarized on Monday April 22, 2024 @02:03AM (#40111753)
I hope developers still love to blog details with article mode like this, rather than vlogging it on YouTube. A lot of detail packed into a few kilobytes only.

"Super Mario World" is still the masterpiece game ever. It has amazing characters, sprites, and stages packed into only 360 KB.

Re:The Super Nintendo Cartridges by Dwedit on Monday April 22, 2024 @04:57AM (#40112552)
The file sizes given by the site are wrong. Super Mario World is 512KB, or 508KB if you discard the padding at the end. Only compressing it to ZIP format gives you a file size around 360KB.
Re:The Super Nintendo Cartridges by bluedino on Monday April 22, 2024 @08:12AM (#40113594)
Did they not compress the assets like they did in other games, like M.C. Kids?

https://games.greggman.com/game/programming_m_c__kids/

Re:The Super Nintendo Cartridges by JohnBooty on Monday April 22, 2024 @11:22AM (#40115239)
As the linked article notes, some of the special on-cart chips were mainly used for data decompression, like the SPC7110. So on those games, definitely compressed assets!

But... I'd love to know how often assets were compressed on "normal" carts without special chips.

Decompressing assets on the fly during gameplay action seems like it would be quite a challenge for the SNES' CPU.

My understanding is that images on title screens and cinematics were often compressed. Anime/comic art styles lend themselves really well to RLE compression because you have lots of consecutive pixels of the same color. And, obviously, these can be fairly static images that don't need to be updated 60 times a second.

Definitely an outlier, but: the title screen of Secret of Mana was actually a JPG that took around a minute (!!) to decompress. The music and scrolling text are cleverly designed to mask this: https://manaredux.com/lore/how-was-the-incredible-title-scre...

Re:The Super Nintendo Cartridges by wk_end on Monday April 22, 2024 @06:19PM (#40123005)
From what I've seen, on average, with many exceptions, most games will lightly compress most data. Tile graphics and layouts only need to be decompressed whenever a scene/level/map is loaded. Games aren't doing streaming audio or anything, so song data can be decompressed and uploaded to the sound processor before a level starts too.

Likewise, text needs to be decompressed once immediately before it's displayed, so games will usually compress that - it's quick enough to decompress a few hundred bytes while the text box loads.

The only thing that I've seen that's usually stored uncompressed is sprite animation data - particularly for player characters with lots of different animations. There's not enough VRAM to load all of it at once, so it needs to be streamed in, and in that case the CPU often just doesn't have the muscle.

Re:The Super Nintendo Cartridges by pests on Monday April 22, 2024 @08:05PM (#40127029)
I was actually just thinking last night about how something like Fortnite handled emotes. Skins and cosmetics I can understand, but they have 100 players and hundreds of emotes that any player can use at any time. Is it all really just streamed in on demand? Most common preloaded?

Made me ponder a bit.

Re:The Super Nintendo Cartridges by JohnBooty on Tuesday April 23, 2024 @07:51AM (#40130831)
Maybe a little counter-intuitive, but Fortnite emotes (essentially, animations) takes up much less memory than skins.

Generally for a modern polygonal game, you are using skeletal animation for the characters. A character consists of a polygon mesh and anywhere from dozens to hundreds of bones.

Animations consist of keyframes. Each keyframe represents just a handful of bytes for each bone (the XYZ coordinates for each end of the bone, and the rotational angle, or something like that). The animators create as many keyframes as they want, maybe 10-20 per second max. So a 5-second emote animation might contain something like 8 32-bit floats * 100 bones * 10 frames per second * 5 seconds = ~120 kilobytes of uncompressed data.

That's all you need to specify an animation. The rest is calculated on the fly at runtime and rendered to the screen at 60fps or whatever the current frame rate is. The graphics engine interpolates bone positions between your keyframes, and the player model mesh is deformed by the bones. Also, those skeletal animations can be shared between all player models.

The alternative to skeletal animation is fully prebaked animations. This involves minimal interpolation and calculation at runtime. It is more memory intensive because you are calculating the position of every point on the mesh ahead of time, and then storing that data on disk. This is generally how a very complex and non-interactive animation (think: cutscenes, etc) would be animated and stored on disk. Note, this is still far less storage-intensive than storing rendered video, and you still maintain a great deal of flexibility at runtime - you can change the camera location, rendering passes, resolution, etc. That's why you don't see a lot of prerendered video cutscenes these days.

Re:The Super Nintendo Cartridges by pests on Tuesday April 23, 2024 @11:03PM (#40140026)
I guess you are right. I never actually did the math on animation storage but I just somehow assumed it was bigger. They obviously use a standard character model (or at least a few) that every animation works with. I just assumed it would be bigger esp with the number of emotes modern cosmetic games have.
Re:The Super Nintendo Cartridges by fabiensanglard on Monday April 22, 2024 @05:18AM (#40112647)
Yea, after writing this I regretted using zip to estimate usage.

Probably would get better number by extracting each zip and look how much zero padding is at the end of the file. WDYT?

Re:The Super Nintendo Cartridges by Dwedit on Monday April 22, 2024 @05:27AM (#40112681)
I think applying RLE to the file might give a better estimate, because files have blank space throughout, not just at the end. Just tried it on Super Mario World and the estimated size was 479,154 (468K) bytes.

If you don't have an RLE tool handy, you can force Pucrunch to act as an RLE-only compressor by using the -r 0 switch which disables the LZ compression feature.

Re:The Super Nintendo Cartridges by morcheeba on Monday April 22, 2024 @06:46AM (#40113059)
hexdump will automatically does "squeezing" of repeated lines. Follow this with a line count and multiply by the bytes/line and you'll get a rough number of non-repetitive bytes. https://man7.org/linux/man-pages/man1/hexdump.1.html
Re:The Super Nintendo Cartridges by anthk on Tuesday April 23, 2024 @01:43PM (#40134781)
Use xxd or od then.
Re:The Super Nintendo Cartridges by justsomehnguy on Monday April 22, 2024 @05:37AM (#40112715)
Just query each archive for the total uncompressed data. While the 'real' code+data is less than the size of the banks, the banks are always ^2.
Re:The Super Nintendo Cartridges by Dwedit on Monday April 22, 2024 @05:39AM (#40112725)
The goal here isn't to tell the real file sizes, the goal here is to estimate the "effective" file size without any padding. Padding can be at places other than the end of the file.
Re:The Super Nintendo Cartridges by rahen on Monday April 22, 2024 @06:53AM (#40113091)
It's still quite impressive to fit such a lengthy and fun game into 508KB without any procedural generation, just tight assembly and clever use of bitmaps. This is programming art.
Re:The Super Nintendo Cartridges by bdw5204 on Monday April 22, 2024 @11:27AM (#40115293)
This is largely a lost art because of several bad paradigms that have become very popular in recent years, making software exponentially worse in the process. In the old days, it was common and NES games were even smaller than SNES games because the graphics were much less complex. I believe Super Mario Bros 3, which many people still insist was better than Super Mario World, actually fit into 32KB.
Re:The Super Nintendo Cartridges by jsd1982 on Monday April 22, 2024 @12:43PM (#40116068)
SMB3 is 3 Megabits in size, aka 384 KiB. You're likely thinking of the original Super Mario Bros which is just 40 KiB.
Re:The Super Nintendo Cartridges by rahen on Monday April 22, 2024 @03:34PM (#40118112)
Out of curiosity, could you cite a few of those paradigms? I wholeheartedly agree, by the way.
Re:The Super Nintendo Cartridges by c0wb0yc0d3r on Monday April 22, 2024 @07:32AM (#40113301)
> hope developers still love to blog details with article mode like this, rather than vlogging it on YouTube.

I think the driving force behind this for many is it's much harder to steal video content. With text bits can scrape it change a few words and reuse it on an SEO ad site.

Re:The Super Nintendo Cartridges by nicole_express on Monday April 22, 2024 @03:44PM (#40118267)
I've definitely noticed as a blogger many sites are so brazen stealing content that they'll even hotlink to my images, so I can find their copying in my server logs. Very annoying.
Re:The Super Nintendo Cartridges by wazoox on Monday April 22, 2024 @09:44AM (#40114293)
"Pitfall!" on Atari VCS held 255 entirely different game screens in a 4k cartridge :)
Re:The Super Nintendo Cartridges by cduzz on Monday April 22, 2024 @10:37AM (#40114806)
Isn't it more of "Pitfall!" has a set of 255 levels that are procedurally generated and the author spent a ton of time searching for the best seed that would generate the levels we know today.

It isn't as if you could have a map editor and adjust the levels or the order of the levels, though you could run the generation procedure to find new levels to your liking.

Still an amazing game. In 4k it is astonishing.

Re:The Super Nintendo Cartridges by netmare on Monday April 22, 2024 @04:24PM (#40119736)
David Crane, the creator of Pitfall, explains it all very nicely in a GDC Classic Game Postmortem [1]. I'm linking at the relevant timestamp, but the whole video is pure Atari 2600 goodness. The full Postmortems playlist is quite enjoyable too. I particularly liked the talks about the original Deus Ex, Myst, Loom, Adventure, Marble Madness, Ms. Pac-Man, Paperboy, Lemmings, and more. I find these videos very soothing and nostalgic. Got to rewatch them now...

[1]: https://youtu.be/tfAnxaWiSeE?list=PL2e4mYbwSTbbiX2uwspn0xiYb...

Re:The Super Nintendo Cartridges by rahen on Monday April 22, 2024 @04:34PM (#40119937)
Take a look at Solaris. Another huge game with 48 sectors and probably the best graphics seen on the 2600, all in a 16k cartridge.

Quite a feat considering how horrifyingly difficult programming the 2600 was. Even the SDK was fairly barebones, basically a VT100 connected to a PDP-11 running RT8 and a 6502 assembler

Re:The Super Nintendo Cartridges by rahen on Friday April 26, 2024 @04:54PM (#40174167)
^ Sorry, I obviously meant RT11, not RT8.
Re:The Super Nintendo Cartridges by tombert on Monday April 22, 2024 @12:55PM (#40116210)
Super Mario World is great, but I stand by Donkey Kong Country 2 being the best game on the system. To me, it just nails every single aspect of platforming, with awesome music, tight controls, and appealing graphics.

Terranigma is right up there as well for me; Super Mario World is probably number 3 in my book.