It is currently Sun May 27, 2018 8:43 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: NESST Metasprite Help
PostPosted: Wed Jan 31, 2018 12:15 pm 
Offline
User avatar

Joined: Wed Sep 21, 2016 12:08 pm
Posts: 83
I've seen many people using NESST to Metasprite builder to create a sprite. I, however, have never been able to get it to work. I've tried dragging tiles from the tileset to the metasprite control, but nothing happens. Tried Copy/Paste. Nothing. Tried dropping it into the Sprite list. Nothing.

I'm doing exactly what the guy in this video is doing but the cursor never changes. I'm using Windows 7 and NESST version 2.32. Any one have an idea why? And yes, I DID use the right mouse button so it can't be that simple.

https://youtu.be/BtV_NCwWAqs?t=671


Top
 Profile  
 
PostPosted: Wed Jan 31, 2018 12:22 pm 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1569
Location: Gothenburg, Sweden
This took me a year to figure out how to properly use it, so i recognize the struggle. ^^

This is how:

-On your nametable field, mark a group of tiles by shift-dragging.
-(optionally) switch to metatile view
-ctrl-m to place selection as meta-sprite in your currently active metasprite slot
-delete redundant tiles
-happy meta spriting!


when editing metasprites, be careful not to mistake the delete key for sprite deletion - it still deletes the currently selected tile from chr, and whenever a sprite is selected, its tile is also selected!

_________________
http://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
PostPosted: Wed Jan 31, 2018 12:25 pm 
Offline
User avatar

Joined: Wed Apr 02, 2008 2:09 pm
Posts: 1145
Could you record a video or something? Because there really isn't more to it. Here's a gif from boot:

Image
All I did was right click and drag after switching to metasprites mode.

_________________
https://kasumi.itch.io/indivisible


Last edited by Kasumi on Wed Jan 31, 2018 12:27 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed Jan 31, 2018 12:27 pm 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1569
Location: Gothenburg, Sweden
Actually, i never understood how drag n drop worked either. I've always used ctrl-m for initial placement and from there duplicated sprites, replaced them and reassigned tiles

oh, right-click/drag. got it. thanks. It's pretty odd that i've tried click-dragging, shiftclick-dragging, altclick-dragging but not right click dragging.

plausible reason for my personal failure, except not being methodical about it: right clicks are less intuitive than command key clicks on many laptops.

_________________
http://www.frankengraphics.com - personal NES blog


Last edited by FrankenGraphics on Wed Jan 31, 2018 12:37 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed Jan 31, 2018 12:36 pm 
Offline

Joined: Sat Oct 15, 2016 8:52 am
Posts: 118
I was puzzling over this for a good half hour the other day, so I can second that its pretty non intuitive. The key is that you HOLD DOWN the right mouse button when you drag.

