Looking for issues with scrolling

Having trouble compiling code? Getting an unexpected error? Player not appearing on screen? Seeking answers on how to do a particular thing? This is the forum you're looking for, to ask other NESmaker users for assistance.
User avatar
jorotroid
Posts: 178
Joined: Wed Aug 08, 2018 7:48 pm
Location: California
Contact:

Looking for issues with scrolling

Post by jorotroid » Wed Jan 23, 2019 8:44 pm

So I've been spending my time since 4.1 released just reading through the code and taking notes with a particular focus on trying to understand how the scrolling does and doesn't work. I want to try to see if I can improve upon it, so I thought I would ask all of you for what sort of weird scrolling behavior you have seen so I can try to see if I can fix it. Here are the issues that I have observed:

-When you have both Right and Left Scrolling on, sometimes a gap will appear in the tiles when you go back in the opposite direction.
-Paths don't load properly when scrolling.
-Moving left to a new screen that has Left Scrolling enabled can lead to a variety of weird behaviors including no function left scrolling at all, as well as if you go yet another screen left you might warp to a random screen or maybe get stuck in a loop of warping to several different screens.
-There is no way to set up a group of screens as two way scrolling rooms. If the end screens only have scrolling in one direction, they you have to scroll completely to the next screen in the room before you can scroll back to the room's exit.

I think I have seen other issues, but it's difficult to determine what is causing what. So let me know what other crazy behaviors you have seen, and I will try to see if I can pin that down.


I'm thinking that what I want to do is eventually rewrite the scrolling so that there is only one flag for marking if a room is horizontally scrollable. Then scrolling will only occur if that room a room next to it are marked as scrollable. If a room is marked as scrollable, but does not neighbor a scrollable room, then no scrolling will occur.
LordFred
Posts: 14
Joined: Mon Dec 03, 2018 4:11 pm

Re: Looking for issues with scrolling

Post by LordFred » Wed Jan 23, 2019 9:32 pm

... I will pray that at least you can solve the issues that you have listed ^^P

I found all these issues using scroll... ^^ path tiles vs scroll... scrolling to the left... looping to several screens... I have experienced all those failures
User avatar
dale_coop
Posts: 2561
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Looking for issues with scrolling

Post by dale_coop » Wed Jan 23, 2019 10:42 pm

Wow, jorotroid, would be awesome of you'd fix those issues! <3
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
Mugi
Posts: 287
Joined: Thu Dec 27, 2018 8:30 pm

Re: Looking for issues with scrolling

Post by Mugi » Thu Jan 24, 2019 1:35 am

There is also the issue of collision tables going crazy when 2way scrolling is used. Usually after scrolling to the right for a couple of rooms, going back to the left causes the collision data of the first room you came from to load in your face.... Its a shit explanation, i know. Ill make a video of this if need be.
User avatar
jorotroid
Posts: 178
Joined: Wed Aug 08, 2018 7:48 pm
Location: California
Contact:

Re: Looking for issues with scrolling

Post by jorotroid » Thu Jan 24, 2019 8:59 am

dale_coop wrote:
Wed Jan 23, 2019 10:42 pm
Wow, jorotroid, would be awesome of you'd fix those issues! <3
I'm making no promises at this point, of course, but I am feeling confident enough to give it a try.

Mugi wrote:
Thu Jan 24, 2019 1:35 am
There is also the issue of collision tables going crazy when 2way scrolling is used. Usually after scrolling to the right for a couple of rooms, going back to the left causes the collision data of the first room you came from to load in your face.... Its a shit explanation, i know. Ill make a video of this if need be.
Thanks, I haven't noticed that, but most of my tests have been with simple screen designs. I try paying more attention to the collisions.
User avatar
dale_coop
Posts: 2561
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Looking for issues with scrolling

Post by dale_coop » Thu Jan 24, 2019 9:23 am

Soemthing "funny" (I am not sure if the right term but)... even when you make a non scrolling game, you have this weird effect during the transition between 2 screens (because of the scrolling code).
Let's say I have screen A <-> B <-> C (in a screen--by-screen game, platformer or adventure... )
When the player moves from A to B... during the transition time, we can see the C appearing (loading), during a fraction of second!
Of course, same when the player moves from C to B... during the transition time, we can see the A displaying briefly :S

It's quite ugly. And surely a source of (collision) issues, visual glitchs, ...
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE
User avatar
Mugi
Posts: 287
Joined: Thu Dec 27, 2018 8:30 pm

Re: Looking for issues with scrolling

Post by Mugi » Thu Jan 24, 2019 2:30 pm

I recorded a clip about what i was trying to explain, though i noticed that the behavior here is a little different than it was on my previous test (could be related to the fact that the left room here is screen 0,0 which means that scrolling to the left is impossible in that room)

