Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Questions about changing Sonic sprite in Master Tile Converter.

Reply to topic Goto page 1, 2  Next
Author Message
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Questions about changing Sonic sprite in Master Tile Converter.
Post Posted: Mon Jun 07, 2021 3:02 pm
I would like to change the Sonic sprite completely. I've got some questions about Master Tile Converter.

I've attached a screenshot of the Sonic tiles in Master Tile Converter.
It looks quite messy to me. Is there any logic here? Is it possible to order the tiles?

Also i'm wondering how much of the tiles are reused in different animations? That will affect how much i can change the sprite.
Master Tile Converter Sonic sprite.png (70.28 KB)
Master Tile Converter Sonic sprite
Master Tile Converter Sonic sprite.png

  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13726
  • Location: London
Reply with quote
Post Posted: Mon Jun 07, 2021 3:32 pm
Sonic uses sprites in a mode where each pair of 8x8 tiles is stacked one above the other; this leads to a lot of empty tiles. You may consider drawing in some placeholder border lines to make it clearer. The tiles may be reused but I suspect they are not because of the way it loads them for animation.

So tiles ABCDEFGHIJKL in the editor may be arranged in-game as

ACE
BDF
GIK
HJL

...or something like that.
  View user's profile Send private message Visit poster's website
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Mon Jun 07, 2021 4:11 pm
Thanks Maxim!

It's good to hear that there are probably not that many reused tiles. I was a bit in doubt if i should go on, but i'll surely give it a try now.

What i want to do is to make SMS Sonic more like the Genesis one.
Has this been done before?
I know someone already replaced the GG Sonic by SMS Sonic; i was very much inspired by that.

Sonic on Genesis is 40 pixels high so he needs to shrink to 32 pixels.
And even then i probably need to be creative to make some frames fit as some are quite wide.

Edit: Do you know if any programs exist that can help reordering tiles?
  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Mon Jun 07, 2021 4:45 pm
Yes! The first frame has been imported :D

  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13726
  • Location: London
Reply with quote
Post Posted: Mon Jun 07, 2021 4:50 pm
I suspect no programs exist to reorder the tiles as you would like... as effectively it’s a custom ordering for every game.
  View user's profile Send private message Visit poster's website
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Mon Jun 07, 2021 6:22 pm
Walking animation.

His toes got cut off because it did not fit in 24x32 pixels. I'll probably make his feet more vertical instead of diagonal, so they fit better.

And the placement/anchor need some tweaking here and there, although it looks smoother than i anticipated already.

  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Tue Jun 08, 2021 11:04 am
One of the biggest issues with Sonic SMS is his shoes not being red.
I've found some instruction out how to change the palette with an hex editor.

I want to make the colors more like Sonic 2 SMS. He seems to have an additional red color. How did they do that? Is that possible in Sonic 1?

Edit: added screenshot of Sonic 1 and 2 palettes.
Edit2:
If i count colors and i add 1 for transparent, then 9 colors are used in Sonic 2:
1 dark blue
2 blue
3 light brown
4 brown
5 light blue
6 black
7 white
8 red
9 transparent???

I presumed 8 color would be the limit. So i'm a bit puzzled. How is 9 possible? Is even more than 9 also possible?

  View user's profile Send private message
  • Joined: 01 Feb 2014
  • Posts: 635
Reply with quote
Post Posted: Tue Jun 08, 2021 2:33 pm
A sprite can have up to 15 colours (+1 for transparency) on the Master System. The reason why Sonic 1 only uses 8 is that by doing so it speeds up the transfer of sprites for each frame of the animation.

You can't possibly store all the frames of animation in vram, so it's a common practice to stream in sprite tiles as needed, especially for player characters. Sonic 1 only needs to transfer 3 bitplanes for each sprite instead of all 4, so it has more time to do other stuff. In Sonic 2 they obviously found making the shoes red more important than saving cpu time.

Unfortunately, you can't easily make Sonic 1 do the same, so unless you want to rewrite the transfer routine, you're stuck with 7+1 colours.
  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Tue Jun 08, 2021 8:28 pm
Thanks for explaining Kagesan! Good to know what is possible and what is not.

I wil change the "brown" color to a more red color, like game gear Sonic.
And i might change the grey to light blue. That way i can also use that blue for skin.

I'll make 2 versions one with the original palette and one with changed palette.

