Author Topic: setting the [COVERAGE: //TBNESW] on a new special brick  (Read 534 times)

Hi guys,

as in the other topic I had I'm making a new ramp brick
it will be a single corner ramp (a 1x1x1 corner ramp, so you only have the corner part)

but since noone has a loving clue what COVERAGE: //TBNESW does, I still have a question about it:
can I just copy the COVERAGE: //TBNESW from another brick?

I'll ease everyone's headaches and give you a rundown of the first bits in .blbs. Don't ask me about Quad details like UV mapping and all that stuff, someone would need to start an RTB wiki article with 3D Cartesian grids to even come close to scratching the surface on all that, in the meantime experimentation is all you can do. I'm not completely fluent in that stuff myself mind you.

Read on for answers.


First off let's look at the special Castle Wall window thing brick

Code: [Select]
3 1 18
SPECIAL

uuu
XXX
XXX
...

COVERAGE:
crazy stuff

I don't understand the coverage bit with this one but you won't need that level of coverage anyways, I'll cover a simpler example. This brick's good for showing off the brick-grid collision stuff.

First off imagine your brick is composed entirely out of 1x1F plate bricks, you can count each of these as 1 coverage unit. As you can see by the dimensions, the Z value is always represented in the number of Flats that need to be stacked upwards to reach the same height. It seems oxymoron but this bit is integral for the next part.

Code: [Select]
uuu
XXX
XXX
XXX
XXX
X-X
X-X
X-X
X-X
XXX
XXX
XXX
XXX
XXX
XXX
XXX
XXX
ddd

These lines determine the dimensions of the brick as far as brick-grid collisions go. You need Y layers of these, and they'll all have a length of X. The layers are separated by a single empty line. Each bit is the size of a 1x1F brick
- "x" means this spot should be treated as filled space, and tells the engine you can't place another brick's collision section at this spot. You get the BRICK OVERLAP message when you try for instance.
- "-" means this is empty space. Other bricks' filled and unfilled sections can be placed here. As you can see, we can place bricks inside the window section of this brick.
- "u" means this spot is simultaneously filled space and that you can connect other bricks on top of this spot.
- "d" means this spot is filled space and that you can connect other bricks underneath.
- "b" means it's filled space and that you can connect bricks on top or underneath (Both)

I think that's it for brick-grid collisions unless I missed some special characters somewhere.



Now for coverage, essentially these parameters help the engine's core components figure out how many 1x1x1 Units it takes, stacked right beside a brick, to un-render your brick's faces. It goes beyond that still, as it also provides a parameter that allows you to determine how many 1x1x1 units this brick is worth on any side in order to calculate whether the OTHER brick's faces will be hidden when placed right beside your brick.

I'll give an example where coverage was essential otherwise you'd get misshaps.

Code: [Select]
2 1 1
SPECIAL

dd

1

0 0 0
2 1 1
COVERAGE: //TBNESW
0 : 1
0 : 1
1 : 2
0 : 1
1 : 2
0 : 1

This is a Grill brick that's been fixed up by adding COVERAGE to it. Beforehand there was no coverage at all, here's what was happening:

The test setup
http://i149.photobucket.com/albums/s51/muffinmixing/Blockland_00102-1.png

The problems
http://i149.photobucket.com/albums/s51/muffinmixing/Blockland_00103-1.png

Apart from the fairly obvious problem, which is that the grill bricks are hiding the plates underneath, they're also hiding adjacent brick faces which is clearly undesireable



Without the COVERAGE parameters determined, the grill plates were being treated like regular Flat bricks, so they were hiding all the faces you'd expect on other bricks. Now let's check out those COVERAGE parameters in more detail

Code: [Select]
COVERAGE: //TBNESW
0 : 2 //Top
0 : 2 //Bottom
1 : 2 //North
0 : 1 //East
1 : 2 //South
0 : 1 //West

The first number represents how many 1x1x1 units each parts of this surface is calculated to represent. Here we denote it as 0 in cases where we don't want that surface to be calculated to un-render other adjacent brick surfaces, or as 1 when you want each unit of the surface to be calculated to un-render adjacent surfaces. I have yet to see a case that uses anything but 0 or 1 for this. It's kind of like 1 being "Yes, unrender adjacent surfaces" or "No, don't unrender adjacent surfaces"

The second is the number of 1x1x1 units required to hide this brick's surfaces. Generally you want this to be the square of the dimensions of that surface. A 2x2x5 brick (in flat terms. 2x2x15) would have 2x2 = 4 units surface on the top and bottom and 2x15 = 30 units of surface on the sides. In the case of specialty bricks like the Girder or Tree, you probably don't want the faces to un-render at any point, so you just assign a ludicrously high number like 999 to make sure this face is impossible to un-render.


With these coverage parameters, the end product looks like this:
http://i149.photobucket.com/albums/s51/muffinmixing/Blockland_00104-1.png



Finally the last piece of the puzzle must be "Which Quads does the engine decide to hide?". Elementary, the Top parameters affect the Top Quads, Bottom parameters the Bottom quads, North affects the North quads and so on. Omni Quads are NOT calculated for un-rendering, they always remain visible unless you un-render the entire brick by Wrench. There's some other ludicrously complex mechanism at work that determines when an adjacent brick counts as being "Adjacent" and thus calculated in quad un-rendering but I'm not entirely sure how it works myself.


That's as much as I know on this topic. If I got something wrong or if someone wants to add something please feel free to go right ahead
« Last Edit: August 03, 2009, 02:52:50 PM by Muffinmix »

thank you very much!
Now I finally understand the coverage thing :D

If I were guy (I quess you're a boy), I would love you :D

But how would you create a .blb file?

But how would you create a .blb file?
use windows editor and save it as an .blb file instead of a .txt file