Enchanted Land parallax scroll

All about ST/STE games

Moderators: simonsunnyboy, Mug UK, ICS, Doctor Bob Gordon, Moderator Team

User avatar
Foxie
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 102
Joined: Wed Feb 03, 2016 7:12 pm

Enchanted Land parallax scroll

Postby Foxie » Fri Jan 12, 2018 5:38 pm

Apologies if this has been brought up already. Couldn't find any hard details with search.

How on earth did they do the parallax scrolling on the intro screen of Enchanted Land? Are they just brute-forcing it with a software blitter?

I can't see how you can do parallax scrolling with sync scroll without resorting to tricks like a single-plane background or palette cycling. Enchanted Land does neither.

Why don't they use the same technique in the game? I can only guess it must be a very dirty trick.

Also it works in all wakestates. Isn't that unusual for 1990? Are they just using a very conservative sync scroll that works every time? I don't think they knew how to detect all four wakestates in 1990?

User avatar
troed
Atari God
Atari God
Posts: 1276
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Enchanted Land parallax scroll

Postby troed » Fri Jan 12, 2018 5:50 pm

Foxie wrote:Also it works in all wakestates. Isn't that unusual for 1990? Are they just using a very conservative sync scroll that works every time? I don't think they knew how to detect all four wakestates in 1990?


It's _very_ conservative. It needs 20 scanlines, and uses only right overscan, right+left overscan and normal line (i.e, 3 combinations). They left out left overscan completely, likely because they couldn't stabilize the Shifter for the following non-overscan screen.

Enchanted Lands was thus more conservative than SoWatt which used 4 different lines (I don't think I've verified Cuddly, but it likely also uses 4).

A modern sync scroll, which needs to know about wakestates, has 12 possible line lengths and only needs 4 scanlines to reach all scroll positions.

User avatar
Foxie
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 102
Joined: Wed Feb 03, 2016 7:12 pm

Re: Enchanted Land parallax scroll

Postby Foxie » Fri Jan 12, 2018 9:23 pm

troed wrote:It's _very_ conservative. It needs 20 scanlines, and uses only right overscan, right+left overscan and normal line (i.e, 3 combinations). They left out left overscan completely, likely because they couldn't stabilize the Shifter for the following non-overscan screen.


Interesting, thanks for the info. I don't think I understand entirely about stabilising the shifter. Of course I've seen stabilisation code in overscans before. I don't really know how that would interact with a non-overscanned line following.


troed wrote:A modern sync scroll, which needs to know about wakestates, has 12 possible line lengths and only needs 4 scanlines to reach all scroll positions.


I saw the slides you made describing that technique. Very impressive. ^.^

Do shifter wakestates come into this at all? I don't know much about wakestates really. From what I understand, shifter wakestate not GLUE-MMU is responsible for the Spectrum 512 dots? Can it ever affect scroll/overscan too?

User avatar
alien
Atari maniac
Atari maniac
Posts: 86
Joined: Sat May 01, 2004 4:01 am
Location: USA
Contact:

Re: Enchanted Land parallax scroll

Postby alien » Sat Jan 13, 2018 4:21 am

An amusing fact for Troed: If I recall correctly, they actually had adaptive code to vary the timing of the the resolution/frequency switches around, just in case there was an Atari out there that had different timings. They read the video counter to see whether the desired line lengths had been obtained. Of course that wouldn't help with the stabilizers. I think at that time, it was still all "magic" because we didn't understand what was happening inside the video chips.
Alien / ST-Connexion

mlynn1974
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 136
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: Enchanted Land parallax scroll

Postby mlynn1974 » Sun Jan 14, 2018 1:55 pm

I never quite understood sync scroller. Paul from DigiTech and Neil from Flair tried to explain it to me, but I didn't quite understand it fully at the time (1991). There is also the fairly well documented sync scroller in the source code for the main menu of the Mindbomb demo. That's good.

I would expect the sync scroller in Enchanted Lands to be conservative and "safe" because it was a commercial product and they could only test it on a limited number of mmu\shifter combinations at the time.

In Enchanted Lands yes sync scrolling is amazing but they must still be blitting a heck of a lot for the overlaid message in the middle, the sprites and some of the layers.

One thing I don't get is that some people say that Grodan and the Kvack Kvack in the So Watt demo also used a sync scroller but when I ripped the graphics from it using Ultimate Ripper the screen line lengths weren't variable and the graphics could be ripped in normal video mode without stabilizers.

