Jump to content
thiekus

tool SC3K Sprite Extractor

8 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

So, In my spare time, I decided to decode SimCity 3000 *.IXF file (internally known as Indexed File) by reverse engineer SC3U Windows (which has PDB debug info embedded on retail SC3U.ICD, though only main executable and not complete) and SC3U Linux libSimSpr.so (not debug info but most functions and class methods were exposed). There's attempts to extracting SC3K sprites here and the same guy did share clues code which responsible to extracting SC3K from late Paul Pedriana (RIP). But so far, no one in has given working sprite extractor.

Sprite format isn't that complicated. It's actually small header that contains sprite size and color type (usually 16-bit RGB 565 or RGB 555), followed by compressed data stream. Compression used is different between SC3K and later SC3U re-release, which in SC3K sprites using MiniLZO in RGB 555 color format, and later SC3U using older iteration of RefPack (or known as Qfs in SimCity 4 and The Sims 2 community) in RGB 565 color format (some were still at RGB 555). After data stream were decompressed, there's another header contains size and transparent color used (or just straght to indexed data for sprite masks) followed by array of strides infomations. Each strides has variable length data that skips transparent color of stride beginnings. There's still unknown part which stride width often has 0x8000 flag which I ignore this time and sprites still rendered just fine. In addition it's also able to extracting buffer images which used mostly for UI elements.

My code is written on Free Pascal flavours of Object Pascal used in Lazarus. This because this project were subset of my bigger GUI application using Lazarus which I can't finish it for now due to current circumstances (hopefully at later time). There's including RefPack decompression routine which I ported Null's DBPFSharp from C#. I'm also port MiniLZO decompression function from C.

This sprite extractor source code in this Github repo or you can also use prebuilt exe from release page here. Now you can start see you favorites building sprites directly or just data mine of possibly unused sprites.

Screenshot_20251209_171905.jpg

Screenshot_20251209_172312.jpg

Screenshot_20251209_183029.jpg

  • Like 5

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 
2 hours ago, thiekus said:

I decided to decode SimCity 3000 *.IXF file

Very impressive. *:) 

(I've added the Gold Featured Star so your topic will also show up in the topic list on the Home Page.)

  • Like 3
  • Thanks 1

Chance favors the prepared mind. ― Louis Pasteur  
Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

Are you new here? Check out the Introduction and Guide to Simtropolis.

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 
2 hours ago, thiekus said:

I'm also port MiniLZO decompression function from C.

Note that the MiniLZO code is GPL 2.0, so any derived projects must have the same license. The author also offers a commercial license, which is probably what EA/Maxis were using.

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    3 hours ago, Null 45 said:

    Note that the MiniLZO code is GPL 2.0, so any derived projects must have the same license. The author also offers a commercial license, which is probably what EA/Maxis were using.

    Yeah, that's also my concern regarding minilzo licensing. That's why I give minilzo as license exception on repo readme, though most of my other parts keep as MIT license. It's possible to build without GPL'd minilzo after stripped SC3K decompression part (obviously you'll missing ability to decompress SC3K sprites, only SC3U), though I didn't implement compiler switch to do so for this time. Since I did expose all source code needed for build under open source license, I think I didn't violate GPL.

    For future ongoing "IXF Explorer" probably I'll use GPLv3 or later for GUI parts (and keep core classes/functions as MIT) because I prefer more restrictive license for bigger project.

    Edit: I give some clarification on readme and some of dependent unit code which states built program is licensed as GPL v2 or later as well when linking minilzo code to comply this situation, while keep most code still under MIT.

    • Like 3

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Updated to v0.0.2, which now able to extract sprites from *.sjs file generated by SimCity 3000 Unlimited Rendering Kit and fix quirk of SJS file itself which store sprites as resource type same as image buffer.

    Now I'm wondering if I could recreate my own rendering kit program (after I implements sprites compression and bitmap importer functions of course), because current SC3URK didn't play nicely with modern Windows.

    • Like 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Oh my goodness gracious. I've wanted this for so long. And it's finally here!

    I hope this paves the way for reinsertion of modified sprites in the future.

    • Like 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Wow, what a great late Christmas present! I've been on/off looking into this for years, thought since Paul's passing that this might remain uncracked. 

    Hopefully opens the door to some sort of OpenTTD-like development, which was my initial aim. Amazing work!

    • Like 3

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Automated Notice Message

    All posts after 1 March, 2026 @ 01:37 GMT were lost in the site crash.

    We've added this message thread divider in every topic across all forums for what were then active threads. (We decided active is if the most recent extant post (from the backup) was on or after 1 January, 2026.)

    This divider serves as notice that the conversation was interrupted. Answers and further discussion which used to be here have been lost. Keep this in mind when replying. Our hope is to rebuild what is missing.


    I am Lab Rat.

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account


    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections