Page 1 of 3

'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Wed Dec 06, 2017 11:00 pm
by 5MinuteRetro
I can't imagine that this will ring bells with many if anyone here but back in the day I remember reading a quote in some magazine article from the programmer of the ZX Spectrum version of Ghosts 'n' Goblins that boasted of the 'dixel' scrolling technique he'd employed, which was his invented term for side-scroll system that shifted the screen two pixels at a time,

Despite Googling and plenty of manual perusal of magazine PDFs, I've never managed to find this reference. Now, at an increasingly ripe age, I'm beginning to wonder if I Imagined it.

Anyone?

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Wed Dec 06, 2017 11:02 pm
by Wall_Axe
i've always wondered how that game was made

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Wed Dec 06, 2017 11:57 pm
by 5MinuteRetro
Wall_Axe wrote: Wed Dec 06, 2017 11:02 pm i've always wondered how that game was made
I consider it a great conversion, for sure. No idea why this 'dixel' reference has stayed with me for 30+ years but it has, and I'd love to track it down. Almost certainly in Crash, YS or Sinclair User, as those were the mags I used to devour, but I'll be buggered if I can find it.

(And if anyone *does* find it, they'll be award a private-messaged clue to this week's Friday Night Quiz. Which, incidentally, is going to be *hard*...)

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Thu Dec 07, 2017 12:17 am
by ZXDunny
The word "Dixel" is indeed a thing and does mean a two-pixel scroll. I never heard of it in the context of the aforesaid game, but it does crop up in a type-in on page 74 of issue 19 of Your Sinclair.

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Thu Dec 07, 2017 8:40 am
by Joefish
I think the name was meant as a joke - 'Dixcel' was a well-known brand of toilet paper at the time.

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Thu Dec 07, 2017 9:11 am
by 5MinuteRetro
ZXDunny wrote: Thu Dec 07, 2017 12:17 am The word "Dixel" is indeed a thing and does mean a two-pixel scroll. I never heard of it in the context of the aforesaid game, but it does crop up in a type-in on page 74 of issue 19 of Your Sinclair.
Hmm... I suppose it's possible that my addled mind got it mixed up and it wasn't in relation to GnG at all, but I'm convinced that it was -- so my hunt continues! But... I'd be interested to see this reference. Where does one view YS back issues now that the once-glorious YSRNRY website is no more?

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Thu Dec 07, 2017 9:12 am
by 5MinuteRetro
Joefish wrote: Thu Dec 07, 2017 8:40 am I think the name was meant as a joke - 'Dixcel' was a well-known brand of toilet paper at the time.
Hah -- you might well be right, and I'll confess that back then the reference was obviously lost on me!

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Thu Dec 07, 2017 9:39 am
by ZXDunny
5MinuteRetro wrote: Thu Dec 07, 2017 9:11 am
ZXDunny wrote: Thu Dec 07, 2017 12:17 am The word "Dixel" is indeed a thing and does mean a two-pixel scroll. I never heard of it in the context of the aforesaid game, but it does crop up in a type-in on page 74 of issue 19 of Your Sinclair.
Hmm... I suppose it's possible that my addled mind got it mixed up and it wasn't in relation to GnG at all, but I'm convinced that it was -- so my hunt continues! But... I'd be interested to see this reference. Where does one view YS back issues now that the once-glorious YSRNRY website is no more?
http://live.worldofspectrum.org/infosee ... lair/19#76

Second column, near the bottom.

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Thu Dec 07, 2017 9:41 am
by 5MinuteRetro
Well... I dunno what changed overnight (apart, perhaps, from being not quite so tired) but by simple dint of this morning putting my "dixel scroll" search term in double quotes narrowed down the results to just three, and I instantly found what I wanted. I'm hardly a computing n00b, so I dunno why it hadn't occurred to me to do that before!