But first i have to finish all the frames :)
  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Wed Jun 09, 2021 9:17 am
All frames consist of 3x4=12 tiles.

There is one exception though, which is the jump frame where the height is 5 tiles.
I've replaced the graphics of these tiles, however in the game the old tile is displayed.

What could be the issue here?
jumpfeet.PNG (51.06 KB)
jumpfeet.PNG

  View user's profile Send private message
  • Joined: 01 Feb 2014
  • Posts: 635
Reply with quote
Post Posted: Wed Jun 09, 2021 11:57 am
slogra wrote
What could be the issue here?


Hard to say without looking at the ROM. My guess is that you probably didn't change the right tiles after all. Try and look if the old tiles can be found elsewhere in the ROM.

I don't really know how Sonic 1 draws its meta sprites, so I'm just speculating here, but it's possible that it uses a routine to draw frames within a 3x4 matrix, but for the jump it just adds a single sprite at a certain offset, as that would be much more efficient than processing a whole additional row.
  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Wed Jun 09, 2021 12:47 pm
I'm quite sure i changed the right tile. This tile is near the other jump tiles.
There is also mirrored tile, but that can't be it.

Both screenshots in my previous post are from the changed rom. If i open the changed rom in Master Tile Converter again, it shows the changed tile. So it's quite a mystery, where it loads the original tile from.

Edit: i've unpacked the zip of the original rom to make sure it's OK. Load that in Master Tile Converter, imported the new tiles and saved it to a new rom file. But the same problem is still there.

Here is a screenshot of the original rom:

  View user's profile Send private message
  • Joined: 26 Jan 2014
  • Posts: 825
Reply with quote
Post Posted: Wed Jun 09, 2021 1:48 pm
Just out of curiosity, what program do you use to edit .bmp made with Master Tile Converter ? I was using Gimp but it's not working anymore (probably a settings thing) :/
  View user's profile Send private message Visit poster's website
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Wed Jun 09, 2021 2:00 pm
I'm using GIMP too. My version is 2.10.24. What is not working on your side?
  View user's profile Send private message
  • Joined: 01 Feb 2014
  • Posts: 635
Reply with quote
Post Posted: Wed Jun 09, 2021 2:01 pm
While it does look like these are the right tiles, logic dictates they can't be. If the altered ROM shows the old tiles after you have changed them, it must take them from someplace else.

Indeed, looking at the contents of the VRAM reveals the problem. As assumed, there are twelve sprite tiles that are streamed in for every frame as needed (red box). The sprites for the tips of the shoes (green box), however, are not streamed in, they are permanently stored in VRAM and are only added to the frame if Sonic is jumping.

The tiles for the shoe tips are therefore most likely just loaded once into VRAM at the start of the game. My guess is that they are stored in ROM in compressed form, which is why they probably don't show up in Master Tile Converter.

Changing them will be quite a challenge, then, because you'll have to locate the compressed tiles in ROM and store the compressed data of the new tiles in their place, provided they fit.

  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Wed Jun 09, 2021 2:15 pm
Good find Kagesan!

I'm not up to that challenge. I like working with pixel art, but i don't know much about hacking SMS code.

If you are up to the challenge, then i certainly won't stop you.
The new shoe tip is smaller with less colors, so i presume the compressed version would fit.

For now I'll work around the issue by aligning the new tiles to the original shoe tip, so the issue will be less noticeable.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13726
  • Location: London
Reply with quote
Post Posted: Wed Jun 09, 2021 4:05 pm
We have compressor for Sonic’s compression format so it’s relatively doable, you first need to figure out which chunk of tiles is decompressed here - maybe Kroc can help. Alternatively you can hack a custom loader to load the new tiles later.
  View user's profile Send private message Visit poster's website
  • Joined: 26 Jan 2014
  • Posts: 825
Reply with quote
Post Posted: Thu Jun 10, 2021 7:33 am
slogra wrote
I'm using GIMP too. My version is 2.10.24. What is not working on your side?


2.10.22 here, when I edit an image with Gimp and try to import it with Master File Converter, I've this error: "Problem loading image."
  View user's profile Send private message Visit poster's website
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Thu Jun 10, 2021 9:32 am
At the moment all the frames of Sonic facing to the right have been done. I'll start on mirroring all the frames for facing left soon.

When that is done i will release a first preview version.
Don't expect too much of it though. A lot of frames still look a very rough due to resizing. I'm optimising the pixelart of each frame manually which takes a lot of time.