regardless, in here you can see that specifically, the left edge of the leftmost room spawns to the left edge of the rightmost room when you attempt to return to the middle room from the right room. It seems like it's simply reloading the collision tables incorrectly. The seam between the rooms also indicates that room 1 is loaded instead of room 2 (pay attention to the random log graphic on the top left corner of the left room, which spawns to the top left corner of the right room when attempting to scroll back to left.)

anyway, the whole deal with showing the collision data and the log that is on the ground which i removed on the second pass, is that in my previous attempt, what happened was that instead of the first room's edge spawning into your face like happens in this video, only the actual collision data of the room was there. so the log would be there, where i get stuck on invisible something while walking, it would be the log, and since it's just one block high, jumping over it or walking on top of it would work just fine.

overall it really seems like it's some kind of oversight in the way the collision tables are loaded/reloaded and stored.
Or it could simply be related to the fact that since Joe said that the engine stores data for 2 screens at a time, and is only meant for one way scrolling, that it just doesnt really know what to do, and having to try and re-read the whole room data instead of having stored tables to deal with just ends up doing all sort of weird shit (propably due to the fact that the vblank is too short for the engine to fully reload the room before you move far enough in it.)

if the video looks like blurry shit, set it to 1080p


it is also worth a note that the object's placement data is slightly off. (pay attention to the animated cross on screen 3 during scroll.)

EDIT: also, this sometimes happen when going back and forth left and right.

Image
For the sake of clarification, the palettes in the screens are as follows:

palette 1: red/orange/yellow (not used on any screen/object.)
palette 2: light green/dark green/ dark cyan (grass/leaves/forest backdrop)
palette 3: light brown/orange/brown (stones/tree trunk)
palette 4: 3 shades of cyan (warp crystal/ health platform)

the glitched stripe of red palette there is not actually used for anything in these screens, so something messes up when loading the data for the screens.
User avatar
Mugi
Posts: 287
Joined: Thu Dec 27, 2018 8:30 pm

Re: Looking for issues with scrolling

Post by Mugi » Mon Feb 11, 2019 11:54 am

there's also this, which i dont really know if it's a result of my own f-uppery with the code or not, but atleast for me, this has been there since the start (you generally dont notice this because mostly people have a HUD at the top of the screen.)
but when scrolling, the second screen omits the first row of tiles when drawing, leaving in a blank black gap to the screen. (this exists everywhere but for example, you cant see it on my stage selection because the screen is black by design. It actually draws the top left metatile of the currently loaded tileset into that blank space.)

for reference, the only thing i've done to the scrolling code so far was disabling the sprite zero draw from pre-draw.asm (use sprite zero is unticked in screen info for all screens.)

User avatar
jorotroid
Posts: 178
Joined: Wed Aug 08, 2018 7:48 pm
Location: California
Contact:

Re: Looking for issues with scrolling

Post by jorotroid » Mon Feb 11, 2019 12:56 pm

Mugi wrote:
Mon Feb 11, 2019 11:54 am
there's also this, which i dont really know if it's a result of my own f-uppery with the code or not, but atleast for me, this has been there since the start (you generally dont notice this because mostly people have a HUD at the top of the screen.)
but when scrolling, the second screen omits the first row of tiles when drawing, leaving in a blank black gap to the screen. (this exists everywhere but for example, you cant see it on my stage selection because the screen is black by design. It actually draws the top left metatile of the currently loaded tileset into that blank space.)

for reference, the only thing i've done to the scrolling code so far was disabling the sprite zero draw from pre-draw.asm (use sprite zero is unticked in screen info for all screens.)
Thanks, I'll watch out for that, too. I think I may have already fixed that. I guess I might as well give an update on my progress. I've definitely made progress, but as I fix one thing, I tend to break another. What this will probably all lead to is a custom core devoted to horizontally scrolling games. I have changed how the flags work with the assumption that you want scrolling by default. So now you can turn on a left or right flag to mark whether or not a screen is and end of scrolling screen. If you want a screen to not scroll, you just turn on both flags. I have also somewhat fixed the screen wrapping problem that had you go to the wrong screen when you hit a screen edge, but I have also since created new warping problems trying to fix other things.

With all that said, if I don't make some significant progress in say the next 5 days or so, I'll probably have to shelve this to focus on the competition. At this point I remain optimistic.
User avatar
Mugi
Posts: 287
Joined: Thu Dec 27, 2018 8:30 pm

Re: Looking for issues with scrolling

Post by Mugi » Mon Feb 11, 2019 1:03 pm

im just gonna let you know that regardless of the outcome of this, i'd kill to get my hands on your code regardless.
Post Reply