Banner
Views: 772,429,387
Time:
14 users online: Bensalot, BlueZy, caiqueleo, ECS.98,  Falconpunch, FreakazoidBR, h.carrell, KrustyKong, Marcozzo Daro, Maxodex,  Ninja Boy, placeholdertest, StrikeForcer,  Thomas - Guests: 30 - Bots: 180Users: 40,568 (1,858 active)
Latest: LuigiBoi
Tip: Don't just modify the original SMW overworld; start from scratch.Not logged in.
n00b Boss question(s) regarding sprite size
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - n00b Boss question(s) regarding sprite size
Pages: « 1 »
First of all, I must say I love this thing, it is just what I needed, mad props to Iceman. I've got my creeper boss acting just like I want, but what I'm wondering is this:

I have two different animations over three states, but I'd like to have one of them be 32 x 64, and the other be 32 x 32. My questions are:

1. Is this even possible?
2. If yes, how hard would it be?
3. If yes, how would I do it?

Any help is appreciated...

Uncle Monkey

--------------------
Solo Hacks In Progress:
Luigi's Big, Green Adventure
Jello's Journey

Collab Hacks In Progress:
K-16 - Story of Steel - Playtester
The Dimensional Rift - Level(s), Title-screen lettering

Sprites:
Creeper Pack - Project Thread

Sprites In Progress:
32 x 64 Creeper Boss
Boom Boom
Originally posted by unklmnky69
1. Is this even possible?

Yes.
Originally posted by unklmnky69
2. If yes, how hard would it be?

Depends on your experience. Probably a mid level assembly coder could bang it out in a couple hours.
Originally posted by unklmnky69
3. If yes, how would I do it?

I can't find the ultimate n00b boss on the site, so I'm just going to explain the normal way of doing it, don't know if the n00b boss has facilities to handle this or not.

People do it in different ways, my personal preference is to create pointer tables to each frame's tiles, XOff, YOff, etcetera (I actually do that anyway) like this:
Code
XOffs:
dw frame1XOff
dw frame2XOff
dw frame3XOff

frame1XOff:
db $00,$02,$00,$02
frame2Xoff:
db $00,$02,$00,$02,$00,$02,$00,$02
frame3Xoff:
db $00,$02,$00,$02

Then have a table that holds the number of tiles for each frame like so:
Code
TileCount:
db $03,$07,$03


Then, before the loop, you store each of your pointers into the direct page somewhere, e.g.:
Code
phx
lda framenumber
asl
tax
rep #$20
lda XOffs,x
sta $03
;Repeat for each table
sep #$20
plx


Then you load up the number of tiles into x, and also store it somewhere for later:
Code
phx
ldx framenumber
lda TileCount,x
tax
sta $0F

Then you loop through until X is down to 0, like a normal graphics loop with a static tile count, the only difference being that, when you want to get from the tables, you have to transfer X into Y and do an indirect load on the direct page addresses you put before, like this for X position as we set it up above:
Code
phy
txy
lda ($03),y
ply
clc
adc $00
sta $0300,x

At the end o the routine, instead of loading the static "#$03", you load the value we saved earlier into $0F and store that instead.
Whew, I'm still learning this stuff, and that's beyond me right now.

This is the Graphics routine in n00b boss:
Code
PROPERTIES:          
	db $40,$00
TILEMAP:
	db !TopLeft,!TopRight,!BottomLeft,!BottomRight,!WalkTopLeft,!WalkTopRight,!WalkBottomLeft,!WalkBottomRight
        db !TopLeft,!TopRight,!BottomLeft,!BottomRight,!WalkTopLeft,!WalkTopRight,!WalkBottomLeft,!WalkBottomRight
TILEMAP2:
	db !TopLeft2,!TopRight2,!BottomLeft2,!BottomRight2,!WalkTopLeft2,!WalkTopRight2,!WalkBottomLeft2,!WalkBottomRight2
        db !TopLeft2,!TopRight2,!BottomLeft2,!BottomRight2,!WalkTopLeft2,!WalkTopRight2,!WalkBottomLeft2,!WalkBottomRight2
TILEMAP3:
	db !TopLeft3,!TopRight3,!BottomLeft3,!BottomRight3,!WalkTopLeft3,!WalkTopRight3,!WalkBottomLeft3,!WalkBottomRight3
        db !TopLeft3,!TopRight3,!BottomLeft3,!BottomRight3,!WalkTopLeft3,!WalkTopRight3,!WalkBottomLeft3,!WalkBottomRight3