But anyway, for anyone else who might be interested here it is -- on page 37 of the June 1986 edition of YS: https://archive.org/stream/YourSinclair ... 7/mode/2up

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Thu Dec 07, 2017 2:55 pm
by Joefish
Cobra scrolls two pixels at a time as well. That's done by re-drawing the screen every time from pre-shifted blocks, rather than rotating the pixels that make up the screen.
The trick there is having a small number of scenery blocks, and further limiting which block you can place next to another block, because what you're really pre-shifting is the transitions from one block to another, and the number of those can get out of hand if you're not careful.

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Thu Dec 07, 2017 5:23 pm
by 5MinuteRetro
Joefish wrote: Thu Dec 07, 2017 2:55 pm Cobra scrolls two pixels at a time as well. That's done by re-drawing the screen every time from pre-shifted blocks, rather than rotating the pixels that make up the screen.
The trick there is having a small number of scenery blocks, and further limiting which block you can place next to another block, because what you're really pre-shifting is the transitions from one block to another, and the number of those can get out of hand if you're not careful.
I really have no idea what any of that means. Good games both, though! :shock:

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Thu Dec 07, 2017 6:17 pm
by ZXDunny
Pre-shifting offloads much of the work in a scrolling game to outside of the game loop. For example:

You are scrolling from right to left. You draw a column of blocks at the right hand edge of the screen, and then you literally process every single byte in the display - rotating the bits in each byte to the right by one place, copying the leftmost bit into the next block to the left etc. After you've done this 8 times (6144 bytes each time for a full screen) you draw another column of blocks to the right. Rinse, repeat - you're scrolling the screen.

It's damned slow. How to speed it up? Well, your screen is likely to be mostly full of empty space. No need to scroll those. And it's made of blocks that you're drawing at the right hand edge, yeah? Well, if you store 8 copies of each block, each rotated one place, then instead of wasting time rotating the screen bytes, you instead just draw the blocks you want at the positions you want, choosing an already-scrolled version instead.

bingo, a much faster scroll. Downside is 8x the memory usage (at best, more if blocks can sit next to one another) as those pre-rotated blocks have to be stored somewhere. But with careful and clever planning, you're good.

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Thu Dec 07, 2017 6:25 pm
by Joefish
Not quite. First split your scenery map up into 16x16 pixel blocks.

Now, imagine the Speccy screen was just one tiny 16x16 pixel window view of the level. At any one moment you'd only be able to see one scenery block scrolling out to the left as another scrolls in from the right. You'd be watching a sort of animation as one block slides out to be replaced by another. By pre-drawing a series of these animations you could display any part of the level going past at any time (within that one-block-sized window). There'd be various different versions of this animation as different blocks scroll out to be replaced by others. But by careful level design, you could keep the different combinations down to a minimum.

Now imagine the Speccy screen as a 16x12 fixed grid of 16x16 pixel blocks. By displaying one of these animations in each block, you could create the look that the whole level is scrolling past.

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Thu Dec 07, 2017 8:19 pm
by Seven.FFF
This is things in the foreground moving horizontally, rather than the entire background - but you can get pretty fast and furious, and deal with different speeds, when you scroll preshifted stuff. As long as you have the space to store all the different versions. I've gone 128K-only here for that reason!

Image

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Thu Dec 07, 2017 8:41 pm
by Ralf
A good example of game with efficient scroll engine is Stormlord. It's better engine than Ghosts'n'Goblins or Cobra as it allows much more variety of graphics.

I made a post about it on old WOS but i may repeat it here.

So the scroll is by 2 pixels and framerate is 25 fps. you have 16x16 pixel tiles, each in 4 versions, shifted by 0,2,4 and 6 pixels.

The trick is assuming that some tiles may touch only selected another tiles so you have for example

- brick wall touching another brick wall
- edge of brick wall touching empty space
- left part of mushroom touching middle part of mushroom and so on

In shifted tiles we have a part of original tile and a part of neigbour tile. You don't have to combine them by OR, XOR or whatever. You just copy it directly from memory to screen.

A bonus to such approach is that you don't have to draw empty tiles. While everything moves "edge tiles" (edges of walls and other objects) which include some empty space effectively clear everything behind them. Maybe one day I'll make a screen about it as it may be hard to imagine from verbal description but it works (if there is enough empty space as scrolling totally filled screen would be too much for 25 fps).

-----------------------------
On the other hand we have Ghosts'n'Goblins. I'm probably in minority but I consider it to be a bad port :twisted: It''s smooth but that's all. It's very simplistic, with few tiles, ugly graphics, tiny sprites, few levels compared to arcade and crazy difficulty.

I respect the author (Keith Burkill) of course. He wrote Commando as well which is simply splendid without discussion.