Sync scrolling is an amazing technique but even as a programmer I found it convoluted and not well documented.
Still got, still working: Atari 4Mb STe, 520STFM, 2.5Mb STF.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).

User avatar
troed
Atari God
Atari God
Posts: 1276
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Enchanted Land parallax scroll

Postby troed » Sun Jan 14, 2018 3:24 pm

mlynn1974 wrote:I never quite understood sync scroller.


Hopefully (?) my little chapter on the subject in the Breakin' the Borders book helps a few more to understand how it works, even though I was pressed for space :)

Mostly what was important for Enchanted Lands was that the following scanlines were non fullscreen. That means any issue with left over words in the Shifter ("non stabilized") would affect the whole screen. Most sync scrollers are otherwise fullscreens where every line has its own stabilizer.

(I know this was a HUGE pain for me when I did the LoSTE demo, which additionally used a very advanced 1+3 line sync scroller)

alien wrote:An amusing fact for Troed: If I recall correctly, they actually had adaptive code to vary the timing of the the resolution/frequency switches around, just in case there was an Atari out there that had different timings. They read the video counter to see whether the desired line lengths had been obtained.


Thanks, yes, that piece of code has actually been studied in detail since it ... doesn't work :D By mistake when hunting for the left border position they trigger a "full" scanline by skipping hsync and since they obviously realized that wasn't the correct position they then add an empirically tested number of cycles ;)

From my studies of the "tv-snow" screen in SNYD1 I'm guessing Nick had a computer which mostly booted in WS2 (that's why the disting logo is only centered in that wakestate, it's off center in the others). WS2 is one nop off compared to the others for the left border so he probably assumed that position couldn't be relied upon always being the same between computers.

User avatar
Foxie
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 102
Joined: Wed Feb 03, 2016 7:12 pm

Re: Enchanted Land parallax scroll

Postby Foxie » Mon Jan 22, 2018 12:08 am

I suppose that nobody knows how the parallax scroll on the title screen was achieved then?

I'd be fascinated to know how they did it, because it would seem to be impossible. Surely they don't have enough cycles to completely re-draw the foreground layer while sync scrolling the background? The foreground sometimes covers the entire screen, so that's a whole lot of copying.

Some games like James Pond II on the Amiga draw their parallax background on only a single plane to make it fast enough. But Enchanted Land doesn't do this - it looks like 16 colours in both foreground and background.

joska
Hardware Guru
Hardware Guru
Posts: 3751
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Enchanted Land parallax scroll

Postby joska » Mon Jan 22, 2018 9:39 am

I had a look at the intro now, and from what I can see only about 1/3 of the screen is parallax scolling. And the background looks like 2 bitplanes only. I believe they're syncscrolling the screen and redrawing the background. I'm not very familiar with syncscrolling - can you sync-scroll only parts of the screen? Because I noticed that the credits seems to be displayed in the two bitplanes not used by the background, and whenever there are credits on the screen there is no scrolling foreground in the same area. So it looks like only the part below the credits is scrolled.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
Foxie
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 102
Joined: Wed Feb 03, 2016 7:12 pm

Re: Enchanted Land parallax scroll

Postby Foxie » Mon Jan 22, 2018 7:20 pm

joska wrote:I had a look at the intro now, and from what I can see only about 1/3 of the screen is parallax scolling. And the background looks like 2 bitplanes only. I believe they're syncscrolling the screen and redrawing the background. I'm not very familiar with syncscrolling - can you sync-scroll only parts of the screen?


I don't think it's possible to scroll only part of the screen, but I'm no expert on sync scrolling. AFAIK there's no way to reload the video address counter mid-frame, which is a shame because that precludes lots of effects. It would be wonderful if someone figured out a way of doing that. I think that latch is wired directly to the vsync signal, so you'd need some way of generating a false vsync mid-frame. I wonder if the 68k's reset instruction could be abused to force an MMU/glue/shifter reset mid-screen?

I've no idea how full-screen distorters work if they can't change the scrolling on each scanline. I've heard they use lots of different screens but I'm struggling to understand how that helps.

I suppose the Enchanted Land background could be two planes. The foreground looks like more though - all four? That means they can't "own" the two background planes like James Pond II does with its background plane. So they must be cleverly masking it when redrawing to avoid overwriting the foreground. I'm amazed that's even possible at 50fps!

