HiveSprite: rip sprites from any Sonic game

Discussion in 'Engineering & Reverse Engineering' started by Hivebrain, Sep 17, 2021.

  1. Hivebrain

    Hivebrain

    Administrator
    2,927
    66
    28
    53.4N, 1.5W
    HiveView
    This program extracts sprites from any Sonic game, given the requisite graphics, mappings, palette and DPLC (optional) data. Currently only Sonic 1 & 2 are supported, but it's possible to add more games to the ini file.

    Image1.png


    https://github.com/cvghivebrain/HiveSprite/releases/tag/v1.2

    Limitations:
    • Mappings & DPLC files must be binary, not assembly. I'm not going to support assembly because I don't see it as necessary.
    • Graphics must be uncompressed. Compressed graphics will be supported when I write my own decompression routines.
    • The first mappings pointer must point to the first mappings listed. It uses this to work out where the pointer list ends and how many mappings there are.
    • It won't work if the mappings expect additional graphics to be loaded by the game (those sprites will be blank or garbled).
     
    Last edited: Sep 23, 2021
  2. Black Squirrel

    Black Squirrel

    your robot's a no-bot Wiki Sysop
    6,483
    650
    93
    Northumberland, UK
    wiki wild wild west
    I actually had a problem with ripped Sonic sprites not too long ago:

    Sonic the Hedgehog 2 (Nick Arcade prototype)/Comparisons/Graphics

    I was using sheets from The Spriters Resource to save time (adjusting the palettes later), which worked well enough for Sonic 1 and 2, but not the Nick Arcade prototype:

    https://www.spriters-resource.com/genesis_32x_scd/sonicth1/sheet/21628/
    https://www.spriters-resource.com/genesis_32x_scd/sonicthehedgehog2prototypes/sheet/159295/

    All the graphics are there in the latter sheet, but the former has reference points for the animation, which is handy for lining up diagonal walking frames. I imagine your program's doing that, but having the "spacing" a different colour might be useful, depending on how people intend to use this.


    I quite like the idea of putting every single graphic up on the wikis so we have an absolutely perfect set, but that might be a pipe dream.
     
  3. Hivebrain

    Hivebrain

    Administrator
    2,927
    66
    28
    53.4N, 1.5W
    HiveView
    Updated to v1.1:

    • Added second bgcolor for checkerboard effect.
    • Added mapcount option for when mappings data and indices aren't in the same order. By default, the first index is used to determine mapcount.
    Sprites were already centered according to their mappings, so animations will line up properly, but the checkerboard should make it a bit clearer. I assume that's what you had in mind?
     
  4. Blastfrog

    Blastfrog

    See ya starside. Member
    Worth noting that PNGs can have X,Y alignment metadata. Useful if the images are exported as individual files.
     
  5. Lostgame

    Lostgame

    turntablist, dinosaur goddess Oldbie
    4,111
    32
    28
    Toronto, ON
    The O.I.C.
    This is absolutely fascinating!

    Great work on this, Hivebrain!
     
  6. Hivebrain

    Hivebrain

    Administrator
    2,927
    66
    28
    53.4N, 1.5W
    HiveView
    Updated to v1.2:

    • Added shortcut menu. More shortcuts can be added via the ini file.
    • Fixed bug where the displayed image was stuck using the dimensions it was first loaded with.
    I might add exporting to separate PNGs in the next version.