Sprite Graphics Editing

Page 1 of 3 1, 2, 3  Next

Go down

Sprite Graphics Editing Empty Sprite Graphics Editing

Post by Darkprince909 Fri 18 Oct 2013 - 0:02

Hi everyone, I'm Darkprince909, one of the graphics editors for Zelda3C, and I've hit a snag. I need to be able to change which palette an individual sprite calls from the palette set without affecting other sprites that use that palette (meaning just changing the colors in the palette won't work.) I've wandered around the forums a bit, and I found the tutorial for the Graphics Schemes section of Hyrule Magic, which seems to be exactly what I'm looking for, but it's incomplete. If someone is willing to walk me through the process of changing these values, it would help all of us on this project a lot, because we wouldn't have to worry as much about making the new sprites fit existing palettes, or even the same palette as the original sprite.

By the way, these forums are sick! I didn't know there were so many other hacks in progress right now. And I'm glad to be invited to the party 😂 

Darkprince909

Sprite Graphics Editing Image211

Since : 2013-10-17

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Erockbrox Fri 18 Oct 2013 - 0:30

Welcome to the forums Darkprince909! I remember seeing you on the message boards from GM's site and from what I hear you have redrawn the small pine tree.

As for your request you might want to ask SePH or someone else because I don't know much about the palettes.

Erockbrox
Erockbrox

Sprite Graphics Editing Image211

Since : 2013-02-05

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Founder Fri 18 Oct 2013 - 0:34

Hello Darkprince909 and welcome here! I just though of inviting you here after your email question since you're a part of the Quest for Calatia team afterall Wink

I you wanna know how to edit the palettes sets, you should read my new compendium faq right here:

https://www.dropbox.com/s/ay6mm8nt3lbguld/Orochimaru%27s%20Zelda%203%20Hacking%20Compendium%20v1.8.4.pdf

Start reading from page 230 until 238 and you should find your answer! The graphics schemes aren't that hard when they have tutorials! The graphics schemes sections aren't all finished but I'll probably finish them after I'm done with my hack!

Founder

Sprite Graphics Editing Image212

Since : 2012-06-19

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Darkprince909 Fri 18 Oct 2013 - 0:38

Oh wow, that's a big guide. I found the Perfect Guide yesterday, but that didn't have nearly this much information. I'm going to finish working on the sprite I'm drawing now, then I'll read this section. Hopefully I can make sense of it. Thanks so much, SePH!

Darkprince909

Sprite Graphics Editing Image211

Since : 2013-10-17

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Founder Fri 18 Oct 2013 - 0:51

No worries, as long as it can help!

I hope you understand, but if you don't, the most basic way to say it is that you can attribute two different enemy colors per area or dungeon floor. Some enemies of course use a certain shared palette and you can't edit it without affecting other sprites if I recall correctly!

I'll look more into this request during my coming weekend (monday-tuesday-wednesday of every week)

But to give you an exemple of what is possible to do with new enemy palettes you can see my bosses videos in there: http://zeldix.forumotion.com/t20-overall-game-progression Very Happy

Founder

Sprite Graphics Editing Image212

Since : 2012-06-19

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Darkprince909 Fri 18 Oct 2013 - 19:39

Okay, I understand how to change which palettes are available in a certain area, but how do I tell the sprite which palette to use? To use the guide's example, in the Desert Palace, it has a green palette and a purple palette, which are used for the Beamos, the Leevers, and the Rocklops. But how do they know which palette of the two to use? And how do the Debirandos and Tentacles use the red and blue soldier palettes when they aren't in the palette set? And what does the second set of enemy palettes do?

Hopefully that all makes sense

Edit: An example of a situation we'll run into when we're importing new enemies: Say we have a Deku Scrub that uses the green soldier's palette, and we want to overwrite an Octorok. If another enemy on screen uses the same palette as the original Octorok (like the Octobomb, the one that floats in the air and explodes), and we have green soldiers on the map too, both palettes will be available for the sprite to use. How do we tell the Deku scrub to use his palette, and not the Octorok's?


Darkprince909

Sprite Graphics Editing Image211

Since : 2013-10-17

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Erockbrox Fri 18 Oct 2013 - 23:49

^ I think the red and blue soldier palettes are like hardcoded or universal because the soldiers can be used anywhere in the game and so apparently that's why they don't have an individual palette.

Someone correct me if I'm wrong.
Erockbrox
Erockbrox

Sprite Graphics Editing Image211

Since : 2013-02-05

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Darkprince909 Sat 19 Oct 2013 - 0:04

Well that's incredibly good to hear! (If you're correct, which I hope) I would guess if that's the case, the red one is hardcoded as well? There's lots of enemies that use that one too. It seems most of my questions have been answered, save for making sure a specific sprite calls the right palette out of the set.

