Zone Occlusion & Maplet Levels

Blitz3D Forums/Blitz3D Programming/Zone Occlusion & Maplet Levels

Chi3f Stadi(Posted 2005) [#1]
Hello,

i just read about this great Zone Occlusion Code in the Code archives:
http://www.blitzbasic.com/codearcs/codearcs.php?code=1228

Now, since i'm using maplet to create .b3d levels, how can i afterwards create a hierachy in my .b3d levels ? Is there a tool around (except B3D Tweak utility) to do such things ?

rgds
-Karel


John Blackledge(Posted 2005) [#2]
The simplest method for somebody who's new to 'zone occlusion' and does not want to spend months writing their own system (- I did, arrgghh!) is to use 'Quill' which has it all built in, and produces a really simple piece of code which you include into your own to control the 'zones'.


Chi3f Stadi(Posted 2005) [#3]
Thank you John. I'm aware of QUILL 3D, unfortunately it's not free like B3D Tweak utility.

I tried a lot of things also BSP maps, so save Blitz3D from rendering too many triangles, but still didn't find a good programs to do occlusion.

So the only opinion is to create lowpoly levels ?!


jfk EO-11110(Posted 2005) [#4]
I don't know exactly how you would rename zones so they can be used in the Occlusion system you where referring to, but there is a further method that I currently would reccomend. Take the ClusterizeMesh Code from the Archives. modify it in a way that it will scale the workspace correctly for any mesh (using min and max world-coordinates of the vertices). The Source will fragment your huge Maplet Level into a 3D grid of pieces. Of course you should choose a piece-size that makes sense, not too small and not too big.

Once Clusterized, you may use the good old ICU Algorithm to determine what pieces can possibly be seen from each piece.

Unlike the ICU VIS Occlusion Demo I wouldn't use a rasterized VIS Grid any longer, but instead simply store a list of (potentially) visible pieces for each Piece. So (EG.) if there is only a single location inside Piece 1 that can see Piece 2, Piece 2 would be flagged as VISIBLE for the entire Piece 1.

OF course, the precalculated VIS information is still based on a rasterized VIS Check, but the result is now only applied to a piece-based VIS Information Grid. The Detection Method is still the same since it's very fast: ICU, Identification trough Color Uniqueness. (Basicly color each piece individually, then make a 6-sided render from any possible location and check the visibility of each piece by their unique color. of course, fullbright only, without lightmap etc. and 24 or 32 Bit required for the precalculation)

EG. let's assume we have 5*5*5 Pieces, that's 125 Pieces. Now if you use an array for each piece, containing visibility information concerning each other piece, the entire VIS Information would use 125*125*4Bytes=not a big lot. Even when it's 10*10*10, all in all you would need 4 megs for the Vis Data, or even only one Meg when you are using single bytes in a bank, or even only 125k when you are using a Bit-System with a bank. Using Types is also possible, although maybe a bit slow to access the wanted indicies.

Anyway, the pro of this method is: You may create a single mesh level, and the code would fragment it automaticly, as well as calcualte visibility information. BTW. if you add further meshes to the level, you may handle them as ordinary pieces while calculating the Visibility of all pieces.