Parallax Scrolling (4.5)

PasseGaming

Active member
I know the concept is probably far more advanced then my skill level at the moment... or if the NES maker could even support it, but has anyone tired any parallax scrolling effects yet in any of their side-scrolling games?
 

CutterCross

Active member
I've done it using Dale's palette cycling routines in Project DART, but I didn't have nametable updates when moving the PPU window in that game. And the effect is really only comprehensible at slower speeds, though the effect at fast speed is better seen on a CRT display from my experience.

View: https://www.youtube.com/watch?v=iEySlJH-TJ0
View: https://www.youtube.com/watch?v=lK8cWAAn9xg&t=1s

Mugi's Dimension Shift uses DMC IRQ to create extra background scrolling splits for parallax, but that requires advanced trickery and NES hardware knowledge, especially if you're still a beginner with NESmaker and programming in general. I find it hard to even call Dimension Shift a NESmaker game at this point tbh.

You can also use a Sprite-0 split to create parallax near the top of the screen if you don't use a background HUD. Or even just use sprites to create a parallax effect.

Though again, if you are very new to NESmaker and NES hardware in general, I wouldn't recommend trying to be fancy with parallax effects just yet.
 
Last edited:

PasseGaming

Active member
Thanks for the quick answer, I was more or less just curious if it could be done within the confines of the tool itself. While I've been messing with the tool for 6 months or so I am probably a intermediate at best with it. Coding-wise I'd am very much a beginner. I can understand some of the code I am looking at and even write some really basic stuff but that's about it. I have a very long way to go. Something to work towards!
 

TakuikaNinja

Active member
I did get sprite 0 parallax to work, but it's currently limited to making the top portion of the screen not scroll at all. (I'll post a video demonstration later.)
At the moment, I have to repeat the parallax graphic on each screen since the nametable data gets overwritten after scrolling a certain amount. If I can figure out how to prevent this, it would restore the old HUD functionality as well. (who would wanna use that over the sprite HUD though?)
 

CutterCross

Active member
TakuikaNinja said:
I did get sprite 0 parallax to work, but it's currently limited to making the top portion of the screen not scroll at all. (I'll post a video demonstration later.)

You can control the scroll speed of the top portion of the screen (before the split) and the bottom portion of the screen (after the split). Basically if you want to make the top portion move while the bottom portion stays static (for example), write the updated X/Y scroll positions to $2005 before the WaitNotSprite0 stuff, then for the bottom portion keep the X/Y scroll positions #$00 when writing to $2005 after the WaitNotSprite0 stuff. That's how the scrolling text is done in DART.


TakuikaNinja said:
If I can figure out how to prevent this, it would restore the old HUD functionality as well. (who would wanna use that over the sprite HUD though?)

Background HUDs are still useful depending on your situation. It all really depends on your sprite usage and positioning, as well as how much information you want to track in your HUD.
 

PasseGaming

Active member
Yeah, I think depending on the game your making. It seems with rpg's and some adventure games a traditional HUD could be a better option.
 

Mugi

Member
the definition of "can this be done inside the tool" is a bit of a hit and miss concept really.
I mean, dimenstion shift still loads in nesmaker and i do still use it for script editing and drawing screens, but vast majority of the code and functions in the game are no longer managed using nesmaker's UI.
I simply use Nesmaker as I would use any other tool for assisting in development, some people draw screens on shiru's screen tool (as do I for special screens like menus) but I just use nesmaker for stage design instead of suffering with manually writing nametables. Same goes for editing scripts, I could just use notepad for it, or whatever text editor, but since its all nicely organized in nesmaker, I just do my script editing with that instead.

as for parallax, as CutterCross said, I use it extensively and just like any other custom piece of code for any nesmaker project, a parallax can be added. Our DMC IRQ splitter is just a software scanline counter controlled in code.
the documentation for using DMC IRQ's for midframe splits is all available in nesdev wiki, https://wiki.nesdev.com/w/index.php/APU_DMC and our code is directly based on this theorem, nothing prevents anyone else from implementing it into their games.

