Register - Login
Views: 86640063
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - JCS - Stats - Latest Posts - Color Chart - Smilies
10-24-17 01:21:23 AM

Jul - Game Research/Hacking/Modding - SimEarth graphic hacking (Or... at least trying to) New poll - New thread - New reply
Next newer thread | Next older thread
Gabu

Star Mario
Placeholder Ikachan until :effort: is found
Level: 160


Posts: 9548/9699
EXP: 52290916
For next: 662083

Since: 08-10-09
From: Santa Cruisin' USA

Since last post: 2 hours
Last activity: 2 hours

Posted on 07-03-16 05:30:43 PM (last edited by Gabu at 07-03-16 06:13:29 PM) Link | Quote
Earlier last week I decided to poke into SimEarth with YY-CHR, because I had the idea to make a pretty simple romhack replacing the species with various types of Pokemon. I was greeted with a mess of a graphics table, and the only way I was able to make anything turn up completely clear was to look at the file in 1-bit mode, where I could find the character table.

I believe I heard somewhere that Maxis SNES games had some kind of weird encryption stuff going on, so it would appear. I did fiddle with some random graphics further down the file (merely by flipping selections vertically), and managed to get some funky, kinda reverse-color stuff going on. The intro screen's space, for instance, was a very light gray, info boxes in the info screens were red instead of green, and in map mode the land was blue, as well as some minor color changes in sprites.

This leads me to believe that SimEarth, at least, stores its graphics in layers? I really don't know, but all I want to do is put some goshdarn Zubats to replace the robot species because lol.

How would I even get started with this? Rip the entire table and then try to overlay different areas of the table in Photoshop until I find some kind of match and then repeat until I get a complete sprite?

EDIT: Not necessarily part of my problem, but I poked through the .SMC file in a hex editor and found a little nugget starting at 00021cb0 that I don't remember running into in all of my years with this game, which I've edited slightly for ease-of-reading and in a manner that it would otherwise probably be displayed in-game:

Dinosaurs are extinct!

Nemesis has occurred.
Nemesis is a planetary
life-crisis that
may have been caused
by a huge meteor im-
pact. Anyway, the dust
and/or water vapor has
blackened the planet's
skies and caused a
glacial period.

Given that in the debug menu, you can see all of the in-game messages, but for whatever reason some of them appear garbled and glitched, this could be an unused message that wasn't pointed to correctly within the game.
Gabu

Star Mario
Placeholder Ikachan until :effort: is found
Level: 160


Posts: 9550/9699
EXP: 52290916
For next: 662083

Since: 08-10-09
From: Santa Cruisin' USA

Since last post: 2 hours
Last activity: 2 hours

Posted on 07-12-16 04:49:18 PM Link | Quote


Was noodling around with corrupting the game via YY-CHR to see if I could find where the sprites were, and at one point the game spat this at me. Good thing I took a picture because it was the only time that happened. But I recognized the order of the Japanese characters and other symbols directly corresponded with their order found in the game file itself, then appears to spit out tiles for sprites in their decrypted form.

So far all I've done was edit the file by drawing straight black/white lines in where I supposed these tiles were stored, immediately after the Japanese characters, but I've yet to find anything conclusive. Still, seems like a neat find.

Gabu

Star Mario
Placeholder Ikachan until :effort: is found
Level: 160


Posts: 9551/9699
EXP: 52290916
For next: 662083

Since: 08-10-09
From: Santa Cruisin' USA

Since last post: 2 hours
Last activity: 2 hours

Posted on 07-16-16 07:09:01 PM (last edited by Gabu at 07-16-16 07:21:20 PM) Link | Quote
So on a whim I decided to look at SimAnt within YY-CHR, figuring that if it's all encrypted the same then I could find some kind of pattern within the two. I came up with two findings:

1.

WHY DID YOU LIE MOMMY?

I never played SimAnt, but this and a whole bunch of other graphics are stored as clear as day in here. Not sure if it's all of them, but I give it a good shot that it is.

2. Given this, I went back to SimEarth and noted that there are huge swaths of the file that contain a checkerboard pattern that is littered with various levels of "static", so to speak, which can be found within the default 4bpp SNES format. I'm figuring that my hypothesis is right, and that the graphics in this game are stored in layers that the game then stitches together. Not sure why, really, though I guess it may have to do with needing to have one sprite have different colors but not necessarily a different palette.