VERT_DISP:          
	db $F0,$F0,$00,$00,$F0,$F0,$00,$00
        db $F0,$F0,$00,$00,$F0,$F0,$00,$00         
HORIZ_DISP:  
	db $F8,$08,$F8,$08,$F8,$08,$F8,$08
	db $08,$F8,$08,$F8,$08,$F8,$08,$F8
Graphics:
	LDA !InvTimer
	CMP #$02
	BCS SkipGFX ; Completely skip if invisible.
	BRA Positive
SkipGFX:
	JMP SkipGFX2
Positive:
	JSR GET_DRAW_INFO
	LDA $1602,x
	STA $03 ; Animation frames -> $03.
	
	LDA $157C,x
	STA $02 ; Direction -> $02.
	BNE NoAdd
	LDA $03
	CLC
	ADC #$08 ; Add displacement if going left.
	STA $03
NoAdd:
	PHX ; Push sprite index.
	LDX #$03 ; Get # of times to go through loop.
Loop2:
	PHX 	; Push it for later..
	TXA
	ORA $03
FaceLeft:
	TAX
	LDA $00
	CLC
	ADC HORIZ_DISP,x ; Apply X displacement ..
	STA $0300,y

	LDA $01
	CLC
	ADC VERT_DISP,x ; .. and Y displacement.
	STA $0301,y

	LDA !InvTimer+9		;\
	ASL A			; |
	PHX			; | Animations involve a pointer.
	TAX			; |
	JMP (PtrPtr,x)		;/
;NOTE - Pointer is used to easily display frames (for future updates)
PtrPtr:
	dw AnimationFrameA 	; 00 ; Normal animation frames (A)
	dw AnimationFrameB 	; 01 ; Normal animation frames (B)
	dw AnimationFrameC 	; 02 ; Normal animation frames (C)
	;dw AnimationExFrame 	; 03 ; Throwing bone/hammer frame

AnimationFrameA:
	PLX
	LDA TILEMAP,x
	BRA DoGfx
AnimationFrameB:
	PLX
	LDA TILEMAP2,x
	BRA DoGfx
AnimationFrameC:
	PLX
	LDA TILEMAP3,x
	BRA DoGfx
DoGfx:
	STA $0302,y

	LDX $02 ; X is already preserved, so no need to push it again.
	LDA PROPERTIES,x
	LDX $15E9
	ORA $15F6,x
	ORA $64 ; Add in property byte.
	STA $0303,y

	LDA #!DoFlash ; Skip flashing if we're not allowed.
	CMP #$01
	BNE NoFlashing

	LDA !Flash,x
	BEQ NoFlashing ; Sprite flashes when jumped on.
	LDA $14
	AND #$07 ; 7 frames ..
	TAX ; -> X.
	LDA $0303,y
	AND #$F1
	ORA FlashTable,x
	STA $0303,y
NoFlashing:

	PLX ; Pull #$03.

	INY
	INY
	INY
	INY
	DEX ; Decrease it for every 16x16 tile drawn.
	BPL Loop2

	PLX
	LDY #$02
	LDA #$03
	JSL $01B7B3
SkipGFX2:	
	RTS

Code
	PLX
	LDY #$02
	LDA #$07
	JSL $01B7B3

I know that this part is what makes it 4 16x16 sprites, and I know that I can change it from 03 (4 tiles) to 07 (8 tiles).

Code
NoAdd:
	PHX ; Push sprite index.
	LDX #$07 ; Get # of times to go through loop.

Changed it here for the number of loops...

Code
VERT_DISP:          
	db $F0,$F0,$00,$00,$F0,$F0,$00,$00
        db $F0,$F0,$00,$00,$F0,$F0,$00,$00         
HORIZ_DISP:  
	db $F8,$08,$F8,$08,$F8,$08,$F8,$08
	db $08,$F8,$08,$F8,$08,$F8,$08,$F8

This is where I'm a bit confused...I think this is where the tile positions is set, but I'm confused as to how to add to it for the extra 4 tiles.

--------------------
Solo Hacks In Progress:
Luigi's Big, Green Adventure
Jello's Journey

Collab Hacks In Progress:
K-16 - Story of Steel - Playtester
The Dimensional Rift - Level(s), Title-screen lettering

Sprites:
Creeper Pack - Project Thread

Sprites In Progress:
32 x 64 Creeper Boss
Boom Boom
Yeah, this sprite is not set up to handle differently sized frames; it's using a fixed difference between offset indexes (see where it's adding 3 all over the place). You'd have to replace the whole routine, realistically. Im on my phone right now, I'll try to explain in more depth when I get off work.

