Sonic and Sega Retro Message Board: Basic Questions & Answers thread - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 410 Pages +
  • ◄ First
  • 397
  • 398
  • 399
  • 400
  • 401
  • Last ►
    Locked
    Locked Forum

Basic Questions & Answers thread NEWBIES: Start here!

#5971 User is offline Stax 

Posted 13 October 2017 - 06:02 PM

  • Posts: 16
  • Joined: 01-July 14
  • Gender:Male
  • Location:Coquitlam, BC
  • Project:Sonic Pocket Mania

View PostMainMemory, on 13 October 2017 - 02:23 PM, said:

Couldn't you just use an image editor that maintains the image's original palette? I know Paint Shop Pro 9 does, though I've never tried editing Sonic Mania with it.


Oh both me and my friend didn't know about Paint Shop Pro 9 when we were trying to fix this.

#5972 User is offline Stax 

Posted 13 October 2017 - 08:34 PM

  • Posts: 16
  • Joined: 01-July 14
  • Gender:Male
  • Location:Coquitlam, BC
  • Project:Sonic Pocket Mania

View PostPokepunch, on 13 October 2017 - 11:49 AM, said:

I think it would help if you got your friend to actually tell us the process this program does in detail. As it stands you haven't actually told us how it works, just that it fixes an issue. It "fixes" the GIF, but we kinda need to know how it fixes it.


The first response was from my point of view. The following is from my friend who created the program.

Alright, boys, I'm gonna teach you some GIF format!

First, let's see the difference between the original GIF from Sonic Mania and the same GIF imported into GIMP 2 and then exported.

Here is the original GIF:
Posted Image

Here is the GIMP 2 export:
Posted Image


As you can see, the image becomes very different when exported from GIMP 2. This is because the original image uses a <b>global color table</b> with 256 colors, but GIMP 2 realizes it can fit the number of colors into a lower power of 2, 32. It does this to reduce the image's size in memory.

We can see this in the bytes at offset 0x0A. Bits 2-0 determine the size of the global color table <i>in colors</i> by the following formula:
Posted Image


You're probably hella confused by the symbolism here, so let me show how it works for these two images.

Firstly, the byte at offset 0xA is located here, where the sum of the offset for the rows and columns is equal to 0xA.
Posted Image


We then want bits 2-0, so we need to translate the value, 0xF7, to binary.

0xF7 = 0b11110111


Bits are ordered highest first, so we start counting from the left, at 0.

1 1 1 1 0 1 1 1
7 6 5 4 3 2 1 0


So bits 2-0 gives us 0b111, which is 7. The formula produces our result.:
Posted Image

This is for the original GIF. The GIMP 2 export has 0x84 as byte 0xA, which is 0b10000100. Bits 2-0 are 0b100, which is 4. Again, the size of the color table is acquired with the formula.
Posted Image


With some math, we can determine the byte where the global color table ends. Each color is three bytes big, so for the original GIF, since 256 = 0x100, 0x100 * 0x3 = 0x300. The global color table starts at byte 0xD, so the global color table ends at 0xD + 0x300 = 0x30D.
Posted Image

Meanwhile, for the GIMP export, 32 = 0x20, so 0x20 * 0x3 = 0x60, and 0xD + 0x60 = 0x6D. That's a very different end for the global color tables, and it this confuses Sonic Mania. I'm honestly suprised that it doesn't crash!


This is where my program attempts to fix the export so that Sonic Mania can properly recognize it. It is a simple task of changing bits 2-0 of byte 0xA to 0b111 and filling the space between the original end of the color table and 0x30D with a lot of 0s. It does not change the global color table; it increases its size.


Speaking of the changing the global color table, for unanimated GIFs, the global color table is the what we call the color palette. <b>YOU CANNOT CHANGE THE COLOR PALETTE!</b> Sonic Mania assigns the color palette itself, ignoring the global color table entirely. Increasing the size of the global color table only accomplishes the task of pushing the image data to the correct offset.

This means that if you do change the color palette, the color for a given index will become the color in the index of the original GIF's color palette. I suspect that this is to accomplish the red-orange coloring during the boss fight by directly modifying the color palette.