Darkprince909

Sprite Graphics Editing Image211

Since : 2013-10-17

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Puzzledude Sat 19 Oct 2013 - 5:40

The soldiers don't have hardcoded palettes. To determine or set the pal of the new sprite it is all about the pixeling. It is importaint what pixel do you use in yy-chr. You have 16 of them, half of them repeat, so 8 colours for a sprite. The game will then load the global pal. For instance, you can repixel the blue bomb (sprite) into anything compatible to a global blue palette (8 colours), but red is not among them (belongs to global red pal).

So you have 3 parameters: set the pal with pixels (8 colours) in yy-chr, set the global pal (in hex), and also the main pal set in HM (pal editor). This last one is not really recommended to change, since it will change "all" colours. For instance green soldier set to yellow soldier, will also change the crab.

On the end you need to set the pal value in HM of the room (indoors) or area (outdoors), which can again manipulate the pal (but it affects the objects to).
Puzzledude
Puzzledude

Sprite Graphics Editing Image213

Since : 2012-06-20

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Conn Sat 19 Oct 2013 - 7:08

What you also can try is to change the hardcoded global palette table each sprite gets its palette from (this will not affect other sprites).

(1) take basis address pc: 06/B359
(2) check in Hyrule Magic the sprite number you want to change; Blue soldier is 41
Sprite Graphics Editing Image210
(3) add this in HEX! to 06/B359:
06B359+41=06/B39A
(4) at pc 06/b39a you find the 19 which is blue for blue soldier. Change the palette according to the palette key below to your wishes (e.g., 19 is blue palette, 17 is red, 1b is green.
.

This works for every sprite so you can edit the palette specific to each sprite now!


Here's the palette key:
Sprite Graphics Editing Image411

Here's when I change the 19 to 1d (all blue soldiers changed to golden):
Sprite Graphics Editing Legend12


Last edited by Conn on Sat 19 Oct 2013 - 8:20; edited 1 time in total
Conn
Conn

Sprite Graphics Editing Image212

Since : 2013-06-30

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Darkprince909 Sat 19 Oct 2013 - 10:34

Sweet zombie Jesus! That palette table is exactly what I was looking for when I started with this problem a week ago! You don't know how much trouble you've saved me, Conn. I'll start experimenting with it tonight when I have time.

One thing, can you elaborate a little bit on how the palette key works? What program is that in, and do I just look for whatever color is in the first slot of that palette in Hyrule Magic? If I were to follow the address for each sprite, would every sprite that uses the blue soldier palette be 19? Every green 1b? etc.

Darkprince909

Sprite Graphics Editing Image211

Since : 2013-10-17

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Conn Sat 19 Oct 2013 - 13:01

You're welcome. The palette key is that pic I posted above..
Follow the red line at 19 and it will point to the blue used for the soldier. With this graphic key you can direct another color out of that key, e.g. 1d for gold. If your color isn't used you need to repixel the sprite.
Conn
Conn

Sprite Graphics Editing Image212

Since : 2013-06-30

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Erockbrox Sat 19 Oct 2013 - 14:51

Nice work guys!
Erockbrox
Erockbrox

Sprite Graphics Editing Image211

Since : 2013-02-05

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Darkprince909 Sat 19 Oct 2013 - 16:38

I feel kind of dumb right now (Hex isn't my strong suit...). I was able to import a new enemy in just fine, but I don't understand the address you gave me for the palette table. I typed it into my hex editor, and it's giving me something competely different from what I'd imagine I should have. At 06B39A, I have FF 00 and and bunch of 03's... I'm probably missing something obvious.

Darkprince909

Sprite Graphics Editing Image211

Since : 2013-10-17

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Puzzledude Sat 19 Oct 2013 - 18:52

You are exactly 200 bytes to short. You need to remove the header from the rom, to see the addresses correctly. In your case you would need to go to 6B59A (with header), but the actual value is 6B39A (when you remove the header).
 
The pal values start like so: 00 00 00 00 00 00 00 00 00 19 0B 1B 4B 41 41 41 4D 1D 01 1D 19 8D 1B 09 9D 3D 01 09 11 40 01 4D.
 
You can search for this series of bytes and you will find them at 6B550 in your current rom.
Puzzledude
Puzzledude

Sprite Graphics Editing Image213

Since : 2012-06-20

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Darkprince909 Sat 19 Oct 2013 - 19:04

So is it better to have a header or not have a header for a hack? Mostly so I can find a rom without one if I need to, to make it easier to list the steps Zack would need to take once we're ready to do this on his end of things. I never thought the issue was because of the header, though. I'll watch out for that now.

Edit: I'm still having a bit of trouble. To start, I was able to replicate what you did with the blue soldier just fine, no problem. But right now, I'm trying to overwrite the Bushcrab with a Deku Scrub. While he has the bush on his head, he appears just fine, in the right palette (green soldier) and everything. But when I pull the bush off his head, his body switches to the blue soldier's palette. I followed the directions and found his palette byte, but it only alters the frames while he has the bush on his head. Nothing I've tried changes the bushless form's palette. How would I go about doing that? Do some sprites that have 2 stages (like this guy, or perhaps the Armos) have a second byte somewhere, or is there a second palette table?

(I'm a newbie when it comes to Zelda 3 hacking. I'm the graphics editor and not the hack creator for a reason. Please forgive me if I'm asking an obvious question.)

Darkprince909

Sprite Graphics Editing Image211

Since : 2013-10-17

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Founder Sat 19 Oct 2013 - 20:58

Puzzledude wrote:The soldiers don't have hardcoded palettes. To determine or set the pal of the new sprite it is all about the pixeling. It is importaint what pixel do you use in yy-chr. You have 16 of them, half of them repeat, so 8 colours for a sprite. The game will then load the global pal. For instance, you can repixel the blue bomb (sprite) into anything compatible to a global blue palette (8 colours), but red is not among them (belongs to global red pal).
I learned something new today! I knew this worked for the items recoloring but never though about doing the same thing for sprites! This will actually help me really much Puzzledude!

Conn's method is also a good thing to know, but repixeling is much easier on my part Razz

Can't help you with that specific problem as I just read those posts from conn and PuzzleDude just now... but as for your header question...

...The only Zelda 3 tool I have which needs a header to work is zcompress (for decompressing and recompressing the graphics... otherwise most of the time it's better to work without a header! Also all hex addresses in the guide are for a rom without header along pretty much all posts in here!

Founder

Sprite Graphics Editing Image212

Since : 2012-06-19

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Darkprince909 Sat 19 Oct 2013 - 21:02

I don't really understand the repixeling method, however maybe that's how I can fix the Deku if you could explain what the repeating part is to me.

On the hex addresses, I guess when I run across one, I'll just add 200 since my rom has a header and I'm too lazy to get one without a header.

Darkprince909

Sprite Graphics Editing Image211

Since : 2013-10-17

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Conn Sat 19 Oct 2013 - 21:14

It's really simple, SePH, it's just taking a calculator and add the sprite number to
06B359. Blue soldier is 41 (Hyrule Magic) so 06B359+41=06B39A.

At pc 06/B39A you find 19, this is the blue palette. Change it according to this palette key:
Sprite Graphics Editing Image411

So, e.g., 06/B39A:19 -> 1d will change the blue to golden. If you need another color you still can repixel all gfx in this global palette Wink

This has the advantage to switch the palette, e.g. from blue to green, red, whatever... (you are very limited with repixeling).
Conn
Conn

Sprite Graphics Editing Image212

Since : 2013-06-30

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Founder Sat 19 Oct 2013 - 21:45

I know Conn!! What I meant to say is that your method combined with Puzzledude's is the best of both worlds! We can finally make use of all the palettes! Including the ones on the right in your chart!!

Here's a visual guide to Puzzledude's repixeling method in question Darkprince!

It all begins with our good ol' yy-chr!

Sprite Graphics Editing Image5_zps04587ac1

1- Open your decompressed graphics file with it.

2- Look at the three colored rectangles in the picture above
---red=the blue soldiers palette
---green=the palette we want the sprite to use instead
---blue= both palettes side to side ► pretty much as you see them in HM:
Sprite Graphics Editing Image10_zps05d44909
World colors 2 palette 0 being light world shared sprites and palette 1 being the dark world ones.

3- Copy the graphics set you want to edit (select the area using the right mouse button and then use the copy button at the top):
Sprite Graphics Editing Image6_zpsef0bcdcf

4-Paste it in your favorite graphics editor (like paint shop pro) and then start modifying the sprite to use the gold palette instead of the blue one:
Sprite Graphics Editing Image8_zps5de43f88

5-When you're done you can safely paste it back in yy-chr, save and recompress in your game with zcompress!
Sprite Graphics Editing Image12_zpsd092a699

Alternatively if you're familiar with yy-chr enough, you can edit the palette of the sprite directly in it!

Founder

Sprite Graphics Editing Image212

Since : 2012-06-19

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Darkprince909 Sun 20 Oct 2013 - 0:21

Dang, it doesn't look like that'll do what I need it to do... I don't think Zack will mind if I post this one little thing about the Deku Scrub, since this is a closed forum. Here's my problem now, and I have now idea what to do:

Sprite Graphics Editing F1yy
Sprite Graphics Editing Urg3

The palette in the first picture works just fine. Once the bush gets pulled off, however, his stem, which should be green, turns blue, and his eyes turn red, which is not what I want. How do I change the palette uses by the bushless version? (The Deku replaces a bushcrab, in case that wasn't obvious.)

Zack is having trouble finding how to change the "awakend" Armos as well. The "sleeping" palettes are no problem, but changing the awake one eludes us.

In any case, you guys have already helped a lot, and I am really thankful. 😂 

Darkprince909

Sprite Graphics Editing Image211

Since : 2013-10-17

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Founder Sun 20 Oct 2013 - 0:38

Conn might need to look into it, as we've run into similar problems with editing the palettes of the items animations... like the rods for exemple, we changed one of them from red to green but the palette had to be changed at four different locations in hex, one for each of the directions.

Others items were affected in the same way. Now I'm not an expert at this, but this is my best guess!


Founder

Sprite Graphics Editing Image212

Since : 2012-06-19

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Darkprince909 Sun 20 Oct 2013 - 0:45

Okay. I figured that there were probably more than one palette location. I just have no idea where it would be. There's no rush to find the location, just as long as we can figure something out sometime lol. Glad to know there likely is a way to fix it.

Edit: *sigh* another thing I don't know how to do...
I was importing the new Tektites, and when I went to change the palette, it seems the table calls up some other function to handle the palette swap depending on the X coordinate. There are other enemies like this in the game, and it seems they all abide by the same rules. How do I find their palette pointer?

Darkprince909

Sprite Graphics Editing Image211

Since : 2013-10-17

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Conn Sun 20 Oct 2013 - 6:53

Change at pc: 03/2915:09 -> 0b (unheadered!, headered should be 03/2b15) and repixel to get the green for the deku scrub.
09 is blue palette (similar as for the blue soldier is 19), 0b is green palette (similar as for green soldier is 1b).

You need to trace every monster in oam and in 7E0F50 region. Normally monster palettes are loaded when entering a screen, but as for this deku scrub it of course changes when lifting the bush, and above code is not a table it is extra coded.
I don't know what tektites are so please post a pic for remaining monsters
Conn
Conn

Sprite Graphics Editing Image212

Since : 2013-06-30

Back to top Go down

Sprite Graphics Editing Empty Re: Sprite Graphics Editing

Post by Puzzledude Sun 20 Oct 2013 - 7:03

So is it better to have a header or not have a header for a hack? Mostly so I can find a rom without one if I need to, to make it easier to list the steps Zack would need to take once we're ready to do this on his end of things. I never thought the issue was because of the header, though. I'll watch out for that now.
 
Always use No Header. A header are 200 bytes (in hex) or 512 in dec at the beginning of the rom as a leftover from the copier, which brought the cart into the smc file. It is used only by the copier and was not produced by original authors. The header is useless and will shift all addresses to a wrong location according to where pointers are pointing. But irronically you need the header when using zcompress (add 200 bytes back at the beginning).
 
On the hex addresses, I guess when I run across one, I'll just add 200 since my rom has a header and I'm too lazy to get one without a header.
 
You don't need to get it, just erase the first 200 bytes (in hex) in the hex editor of your current rom.
 
Do some sprites that have 2 stages (like this guy, or perhaps the Armos) have a second byte somewhere, or is there a second palette table?
 
Yes, they do. The 2 stage sprite is a problem, since you also need to find a hex location of the other state, usually done with tracing (as a part of asm).
 
Regarding the palettes. The repixeling is really not my method, it is just the first stage. For instance: when I was remodeling the Armos knight and give him legs, I needed to choose the pal for his clothes (I wanted brown). So I needed to choose the correct pixel first, which will then become the correct colour after the hex edit.
 
So it goes like this: choose a pixel (yychr) < choose global pal in hex, set the pal in HM (usually not changed), set the pal in area or a room using the pal value.
Puzzledude
Puzzledude

Sprite Graphics Editing Image213

Since : 2012-06-20

Back to top Go down

Page 1 of 3 1, 2, 3  Next

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum