This article was written by Violet CLM, and contains both already-known information and information gathered by Violet CLM and URJazz. We tried to cover everything about textured backgrounds we could think of, except how to draw one and things like that.

Table of Contents:
Palette Areas
JCS Textured Backgrounds: Howto
JCS Textured Backgrounds: A few Questions
JCS Textured Backgrounds: Confusing
Challenges
Disclaimer


Palette Areas:
Working palettes are probably the most important part of a textured background – otherwise they just won’t work. Well, they’ll usually work in 16-bit, but in 8-bit, they end up looking awful if not done right.
Picture of a Non-working Textured Background.
So as you probably know, a textured background uses a gradient of colors. This gradient must be in a certain area of the palette. Yes, it is assumed you know how to make a palette. Sorry.

Remember that no colors in the textured background should be used anywhere else in the palette, but they should all be used somewhere else in the tileset. Ask Disguise. Now for the various palette entries, in a strange order.


Palette Entries 176-207:
This is easily the most common place to put the textured background gradient. Water also uses this in 8-bit, so it’s doubly useful. Everything works fine, and the background fades into the distance.
8-bit Working Background. 16-bit Working Background.

Palette Entries 208-239:
In 16-bit, this works the same as 176-207. However, in 8-bit, instead of fading into the last few colors, it goes on repeating into the distance.
Infinitely Looping Background.

Palette Entries 144-175:
Placing your textured background here has the same effect as 208-239.

Palette Entries 112-143:
Here it gets a bit strange. 128-143 work just fine, in the way of 208-239 or 144-175, but 112-127 get completely messed up. Same in 16-bit. Oh, and in 8-bit, speed leaves a black trail over the messed up parts.
112-143

Palette Entries 80-111:
Yes, we are moving into the Sprite Colors by now. Never use this one. Complete pandemonium. The colors are all messed up. Yes, even in 16-bit.

Palette Entries 48-79:
Now this one is interesting. In 16-bit, no matter what color is actually in the textured background, it Displays the colors from 176-207! In 8-bit, it does about the same thing.
Look! See!

Palette Entries 16-47:
Basically the same as 80-111. Don’t use.

Palette Entries 0-15 and 240-255:
Yes, this one wraps around. Anyway, a few places try to use the 176-209 colors, but most of it is completely messed up in either color scheme. Don’t use.

Palette Summary:
So there are really four kinds of textured background. Fading into the distance, infinitely looping, completely non-working, and taking the colors from 176-209. What is the last one good for? Well, you can have a 8 color texture using a sprite color gradient, but when you texture it, you get a working textured background the color of your water.


JCS Textured Backgrounds: Howto:
This is only for those who don’t know how to make your level display a textured background.
1. Go into Layer 8’s Layer Properties, and check the “Texture mode” box. Also check “Tile Width” and “Tile Height”, then leave the properties.
2. Search through the tileset until you find the Textured Background. If the tileset doesn’t have one, you should probably give up, unless you think you can create one out of other tiles. But let’s assume you found one.
3. Put the background you found into Layer 8. If it’s 1×1, 2×2 or 4×4, tile it so it fits into the 8×8 area. If it’s not 8×8, or one of those others, it won’t work.
4. Save and Run.

Now, you’ve seen textured backgrounds that move when you move, or even move by themselves, right? Well, that’s simple enough.
1. Go into Layer 5’s Layer Properties, and look at the boxes marked X Speed, Y Speed, Auto-X Speed and Auto-Y Speed.














Positive Negative
X Speeds Left Right
Y Speeds Up Down

The further away from 0 any of your numbers are, the faster it will be.


JCS Textured Backgrounds: A few Questions:
“Why do, as seen in the last section, Layer 5’s Layer Properties control Layer 8? Shouldn’t they control Layer 5?”
The quick answer is yes, they do. Layer 8’s Speeds can also control Layer 8, but only if the corresponding Layer 5 box is 0. Other numbers, and 5 will take over.

“What do you mean, Create a Textured Background out of other tiles?”
Well, in some tilesets, a palette area (preferably 176-207) will have a gradient, but not a textured background that uses it. For this, one can use tiles that use only colors from 176-207. The normal background for Castle1 works all right, as do the red bricks in Tubelectric. Even a single color tile from that area will usually work.

“I’ve seen people make Textured Backgrounds solid!”
No, you haven’t. What you’re seeing is tiles that are masked, without having been drawn at all. It can make a cool effect, though.

“Why did the background glow blue in the 16-bit screenshot?”
Well, in 16-bit, the normal textured background types fade away to black by default. But by editing the Fade Red, Fade Green and Fade Blue boxes, you can set what color you want it to fade to. For example, 255, 0, 0 would result in a bright red, while 75, 0, 0 would get a nicer, more peaceful red. Remember, this only works in 16-bit.


JCS Textured Backgrounds: Confusing:
First, a warning. Pretty much any Textured Background with animated tiles in it will cause an access violation. And access violations are bad.
Now let’s observe Different Layers of Levels. We are going to be putting textured backgrounds on all the 8 layers JJ2 supports, and seeing how they work in various combinations. For the purpose of this section, all textured backgrounds will be using palette slots 176-207, and be made for the job, not a cave tile which just happens to texture well.

Layer 8:
You all know about textured backgrounds in Layer 8. Tile Width, Tile Height, Texture mode on, size 8×8. It works fine, as described earlier. How about we change things around a bit?
Let’s say we take off “Tile Height”. Now the top half of the screen has a textured background, but the bottom half doesn’t.
Yes, this could be considered a bug.
Turning off Tile Width is about the same. The left half or so of the screen has a textured background, the rest doesn’t. Turning them both off makes there be only a background in the upper left corner.

Layer 7:
Layer 7 is kind of confusing. By itself, it’s invisible. However, if layer 8 is fully covered in tiles (but not textured… we won’t go into if layer 8 is only partly covered just now), layer 7’s textured background will paste itself onto layer 8. Simple so far? Read on…
However, this is not a full time thing. If layer 7 has Tile Width and Height on, it doesn’t do this at all. Only Tile Width, the top and bottom get textured, and the middle has a big jutting Empty Layer 8 thing. Tile Height is the same, only rotated.
So what if we turn both Tile Width and Tile Height off? Then everything is a working textured background, EXCEPT FOR AN 8×8 HOLE IN THE MIDDLE.
Eep! What a problem.
It should be noted that all of these holes can be removed by either turning on low detail, or setting the Auto-X/Y speed to something other then 0, at which point it becomes an ordinary textured background. Also, if you turn off Textured Background mode, all you see is whatever you put in Layer 8 (and any other stuff that happens to be floating around in your level).

Layers 5 and 6:
As far as I can tell, these two layers behave in the exact same way as Layer 7. Feel free to try to mix Layers 5, 6 and 7 (with different textured backgrounds in each, say) into a grand picture, but you may not get the best results – all I could achieve was an empty plus sign in the middle of the level.


Before we move on to Layer 4, let’s talk about this pasting a bit more. Say layer 8 is animated, flashing between having a filled tile there, and a blank tile. Then what happens?
Simply put, when there’s a tile there, you can see the Textured Background moving (well, only moving if you have some auto speed). When there’s no tile there, the Textured Background freezes in position, pasted onto the empty layer 8. Move around while this is happening, you’ll leave trails. When the Textured Background appears again, it will have moved forwards without your seeing, causing it to look jerky.
So what? Well, say Layer 8 has multiple animations. Say different parts of it are there at different times. This can result in something quite interesting (though it gave me a headache to set up).
I endured pain to create this, so the least you can do is look at it.
It looks much better when it’s moving, but you may get the idea. The main downside is blocky trails get left (not forever… they get erased) whenever anything moves. Low detail will not change this effect at all – it thinks that the textured background is actually in layer 8, and even if it’s really in layer 5, layers 6 and 7 will appear in front.

