It is currently Sun Oct 22, 2017 8:52 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Thu Jul 28, 2016 8:01 am 
Offline
User avatar

Joined: Sun Jun 05, 2016 1:41 pm
Posts: 74
Whilst working on my emulator project to get VRC2/VRC4 games working, I couldn;t help but wonder how the wavy moon to monster sprite animation is implemented in the game Bocu Dracula-kun.

Anyone care to shed light on this? Is the PPU mid-frame scroll technique being used on a small region of the background here? Or is this a sprite effect?

Title animation:
Image

_________________
Tile IDE and tile engine for XNA: http://tide.codeplex.com/
Fancy Fish Mod - Minecraft Mod: http://fancyfishmod.weebly.com/


Top
 Profile  
 
PostPosted: Thu Jul 28, 2016 8:07 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19115
Location: NE Indiana, USA (NTSC)
It's background scrolling in a sinusoidal pattern. The same effect is used for warp zones in the port of Super Mario Bros. 2: Mario Madness in Super Mario All-Stars and for the title screen of Solar Wars. Try logging writes to $2005 and $2006 while that animation plays.


Top
 Profile  
 
PostPosted: Thu Jul 28, 2016 8:18 am 
Offline
User avatar

Joined: Sun Jun 05, 2016 1:41 pm
Posts: 74
tepples wrote:
It's background scrolling in a sinusoidal pattern. The same effect is used for warp zones in the port of Super Mario Bros. 2: Mario Madness in Super Mario All-Stars and for the title screen of Solar Wars. Try logging writes to $2005 and $2006 while that animation plays.


I suspected so, but what about the static stars and tapering roof of the tower lying within the same horizontal band of the screen? Since they are not affected, are those sprites? Surely it isn't possible to alter just the scroll position of the rectangular region containing the moon graphics.

Edit: I also noticed a subtle parallax effect of the foreground roof where the hero is standing. I'm assuming this is done using the IRQ counter and splitting the screen. Very clever :)

Edit 2: Some quick hacks to highlight game sprites does reveal that the tower roof and stars in the middle horizontal band of the screen are in fact sprites.

_________________
Tile IDE and tile engine for XNA: http://tide.codeplex.com/
Fancy Fish Mod - Minecraft Mod: http://fancyfishmod.weebly.com/


Last edited by colinvella on Thu Jul 28, 2016 8:47 am, edited 2 times in total.

Top
 Profile  
 
PostPosted: Thu Jul 28, 2016 8:44 am 
Offline

Joined: Thu Aug 12, 2010 3:43 am
Posts: 1589
Yeah, the background in that area is sprites. Note how there isn't much detail in that zone.


Top
 Profile  
 
PostPosted: Thu Jul 28, 2016 9:40 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5732
Location: Canada
Just a suggestion, you can open this game in FCEUX and go to the menu and choose: Debug > Name table Viewer.

It will quickly let you see what is sprite and what is background.

Alternatively you can toggle the sprite or background layers individually: Config > Display > Graphics: BG / Graphics: OBJ


This is a pretty advanced title screen sequence. Lots of interesting interplay between sprites and background going on. (Thanks for sharing.)


Attachments:
fceux_nametable.jpg
fceux_nametable.jpg [ 139.92 KiB | Viewed 2136 times ]
Top
 Profile  
 
PostPosted: Thu Jul 28, 2016 10:59 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7234
Location: Chexbres, VD, Switzerland
Quote:
I suspected so, but what about the static stars and tapering roof of the tower lying within the same horizontal band of the screen? Since they are not affected, are those sprites? Surely it isn't possible to alter just the scroll position of the rectangular region containing the moon graphics.

Actually such an effect would be perfectly possible, with mid-scanline $2005 writes. But you'd be limited to 7 pixels in depth of the wave, which is not the case here. To bypass this limit a combination of $2006 and $2005 writes would be necessary, and it'd be extremely though if not impossible to get it to display without garbage, not saying no current emulators would probably support it.


Top
 Profile  
 
PostPosted: Thu Jul 28, 2016 11:20 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6294
Location: Seattle
A few years ago, Bananmos wrote a proof-of-concept that generates a pixel-perfect midscanline split.

However, it generates exactly one midscanline split, so the effect is rather subtle.


Top
 Profile  
 
PostPosted: Thu Jul 28, 2016 11:21 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5732
Location: Canada
I think my favourite part of this is how the tower and the rooftop do a vertical parallax, and it's by putting an extra slice of tower rows on the second nametable that it switches to for a few scanlines before switching back to the flat roof.

It lets the first nametable stay unchanged during the process (no moving the roof around), and it's important that the trees remain hidden as black during the transition, because they'd be sliced up by the inserted rows of tower.


Top
 Profile  
 
PostPosted: Thu Jul 28, 2016 12:24 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2963
Location: Tampere, Finland
lidnariq wrote:
A few years ago, Bananmos wrote a proof-of-concept that generates a pixel-perfect midscanline split.

However, it generates exactly one midscanline split, so the effect is rather subtle.