And when all that is finished and the results look nice, then i hope somebody will be interested in fixing the in memory tiles issue.
  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Thu Jun 10, 2021 6:59 pm
As promised hereby a preview. Enjoy!

Let me know if you have any suggestions. What pixels would you change? :).

  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13726
  • Location: London
Reply with quote
Post Posted: Thu Jun 10, 2021 7:21 pm
I guess you may get more feedback if you post some images...
  View user's profile Send private message Visit poster's website
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Thu Jun 10, 2021 9:41 pm
Yeah, of course, here are a few.
stand.png (5.23 KB)
stand.png
improvedwalk.png (4.92 KB)
improvedwalk.png
ball.png (5.2 KB)
ball.png
death.png (5.91 KB)
death.png
run.png (4.98 KB)
run.png

  View user's profile Send private message
  • Joined: 21 Oct 2015
  • Posts: 250
Reply with quote
Post Posted: Fri Jun 11, 2021 10:20 am
I have played few minutes and it's perfect for me. Great job!!
  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Fri Jun 11, 2021 11:42 am
Thanks for you feedback. I'm glad you like it.

The walking animation was very hard to get right, especially the positioning/bobbing, but it worked out fine in the end. The chopped off feet are not that distracting, so i probably won't fix that.

I will clean up all frames a bit more, trying to capture the essence of each pixel of the original ;). Like making his legs and arms to 2 pixels, where now they are only 1 pixel thin at some places. His eyes and ears can use some improvement. And his belly is a bit too square at places. I'm not satisfied with his shoes they seem a bit too flat, etc :)
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2943
Reply with quote
Post Posted: Fri Jun 11, 2021 2:17 pm
Kagesan wrote
The tiles for the shoe tips are therefore most likely just loaded once into VRAM at the start of the game.


An emulator with a debugger, one breakpoint triggered when the write to that specific VRAM address happens and we can likely see where's that data taken from :)
  View user's profile Send private message Visit poster's website
  • Joined: 22 Mar 2015
  • Posts: 200
Reply with quote
Post Posted: Fri Jun 11, 2021 5:11 pm
This mod looks fantastic, all the aimations are pretty good anyway you seem to forgot the aspect ratio since the horizontal resolution of the SMS is 256 pixels that is strechted to fill the screen in old CRT TVs just compare Sonic in ball form is a perfect circle while the rings are squeezed circles, as strechting screen is the way meant to be played, consider this suggestion and watch this interesting vid of aspect ratio related to the topic:

  View user's profile Send private message
  • Joined: 06 Aug 2015
  • Posts: 42
Reply with quote
Post Posted: Fri Jun 11, 2021 5:41 pm
slogra wrote
Yeah, of course, here are a few.


It was very good! Are you going to change more things?
  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Fri Jun 11, 2021 6:24 pm
For a short while i considered the aspect ratio. I have a pal 50hz SMS, so i've never seen the correct ratio on a real system. This also mean i don't really mind a squashed image in classic video games.
A while ago i tried to find some info online but i could not decipher this:
https://forums.libretro.com/t/correct-geometry-aspect-ratio-for-different-system...

So... as the 1:1 pixel aspect is close to 4:3 i just went for that.
I'm afraid i'm too far in the process to change it now.

Another advantage of correct aspect would be that the wide walking frames would fit better.
But the disadvantage is that i can't use as many pixels. And it might start to look too much like the sms sonic that way ;).
  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Fri Jun 11, 2021 6:28 pm
EmuBoarding wrote
slogra wrote
Yeah, of course, here are a few.


It was very good! Are you going to change more things?


Thanks!

What do you mean by more things? I'm just changing the Sonic character. Other stuff like background and enemies is much more difficult as those are compressed. I do not know how to change them.
  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Fri Jun 11, 2021 7:02 pm
sverx wrote

An emulator with a debugger, one breakpoint triggered when the write to that specific VRAM address happens and we can likely see where's that data taken from :)


Sounds good! When the graphics are done, i will give it a shot. But honestly i don't think i can make it work with my hacking knowledge.
  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Fri Jun 11, 2021 9:45 pm
A new version with tiny changes in almost every frame(!)

Have fun!
shield.png (1.26 KB)
shield.png

  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Fri Jun 11, 2021 10:22 pm