Edit:
So you would need to add a different table for each frame and then have pointers to them, like I put in my first post. So instead of:
Code
VERT_DISP:          
	db $F0,$F0,$00,$00,$F0,$F0,$00,$00
        db $F0,$F0,$00,$00,$F0,$F0,$00,$00

it would look more like this:
Code
VERT_DISP_POINTERS:
	dw VERT_DISP1
	dw VERT_DISP2
	dw VERT_DISP3
	dw VERT_DISP4

VERT_DISP1:          
	db $F0,$F0,$00,$00
VERT_DISP2:
	db $F0,$F0,$00,$00
VERT_DISP3:
        db $F0,$F0,$00,$00
VERT_DISP4:
	db $F0,$F0,$00,$00

repeat for horizontal displacement. To add new tiles, find the frame you want to add them to, then add the displacement for each tile. So if you wanted to change frame 2, you would add 4 more bytes after VERT_DISP2. A position of $80-$FF is negative, e.g. $F0 is -$10, so it will place the tile higher up. Then you need to use the pointers to get the data instead of loading from the tables directly, as I explained in my first post.

Unfortunately, there is no easy way to do this. While Iceguy certainly tried to make the boss generic, it was done a LONG time ago, and I'm pretty sure is totally unsupported and in fact kind of the whole idea was abandoned as unrealistic at some point. There are some truly generic graphic routines out there (Mine comes pretty close) but they don't fit well into the n00b boss structure.
Thanks for all your help. I'm trying to learn all this so I can be more than a copy and paste spriter, so I have a few more questions to make sure I understand:

In the original code are my notes correct?
Code
VERT_DISP:          
	db $F0,$F0,$00,$00,$F0,$F0,$00,$00	;This is the displacement of the 8 tiles of frame 1 of 2 (typically standing)
        db $F0,$F0,$00,$00,$F0,$F0,$00,$00	;This is the displacement of the 8 tiles of frame 2 of 2 (typically walking)
;And this applies to all 3 animations available in n00b boss


And then in yours, am I understanding correctly?
Code
VERT_DISP_POINTERS:
	dw VERT_DISP1	\ Each of these is an individual frame
	dw VERT_DISP2	| available for use. So I could use 1 and
	dw VERT_DISP3	| 2 for the tall state, and 3 and 4 for
	dw VERT_DISP4	/ the short state.

VERT_DISP1:          
	db $F0,$F0,$00,$00	;Which means an extra line of values
	;here....
VERT_DISP2:
	db $F0,$F0,$00,$00	:And
	;here
VERT_DISP3:
        db $F0,$F0,$00,$00	;But none here
VERT_DISP4:
	db $F0,$F0,$00,$00	; or here


And then I would need 4 tilemaps, one for each frame?
Code
TILEMAP:
	db !__,!__,!__,!__,!__,!__,!__,!__
        db !__,!__,!__,!__,!__,!__,!__,!__
	db !__,!__,!__,!__,!__,!__,!__,!__
        db !__,!__,!__,!__,!__,!__,!__,!__
TILEMAP2:
	db !__,!__,!__,!__,!__,!__,!__,!__
        db !__,!__,!__,!__,!__,!__,!__,!__
	db !__,!__,!__,!__,!__,!__,!__,!__
        db !__,!__,!__,!__,!__,!__,!__,!__
TILEMAP3:
	db !__,!__,!__,!__,!__,!__,!__,!__
        db !__,!__,!__,!__,!__,!__,!__,!__
TILEMAP4:
	db !__,!__,!__,!__,!__,!__,!__,!__
	db !__,!__,!__,!__,!__,!__,!__,!__

Is this correct?

Thanks for all of your help, I feel like I'm actually learning something....:P

--------------------
Solo Hacks In Progress:
Luigi's Big, Green Adventure
Jello's Journey

Collab Hacks In Progress:
K-16 - Story of Steel - Playtester
The Dimensional Rift - Level(s), Title-screen lettering

Sprites:
Creeper Pack - Project Thread

Sprites In Progress:
32 x 64 Creeper Boss
Boom Boom
Originally posted by unklmnky69
In the original code are my notes correct?
Code
VERT_DISP:          
	db $F0,$F0,$00,$00,$F0,$F0,$00,$00	;This is the displacement of the 8 tiles of frame 1 of 2 (typically standing)
        db $F0,$F0,$00,$00,$F0,$F0,$00,$00	;This is the displacement of the 8 tiles of frame 2 of 2 (typically walking)