This is also why the color palette's colors cannot be rearranged, which is what Paint.Net does, which is why the image is the same but with the colors assigned to the wrong places.

As much as I would love to fix this in my program, this is easier said than done. The GIF format uses LZW compression on the image data, so I would have learn how to decompress the image data in order to modify the color index of each pixel, and since there are ways to export the image with the correct color palette, I am not interested in bothering with this.
This post has been edited by Stax: 13 October 2017 - 10:24 PM

#5973 User is offline Overlord 

Posted 14 October 2017 - 03:37 PM

  • Substitute Meerkovo IT Chief
  • Posts: 17032
  • Joined: 12-January 03
  • Gender:Male
  • Location:Berkshire, England
  • Project:VGDB
  • Wiki edits:3,204
Quite an illuminating read, thank you.

If you're using formatting tags, you want to use BBCode, not HTML. [], not <> !

#5974 User is offline TheInvisibleSun 

Posted 14 October 2017 - 11:56 PM

  • OVER THE TOP TECHNO-BLAST
  • Posts: 1384
  • Joined: 09-December 09
  • Gender:Male
  • Location:Buffalo, NY, USA
  • Project:Sonic 1 Color Contrast

View PostGreggSalt, on 06 October 2017 - 03:04 PM, said:

Wow, I'm asking a lot of questions, but how would one go about making a new spring variant?


If you look into and learn what the existing object does, you should be able to duplicate it, and make a new object or subtype with whatever parameters you like.

#5975 User is offline EnderWaffle 

Posted 10 November 2017 - 01:14 PM

  • Ghostly Friend
  • Posts: 12
  • Joined: 13-August 15
  • Gender:Male
  • Location:New Donk City, Metro Kingdom
  • Project:Sonic Legends
So I currently can't work on my hack at the moment because my computer stopped working for some odd reason, but I'm still trying to think of ideas. :argh:

Does anyone know how to shift the pitch of the songs in Sonic 3? I wanted to use Azure Lake in my hack and have it sound like the version from Sonic Pocket Adventure, but could only find a video showing how to change tempo.
This post has been edited by EnderWaffle: 10 November 2017 - 01:15 PM

#5976 User is offline Aiko 

Posted 21 November 2017 - 06:24 PM

  • Posts: 1
  • Joined: 09-November 17
  • Gender:Female
  • Location:Canada
I'm pretty new here and I was surfing around the forums to try and find where I should post questions and I found myself here to ask about my SA2 ModLoader. I play SA2 on Steam and I downloaded SA2 ModLoader for it as soon as I got it. Everything was working perfectly but one day about a week ago, it kept crashing on the Omochao tip screen. I asked the Steam community about it and one guy told me to verify the game's integrity. So I did. And then my save file got deleted. Which isn't that big of a deal. But it kept crashing. So I rage quit for a couple of days but found myself coming back to it. I tried to run the game again with mods, but, it just crashed again. So then I clicked 'uninstall loader' and my game ran fine. It didn't crash. I'm hoping that someone can help me figure out how to fix this and get my mods back. I don't know if it has anything to do with it, but, I also have Fushion's Chao Editor installed. Maybe it conflicts with the files. I don't know. I'm not very good with coding or anything of the sorts.

#5977 User is offline Blue Spikeball 

Posted 04 December 2017 - 02:45 PM

  • Posts: 387
  • Joined: 29-October 16
  • Gender:Male
Question. What program(s) should I use to edit the sprites and art in .bin format in the S&K Disassembler files?

#5978 User is offline EnderWaffle 

Posted 05 December 2017 - 11:08 AM

  • Ghostly Friend
  • Posts: 12
  • Joined: 13-August 15
  • Gender:Male
  • Location:New Donk City, Metro Kingdom
  • Project:Sonic Legends
What compression type is it? If it has no compression on it (usually in an "artunc" folder), or if it uses Nemesis or Kosinski compression (usually in "artnem" or "artkos" folders respectively), then SonMapEd should be the right one to use. IIRC there might be other compression types, but I'm not sure if SonMapEd supports them or not.

EDIT: Just realised that those folder names might only be for S1 and S2, nor S3K. But SonMapEd should still work, just as long as you make sure to set the Format to Sonic 3 in Settings -> Format -> Sonic 3. Also, here's a link to the SonMapEd info page.
This post has been edited by EnderWaffle: 05 December 2017 - 11:26 AM

