The device of special effects for games under NES. Part 2
In this article, you will continue the description of the device special effects for games under the NES (the first part here ). This time there will be less theory and more sample pictures.
We will consider the groups of effects created by switching the scrolling position of the video processor, as well as a couple of effects obtained by switching the state of the video processor.
An animation of scrolling position changes
Interframe
The most basic and obvious “effect” created by changing the position of a scroll is creating a game camera . It is perceived as something obvious, but I would put a whole bitcoin on the fact that you will not be able to implement scrolling correctly the first time without a single error.
Consider several options for scrolling in different games. Although it is not very impressive, it is useful to understand what the video processor does and help you understand the following effects.
')
As I mentioned in the first article, there are four screen pages in the address space of the NES video processor that contain characters to display. Also, the video processor has a certain scrolling position - the coordinates from which it begins to draw tiles on the screen.
However, most often the contents of the pages are mirrored ( here is a more detailed description of the main types of mirroring). If you don’t go into details, it means that most often the game has not four, but only two pages (and sometimes only one).
The screenshot shows an example of scrolling with horizontal mirroring of pages from the game Mitsume Ga Tooru .
Horizontal scrolling
In this case, the left two pages reflect the right two pages. Also on the screenshot, I marked the position of the scroll, and the emulator selects the window that is visible on the screen at the moment.
Due to the low speed of the video processor, games cannot pre-render the contents of all pages, they are limited only to updating this active window, and also update only the first invisible lines near the window in order to have time to build them by the time the player goes directly to them.
That is why in some games you can not go back, to organize the movement of the camera in both directions - it is already a non-trivial task for developers.
Different games organize the update of columns / lines a little differently when the camera is moving - most often this is related to the way the level data is stored in the ROM files of games (blocks of various sizes, or a compressed tile map).
Vertical scrolling
The type of mirroring can be hard-coded by the mapper of the cartridge, or it can be switched by game programmatically. Two screens in height, as in the example above, may be enough to create the illusion of vertical scrolling, however, in order to create a level with a height and width of more than two screens, the developers had to invent tricks.
Some games make in levels with a height of more than two screens "doors" ( Megaman series engine), when entering the game, it makes a short pause to update the contents of the screen pages.
Others skim and encode this effect programmatically:
In games like Jungle Book or Hudson's Adventure Island, the main type of scrolling is horizontal, but games also allow the camera to move up and down, rearranging the top line to the bottom on the fly, and thus organizing support for “diagonal” camera movement.
To emphasize the complexity of scrolling in an arbitrary direction, we can cite as an example the mistakes of the developers. For example, in the game Little Mermaid, with vertical scrolling, the game each time “eats” half a block, which are visible in the game editor - i.e. designers created levels without this error.
It is due to the fact that most NES games use a block level description system with a block size that is not a multiple of the screen size, which is why the bottom of the last block will be thrown out during vertical scrolling. This effect is visible in the game Tiny Toon Adventures , where the developers deliberately left the garbage in an unmapped block:
Here the red line underlines the line that will be thrown out by the game engine (such notes are present in each level with a height of several screens).
Scrolling in games with one screen page
Some mappers do contain only one screen page, which is mirrored 4 times. To organize scrolling in such games, developers were forced to look for a way to disguise artifacts that arise from the fact that the right side of the screen overwrites the left.
In Battletoads, the game simply “extinguishes” the beam of the video processor at the beginning of the line output in order to hide the fact that the first columns duplicate those that will be displayed after the screen scrolls to the right.
In Felix The Cat and Tom & Jerry games, the right side of the lines is masked with black sprites, as can be seen with the help of the script for displaying the numbers of sprites described in the first part of the article.
Scrolling animation
There is also an interesting animation effect by abruptly changing the position of the scroll.
An example of such an animation is the second boss in the game Mitsume Ga Tooru .
The torso of the boss is drawn in two different screen pages with a slight offset, and the game every few frames switches the scroll to another screen, due to what it seems that the torso of the boss pulses.
Animation consists of only two frames, but this is enough to create a beautiful effect. The game uses horizontal mirroring, due to which two different pictures of the boss should be drawn with a half-block offset (see examples of vertical scrolling above), as can be seen by opening the games in the CadEditor editor
For clarity, you can change the block “indicator” to see how the game will change its position when switching screen pages:
A more advanced example of background animation in several frames can be seen in the game Bucky O'Hare . The game has a rotating maze
For its implementation in the game, each frame is updated part of the screen that is not currently on the screen. As soon as the screen is finished, the scroll instantly “flips” the display onto it and creates the effect of turning the room 90 degrees. After that, the game starts drawing the next frame again in another screen.
The screenshot shows a partial drawing of the frame in an invisible screen page.
Rendering a large object in the background
Sometimes the game draws a large object as a background, and by changing the position of the scroll creates the effect of movement of this object (most often it is the bosses). If necessary, the boss will add animated parts with sprites or animation by changing the video memory banks.
The result is beautiful big bosses, for example, as in Monster in My Pocket :
Or in Chip & Dale 2
Here you can see a great design decision - the boss-witch appears only when the candles are extinguished, and the developers have the moral right to make the background black.
A side effect is that the background itself on such bosses must be absent, otherwise it will move along with the boss. Theoretically, the effect of background animation is possible in such a way that its one-way movement compensates for the boss's movement in the opposite direction, but I could not find a single game or demo in which this effect would be implemented.
Another way to make a background for such a boss is to change the scrolling position right during the frame, in the midframe animation section there will be an example of such a boss and a description of the limitations of such an implementation.
Midframe animation
If you change the position of the scroll during the frame drawing, it is possible to split the screen into several horizontal “bands” moving at different (including zero) speeds. However, there is no way to change the position of a scroll directly during a row without screen shake, so if you see parts of a line moving at different speeds, most likely, the developers are deceiving your vision using animated sprites or changing CHR banks (examples in the first part of ).
Different effects can be created based on the movement of the “stripes” of the screen at different speeds. In order to investigate such effects, I made a script for the Mesen emulator (it only allows you to track effects right in the middle of the frame).
After launch, it will show the lines on which the game changes the position of the scroll and divides the screen into separate lanes moving at different speeds. Screenshots of effects in this section were created using this script.
GUI drawing
The simplest and most understandable effect is drawing the user interface below or above the game screen. Everything is simple - the GUI is motionless, unlike the layer of the level along which the player moves. Most of the games, in addition to other effects, use this one, so I won't mention it separately anymore.
The simplest example is the Super Mario Bros game - the upper part of the screen remains stationary. Tricks that are used to determine the exact period of time when you need to change the position of the scroll, sometimes very tricky, but most commonly used are known Sprite Zero Hit or tracking line number on the mapper.
Parallax
The parallax effect allows you to display that for an observer, farther objects move slower than closer ones. In next-generation consoles, it is possible to draw on several layers, independent of each other, but this is not available on the NES, so the developers emulated the layers by scrolling parts of the picture horizontally.
An important limitation of such layers is that they never vertically intersect each other, which can be checked using the above script (without a dividing line, the player is much less noticeable that they do not intersect with each other).
The simplest example is Kyoto Ninden Teyandee, a ninja-cat running against the sunset.
Here, as well as in Mario, just one division of the screen into moving and stationary parts is enough (well, the second division in the GUI zone, which occurs in almost every game, I will not mention separately).
More beautiful and complex examples:
Red Planet in Bucky O'Hare . Here a layer of distant clouds in the sky and closer mountains are added to the static sky. Without dividing lines, it seems that there is still a layer of the landscape between the mountains and the player’s layer, due to the fact that it is homogeneous and the eye cannot determine whether this layer is moving or not.
There are many games with examples of parallax of this type - Joe & Mac - Caveman Ninja , Totally Rad , Metal Fighter , Vice - Project Doom and others.
However, it is worth remembering that if you see the effect of intersecting layers on the same horizontal line (parallax of the background behind the windows in Bucky O'Hare ) or vertical parallax in general (on the walls of the well Battletoads level 2, the Megaman 2 launch screen) article, remember - the horizontal scroll can not be changed in the middle of the line, in these games other effects are used.
A separate interesting case of parallax with a moving far background - levels with moving vehicles, a few examples:
Spartan X2
Tinny toon 2
Batman: Return of the Joker
Parallax is also noticeable if the camera is inside an oval object or cave. In this case, the lower and upper parts will be closer to the chamber than the far wall. The best example is the turbo tunnel in Battletoads :
Or Batman: Return of the Joker :
The last examples devoted to parallax relate to the case when the displayed plane is strongly tilted with respect to the camera, in this case different speed of movement of the parts of the plane will be clearly visible, and many layers are needed to display it.
Look at the number of floor layers in TMNT4: Tournament Fighters :
Or at sea in the TMNT3: Manhatten Project :
Paul in Battletoads and Double Dragon (limiting case, separate scroll of each line):
Displays the movement of parts of the scene
This effect is used to display large parts of the scene.
Boss in Tiny Toon Adventures
Some examples from Bucky O'Hare
For relatively small parts of the scene, up to individual lines (sections of the road when turning in the Super Spy Hunter ):
For a beautiful combination of parts of the scene (Versus-screen in TMNT4: Tournament Fighters )
And also for displaying full-screen puzzles (roulette in Super Mario Bros. 3 ):
A scene can also be a large object that initially looks like a sprite, not a background, but too large for a sprite, because sprites have a limit on the size, total number, and number in one line. For example, a green planet boss ball in Bucky O 'Hare (yes, this game is generally very rich in different effects) is drawn with a background, but moves separately from the floor:
Demo effects
Often, the effects of separate movement of the scene layers are used for the spectacular appearance of text or screensavers. Immediately two effects at the start of Jurassic Park :
Wave effects in Tmnt 3 , Mickey Mouse 3 , Mitusme Ga Tooru :
And other similar.
Change the vertical position of the scroll
Most often used to create the effect of a descending ceiling. As well as for bosses, a necessary condition is a black background on which the movement of the entire layer will not be noticeable. Therefore, the descending ceiling is most often found in dark caves:
Mitsume Ga Tooru
Batman: Return of the Joker
Animation of changing processor state
In addition to the main types of animation, graphic effects can be created by changing the state of the video processor. Switchable status flags can be viewed in the documentation (for example, here ). These include: switching the processor to black and white mode , changing the brightness or changing the address of the active screen .
For example, in the Battletoads game, the user interface is drawn in a separate screen that switches to another in the middle of the frame, in which the level itself is drawn without an interface.
Additional features can also be added using the mappers. For example, consider Mappy Kids games on the Namcot 163 mapper , which can switch screen pages with a separate command, due to which the game supports split screen mode — one screen page is active during the top half of the screen rendering, and the other is on the bottom half of the screen render.
These are all the main types of animation effects used on the NES. Naturally, some separate effects in different groups are missed and the effects on rare mappers are little explored; they can devote a separate article to them when there are enough of them.
Now you can try to program any of these effects, in the following articles I will try to show examples of how to do this in C using CadEditor to pull graphics and data from ROM files.
In general, all the research of games in this and previous articles was carried out within the framework of this project of mine, which partly became a project of the romhaker community; most of the game levels were added not by me, but by other users, let me mention the Patreon project page, if such studies are interesting, you can support them donations.
Scripts for the emulator Mesen:
logParallax - draws lines on which the game changes the position of the scroll during frame rendering.
makeScreenshots - by pressing Q starts taking screenshots, pressing again stops. Convenient for preparing images and then stitching them into gif-pictures.
modifyScreen - a bonus is another script that allows you to write "shaders" and play with the creation of their own post-effects for the emulator.