Also there's some per-line scrolling on the floor. It might be possible to scroll 0, 4, 8, or 12 pixels on each line by switching to medium res? I'm not entirely sure. The "big" scrolling AFAIK can only be done at the top of the screen since it takes many scanlines to advance the video address counter to the desired position. I think Troed's method uses only four scanlines, but that's still four scanlines too many to do mid-screen (unless you cleverly arranged it with a break in the screen I suppose).

Come to think of it, perhaps you could put a sync-scroll mid-screen, and then cover up the four lines of artifacts by just blitting those lines.

The two weirdest things about Enchanted Land are that the parallax scroll doesn't happen in the game itself, and they didn't go fullscreen. Actually I can forgive them for not going full screen horizontally because of the need to write a blitter routine that's synced. But they could have easily gone vertical which would have looked nice.

joska
Hardware Guru
Hardware Guru
Posts: 3751
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Enchanted Land parallax scroll

Postby joska » Mon Jan 22, 2018 8:43 pm

I suspect a lot of precalculation. That would work fine with the intro but not in the game where the playfield is a lot bigger.
Jo Even

Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

thomas3
Atari User
Atari User
Posts: 31
Joined: Tue Apr 11, 2017 8:57 pm

Re: Enchanted Land parallax scroll

Postby thomas3 » Mon Jan 22, 2018 10:37 pm

I seem to remember hearing somewhere that they used a four plane version of the background graphics when the text isn't displayed, but drop down to 2pl when it is.

fenarinarsa
Atari User
Atari User
Posts: 41
Joined: Sat Mar 15, 2014 11:23 pm

Re: Enchanted Land parallax scroll

Postby fenarinarsa » Tue Jan 23, 2018 12:40 am

First of all Enchanted Lands works on plain STF so you can forget about using the blitter and changing the video address counter mid screen since it's possible only on the STE.

So it's all software.

During the game it obviously uses the syncscroll technique. Syncscroll is mostly used to achieve vertical scrolling of the whole screen, you can't use it mid screen without displaying distorted or black lines. In addition as troed said, in EL it needs 20 scanlines to achieve the effect, so you would have 20 distorted or black lines in the middle of the screen. It's useless for the intro screen.

IMO it's only preshift and lots of bitplanes tricks. The background seems to be a looping 1 pixel scroll in 2 bitplanes 320 pixels wide so I guess it's preshifted 16x (on Amiga it's 4 bitplanes, no need to preshift). For the foreground I'm not so sure, it looks like it's a 4 bits scrolling from the timing, so maybe it's tiles that are preshifted 2x and then uses movep to add 8 bit shift or something like that? I'm sure some people had already checked the code...

What you can see clearly anyway is that the foreground is not used when text appear, so they use the same bitplanes/"layer".

User avatar
Foxie
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 102
Joined: Wed Feb 03, 2016 7:12 pm

Re: Enchanted Land parallax scroll

Postby Foxie » Tue Jan 23, 2018 2:02 am

fenarinarsa wrote:Syncscroll is mostly used to achieve vertical scrolling of the whole screen, you can't use it mid screen without displaying distorted or black lines. In addition as troed said, in EL it needs 20 scanlines to achieve the effect, so you would have 20 distorted or black lines in the middle of the screen. It's useless for the intro screen.


I'm pretty sure the entire screen is scrolling using sync scroll even on the intro screen. I've heard it said that there's insufficient time to redraw the entire four bitplanes at 50fps. Although doing a rough calculation, it looks like you can move about 40KB per frame with movem which might be enough.

They must at a minimum be redrawing the background only, or the foreground only. The foreground looks like four planes, and it covers the entire screen at one point. So I'm not sure if they're drawing that in software. But the background could be. Two planes plus complex masking is a lot to ask for.

I don't see why you couldn't do a sync scroll mid-screen, it's just that you'd need to blit over the distorted lines. Since the distortion is absolutely predictable, you could adjust your blitting positions so it appears in the right place on-screen. But of course that only gives you control over the low 8 bits of the video counter. The others are only latched during vsync.

I did notice that the floor pattern is a short repeating pattern, so they might be able to live with only a small amount of shift for that. From what I understand of sync scroll, to go down to 4 pixel resolution you need to switch into medium resolution briefly. Does this need to be done at the start of the screen? Or every single scanline? I'm thinking they might use this trick on each scanline to get a small displacement of each line?


Social Media

     

Return to “Games - General”

Who is online

Users browsing this forum: Frank B and 2 guests