It is currently Mon Oct 15, 2018 9:47 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 41 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Fri Aug 31, 2018 5:44 am 
Offline
User avatar

Joined: Sun Nov 09, 2008 9:18 pm
Posts: 1107
Location: Pennsylvania, USA
This looks incredible. Definitely looks like it could replace nesmaker. Are you going to be selling it or is it free/open source?

Also, how do you make your guy go behind walls? I was impressed by that because I never could figure out a good way to do that on my own adventure game (The Legends of Owlia), so I just made it impossible. In Crystalis, they had to severely compromise the palette and have more than one shared color so that you could go behind a house using the background color as green but still have black outlines etc. It was kinda ugly.

My guess is maybe you have a character that always moves on an 8x8 grid and you can just cut him off? I cut off sprites for text boxes by nudging them a max of 4 pixels and then cutting them off at the sprite grid boundary, but never found a nice way to do the same just going behind walls etc.

Very cool stuff.


Top
 Profile  
 
PostPosted: Fri Aug 31, 2018 10:42 am 
Offline

Joined: Wed Apr 04, 2018 7:29 pm
Posts: 37
Location: Montreal, Canada
GradualGames wrote:
This looks incredible. Definitely looks like it could replace nesmaker. Are you going to be selling it or is it free/open source?

Also, how do you make your guy go behind walls? I was impressed by that because I never could figure out a good way to do that on my own adventure game (The Legends of Owlia), so I just made it impossible. In Crystalis, they had to severely compromise the palette and have more than one shared color so that you could go behind a house using the background color as green but still have black outlines etc. It was kinda ugly.

My guess is maybe you have a character that always moves on an 8x8 grid and you can just cut him off? I cut off sprites for text boxes by nudging them a max of 4 pixels and then cutting them off at the sprite grid boundary, but never found a nice way to do the same just going behind walls etc.

Very cool stuff.


Thanks. Not planning to sell anything, I'm just having fun and learning. Will definitely put the code up somewhere at some point. Its just too messy now!

To hide the guy i simply have a flag for each metatile that says if it is a "foreground" tile. So I constantly look if the feet of the character are touching a foreground tile, if it is, i render him behind the background.

This look cool, but it has severe limitations.

Most obvious one is that your floor, at least near the areas where you character can be occluded, needs to be of a plain color (i.e. the background color, which is this ugly orange/pink color). So i have these little "brick" tiles on the floor, but I could NOT put one near the bottom wall, otherwise the guy would render behind the brick pattern.

Also, gameplay-wise, I can see how it could be frustrating to die because you were partially occluded and couldnt see what was going on... So for all these reasons I might not keep it. Or I might adapt my level design to mitigate the problems. We will see.

-Mat


Top
 Profile  
 
PostPosted: Fri Aug 31, 2018 11:14 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20656
Location: NE Indiana, USA (NTSC)
The background doesn't necessarily have to be a plain color. If you have any sprite that matches either the background color or the shape of the background object, you can use what I call impossible triangle priority, a quirk of sprite priority on the NES. To put it short: If sprites' priority bits don't match their OAM order, the background wins.

When you hit a block in Super Mario Bros. 3 and a mushroom sprouts, you have three things mutually overlapping:

1. The block in the background
2. A solid black mask sprite, which is "behind" the block
3. The mushroom sprite, which is "in front of" the block but "behind" the mask sprite, hence the impossible triangle

The mask sprite appears before the mushroom in OAM, so it covers up the mushroom's pixels. But because the mask sprite has the priority bit turned on, any opaque pixels in the background replace the pixels of the mask sprite. Thus the mask sprite cuts a hole in all sprites behind it, allowing the background block to show through. Pillars in Mystery World Dizzy and The Curse of Possum Hollow use the same principle, as do tall pieces of furniture in RHDE: Furniture Fight.

See also:
PPU sprite priority and the entry of SMB3 in Tricky-to-emulate games


Top
 Profile  
 
PostPosted: Fri Aug 31, 2018 11:21 am 
Offline

Joined: Wed Apr 04, 2018 7:29 pm
Posts: 37
Location: Montreal, Canada
tepples wrote:
The background doesn't necessarily have to be a plain color. If you have any sprite that matches either the background color or the shape of the background object, you can use what I call impossible triangle priority, a quirk of sprite priority on the NES. To put it short: If sprites' priority bits don't match their OAM order, the background wins.

When you hit a block in Super Mario Bros. 3 and a mushroom sprouts, you have three things mutually overlapping:

1. The block in the background
2. A solid black mask sprite, which is "behind" the block
3. The mushroom sprite, which is "in front of" the block but "behind" the mask sprite, hence the impossible triangle

The mask sprite appears before the mushroom in OAM, so it covers up the mushroom's pixels. But because the mask sprite has the priority bit turned on, any opaque pixels in the background replace the pixels of the mask sprite. Thus the mask sprite cuts a hole in all sprites behind it, allowing the background block to show through. Pillars in Mystery World Dizzy and The Curse of Possum Hollow use the same principle, as do tall pieces of furniture in RHDE: Furniture Fight.