As for the Ghosts'n'Goblins engine, I inspected the game code a bit once and would say there isn't any :lol: Really. For me engine is something reusable that you can use for another game. Here everything is hardcoded, data mixed with code all the time. There aren't any tiles or maybe there are tiles of different width and height. There is different code to scroll graves, different to scroll ground, different to scroll trees, platforms and so on. Totally crazy code that devil himself wouldn't understand. :)

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Thu Dec 07, 2017 8:42 pm
by R-Tape
Robin, please remember this is a Spectrum forum. We'd appreciate it if you post your Atari 2600 vids elsewhere.

Thankyou.

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Thu Dec 07, 2017 8:51 pm
by Seven.FFF
R-Tape wrote: Thu Dec 07, 2017 8:42 pm Robin, please remember this is a Spectrum forum. We'd appreciate it if you post your Atari 2600 vids elsewhere.

Thankyou.
LOL!

The really, really annoying thing is that Mark Turmell did it all on the woody with 128 bytes of RAM and 4 KB of ROM :((((

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Thu Dec 07, 2017 9:27 pm
by R-Tape
Ralf wrote: Thu Dec 07, 2017 8:41 pm As for the Ghosts'n'Goblins engine, I inspected the game code a bit once and would say there isn't any :lol: Really. For me engine is something reusable that you can use for another game. Here everything is hardcoded, data mixed with code all the time. There aren't any tiles or maybe there are tiles of different width and height. There is different code to scroll graves, different to scroll ground, different to scroll trees, platforms and so on. Totally crazy code that devil himself wouldn't understand. :)
I never investigated the code but I was impressed by the GnG scroller, it does a lot of ~detailed graphics quickly and smoothly over a large area. I guess ^that^ would explain it, lots of designed for purpose routines that are horrible to unravel but do one job well.

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Thu Dec 07, 2017 10:02 pm
by 5MinuteRetro
Ralf wrote: Thu Dec 07, 2017 8:41 pm A good example of game with efficient scroll engine is Stormlord. It's better engine than Ghosts'n'Goblins or Cobra as it allows much more variety of graphics.

I made a post about it on old WOS but i may repeat it here.

So the scroll is by 2 pixels and framerate is 25 fps. you have 16x16 pixel tiles, each in 4 versions, shifted by 0,2,4 and 6 pixels.

The trick is assuming that some tiles may touch only selected another tiles so you have for example

- brick wall touching another brick wall
- edge of brick wall touching empty space
- left part of mushroom touching middle part of mushroom and so on

In shifted tiles we have a part of original tile and a part of neigbour tile. You don't have to combine them by OR, XOR or whatever. You just copy it directly from memory to screen.

A bonus to such approach is that you don't have to draw empty tiles. While everything moves "edge tiles" (edges of walls and other objects) which include some empty space effectively clear everything behind them. Maybe one day I'll make a screen about it as it may be hard to imagine from verbal description but it works (if there is enough empty space as scrolling totally filled screen would be too much for 25 fps).

-----------------------------
On the other hand we have Ghosts'n'Goblins. I'm probably in minority but I consider it to be a bad port :twisted: It''s smooth but that's all. It's very simplistic, with few tiles, ugly graphics, tiny sprites, few levels compared to arcade and crazy difficulty.

I respect the author (Keith Burkill) of course. He wrote Commando as well which is simply splendid without discussion.

As for the Ghosts'n'Goblins engine, I inspected the game code a bit once and would say there isn't any :lol: Really. For me engine is something reusable that you can use for another game. Here everything is hardcoded, data mixed with code all the time. There aren't any tiles or maybe there are tiles of different width and height. There is different code to scroll graves, different to scroll ground, different to scroll trees, platforms and so on. Totally crazy code that devil himself wouldn't understand. :)
I read it. Read it again. And read it again. And I still don't really geddit. I really appreciate all the effort here but I suspect the only way I'd ever understand all this stuff is with an animation of some sort. Either way, all this shifting sounds like immensely hard, complicated work!

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Thu Dec 07, 2017 10:10 pm
by 5MinuteRetro
Joefish wrote: Thu Dec 07, 2017 6:25 pm Not quite. First split your scenery map up into 16x16 pixel blocks.

Now, imagine the Speccy screen was just one tiny 16x16 pixel window view of the level. At any one moment you'd only be able to see one scenery block scrolling out to the left as another scrolls in from the right. You'd be watching a sort of animation as one block slides out to be replaced by another. By pre-drawing a series of these animations you could display any part of the level going past at any time (within that one-block-sized window). There'd be various different versions of this animation as different blocks scroll out to be replaced by others. But by careful level design, you could keep the different combinations down to a minimum.

Now imagine the Speccy screen as a 16x12 fixed grid of 16x16 pixel blocks. By displaying one of these animations in each block, you could create the look that the whole level is scrolling past.
Actually, I suppose I *do* kind of get this. But it sounds enormously labour-intensive to have to draw all the possible background/tile combinations. In fact, having just watched a Stormlord video on YouTube, I simply cannot imagine how all that is feasible in 48K.

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Thu Dec 07, 2017 11:18 pm
by Joefish
Well, the trick is to set yourself some strict rules for level design to reduce the number of potential combinations. The easiest is to always leave one whole empty tile between different objects, then each object is only ever paired up with empty space.

But yes, it means a simple platform block becomes three separate tiles; empty space->platform, platform->repeated platform, platform->empty space.

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Fri Dec 08, 2017 6:22 am
by Hikaru
Ralf wrote: Thu Dec 07, 2017 8:41 pm On the other hand we have Ghosts'n'Goblins. I'm probably in minority but I consider it to be a bad port :twisted: It''s smooth but that's all. It's very simplistic, with few tiles, ugly graphics, tiny sprites, few levels compared to arcade and crazy difficulty.

I respect the author (Keith Burkill) of course. He wrote Commando as well which is simply splendid without discussion.

As for the Ghosts'n'Goblins engine, I inspected the game code a bit once and would say there isn't any :lol: Really. For me engine is something reusable that you can use for another game. Here everything is hardcoded, data mixed with code all the time. There aren't any tiles or maybe there are tiles of different width and height. There is different code to scroll graves, different to scroll ground, different to scroll trees, platforms and so on. Totally crazy code that devil himself wouldn't understand. :)
I'd say the underlying game itself is bad to begin with, regardless of platforms. That out of the way, I do agree about the graphics to an extent. Specifically, it is this very messy way they use to combine the sprites with the bg that irks me the most (I have the impression it might be caused by badly designed sprite masks), I think it would have actually looked decent if not for this one problem. Mind you the second part has always looked much worse to me in comparison, I mean that f..king tree branch. :lol:

And yep, it has pretty crazy code that's hard to make heads or tails of. - Interestingly, it also adds vertical scrolling starting from lv2 in spite of it all. IIRC, a good number of Keith Burkhill's titles work this way internally (aside from Commando, there's also Marauder for instance). Notice however that he is actually building fairly coherent and varied levels with it. So I don't think it's all one-off hardcoded stuff, there's probably methodology and/or tools to build levels in this way.

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Fri Dec 08, 2017 9:33 am
by 5MinuteRetro
Hikaru wrote: Fri Dec 08, 2017 6:22 am And yep, it has pretty crazy code that's hard to make heads or tails of. - Interestingly, it also adds vertical scrolling starting from lv2 in spite of it all.
And not just vertical -- it's diagonal on the ice level. So, eight-direction smooth scrolling. Surely, at least so far as I understand it (which isn't much, tbh), the whole pre-drawn tiles idea can't work here. It can't be possible/practical to draw/store every possible tile combination for eight-way scrolling?

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Fri Dec 08, 2017 11:44 am
by Ralf
I read it. Read it again. And read it again. And I still don't really geddit.
Okay. I guess I'll need to write a proper long post with pictures about it :) Especially as people showed interest in other posts.

Actually I disassembled engine of Stormlord some time ago and have my own game, about 30% finished using it so I know the details.

I'll try to do something during this weekend.

Re: 'Dixel' scrolling... Ghosts 'n' Goblins

Posted: Fri Dec 08, 2017 11:47 am
by 5MinuteRetro
Ralf wrote: Fri Dec 08, 2017 11:44 am
I read it. Read it again. And read it again. And I still don't really geddit.
Okay. I guess I'll need to write a proper long post with pictures about it :) Especially as people showed interest in other posts.

Actually I disassembled engine of Stormlord some time ago and have my own game, about 30% finished using it so I know the details.

I'll try to do something during this weekend.
That would be amazing. I am very interested, but I think only an illustrated guide will help fix the concept(s) in my head.

(I imagine that GnG's eight-direction scrolling is a different thing entirely, though obviously I really have no idea. But if you could start with the tiling thing, that'd be marvellous.)