;And this applies to all 3 animations available in n00b boss

No. For some reason, MikeyK liked to put multiple frames on one line. Because MikeyK did it, so do a lot of other people. Each frame is actually 4 bytes, not 8.

Originally posted by unklmnky69
And then in yours, am I understanding correctly?
Code
VERT_DISP_POINTERS:
	dw VERT_DISP1	\ Each of these is an individual frame
	dw VERT_DISP2	| available for use. So I could use 1 and
	dw VERT_DISP3	| 2 for the tall state, and 3 and 4 for
	dw VERT_DISP4	/ the short state.


Probably. My n00b boss knowledge is limited.
Originally posted by unklmnky69

Code
VERT_DISP1:          
	db $F0,$F0,$00,$00	;Which means an extra line of values
	;here....
VERT_DISP2:
	db $F0,$F0,$00,$00	:And
	;here
VERT_DISP3:
        db $F0,$F0,$00,$00	;But none here
VERT_DISP4:
	db $F0,$F0,$00,$00	; or here


So are you saying the first two frames would be the tall state? if so, then yes, that would be the correct places to stick extra offsets.
Originally posted by unklmnky69

And then I would need 4 tilemaps, one for each frame?
Code
TILEMAP:
	db !__,!__,!__,!__,!__,!__,!__,!__
        db !__,!__,!__,!__,!__,!__,!__,!__
	db !__,!__,!__,!__,!__,!__,!__,!__
        db !__,!__,!__,!__,!__,!__,!__,!__
TILEMAP2:
	db !__,!__,!__,!__,!__,!__,!__,!__
        db !__,!__,!__,!__,!__,!__,!__,!__
	db !__,!__,!__,!__,!__,!__,!__,!__
        db !__,!__,!__,!__,!__,!__,!__,!__
TILEMAP3:
	db !__,!__,!__,!__,!__,!__,!__,!__
        db !__,!__,!__,!__,!__,!__,!__,!__
TILEMAP4:
	db !__,!__,!__,!__,!__,!__,!__,!__
	db !__,!__,!__,!__,!__,!__,!__,!__

Is this correct?

Also yes.
Crap, I thought I was ready, but it turns out I'm confused on the tilemaps.....I know that the vertical and horizontal displacement values affect the tiles listed in the tilemaps, but there is twice as many values in the tilemap tables as there are in the displacement tables.:O

--------------------
Solo Hacks In Progress:
Luigi's Big, Green Adventure
Jello's Journey

Collab Hacks In Progress:
K-16 - Story of Steel - Playtester
The Dimensional Rift - Level(s), Title-screen lettering

Sprites:
Creeper Pack - Project Thread

Sprites In Progress:
32 x 64 Creeper Boss
Boom Boom
Sorry, I must not have read what you were saying correctly. The underscores got me confused. It's one tile to one offset.
Code
VERT_DISP1:          
	db $F0,$F0,$00,$00	
	db $F0,$F0,$00,$00 

TILEMAP:
	db $00,$02,$20,$22,$04,$06,$24,$26
    	db $00,$02,$20,$22,$04,$06,$24,$26
	db $40,$42,$60,$62,$44,$46,$64,$66
    	db $40,$42,$60,$62,$44,$46,$64,$66

This is what I ended up with. I'm confused as to why the first and second lines of the tilemap are the same, and the third and fourth. And how the 8 offset values line up with the 16 or 32 tilemap values. All I did to make the tilemaps is plug in the actual values instead of the pointers that iceguy used. Would it just be easier at this point for me to make it from scratch? I don't have the necessary knowledge and experience needed just yet, but with a good mentor I'm sure I could learn.:P

--------------------
Solo Hacks In Progress:
Luigi's Big, Green Adventure
Jello's Journey

Collab Hacks In Progress:
K-16 - Story of Steel - Playtester
The Dimensional Rift - Level(s), Title-screen lettering

Sprites:
Creeper Pack - Project Thread

Sprites In Progress:
32 x 64 Creeper Boss
Boom Boom
Sorry, my brother was in town this week, so I've been pretty busy.

I'm unsure why there are double the tiles. Best I can tell is the bottom line is the tiles for going left.

This routine is unwieldy, it would likely be better to recreate it from scratch.
Pages: « 1 »
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - n00b Boss question(s) regarding sprite size

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2019 - SMW Central
Legal Information - Privacy Policy - Link To Us


Total queries: 9

Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Talkhaus
  • SMBX Community
  • GTx0
  • Super Luigi Bros
  • ROMhacking.net
  • MFGG
  • Gaming Reinvented