EDIT: Probably false, absolutely nothing changed that I could see when the checkerboards were flipped.
Gabu

Star Mario
Placeholder Ikachan until :effort: is found
Level: 160


Posts: 9555/9699
EXP: 52290916
For next: 662083

Since: 08-10-09
From: Santa Cruisin' USA

Since last post: 2 hours
Last activity: 2 hours

Posted on 07-22-16 11:56:16 AM Link | Quote
So I kinda fold; is there any way to see how a SNES game reads and displays sprites? Because this encryption crap is just going to drag on forever if I keep brute forcing things.
divingkataetheweirdo

Lantern Ghost
TCRF Super Editor
Level: 52


Posts: 608/765
EXP: 1014522
For next: 69318

Since: 07-09-11


Since last post: 1 day
Last activity: 2 hours

Posted on 07-23-16 03:59:43 PM (last edited by divingkataetheweirdo at 07-23-16 04:17:03 PM) Link | Quote
Originally posted by Gabu
So I kinda fold; is there any way to see how a SNES game reads and displays sprites? Because this encryption crap is just going to drag on forever if I keep brute forcing things.


https://emu-docs.org/Super%20NES/General/snesdoc.html

http://wiki.superfamicom.org/snes/show/Sprites

https://en.wikibooks.org/wiki/Super_NES_Programming/Animated_Sprites

Try these and use No$SNS along with these to see it loading stuff in real time. Also, try to figure out which compression SimEarth uses, probably an LZ-type compression. There's no easy way to see how SNES games read and display sprites besides trying to find lda, ldb, ldx or ldy instructions in the game. Alternatively, try digging through an SNES game to see if it has a bunch of uncompiled code hidden inside, be it plain as day or hidden in an archive format.
Joe
Common spammer
🗿
Level: 104


Posts: 3259/3287
EXP: 11518712
For next: 343414

Since: 08-02-07
From: Pororoca

Since last post: 20 days
Last activity: 12 hours

