It is currently Thu Dec 14, 2017 9:46 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Tue Jun 20, 2006 2:55 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3968
How does Wizards and Warriors 3 manage to have a status bar at the bottom of a vertically scrolling screen without the help of an MMC3? It looks like there's a sprite in the bottom row of the graphics, but how can you guarantee a sprite 0 hit when the background scrolls in all directions?

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Tue Jun 20, 2006 5:50 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19346
Location: NE Indiana, USA (NTSC)
Dwedit wrote:
how can you guarantee a sprite 0 hit when the background scrolls in all directions?

One way is by drawing an opaque tile at the bottom left corner of the playfield.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 20, 2006 8:01 pm 
Offline

Joined: Sun Mar 19, 2006 9:44 pm
Posts: 924
Location: Japan
The Guardian Legend uses the same trick, and it's quite visible too.

_________________
http://www.chrismcovell.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 20, 2006 8:10 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19346
Location: NE Indiana, USA (NTSC)
But in fact, the bottom right corner is slightly less visible because the NES picture is offset two pixels to the right.

NES Scrolling Test by Lasse Öörni (Cadaver) displays the technique, but it's slightly glitchy on Nintendulator because like the NES, Nintendulator doesn't recognize sprite 0 overlaps in column 255.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 20, 2006 11:05 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3968
I just watched the name table viewer carefully... It copies the original tile graphics to a specific tile number, changes the tile number for the lower-left corner, and plots a single PIXEL in that special tile. That single pixel collides with a single pixel sprite. Wow.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 21, 2006 8:14 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7314
Location: Chexbres, VD, Switzerland
Since you make sure you never have 8 consecutives BG color pixels in the playfield, it will cause no problems to have a sprite zero hit with some 8 pixel tolerance (anyway, the tolerance so that the hit check loop is larger then 8).
I think the best way is to make sure to never have 4 horizontal consecutive BG color in your whole tileset.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 21, 2006 10:41 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10164
Location: Rio de Janeiro - Brazil
I think Big Nose Freaks Out also places a solid tile, by the right bottom corner.

I think you have to be really careful with that trick, because even if you make sure the sprite hit will happen, you must also be sure that game logic will never go beyond the place where the hit is to happen.

I was planning on turning the screen off early for a project, by having a sprite 0 hit on the last scanline, but am afraid that the calculations during the frame may take too long.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 21, 2006 11:16 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7314
Location: Chexbres, VD, Switzerland
You're right, however there are game engines especially designed to be fast (Konami games ?).
However, in your case, that would just wait until the hit in the next frame, causing a slowdown that would happen anyways.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 21, 2006 12:07 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10164
Location: Rio de Janeiro - Brazil
Bregalad wrote:
that would just wait until the hit in the next frame, causing a slowdown that would happen anyways.

Worse than the slowdown is the fact that the bottom part, that should be hidden, will be displayed for a frame, causing flicker and possibly exposing undesired/incorrect tiles/attributes.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 21, 2006 12:20 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7314
Location: Chexbres, VD, Switzerland
Yeah... at least the game wouldn't frezee.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 21, 2006 12:22 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19346
Location: NE Indiana, USA (NTSC)
tokumaru wrote:
you must also be sure that game logic will never go beyond the place where the hit is to happen.

I was planning on turning the screen off early for a project, by having a sprite 0 hit on the last scanline, but am afraid that the calculations during the frame may take too long.

If you aren't using DPCM sound, you could borrow its IRQ for timing the sprite 0 hit. Start a DPCM playback in the vblank NMI, with a length such that it finishes a few scanlines before sprite 0. Then wait for sprite 0 inside the IRQ handler and do the PPUSCROLL/PPUADDR magic. But then you have to use an emulator that supports the game Fire Hawk if you want any accuracy.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 22, 2006 8:13 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7314
Location: Chexbres, VD, Switzerland
How to do this without hearing sound glitches ?
Hey, this has gotten me an alternate idea. Before the screen loads, wait a given number of cylces and write the value #$80 to $4017 to enable IRQ and use 4-step sequcne.
Then the interrupt will continue to reliably happen each frame when the game logic goes on. Unfrotuntaly, I think the frequencey is a very bit shorter than the 60Hz framerate, so something to compensate this is needed (re-write to $4017 after wait the difference of time between screen and APU).

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 22, 2006 10:25 am 
Offline
User avatar

Joined: Mon Sep 27, 2004 8:33 am
Posts: 3715
Location: Central Texas, USA
Bregalad wrote:
How to do this without hearing sound glitches?


Use a DMC sample that's all $00 bytes and write 0 to $4011 at startup.

Quote:
Hey, this has gotten me an alternate idea. Before the screen loads, wait a given number of cylces and write the value #$80 to $4017 to enable IRQ and use 4-step sequcne. Then the interrupt will continue to reliably happen each frame when the game logic goes on. Unfrotuntaly, I think the frequencey is a very bit shorter than the 60Hz framerate, so something to compensate this is needed (re-write to $4017 after wait the difference of time between screen and APU).


Yeah, I tried to work this approach out a while back but was foiled by the APU's frame rate being slightly lower than the PPU's. If it were the other way around, it'd work out since you could reschedule the interrupt for the next frame slightly before the current scanline, after you had found a sprite #0 hit at the exact moment. Oh well.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 22, 2006 10:37 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7314
Location: Chexbres, VD, Switzerland
Quote:
Yeah, I tried to work this approach out a while back but was foiled by the APU's frame rate being slightly lower than the PPU's. If it were the other way around, it'd work out since you could reschedule the interrupt for the next frame slightly before the current scanline, after you had found a sprite #0 hit at the exact moment. Oh well.

Sorry, I was really thinking it was the other way arround for some reason. That's a lame.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 22, 2006 1:08 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19346
Location: NE Indiana, USA (NTSC)
blargg wrote:
Yeah, I tried to work this approach out a while back but was foiled by the APU's frame rate being slightly lower than the PPU's. If it were the other way around, it'd work out since you could reschedule the interrupt for the next frame slightly before the current scanline, after you had found a sprite #0 hit at the exact moment. Oh well.

But on PAL...


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: Yahoo [Bot] and 9 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