See also:
PPU sprite priority and the entry of SMB3 in Tricky-to-emulate games


Wow, this is some cool stuff! I didnt know any of that. I will read the wiki. Thanks!

-Mat


Top
 Profile  
 
PostPosted: Fri Aug 31, 2018 2:40 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2296
Location: DIGDUG
tokumaru wrote:
The IRQ counter won't work with rendering disabled, which is why I mentioned disabling only one layer (either sprites or background - as long as one of them is enabled, the PPU will function normally, and so should the scanline counter), and bankswitching blank patterns for the other. IIRC, Jurassic Park uses black (not blank - it has black in every palette!) patterns for both layers. Palette swaps mid-screen are notoriously hard to pull off on the NES, very few games did it.


I find this discussion fascinating.

What if you only had BG disabled for the top 8 lines, but sprites on, and you put 8 blank sprites at Y=0. The 8 Sprite limit makes it impossible for any other sprites to show up there.

I'm 90% sure the MMC3 IRQ would work, because it ticks the counter down on the sprite evaluation (I think).

Then rendering on till line 231, then another IRQ, then rendering off at the bottom.

Does anyone see any flaws with this plan?

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Fri Aug 31, 2018 3:34 pm 
Offline
User avatar

Joined: Thu Mar 31, 2016 11:15 am
Posts: 379
Can't you just busy-wait with rendering disabled for the top 8 scanlines? Or would that also muck up the IRC counter?


Top
 Profile  
 
PostPosted: Fri Aug 31, 2018 3:37 pm 
Offline

Joined: Wed Apr 04, 2018 7:29 pm
Posts: 37
Location: Montreal, Canada
dougeff wrote:
What if you only had BG disabled for the top 8 lines, but sprites on, and you put 8 blank sprites at Y=0. The 8 Sprite limit makes it impossible for any other sprites to show up there.


I think it would work BUT keep in mind my background color is NOT black. Its that ugly pink/orange on the floor. So you wouldn't get black bars, you would get pink bars!

-Mat


Top
 Profile  
 
PostPosted: Fri Aug 31, 2018 4:44 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10892
Location: Rio de Janeiro - Brazil
I used this technique before, but since timing raster effects at the bottom of the screen without IRQs is pretty hard (if you scroll vertically, guaranteeing a sprite 0 hit is practically impossible), I just masked 16 scanlines at the top of the screen. In the NMI handler, I turned background rendering off, and placed 9 high-priority transparent sprites at the very top of the screen, and waited for the sprite overflow flag to get set. After that, I'd wait 16 scanlines with time code before turning background rendering back on. My main CRT back then used to hide 12 or so scanlines at the top, so there was very little blank space visible, which bothered me much less than scrolling artifacts.


Top
 Profile  
 
PostPosted: Tue Sep 04, 2018 7:02 am 
Offline

Joined: Tue Jul 01, 2014 4:02 pm
Posts: 320
Hey there - this is Joe from The New 8-bit Heroes / NESmaker. Just wanted to say...this is fantastic :-)

Great tools, friend! Look forward to seeing what comes from them! We actually have a similar bit flip for hiding behind tiles this way...super cool to see it in yours too! And I'm jealous of how awesome your 4 way scrolling handles! Our scrolling is still pretty clunky to make the rest of the engine fit congruently.

Great work. Love to see the community building things like this. :-)

Joe


Top
 Profile  
 
PostPosted: Tue Sep 04, 2018 8:20 am 
Offline

Joined: Wed Apr 04, 2018 7:29 pm
Posts: 37
Location: Montreal, Canada
JoeGtake2 wrote:
Hey there - this is Joe from The New 8-bit Heroes / NESmaker. Just wanted to say...this is fantastic :-)

Great tools, friend! Look forward to seeing what comes from them! We actually have a similar bit flip for hiding behind tiles this way...super cool to see it in yours too! And I'm jealous of how awesome your 4 way scrolling handles! Our scrolling is still pretty clunky to make the rest of the engine fit congruently.

Great work. Love to see the community building things like this. :-)

Joe


Oh thanks!

Let me know if I can help with the scrolling. Its been kind of annoying to get it to work, maybe i can save you some time. But I doubt that is plug-an-play since its highly dependent on your data layout.

-Mat


Top
 Profile  
 
PostPosted: Tue Sep 04, 2018 8:28 am 
Offline

Joined: Tue Jul 01, 2014 4:02 pm
Posts: 320
Thanks, friend! Yeah, it's not that SCROLLING itself is an issue. Conceptually, we've already made it work fine. It's more that in an attempt for a extremely malleable code base with a consistent front end, it's been SUPER tricky to devise methods for it around that!

Would love to talk to you more about your project and what you're doing...I think it looks fantastic (and amazing art, too!!) Hit me up in an email if you'd like - joe@TheNew8bitHeroes.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 41 posts ]  Go to page Previous  1, 2, 3

All times are UTC - 7 hours


Who is online

Users browsing this forum: chimaera and 2 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