I realized his arm looks a bit square in the screenshot, which i fixed in another new version.

  View user's profile Send private message
  • Joined: 06 Aug 2015
  • Posts: 42
Reply with quote
Post Posted: Sat Jun 12, 2021 2:28 am
slogra wrote
I realized his arm looks a bit square in the screenshot, which i fixed in another new version.


Perfect! =)
  View user's profile Send private message
  • Joined: 06 Aug 2015
  • Posts: 42
Reply with quote
Post Posted: Sat Jun 12, 2021 7:10 am
I put the rings from the Mega Drive version too.

[/url]
Sonic.gif (7.9 KB)
Sonic.gif

  View user's profile Send private message
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Sat Jun 12, 2021 8:49 am
Last edited by slogra on Sat Jun 12, 2021 10:12 am; edited 1 time in total
Wow, those rings look very nice!

I've created a small additional patch to change the color of his shoes to red.

You can apply it to this version of the game, or the original version.

  View user's profile Send private message
  • Joined: 26 Jan 2014
  • Posts: 825
Reply with quote
Post Posted: Sat Jun 12, 2021 9:17 am
Nice work guys! For the rings, you also need to change the one falling when you get hit.
  View user's profile Send private message Visit poster's website
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Sat Jun 12, 2021 12:07 pm
I played through the game completely and did not find any issues.
The hack is ready to be released!

How do i submit this hack to the "Game Modifications" section?
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13726
  • Location: London
Reply with quote
Post Posted: Sat Jun 12, 2021 2:27 pm
This forum thread is enough, so long as someone supreme picks it up :) Post the screenshots and text to make it easier.
  View user's profile Send private message Visit poster's website
  • Joined: 09 Jun 2014
  • Posts: 58
Reply with quote
Post Posted: Sat Jun 12, 2021 2:31 pm
EmuBoarding wrote
I put the rings from the Mega Drive version too.


How did you change the rings? I noticed ring tiles near the players sprites, but those are not the tiles you changed, right?

I presume the tiles near the player is the ring that is used when you are hit.
  View user's profile Send private message
  • Joined: 06 Aug 2015
  • Posts: 42
Reply with quote
Post Posted: Sat Jun 12, 2021 4:18 pm
slogra wrote
EmuBoarding wrote
I put the rings from the Mega Drive version too.


How did you change the rings? I noticed ring tiles near the players sprites, but those are not the tiles you changed, right?

I presume the tiles near the player is the ring that is used when you are hit.


I forgot to change these.

I found here.
Aqui.png (40.62 KB)
Aqui.png

  View user's profile Send private message
  • Joined: 06 Aug 2015
  • Posts: 42
Reply with quote
Post Posted: Sat Jun 12, 2021 4:49 pm
EmuBoarding wrote
slogra wrote
EmuBoarding wrote
I put the rings from the Mega Drive version too.


How did you change the rings? I noticed ring tiles near the players sprites, but those are not the tiles you changed, right?

I presume the tiles near the player is the ring that is used when you are hit.


I forgot to change these.

I found here.


Ready! Rings modified on hit. Now we have to find the hud ring.

Sonic 2.gif (34.65 KB)
Sonic 2.gif

  View user's profile Send private message
  • Joined: 06 Aug 2015
  • Posts: 42
Reply with quote
Post Posted: Sat Jun 12, 2021 6:55 pm
Unfortunately sprites do not appear correctly in MTC. It's impossible to change more things. =(
  View user's profile Send private message
  • Joined: 06 Aug 2015
  • Posts: 42
Reply with quote
Post Posted: Sat Jun 12, 2021 7:52 pm
I modified some palettes. Here is the ips in case anyone wants to use it.
Mega Sonic 003.png (3.91 KB)
Mega Sonic 003.png

  View user's profile Send private message
  • Joined: 19 Apr 2019
  • Posts: 46
  • Location: Málaga, España
Reply with quote
Post Posted: Sun Jun 13, 2021 7:34 pm
EmuBoarding wrote
I modified some palettes. Here is the ips in case anyone wants to use it.


how you get your change the palette? With Meka? I would be interested in learning

I have tried the hack, and looks nice,
  View user's profile Send private message
  • Joined: 06 Aug 2015
  • Posts: 42
Reply with quote
Post Posted: Sun Jun 13, 2021 8:53 pm
Ershei wrote
EmuBoarding wrote
I modified some palettes. Here is the ips in case anyone wants to use it.


