VOGONS


First post, by MAZter

User metadata
Rank Member
Rank
Member

Greetings!

Any Java programmers here? It is necessary to unpack resources out of SimCity 2000 and pack them back in a truncated form so that the file takes up less space in memory. The final goal, I'm not sure if it is realizable, is to make the game work with 2 megabytes of RAM. For example, on a Sega Saturn with 2 megabytes of RAM, the game works, if you cut out music and sounds, maybe it will start? I agree the quest is so-so, if there are those who want to take it?

The script itself is at the link below, but I didn’t manage to figure it out, only with node.js I compiled some two files with classes, and then it’s not clear what to do with it.

https://blog.krusher.net/en/2017/12/taking-si … 00-into-pieces/

Attachments

  • Filename
    sc2000.zip
    File size
    1 MiB
    Downloads
    28 downloads
    File license
    Public domain
Last edited by MAZter on 2022-12-02, 02:46. Edited 2 times in total.

Doom is what you want (c) MAZter

Reply 2 of 2, by MAZter

User metadata
Rank Member
Rank
Member

The extraction issue has been resolved with QuickBMS, so this part of the task is already kind of done. But QuickBMS can't properly pack back, it's written in their manual that packing is an experimental feature.

I decided to write my hand-written code in PHP, it makes packaging ideally convenient - just put any files in the FILES folder, even in formats not compatible with the game, and a ready-made one appears in the OUTPUT folder sc2000.dat file to feed it to the game (the game simply ignores extra files, the load order is not important).

As a result, I managed to make a release that starts with 2250 kilobytes of free RAM, but it turns out to be completely empty in terms of music and sounds, and even with limited zoom (zooming in the game to the maximum). The release for free 2.5 megabytes is better - there is no zoom limit. One way or another, the goal is almost reached.

The instruction is something like this (may differ from the last release, but the action plan is clear):

1) The game starts with the keys NO_INTRO NO_MEM_CHK (there is no need for the INTRO.RAW file and we turn off the free memory check)
2) TITLE.RAW can also be deleted
3) Delete *.XMI, leave one file with 10.XMI music and edit %d.XMI to 10.XMI inside SC2000.EXE
4) Delete *.VOC, leave one file with sound 11.VOC and inside SC2000.EXE edit %d.VOC to 11.VOC
5) Delete PAPER*, leave one PAPER7 file and edit PAPER.. to PAPER7 inside SC2000.EXE.
6) Delete TXT*, leave one file TXT11 and edit TXT%d inside SC2000.EXE. on TXT11
7) Delete ABOUT*.RAW, PPDT*.RAW, NEWYRK*.FNT, POP*.RAW
8] For the version requiring a maximum of 2Mb, delete: LARGE.HED and LARGE.DAT (graphics for maximum zoom) inside SC2000.EXE edit them in SMALL.HED and SMALL.DAT respectively

In some cases, if editing SC2000.EXE does not work, you can simply zero the contents of TXT, VOC, XMI and some other files

It is important that not all versions of the game allow such changes, for example, the DEMO version, which would be logical to start with (it no longer contains music, sounds and pop-up newspapers), does not allow you to just load SMALL.DAT and SMALL.HED twice in editing SC2000.EXE (what to do in this case? if you reset the name, then I / O starts to swear), while the full version of the game does not notice this substitution of LARGE for SMALL.

In my opinion, for a full-fledged patch on 2Mb of RAM, a competent approach, disassembly, etc. is required. which was no longer in my plans. Ideally, I would get a list of which bytes to change in SC2000.EXE and what else can be cut in the file to reduce the amount of RAM used.

In the php script attachment for packing, the upper part of the packing script is not used, it is for debugging when reading and parsing sc2000.dat and understanding what turns into what.

Attachments

  • Filename
    SC2000_2Mb.zip
    File size
    850.15 KiB
    Downloads
    29 downloads
    File license
    Public domain

Doom is what you want (c) MAZter