Register - Login
Views: 99793079
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
05-03-22 04:56:36 AM
Jul - General Game/ROM Hacking - SMW ASM question regarding custom sprite creation New poll - New thread - New reply
Next newer thread | Next older thread
Schwa
Member
Level: 24


Posts: 10/101
EXP: 73551
For next: 4574

Since: 12-17-07

From: Tacoma + Redmond = The Moment

Since last post: 9.3 years
Last activity: 9.3 years

Posted on 01-04-08 01:16:29 PM Link | Quote

I'd be asking this at SMW Central but they deleted that site, and they won't let me make a new account at the new site (no Register button), so I'm asking here.

I need to learn how to change how many tiles a custom sprite consists of. It's extremely important that I learn how to resize sprites, but after half an hour of studying different custom sprite ASM codes and trying to find a pattern, I still have no idea how this is done. Furthermore there was NOTHING on Google about resizing sprites. Will someone please teach me how to do this? You'll get a spot in the credits at the very least.

I hope for a fast response. My hack is nearly halted until I figure this out.

Thanks for your patience. --Schwa

____________________
(Layout made by Peardian, graphics from Sonic Team. Worship them.)
Sukasa

Level: 123


Posts: 208/4326
EXP: 20935536
For next: 295730

Since: 07-07-07


Since last post: 1.1 years
Last activity: 1.1 years

Posted on 01-04-08 05:07:28 PM Link | Quote
Profile | Send PM
Real Life Comics
p2pnet.net
My Site
You mean resizing a la Bowser?

Unfortunately, that's impossible. Bowser is actually a layer 1 object, running in SNES Mode7. The only way you'll be able to 'resize' anything in a normal level short of using the SuperFX is to use multiple copies of the sprite in the GFX file You could sorta 'resize' it if you coded it so tiles expanded out from the smaller sprite into the larger one, but it would be a rather complex setup I'd imagine.

____________________
Rena
I had one (1) message in Discord deleted and proceeded to make a huge, huge mess about how it was a violation of free speech and how moderators are supposed to be spam janitors and nobody should have the right to tell me not to talk about school shootings
Level: 135


Posts: 2044/5390
EXP: 29075317
For next: 259688

Since: 07-22-07

Pronouns: he/him/whatever
From: RSP Segment 6

Since last post: 342 days
Last activity: 342 days

Posted on 01-04-08 05:38:58 PM Link | Quote
Jul - Post #2044 - 01-04-08 12:38:58pm
Yeah, SNES has no hardware sprite scaling. You can only use prescaled graphics (which will eat up memory) or software scaling (which will be slow as shit without an expansion chip to do it).

Or, you might be able to use the same method as Bowser, if you don't need anything else on the screen.

____________________
Schwa
Member
Level: 24


Posts: 11/101
EXP: 73551
For next: 4574

Since: 12-17-07

From: Tacoma + Redmond = The Moment

Since last post: 9.3 years
Last activity: 9.3 years

Posted on 01-04-08 08:36:37 PM Link | Quote

You know, I really love it how you people jump to conclusions so damn quickly.

No, no, NO, I want NOTHING to do with Bowser, dammit. What I'm trying to do is make a Cobrat custom sprite, since Cobrat was one of my favorite enemies from the Mario series. I thought I could make the Cobrat based off a Snifit, but the Snifit takes up one 16x16 tile and I want it to take up two (meaning 16x32). I just have no idea what code to change/add to make him take up two tiles.

It would also be good if I made him open his mouth before firing, but I think I might be able to figure that out by studying how Birdo was done... that is, after I made him taller like I'm trying to do.

Now that we're clear on what's trying to be accomplished, NOW can anyone help me?

____________________
(Layout made by Peardian, graphics from Sonic Team. Worship them.)
Sukasa

Level: 123


Posts: 209/4326
EXP: 20935536
For next: 295730

Since: 07-07-07


Since last post: 1.1 years
Last activity: 1.1 years

Posted on 01-04-08 08:41:06 PM Link | Quote
Profile | Send PM
Real Life Comics
p2pnet.net
My Site
Sorry Schwa, but I misunderstood it and thought you meant changing sprite's size in-game.

Basically, you need to find the draw routine in the sprite, and there should be an area where it writes to $0300,Y or so. That's the code that draws a sprite tile, You'll want to adjust that to draw two tiles a frame instead of one, and remember to add (or subtract) 16 pixels from the second tile. You'll also wan tto change the sprite's clipping value so that it collides with mario properly, for a cobrat, you'll probably be fine copying the clipping value of a koopa (using Mario world reconfigurator or tweaker).