Layer 4:
Have you ever tried to texture layer 4? Then you may know it results in an access violation. However, URJazz has found a way to texture layer 4 which is actually quite interesting:
Go into layer 4’s layer properties, and tick the “Texture Mode” box. Tile Width and Tile Height off, of course. Press Ok. It will ask you if you want to do this – tell it “No” both times it asks. The Texture Mode box will now be checked, and the level will have retained its size.
So what does this do in JJ2? Every single tile in layer 4 goes straight through into emptiness (you leave trails in it). This includes empty tiles (except for the upper left corner one), unmasked tiles and masked tiles. (This works in other layers, too, but it’s not incredibly useful in them)
It gets weirder. If enough of the tiles (I think… I don’t really know how it’s decided) in the level are transparent, every single tile in layer 4 turns invisible, and any holes in the background are fixed. (It would seem turning layer 8 transparent does this too)

Layer 3:
Layer 3 is a bit strange. It acts like Layers 5, 6 and 7 in terms of pasting, but because it’s a foreground layer, it’s a tad different. The layer 3 Textured Background goes in front of the sprites, but behind layer 4. Odd? Yep.
Now let’s say we add a (non Textured Background) layer. 5 will do. Make it Tile Width and Tile Height, and put some tiles in it. Wherever the layer 5 tiles appear, the Layer 3 textured background will not be, and you can walk in front of the layer 5. However, wherever layer 5 tiles are not, you get the foreground textured background.
Confused? Let’s put it this way. First, remember the sprite layer is actually layer 3.5, and not 4, because sprites go in front of layer 4, but behind layer 3. In this case, layer 3 is in front of the sprite layer, layer 5 is in front of layer 3, and the sprite layer is in front of layer 5. :) And layer 8 dictates where layer 3 can be, all the way behind layers 5 and sprite.
It may take you a moment to figure out what’s wrong with this picture…

Layers 1 and 2:
These two layers seem to be just the same as Layer 3. Again, feel free to try mixing them, though again I could only get a empty plus sign (admittedly, it took out the walls inside it this time).



That’s the technical side of things. You are free to use these things to create new and original ideas no one’s ever thought of before.


Challenges:
Create the road effect shown in the picture below. You can use a different tileset, but that was the best working one we found. (The stars aren’t necessary)
Look both ways before you make the street.

Also, if you find a way to have two textured backgrounds at once (each taking up half the screen), and the whole screen occupied, let me know. That’s what I was trying to do when I started this whole thing.


Disclaimer:
We can not guarantee everything in this article is accurate. We think it is, but are willing to edit faulty information if you find any problems.
All long term disastrous effects to your JJ2, JCS, or any other programs used is completely your fault.

Comments

Black Ninja on August 05, 2003 04:00

Very informative. It is my new goal to use that ‘road’ effect in a Foo Race. ;p
But really, this is a very good article. Good work, Violet and URJazz.

Lark on August 06, 2003 04:00

Danyjel, you’ve never even made a tileset. How would you know how to make a textured background?

DanYjel on August 06, 2003 04:00

oh.

URJazz on August 06, 2003 04:00

Very well written article that features lots of useful information. Oh, and by the way Danyjel, I believe that those mentioned in your above post were discovered much longer before.

snzspeed on August 15, 2003 04:00

Wow! this article is very handy. i just created a palette, with instructions of this article.

NovaStar on November 01, 2005 08:38

Too long. Too complicated for me. I may as well not make a level at all, sice the guides are non-helpful.

Actually, I noticed all of the guides are too long.

FreeFull on September 20, 2006 17:33

Like URJazz has writen, its very informarive article. All i can say is: LOL!

PurpleJazz on November 11, 2006 09:54

Very useful!

jalo0 on March 21, 2009 16:28

I can\‘t do a tileset :(
I don\‘t know how to do it.
WHAT PROGRAM SHOULD I USE?

sonicnathan 1 on April 30, 2009 17:04

Thanks. Used this for my tilesets