Incidently, is anyone using this to store negative values? I had a bit of a mess around with it and the table it generated had both positive and negative values ( I presume you'd use twos compliment).

How are people setting g their x and y relative to the metasprite? I'm always using top left hand corner and offsets.


Top
 Profile  
 
PostPosted: Wed Jan 31, 2018 12:56 pm 
Offline
User avatar

Joined: Wed Apr 02, 2008 2:09 pm
Posts: 1145
team_disposable wrote:
Incidently, is anyone using this to store negative values? I had a bit of a mess around with it and the table it generated had both positive and negative values ( I presume you'd use twos compliment).

If you're working with 8bit (your game doesn't scroll)
-1 is the same as 255. ($FF)
0-1=255 (because of wraparound)
0+255=255
You can do
Code:
clc
adc table,x

regardless of if it's positve or negative and it'll just work.
If you're working with 16bit
-1 is the same as 65535 ($FFFF)
Since you only have one byte of $FFFF you do what's called a sign extension.
Code:
ldy #0;Y contains the high byte of the offset
lda table,x;Get the offset's low byte
bpl skipsignextend;If the number was positive, $00 is the correct high byte
dey;If the number is negative, the high byte must be $FF so we adjust Y
skipsignextend:
clc
adc poslow
sta poslowresult

tya;getting the high byte into A
adc poshigh
sta poshighresult

edit:
Quote:
How are people setting g their x and y relative to the metasprite? I'm always using top left hand corner and offsets.

Top Left, AND bottom middle... for different objects in the same game. But don't be me.

_________________
https://kasumi.itch.io/indivisible


Top
 Profile  
 
PostPosted: Wed Jan 31, 2018 1:08 pm 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1569
Location: Gothenburg, Sweden
Quote:
Top Left, AND bottom middle... for different objects in the same game. But don't be me.


These are very sensible. If NESST has another update anytime, one of the features i'd like to see is being able to move the origin of the grid (in other words the anchor point) independently for each metasprite. No additional bytes required; it just manipulates all sprites' relative position and you get visual feedback on the placement/grid screen. You sort of can do this as far as exports go, but your metasprite will be viewed off-centre of that narrow window which sometimes poses a problem.

_________________
http://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
PostPosted: Thu Feb 08, 2018 2:31 am 
Offline

Joined: Sat Oct 15, 2016 8:52 am
Posts: 118
More questions on this!

With regards to the offsets as minus numbers, how are people storing these?

It seems that with CA65 at least, you would need to convert them in to their positive (2s compliment) equivalent -

After this discussion, I have just attempted to store an (unrelated to NESST) array for a bounce offset of an item* and CA65 throws up range errors if I try and use minus numbers.

So it would seem that the code generated by NESST for metasprites still wouldn't work, as although you could use it in sbc, adc etc, you couldn't store it. Unless I'm missing something? Is there a signed byte size label or equivalent?** Or are people using C and is CC65 converting it for you?

*I'm experimenting with using a flat physics model for my latest game with fixed LUTs for gravity, acceleration, recoil, etc.
** In fact,I quickly tried copying a pasting in a metasprite and NESST auto generated the byte labels and caused the same issues.

Code:
cut and pasted from NESST:

metasprite:
   .byte -16,- 8,$00,0
   .byte - 8,- 8,$01,0
   .byte -16,  0,$10,0
   .byte - 8,  0,$11,0
   .byte   0,  0,$12,0
   .byte -16,  8,$63,0
   .byte -16, 16,$73,0
   .byte - 8,  8,$64,0
   .byte - 8, 16,$74,0
   .byte   0, 16,$75,0
   .byte   0,  8,$65,0


Errors in the assembler:

twin_ships_asm.s(1721): Error: Range error (-16 not in [0..255])
twin_ships_asm.s(1721): Error: Range error (-8 not in [0..255])
twin_ships_asm.s(1722): Error: Range error (-8 not in [0..255])
twin_ships_asm.s(1722): Error: Range error (-8 not in [0..255])
twin_ships_asm.s(1723): Error: Range error (-16 not in [0..255])
twin_ships_asm.s(1724): Error: Range error (-8 not in [0..255])
twin_ships_asm.s(1726): Error: Range error (-16 not in [0..255])
twin_ships_asm.s(1727): Error: Range error (-16 not in [0..255])
twin_ships_asm.s(1728): Error: Range error (-8 not in [0..255])
twin_ships_asm.s(1729): Error: Range error (-8 not in [0..255])



Top
 Profile  
 
PostPosted: Thu Feb 08, 2018 2:44 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6295
Location: Canada
Put this at the top of your code to eliminate those errors:
Code:
.feature force_range


At some point ca65 added a feature for range checking that is on by default, but it makes all use of signed numbers range errors, which I think is kinda stupid but here we are. Alternatively you can put < before each signed byte value to convert it to an unsigned byte and suppress the error for that one value in particular.

What I'd really like instead is range checking, but also a signed version of .byte and maybe a signed version of the # immediate prefix that makes the range check a signed one. Until all my dreams become a reality, though, I just disable range checking with that .feature directive in any files that use signed values.


Top
 Profile  
 
PostPosted: Thu Feb 08, 2018 2:59 am 
Offline

Joined: Sat Oct 15, 2016 8:52 am
Posts: 118
Makes sense!

I'm on a linux automated update of ca65 releases and I've noticed a few switched of syntax. One day I couldn't compile as I had to change the order of the switches! It's great to have an assembler/compiler that's being so actively developed though.

Since it seems like the switch is limited to auto-changing stored and used values, it seems safe enough to switch on. It would be if it stopped telling me about branching overflows I'd be worried!

Thanks rainwarrior!


Top
 Profile  
 
PostPosted: Thu Feb 08, 2018 3:22 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 6295
Location: Canada
Yes, branch limits are still an error with or without force_range. It is an unrelated check (and not possible to disable, AFAIK).

Yeah, they did add GCC-style command line argument ordering constraints in one version but I think that later got reverted? Can't recall.


Top
 Profile  
 
PostPosted: Thu Feb 08, 2018 4:12 am 
Offline

Joined: Sat Oct 15, 2016 8:52 am
Posts: 118
Just checked, yes was reverted. Was refusing optimisation (Oi) and add debug (g) as a single -Oig on CC65 (insisting instead on them separately as -Oi and -g). I've just reverted it back to -Oig in my makefile to check and it looks like it accepts them together again now.

The dangers of life at the cutting edge!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group