It's somewhat me complex than that, but if you want ot talk to me in PMs or on IRC, I'd be happy to help.

____________________
Schwa
Member
Level: 24


Posts: 12/101
EXP: 73551
For next: 4574

Since: 12-17-07

From: Tacoma + Redmond = The Moment

Since last post: 9.3 years
Last activity: 9.3 years

Posted on 01-05-08 01:03:01 AM Link | Quote

Hmm... Okay, that helps a little. But I still need to know how the draw routine and this $0300,Y works if I'm going to be successful. No need to use PMs, that's what I made this thread for (maybe this will help other people once I figure this out).

Also, I found a convenient tutorial on this stuff by mikeyk, but I don't understand it very well. It would help if it told me exactly what to do to add tiles to a sprite, and I also think the example they gave is different than the way mikeyk himself codes his own sprites...

I wonder if he'll respond if I email him? He's like a celebrity, and I didn't get one from Glyph Phoenix...

____________________
(Layout made by Peardian, graphics from Sonic Team. Worship them.)
Sukasa

Level: 123


Posts: 210/4326
EXP: 20935536
For next: 295730

Since: 07-07-07


Since last post: 1.1 years
Last activity: 1.1 years

Posted on 01-05-08 04:06:11 AM Link | Quote
Profile | Send PM
Real Life Comics
p2pnet.net
My Site
He might. Ah well, I"ve worked with sprite graphics.

Basically, $0300,Y is an array of sprite tiles, formatted to 4 bytes per tile. One byte is the actual tile number, lower 8 bits. Two bytes are the sprite X/Y in-level, and the fourth byte contains the sprite page bit (2 pages of sprite tiles), and all the bits for PPU (X/Y flip, Palette, draw order). I can't remember the specific order though. That's basically $0300,Y in a nutshell. The draw routine in a sprite simply adds tiles to this array based on any number of sprite-specific rules. Unfortunately, because of how the sprites are so different, these can vary between even similar sprites.

____________________
Schwa
Member
Level: 24


Posts: 14/101
EXP: 73551
For next: 4574

Since: 12-17-07

From: Tacoma + Redmond = The Moment

Since last post: 9.3 years
Last activity: 9.3 years

Posted on 01-05-08 06:45:48 AM (last edited by Schwa at 01-05-08 09:49 AM) Link | Quote

Right, I got that part, from mikeyk's tutorial that came with SpriteTool (I read it again and it made sense this time).

To make the Cobrat, I know what I need to do, but I don't know how to do it.

1) Take the Snifit and make him 16x32 instead of 16x16. This will require writing an extra 16x16 tile, which is where I'm stuck (the example in the tutorial is nothing like the one for Snifit).
1b) Set the animation frames for each tile on the Tilemap. This I can do.
2) Set a third animation for Cobrat opening his mouth to fire. I think I can get him to do this by copying something from Birdo's ASM code, but it won't be easy (I can already see all kinds of glitches with this).
3) Make Cobrat not pause before firing. I MIGHT know how to get this to work, but it might mess up the opening mouth animation.
4) Make the bullet shoot from the upper Cobrat tile instead of the lower one. Easy; I know what to change for this.
5) Change Cobrat's speed and bullet speed. Again, I know this one.

Probably some other steps I missed too.

I'll give this another try... It always screws up when I copy-paste from Birdo's code, so this time I'm forced to do it manually.

Sorry I'm being so high-maintenance... I promise when I get this to work, I'm releasing it in the open for everyone to use.


Edit: I got it to work! I created the Cobrat! I am the MAN!

Here's the .ASM file. You may want to change the tilemaps. Sorry I haven't put any comment tags on it for easy reference... I was kinda in a hurry. (BTW, I didn't include the .CFG file either... Just copy a Snifit config file, set the palette to C, set the clippings to the same as Birdo, any other reasonable settings you want and you should be good.)

____________________
(Layout made by Peardian, graphics from Sonic Team. Worship them.)
Next newer thread | Next older thread
Jul - General Game/ROM Hacking - SMW ASM question regarding custom sprite creation New poll - New thread - New reply


Rusted Logic

Acmlmboard - commit 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

27 database queries, 5 query cache hits.
Query execution time: 0.106409 seconds
Script execution time: 0.023785 seconds
Total render time: 0.130194 seconds