Have you tried it on a real NES? I actually did recently, and it's not just a single scanline that it splits. It had some glitches but still it was a pretty cool experiment. None of the emulators I tried came close to emulating it correctly.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Thu Jul 28, 2016 12:34 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6294
Location: Seattle
I did run it on a real NES, which is how I finally understood what it was supposed to do :)

I should perhaps have said "a single scroll change done with pixel precision in the middle of a scanline", since it doesn't revert on later scanlines.

(I would have taken a picture and posted it in that thread, if I had had a flashcart with more than the 1 KiB that my m218 one does)


Top
 Profile  
 
PostPosted: Thu Jul 28, 2016 1:46 pm 
Offline
User avatar

Joined: Sun Jun 05, 2016 1:41 pm
Posts: 74
rainwarrior wrote:
I think my favourite part of this is how the tower and the rooftop do a vertical parallax, and it's by putting an extra slice of tower rows on the second nametable that it switches to for a few scanlines before switching back to the flat roof.

It lets the first nametable stay unchanged during the process (no moving the roof around), and it's important that the trees remain hidden as black during the transition, because they'd be sliced up by the inserted rows of tower.


At first I was wondering why the copying of rows was needed.. thinking that it would suffice to have a static background name table and a static foreground one that is simply scrolled in with a moving IRQ counter split.. then I realised that before the flat roof pans up, the tower already occupies a whole nametable in height. I think I understand the trick now.. presumably the extra tower rows are held in the invisible bottom part of the flat roof nametable with a split done twice.

It makes one truly appreciate the resourcefulness of 8 bit game programmers of the time! :)

_________________
Tile IDE and tile engine for XNA: http://tide.codeplex.com/
Fancy Fish Mod - Minecraft Mod: http://fancyfishmod.weebly.com/


Top
 Profile  
 
PostPosted: Thu Jul 28, 2016 1:53 pm 
Offline
User avatar

Joined: Sun Jun 05, 2016 1:41 pm
Posts: 74
lidnariq wrote:
I did run it on a real NES, which is how I finally understood what it was supposed to do :)

I should perhaps have said "a single scroll change done with pixel precision in the middle of a scanline", since it doesn't revert on later scanlines.

(I would have taken a picture and posted it in that thread, if I had had a flashcart with more than the 1 KiB that my m218 one does)


So essentially its impossible to do a vertical split on several scanlines then (leaving aside MMC5 for the moment).

On a related note, there is a test rom (scanline.nes) that tests PPU-CPU timing precision by hiding a column of asterixes on the right quarter of the screen by turning the PPU off and on at specific intervals dictated by CPU cycles. This seems to flicker slightly even on the best emulators and I'm thinking having a second nametable rendered in a vertical split would not work well due to the fetch cycles required. I believe the ROM in question is here: https://github.com/christopherpow/nes-test-roms/blob/master/scanline/scanline.nes

_________________
Tile IDE and tile engine for XNA: http://tide.codeplex.com/
Fancy Fish Mod - Minecraft Mod: http://fancyfishmod.weebly.com/


Top
 Profile  
 
PostPosted: Thu Jul 28, 2016 1:56 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5732
Location: Canada
colinvella wrote:
At first I was wondering why the copying of rows was needed.. thinking that it would suffice to have a static background name table and a static foreground one that is simply scrolled in with a moving IRQ counter split.. then I realised that before the flat roof pans up, the tower already occupies a whole nametable in height. I think I understand the trick now.. presumably the extra tower rows are held in the invisible bottom part of the flat roof nametable with a split done twice.

It's on the second nametable. There's no use of "invisible" parts of the screen, this intro remains perfectly fine if you show the top and bottom 8 pixels.

When the pan stops and the extra tower segment is no longer needed, the second nametable is then filled with the demon face instead.


Attachments:
fceux_nametable_boku_tower.jpg
fceux_nametable_boku_tower.jpg [ 65.8 KiB | Viewed 2069 times ]
Top
 Profile  
 
PostPosted: Thu Jul 28, 2016 2:06 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6294
Location: Seattle
colinvella wrote:
So essentially its impossible to do a vertical split on several scanlines then (leaving aside MMC5 for the moment).
Hmmm. Impossible? I dunno, it seems like once you've got one perfect cycle-timed mid-scanline split, putting a few more with constant relative spacing should be doable. As long as you have enough time to load and store all of the new values to the scrolling registers, or ≈28cy=84pixels.

Impractical? Yeah.


Top
 Profile  
 
PostPosted: Wed Aug 03, 2016 7:30 pm 
Offline
User avatar

Joined: Sat Jul 12, 2014 3:04 pm
Posts: 936
lidnariq wrote:
colinvella wrote:
So essentially its impossible to do a vertical split on several scanlines then (leaving aside MMC5 for the moment).
Hmmm. Impossible? I dunno, it seems like once you've got one perfect cycle-timed mid-scanline split, putting a few more with constant relative spacing should be doable. As long as you have enough time to load and store all of the new values to the scrolling registers, or ≈28cy=84pixels.

Impractical? Yeah.

341 px per scanline modulo 3 = 2. So, you wouldn't be able to line them up perfectly.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 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