Posted on 07-23-16 10:16:01 PM Link | Quote
I had a decent explanation of the compression format (it's LZSS with a small header attached), but my internet connection died and I'm not going to type the whole thing on my phone.

Compressed graphics start at 0x60000 in the USA ROM ($0C:8000 in SNES memory).

I like MAME's debugger better than no$sns.
Joe
Common spammer
🗿
Level: 104


Posts: 3260/3287
EXP: 11518712
For next: 343414

Since: 08-02-07
From: Pororoca

Since last post: 20 days
Last activity: 12 hours

Posted on 07-26-16 12:55:18 PM Link | Quote
Okay, internet's back on.

The graphics compression is LZSS with a four-byte header. All two-byte values are stored with the low byte first.

The header is two two-byte values: the length of the uncompressed data, and the length of the compressed data (not including the header). The decoder in the game ignores the compressed data length, so it may not be correct for all of the graphics.

Following the header is the actual LZSS-compressed graphics. In this variety of LZSS, the flags bytes are coded MSB first, with 0 to indicate a literal byte and 1 to indicate a run.

Runs in this variety of LZSS are two bytes (low byte first). The upper twelve bits are the offset from the end of the current decompressed data: 0 means start at the last byte in the buffer, 1 means the byte before last, and so on. The lower four bits are the run length minus 3: 0 means copy 3 bytes, 1 means copy 4 bytes, and so on.

Like all varieties of LZSS, runs may be longer than the remaining data in the buffer.


In order to replace the graphics, you'll have to either compress them to be no larger than the graphics they're replacing, or put them elsewhere in the ROM and replace the pointers that are used to load them.
Joe
Common spammer
🗿
Level: 104


Posts: 3261/3287
EXP: 11518712
For next: 343414

Since: 08-02-07
From: Pororoca

Since last post: 20 days
Last activity: 12 hours

Posted on 08-01-16 02:00:44 PM Link | Quote
Do you like command-line programs? Sure you do, because this one can decompress all the graphics in SimEarth. Let me know if you need a 32-bit version because this one is 64-bit. It doesn't put the graphics back into the ROM yet because Real Life™ is taking up all of my free time.

The source code is here in case you want to follow my progress and/or laugh at my ugly code. Don't expect frequent updates because being an adult sucks.

Fun fact, there are some minor graphical differences between the Japan and North America versions. (Aside from all of the text, I mean.) Also Tile Molester's default palette sucks.
Gabu

Star Mario
Placeholder Ikachan until :effort: is found
Level: 160


Posts: 9557/9699
EXP: 52290916
For next: 662083

Since: 08-10-09
From: Santa Cruisin' USA

Since last post: 2 hours
Last activity: 2 hours

Posted on 08-03-16 10:37:52 PM (last edited by Gabu at 08-03-16 11:27:43 PM) Link | Quote
I'm actually using YY-CHR, but same difference. You'd think that since they're graphics editors that the default palettes would be at least halfway decent. ¯\_(ツ)_/¯
Joe
Common spammer
🗿
Level: 104


Posts: 3262/3287
EXP: 11518712
For next: 343414

Since: 08-02-07
From: Pororoca

Since last post: 20 days
Last activity: 12 hours

Posted on 08-28-16 02:49:45 PM Link | Quote
It's been a month (seriously?) and now, with little fanfare, here is the program to put graphics back in the game.

  • It doesn't compress anything yet. The ROM will get bigger if you edit lots of graphics.
  • It doesn't pad the resulting ROM to a reasonable size yet. You may have to manually add padding if it makes your emulator unhappy.
  • The original compressed graphics may be relocated to make room for your modified graphics. You should use a good patch format (not IPS) to avoid creating a patch that contains most of the original ROM.


Let me know if you find any bugs. I literally have no idea how to play this game, so I might have messed something up.
Gabu

Star Mario
Placeholder Ikachan until :effort: is found
Level: 160


Posts: 9574/9699
EXP: 52290916
For next: 662083

Since: 08-10-09
From: Santa Cruisin' USA

Since last post: 2 hours
Last activity: 2 hours

Posted on 11-05-16 06:15:50 PM Link | Quote
After literally forgetting about this project's existence for two months, I only just now used your compression tool to put some custom graphics back in the game (though from a USA ROM to a Japanese ROM). At first I didn't know if it worked, but then I found the apparent graphic I used versus what I thought I put in. Then I immediately erased the screen I printed to cover the whole spritesheet with this one graphic, just to see if it worked perfectly.



In short it did.
Joe
Common spammer
🗿
Level: 104


Posts: 3264/3287
EXP: 11518712
For next: 343414

Since: 08-02-07
From: Pororoca

Since last post: 20 days
Last activity: 12 hours

Posted on 11-06-16 05:28:38 AM Link | Quote
I'm glad to hear it works for you. If you want either of those last two features (compression, padding the ROM to a reasonable size) I can spend some time this weekend finishing it up.

Originally posted by Gabu
from a USA ROM to a Japanese ROM

I probably should mention that the graphics data isn't compatible between the USA and Japanese ROMs. You have to make some adjustments to use the graphics from one region in the other without corrupting anything.
Gabu

Star Mario
Placeholder Ikachan until :effort: is found
Level: 160


Posts: 9576/9699
EXP: 52290916
For next: 662083

Since: 08-10-09
From: Santa Cruisin' USA

Since last post: 2 hours
Last activity: 2 hours

Posted on 11-08-16 12:31:26 AM (last edited by Gabu at 11-08-16 12:34:01 AM) Link | Quote
I might be wrong. I had decompressed the files three months ago and they'd been lingering pretty much ever since, so I wasn't exactly sure if they were from the .sfc or .smc ROMs, and didn't really bother to check.

Only reason I suspect this is the opening graphics that are supposed to display Imagineer had corrupted and appear to be trying to use FCI's splash screen (Imagineer was the publisher for the Japanese version, FCI for NTSC), but end up displaying some all-white cresant moon shape on the right.
Next newer thread | Next older thread
Jul - Game Research/Hacking/Modding - SimEarth graphic hacking (Or... at least trying to) New poll - New thread - New reply




Rusted Logic

Acmlmboard - commit 2f1bc75 [2017-08-27]
©2000-2017 Acmlm, Xkeeper, Inuyasha, et al.

28 database queries, 10 query cache hits.
Query execution time: 0.130263 seconds
Script execution time: 0.015356 seconds
Total render time: 0.145619 seconds