how you get your change the palette? With Meka? I would be interested in learning

I have tried the hack, and looks nice,


Easy...

Use Emulicious...

go to "Tools" -> "Palette Viewer" or Press "F6"

in Palette Viewer... the first row of colors is for backgrounds and the second for character sprites, enemies.


Place your mouse cursor over the color you want to change.

This way you will find out the color number in Hex and the offset location.

Now using a Hex Editor (I use HxD Hex Editor) let's make the changes.

Open the game ROM on HxD HE. Press Ctrl+G and put the offset you found in Emulicious "62BE" and press Enter.


Now using the Master System color chart, choose which color you will use.


I will use the dark red color. In Hex it is "02".


Now using HxD change Hex "39" to "02" and save.


Now open the game in Emulicious and see if it worked.


Hope this helps. Sorry for my bad English.
004.png (5.34 KB)
004.png
005.png (20.86 KB)
005.png
001.png (16.21 KB)
001.png
002.png (29.08 KB)
002.png
003.png (125.72 KB)
003.png
006.png (15.97 KB)
006.png

  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13726
  • Location: London
Reply with quote
Post Posted: Mon Jun 14, 2021 8:20 am
You can also hex edit the ROM in Emulicious and then save the IPS.
  View user's profile Send private message Visit poster's website
  • Joined: 06 Aug 2015
  • Posts: 42
Reply with quote
Post Posted: Mon Jun 14, 2021 5:39 pm
Maxim wrote
You can also hex edit the ROM in Emulicious and then save the IPS.


Yes I know, but I prefer to use HxD because it already saves in *.sms and I can test directly in the emulator without having to apply the ips. =)
  View user's profile Send private message
  • Joined: 14 Apr 2013
  • Posts: 546
Reply with quote
Post Posted: Mon Jun 14, 2021 6:14 pm
EmuBoarding wrote
Maxim wrote
You can also hex edit the ROM in Emulicious and then save the IPS.


Yes I know, but I prefer to use HxD because it already saves in *.sms and I can test directly in the emulator without having to apply the ips. =)

When you modify the rom from within Emulicious you already have the modified rom loaded so that actually allows you to test it directly in the emulator. So it's quicker.
And you can also directly save as an sms file from Emulicious.

Additionally, you can instead of just hovering the color in the Palette viewer also click it to select it.
After that, you can click the source to open it in the Memory Editor where you can directly edit it. After that you can reset (CTRL+Backspace in the main window) and see the effect of your change in the game. Then you can press CTRL+S in the Memory Editor and save your modified sms file.

So all you get from using HxD is that you spend more time on something that you could do a lot quicker if you did it directly and in place. :)
  View user's profile Send private message Visit poster's website
  • Joined: 06 Aug 2015
  • Posts: 42
Reply with quote
Post Posted: Tue Jun 15, 2021 5:13 am
Calindro wrote
EmuBoarding wrote
Maxim wrote
You can also hex edit the ROM in Emulicious and then save the IPS.


Yes I know, but I prefer to use HxD because it already saves in *.sms and I can test directly in the emulator without having to apply the ips. =)

When you modify the rom from within Emulicious you already have the modified rom loaded so that actually allows you to test it directly in the emulator. So it's quicker.
And you can also directly save as an sms file from Emulicious.

Additionally, you can instead of just hovering the color in the Palette viewer also click it to select it.
After that, you can click the source to open it in the Memory Editor where you can directly edit it. After that you can reset (CTRL+Backspace in the main window) and see the effect of your change in the game. Then you can press CTRL+S in the Memory Editor and save your modified sms file.

So all you get from using HxD is that you spend more time on something that you could do a lot quicker if you did it directly and in place. :)


Thank you very much.
I am going to try!
=)
  View user's profile Send private message
  • Joined: 19 Apr 2019
  • Posts: 46
  • Location: Málaga, España
Reply with quote
Post Posted: Wed Jun 16, 2021 8:58 pm
Last edited by Ershei on Wed Jun 16, 2021 9:43 pm; edited 2 times in total
when I edit the palette in Emulucious, how do I get to save the changes? It only allows me to save to file.pal
I want to change the colors of Ryu's double in Street Fighter 2 so that it looks more like the original arcade, and the same with the rest of the characters and stages.

  View user's profile Send private message
Reply to topic Goto page 1, 2  Next



Back to the top of this page

Back to SMS Power!