Invisible walls

Questions and answers about the how and why of making maps.
Post Reply
User avatar
Cruel dog
Private First Class
Private First Class
Posts: 173
Joined: Sat Jul 16, 2005 9:32 pm
Location: Québec province, Canada
Contact:

Invisible walls

Post by Cruel dog »

hello, Could anyone give me the easyest way to make an invisible wall? Thanks!
Owner@ BZAddict.net
Admin @ bunch of servers
And much more!
"Even if I am named Cruel dog, I still am friendly! I just become Cruel with troublemakers! xD"
F687/s
Private First Class
Private First Class
Posts: 369
Joined: Sun Dec 31, 2006 8:30 pm

Post by F687/s »

Code: Select all

material
 name invisible
 color 0 0 0 0
end

meshbox
 position 0 0 0
 size 10 10 10
 matref invisible
end
Hope that helps.
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1052
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Post by optic delusion »

if you are using lots and lots of invisible walls, it might be better to use an invisible texture
http://images.bzflag.org/pmatous/transparent/
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.
Legolas_
Private First Class
Private First Class
Posts: 513
Joined: Thu Jan 20, 2005 10:24 pm

Post by Legolas_ »

Expanding on Optic's post :

Code: Select all

material 
 name invisible 
 texture http://images.bzflag.org/pmatous/transparent/Trans-100.png
end 

meshox
 position 0 0 0
 size 10 10 10 
 matref invisible
end
I'm not exactly sure what the reasoning behind this being better, except perchance that it makes the map load faster.
User avatar
Joe-Schmoe
Private First Class
Private First Class
Posts: 192
Joined: Mon Jul 24, 2006 1:10 am
Location: This field unintentionally left blank.

Post by Joe-Schmoe »

It increases fps as well, not sure how.
Join MI6!
User avatar
Peter
Private First Class
Private First Class
Posts: 354
Joined: Tue Jan 23, 2007 5:44 pm
Location: 127.0.0.1
Contact:

Post by Peter »

You can make an invisible object with just one line of code...

Code: Select all

meshbox
position 0 0 0
size 100 2 20
rotation 45
diffuse 0 0 0 0
end

Code: Select all

diffuse 0 0 0 0
“Roses are #FF0000, violets are #0000FF, all of my base are belong to you.” ~ Nerd on Colour
Legolas_
Private First Class
Private First Class
Posts: 513
Joined: Thu Jan 20, 2005 10:24 pm

Post by Legolas_ »

PETER wrote:You can make an invisible object with just one line of code...

Code: Select all

meshbox
position 0 0 0
size 100 2 20
rotation 45
diffuse 0 0 0 0
end

Code: Select all

diffuse 0 0 0 0
That may be the easiest, but we are trying to figure out which way is the best for many objects.
User avatar
Peter
Private First Class
Private First Class
Posts: 354
Joined: Tue Jan 23, 2007 5:44 pm
Location: 127.0.0.1
Contact:

Post by Peter »

Legolas_ wrote: That may be the easiest, but we are trying to figure out which way is the best for many objects.
Okay then, I think you can do this with groups...

Code: Select all


define many_objects

meshbox
position 0 0 1
size 10 10 1
rotation 0
end

meshbox
position 0 0 2
size 10 10 1
rotation 0
end

meshbox
position 0 0 3
size 10 10 1
rotation 0
end

enddef

group many_objects
scale 1 1 1 # Scale if you want
shift 0 0 0
diffuse 0 0 0 0 #Where did all those objects go?
end

“Roses are #FF0000, violets are #0000FF, all of my base are belong to you.” ~ Nerd on Colour
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1052
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Post by optic delusion »

It has to do with backface culling. The faces of an object that you can't see, because they are behind another face. When you add transparency.. they suddenly become visible.

I just did a little research, and it seems that the devs have "fixed" backside culling for transparent faces. It used to be (V2.0.4) that when you used transparency math in a material, bzflag displayed all sides of the object, including backfaces. This led to a framerate reduction which became exponentially worse the more objects were transparent. .. But when you used a transparent texture bzflag didn't know it was transparent and culled faces properly, leading to faster FPS.

Now face culling is done the same way with a color math or with a texture. So there is no FPS boost either way. I think this was fixed in 2.0.6.
~devs++
Take a look at my Defender game mode concept.

Thinking is not an automatic process. A man can choose to think or to let his mind stagnate, or he can choose actively to turn against his intelligence, to evade his knowledge, to subvert his reason. If he refuses to think, he courts disaster: he cannot with impunity reject his means of perceiving reality.
Post Reply