#5979 User is offline MainMemory 

Posted 05 December 2017 - 01:06 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4215
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
I'd recommend Flex 2. It is worth noting that Sonic's sprites in particular are difficult to edit for two reasons: first, his mapping and DPLC lists are sort of merged with Super Sonic's, so you have to disentangle them before you can edit anything, and secondly, he has two sets of art, so you have to switch between the two depending on which sprite you're editing.

#5980 User is offline Blue Spikeball 

Posted 05 December 2017 - 09:25 PM

  • Posts: 387
  • Joined: 29-October 16
  • Gender:Male
Thanks for the suggestions guys, these programs seem to be what I needed. I have some questions about them, though.

I don't suppose you can export a spritesheet as a bmp with SonMapEd?

Also, can you edit the sprites directly? Because exporting them as bitmaps and editing like that them doesn't seem to be a very reliable method. I tried exporting them as bmp and reimporting them back, but the program gets the colors mixed up on the reimporting, even if I didn't edit the bitmap...
If not, how should I go about editing the sprites?

Does Flex 2 support importing data from .bin files? Because the "Import Over Sprite" and "Import Spritesheet" options seem to be for image formats only.
This post has been edited by Blue Spikeball: 05 December 2017 - 09:51 PM

#5981 User is offline MainMemory 

Posted 06 December 2017 - 12:06 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4215
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
As far as I'm aware, the only tool that can generate a sprite sheet image is my own SpriteSheetGen from the SonLVL tool set. There's also a related SpritePlotter.NET program for converting a sprite sheet into art+mappings.

SonMapEd does not allow direct editing of graphics, Flex 2 does however.

I'm not sure what .bin files you're talking about. If you mean tiles, you can just use the command prompt like "copy /b file1.bin+file2.bin newfile.bin" assuming the files are uncompressed.

#5982 User is offline Blue Spikeball 

Posted 06 December 2017 - 08:01 AM

  • Posts: 387
  • Joined: 29-October 16
  • Gender:Male
I mean importing or loading the sprite and art files from the S&K Disassembler package so that I can edit them. They all have the .bin extension, and most of the art is compressed in Enigma or Kosinski format.
This post has been edited by Blue Spikeball: 06 December 2017 - 11:45 AM

#5983 User is offline MainMemory 

Posted 06 December 2017 - 11:24 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4215
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
You need to create a project, add an object, then change the settings to point to the proper art and mapping files.

#5984 User is offline lil-g-gamegenuis 

Posted 10 December 2017 - 07:03 PM

  • GO! GO! GO! GO! GO! GO!
  • Posts: 25
  • Joined: 03-April 12
  • Gender:Male
  • Location:olathe, ks
  • Project:Practicing to make better SMPS
Not sure if this is simple enough to go here, but I'll ask anyway.
How would I go about exporting the collisions from Sonic Generations?
I've been using SonicGLVL to export stage models, and I can view the collisions within the program, however I'm unable to find a way to export just the collisions.
For example, this is what the collisions look like below. If I could export this as a model or anything else, that would be perfect. Posted Image

#5985 User is offline Rlan 

Posted 19 December 2017 - 05:42 AM

  • Posts: 172
  • Joined: 16-August 04
Question: What's the best Megadrive emulator out there now for screen capture and sprite extraction?

I've got various versions of Demul like Gens+ and GensKMod, but they just don't do what I need. None of them use OpenGL, and on my Windows 10 64-bit machine they kind of run poorly. Switching between 60fps and stuttering every 10 seconds. Since it's not OpenGL, this also means Fraps doesn't work with it at all.

Kega Fusion is alright for general capture, but doesn't have any of the features like turning off layers like the others do. I also need to run it in 2x pixel mode, as 1x pixels makes the whole thing a blurry mess. If I'm going to mess with sprites, I need guaranteed 1:1 accuracy!

Anything worth suggesting?

  • 410 Pages +
  • ◄ First
  • 397
  • 398
  • 399
  • 400
  • 401
  • Last ►
    Locked
    Locked Forum

3 User(s) are reading this topic
0 members, 3 guests, 0 anonymous users