General Boards => Mapping Tips/Guides => Topic started by: Will on February 09, 2011, 06:42:35 am

Title: Unusual layer toggling
Post by: Will on February 09, 2011, 06:42:35 am
I have come across a freeware horizontal-scrolling shooter by the name "Kaeon" by Tran. This game has a layer toggling feature I thought I would never see in any PC DOS game. The purpose of this layer toggling was to help the game run faster on older and slower computers. But if anyone is good with programming, that game and its code may come in handy for manipulating layers of other games, or so I've heard.
Title: Re: Unusual layer toggling
Post by: Peardian on February 09, 2011, 08:48:55 am
Very interesting. I  never thought there would be a feature like that outside of emulators. I'm not sure how readily portable the code would be, though, because it would depend on knowing just how the game draws its layers. It may turn out that the code is only good in inspiring the idea to try it, while the actual implementation is different enough that it could have been done without knowing about how Kaeon does it.
Title: Re: Unusual layer toggling
Post by: Maxim on February 09, 2011, 09:11:09 am
I don't see that it would have any relevance to layer toggling in other games, unfortunately, unless this game is able to use other games' data files. If that were true, you'd already know about it from the readme.
Title: Re: Unusual layer toggling
Post by: Grizzly on February 09, 2011, 02:16:58 pm
The problem is that, while on gaming computers like the Commodore 64 and consoles like the Super NES the hardware's video modes supported scrollable background layers and the concept of sprites, and games also used them in almost all cases to hava a major speedup and more available CPU power for the actual game logic, there wasn't such a standard on the IBM compatible PCs. Early PC video adapters (CGA, EGA) just supported special text modes for displaying text on screen and general image modes where an array of color values was submitted to the adapter to display an image on the screen.

Wikipedia says that the proceeding VGA standard supported smooth hardware scrolling, but I have no clues in which ways this might open a possiblity to extract a scrolling layer out of the data that is submitted for display in each drawing cycle. Also maybe that wouldn't mean that multiple layers could be distinguished because each game engine was programmed differently. But I don't know anything about that for sure because I never programmed a VGA game. Might be a question that is best lead to a developer of the DOSBox, for example.
Title: Re: Unusual layer toggling
Post by: TerraEsperZ on February 09, 2011, 05:03:44 pm
This reminds me of this old French PC gaming magazine I used to buy back in the days of VGA DOS games. Since it was European, it also featured a lot of Amiga content and whenever they would compare the Amiga and PC versions of the same game, the PC would *always* lose both graphically and aurally. In particular, they would always mention how parallax scrolling was simply removed on the PC side and even then, the scrolling would still be choppier and the colours less vibrant. Apparently, the old PC graphic adapters were just that generic.
Title: Re: Unusual layer toggling
Post by: Maxim on February 10, 2011, 02:38:57 am
Older PC games had:

- a limited palette (16 colours?)
- no hardware scrolling (you have to redraw the whole screen instead of moving a "window" into a larger image)
- no graphics layers (to do layers, you have to redraw the whole screen again)

All of which is crummy but logical when the graphics adaptor was just letting you display a bitmap on the screen. Only really when 3D cards appeared did any new capabilities appear, and these days you can draw all your 2D layers in 3D and it works just as well (in fact, better - you get scaling and rotation too) as the old layered graphics systems.