https://www.youtube.com/watch?v=J0yg9mg-QNk
 

TakuikaNinja

Active member
CutterCross said:
You can control the scroll speed of the top portion of the screen (before the split) and the bottom portion of the screen (after the split). Basically if you want to make the top portion move while the bottom portion stays static (for example), write the updated X/Y scroll positions to $2005 before the WaitNotSprite0 stuff, then for the bottom portion keep the X/Y scroll positions #$00 when writing to $2005 after the WaitNotSprite0 stuff. That's how the scrolling text is done in DART.

I understand that you'd need to write new scroll positions before the split, but how would I go about calculating those if I wanted both "layers" to scroll? Simply adding to or subtracting from camX/camY (as defined in the code) and writing those to $2005 crashes the game after scrolling a certain amount.
 

PasseGaming

Active member
I don't think I'll be getting away from the NESmaker to do my own coding any time soon... It's been 6 months of tinkering with this tool and I only have a semi-partial understanding of some of the code I try looking at. I think this week is the most I've spent with the tool yet. Though, it's good to know I have a resource, when and if I get to the point that I can use it. Anyhow, thanks for the help!
 

TakuikaNinja

Active member
No problem. I doubt even the NESmaker team fully understands most of their code lol.
If I'm going to make a game using the sprite 0 parallax, I'll just keep it simple and use it for a static background element like a sun or moon.
After all, it's what you do with it that matters.
 

TakuikaNinja

Active member
After some more tinkering, I've finally managed to get the parallax scrolling to work! :lol:
Turns out the crashing I mentioned prior was due to me using the level geometry tiles instead of the background ones. Not a big deal.
And the scroll calculation was super easy - in this case I just used an LSR instruction to make the top part scroll at half the speed.
Here's the video as promised:
[media]https://youtu.be/5CLXfiBHyoM[/media]
So yeah, I'm definitely gonna make a byte-off entry to showcase this.
 

TakuikaNinja

Active member
It involves modifying a few scripts and setting up some stuff in nesmaker itself.
I'll share the process with y'all once I get some decent sleep - it's past 1am here lol.
 

CutterCross

Active member
You can also use Mapper#30's CHR-RAM bankswitching and some clever tile usage to create parallax if you can set it up. With this method you're limited to 4 frames of animation per tile (unless you also do some palette-swapping trickery or use both pattern tables for background graphics), as Mapper#30 only has 4 CHR-RAM banks to swap to.

View: https://www.youtube.com/watch?v=tbixFCqqTOc


Though this video also uses sprites to create an additional layer of depth.

And yes I literally just set this up today haha
 
Last edited:

Logana

Well-known member
Do you have code or can you show how to do the bank switching, this is litterly the exact thing I was trying to figure out in one of my posts
 

dale_coop

Moderator
Staff member
CutterCross said:
You can also use Mapper#30's CHR-RAM bankswitching and some clever tile usage to create parallax if you can set it up. With this method you're limited to 4 frames of animation per tile (unless you also do some palette-swapping trickery or use both pattern tables for background graphics), as Mapper#30 only has 4 CHR-RAM banks to swap to.

And yes I literally just set this up today haha

Oh, now we're all waiting for your guide "how to implement that in our NESmaker project" ;)
 

Logana

Well-known member
CutterCross said:
You can also use Mapper#30's CHR-RAM bankswitching and some clever tile usage to create parallax if you can set it up. With this method you're limited to 4 frames of animation per tile (unless you also do some palette-swapping trickery or use both pattern tables for background graphics), as Mapper#30 only has 4 CHR-RAM banks to swap to.

https://www.youtube.com/watch?v=tbixFCqqTOc

Though this video also uses sprites to create an additional layer of depth.

And yes I literally just set this up today haha
Did ya miss dales post, sorry if I’m bothering you
 
Top Bottom