Box Vs Mesh

Questions and answers about the how and why of making maps.
Post Reply
TeamVSS_IsBack
Private First Class
Private First Class
Posts: 16
Joined: Sat Jul 02, 2016 12:48 pm
Location: France

Box Vs Mesh

Post by TeamVSS_IsBack »

Hello,

Is that the Mesh are more efficient than the Box on rendering or can cause less Lag for players ?

If its true, if i use a ton of Mesh, What is the maximum size of a bzw file a server can handle ?

yours faithfully

TeamVss
User avatar
Bullet Catcher
Captain
Captain
Posts: 564
Joined: Sat Dec 23, 2006 7:56 am
Location: Escondido, California

Re: Box Vs Mesh

Post by Bullet Catcher »

I don't know about mesh vs. box for lag, but there is no arbitrary size limit for bzw files. The biggest bzw files I have seen are under 2 megabytes.
User avatar
ahs3
Private First Class
Private First Class
Posts: 327
Joined: Sun Mar 04, 2007 8:33 pm
Location: Press '/' to search
Contact:

Re: Box Vs Mesh

Post by ahs3 »

In my belief mesh is much more efficient, less faces to do the same job, however boxes are more reliable. When it comes to teleporters, they work much better over boxes.
TeamVSS_IsBack
Private First Class
Private First Class
Posts: 16
Joined: Sat Jul 02, 2016 12:48 pm
Location: France

Re: Box Vs Mesh

Post by TeamVSS_IsBack »

I do not think this causes lag but "small blockage" when you move.
In my example, I have a map with ton of box, I Open it with the tool of JeffM in the Unity3D editor (Here : viewtopic.php?f=24&t=19309), and I export all the map to an ".OBJ" File.

Then I run the modeltool.exe to export the ".OBJ" file to an ".BZW" file with Mesh, (result is 10 megabytes !).
When I test it (bzfs), I have no more "small blockage".

The question is now, is it a problem to host a 10 megabytes files :mrgreen: ?
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Re: Box Vs Mesh

Post by JeffM »

yes, meshes require more lines in the map file than a box. boxes and meshboxes are parametric, raw meshes are not. That is not a valid comparison.

On the client everything gets expanded out to the same number of faces for the graphics card (a box and a meshbox use the same number of faces when a shots are not near them).

You are just looking at file format sizes, that has nothing to do with graphical latency.

Everything you guys are saying here is total speculation and not based on any form of reality ;)
ImageJeffM
User avatar
optic delusion
Special Forces
Special Forces
Posts: 1052
Joined: Sat Sep 25, 2004 2:29 pm
Location: Planet MoFo
Contact:

Re: Box Vs Mesh

Post by optic delusion »

In experiments I did in 2009.... I had seven variations of starship enterprise models with face counts from 1,000 to 100,000.
My mac's BZFlag frames-per-second dropped pretty significantly as the total number of mesh faces neared 30,000.
I ran public servers with these models and almost all of the players agreed with that assessment. Some people had lower quality machines.
Further tests confirmed that 30,000 faces was too many for almost all players in a playable game environment.
Conclusion: It gets pretty choppy for most players above 25,000 faces.

And BZFlag displays only triangles. Every face is triangulated before they are rendered, including mesh faces. A box is not rendered as six square faces, but as twelve triangular ones. (This does not apply to drawinfo.)

I had another model that seemed to cause problems. It was Frank Lloyd Wright's "Fallingwater" building and some surrounding landscape. It was composed of numerous large flat planes two units high, piled one on top of another. Every landscape plane went all the way to the edge of world boundaries. Even though this map had less than 10,000 faces, we got FPS numbers comparable to the 100,000-face enterprise. I think these large flat planes caused collision detection to slow.

It must be noted that collision detection is done separately on each player's machine, and computing the locations of tanks and shots versus objects consumes a large portion of the processor speed. If you have any objects that are purely decorative, you should convert them to drawinfo, releasing them from collision detection so they render MUCH faster.
On some of my maps i have converted almost every object to drawinfo, and use matching invisible objects (that occupy the same space but have less total faces) for collisions. This provides a little speed boost, i think maybe 10 percent.

Another thing to consider is the worst-case scenario. When you are off in a corner of the map, facing towards center with everything in front of you, FPS will be much slower than when you are in the center looking out, with less than half of the faces in your view.
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.
User avatar
blast
General
General
Posts: 4931
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Box Vs Mesh

Post by blast »

Another example of what not to do would be to make a grate platform out of actual geometry. A map once did this, and it caused a significant performance drop due to all the collision checks of each individual piece of the grate. I believe it was replaced with a flat box that used a alpha blended grate texture, so then it was just a visual effect instead of complicating the collision model.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image
User avatar
Bullet Catcher
Captain
Captain
Posts: 564
Joined: Sat Dec 23, 2006 7:56 am
Location: Escondido, California

Re: Box Vs Mesh

Post by Bullet Catcher »

Make BZFlag grate again!
User avatar
JeffM
Staff Sergeant
Staff Sergeant
Posts: 5196
Joined: Fri Dec 13, 2002 4:11 am

Re: Box Vs Mesh

Post by JeffM »

or just make BZFlag again.
ImageJeffM
Post Reply