Page 1 of 1

Special Mesh Faces

Posted: Sun Apr 26, 2009 3:26 am
by trepan
The latest SVN commit adds the capability to use mesh faces as team
bases and teleportation link sources and destinations. The team base
faces have to be flat tops (normal = +z), but there are no limitations
other than that. You can still jump and shoot backwards through the
mesh faces without having either the baseTeam or teleportLink properties
take effect.

The face links are especially useful, because I've added large number
of configuration parameters. Here are some examples:

- source to destination coordinate system translation (position & velocity)
- entry velocity scale
- exit velocity
- entry angular velocity scale
- exit angular velocity
- exit angle (or angle offset)
- radar rendering
- teleport sound
- teleport glow effect
- tank discrimination (based on driveThrough)
- shot discrimination (based on shootThrough)
- tank team discrimination
- shot team discrimination
- min and max entry velocities (relative to the source plane's normal)

P.S. except for the new 'text' objects, all world geometry can now be
done using meshes. Teleporters and bases were the last two holdouts.

Code: Select all

------------------------------------------------------------------------
r19708 | trepan | 2009-04-25 23:54:15 -0300 (Sat, 25 Apr 2009) | 68 lines

* bumped BZ_PROTO_VERSION to 0080, and BZ_REV to 22
* made map text objects 'groupable'
* made map link objects 'groupable'  (absolute linkage availabe from within groups)
* made MeshFaces capable of being team bases  (but only faces with +z normals)
* made MeshFaces capable of being teleport link sources and destinations
* added link and base faces to the RadarRenderer
* replaced the Teleporters with meshes (sceneNodes and collision routines)
* created teleporter meshes using the 'x size' properly
  (the mesh extends to where faces lie in the x axis)
* added the teleporter 'texsize' parameter (controls the border texture scale)
* added the faceType to ObstacleType (after ObstacleTypeCount)
* removed the gimbal lock for Guided Missiles
  (by replacing azimuth/elevation with 'fvec3 nextVel', and playing with vectors)
* rename the global bzfs 'TeamInfo team[]' variable to 'TeamInfo teamInfos[]'
* added the '_forbidDebug'       BZDB variable
  (used when debugging reveals game state, defaults to 1)
* added the '_gmAdSpeed'         BZDB variable
* added the 'debugLinks'         BZDB variable
* added the 'debugTele'          BZDB variable
* added the 'debugMotion'        BZDB variable
* added the 'debugShotSegments'  BZDB variable
* added the client /selflock command
  (used for testing, should probably be removed)
* added the IDL(fancy) teleporter shot effect  (uses a clip plane)
* changed LinkManager to a global (rather than being owned by World and WorldInfo)
* updated bzw.5 with the new MeshFace and Link parameters
* cleanup (headers, whitespace, typos, rare segvs, etc...)

Link notes:

1. mesh face link sources used the driveThrough and shootThrough properties of
   the face to determine if shots and tanks can pass through the link
   (so you can have 'tank-only' links, and 'shot-only' links, as well as the
   standard 'all-shall-pass' links. The link sources can also define team
   specific blocks using the linkSrcShotBlockTeams and linkSrcTankBlockTeams
   parameters.

2. when a link object is defined inside of a group definition, you can use the
   '/' character in front of 'src' and 'dst' names to link absolutely. If the
   '/' character is not used, then matches are limited to that group definition.

3. multiple 'src' and 'dst' lines can now be used in a single link object. you
   can also put multiple entries on a single line, separated by whitespace.

4. the linkSrc to linkDst transformation maps between two 3D spaces, defined
   by their S/T/P vectors. The standard setup is as follows:

                 vertical faces:  (standard teles)
       linkSrc:
         S : side  vector, points to the left when looking into the plane normal
         T : top   vector, points upwards (+z)
         P : plane vector, the inverse to the plane normal (travel direction)
       linkDst:
         S : side  vector, points to the right when looking into the plane normal
         T : top   vector, points upwards (+z)
         P : plane vector, the plane normal (travel direction)

                 horizontal faces:  (face normal is -z or +z)
       linkSrc:
         S : side  vector, the edge vector defined by (vertex[0] - vertex[1])
         T : top   vector, P points upwards (+z)
         P : plane vector, the inverse to the plane normal (travel direction)
       linkDst:
         S : side  vector, the edge vector defined by (vertex[1] - vertex[0])
         T : top   vector, points upwards (+z)
         P : plane vector, the plane normal (travel direction)


------------------------------------------------------------------------

Re: Special Mesh Faces

Posted: Sun Apr 26, 2009 12:13 pm
by Spazzy McGee
Wow, trepan! Excellent work - it's going to open up some great new opportunities for map makers. Irregular bases and teleporters are something us map makers have whined about for years and years.

By the way - do teleporter faces need to be vertical? Can we have horizontal (and every which way in between) teleporters?

[edit: I read the commit and answered my own question - yes you can]

Re: Special Mesh Faces

Posted: Sun Apr 26, 2009 6:12 pm
by clarahobbs
WOW! This sounds amazing! Horizontal teleporters! Bases with drivethrough bottom! I can't wait for BZFlag 3 now!

Re: Special Mesh Faces

Posted: Mon Apr 27, 2009 11:39 pm
by allejo
mhmmmm Very Very interesting. this will make maps more and more interesting. nice job trepan. I wonder if Louman will make a 3.0 map when bzflag 3 comes out :P i hope that happens.

Re: Special Mesh Faces

Posted: Thu Apr 30, 2009 2:01 am
by trepan
I've since added tank flag and shot flag discrimination. As well,
you can now block tank and shot passage by using BZDB variables.

Re: Special Mesh Faces

Posted: Thu Apr 30, 2009 2:15 am
by Bambino
Ok, now I am drooling :P

Re: Special Mesh Faces

Posted: Thu Apr 30, 2009 3:28 pm
by clarahobbs
trepan wrote:I've since added tank flag and shot flag discrimination. As well,
you can now block tank and shot passage by using BZDB variables.
I'm not sure I understand... do you mean that one could change server variables to make mesh faces passable by tanks or shots? That would be pretty cool.

Re: Special Mesh Faces

Posted: Thu Apr 30, 2009 11:46 pm
by trepan
guess what happens...

Code: Select all

options
  -setforced linkShotBlock 1
  -setforced linkTankBlock 0
end

teleporter tele1
  pos +20 0 0
end
teleporter tele2
  pos -20 0 0
end

link
  shotBlockBZDB linkShotBlock
  tankBlockBZDB linkTankBlock
  src *
  dst *
end

Re: Special Mesh Faces

Posted: Thu Apr 30, 2009 11:53 pm
by joevano
The universe ends???

Re: Special Mesh Faces

Posted: Fri May 01, 2009 3:48 pm
by clarahobbs
It stops shots from going through the teleporter, and instead they just ricochet off? Amazing! This can be sorta half-done now with drivethrough and shootthrough boxes in front of the teleporters, though.

Re: Special Mesh Faces

Posted: Fri May 01, 2009 4:56 pm
by trepan
this effect can't: /set linkTankBlock 0
(and that's the point of having link BZDB tie-ins, now isn't it?)

NOTE: the parameter names were renamed to shotBlockVar and tankBlockVar.

Re: Special Mesh Faces

Posted: Mon Dec 21, 2009 3:53 am
by LouMan
allejo wrote:mhmmmm Very Very interesting. this will make maps more and more interesting. nice job trepan. I wonder if Louman will make a 3.0 map when bzflag 3 comes out :P i hope that happens.
Maybe... maybe. I have been away from BZFlag for quite some time now; I'm getting a little bit of an itch to start stopping by again. Apologies to all of my BZFriends for disappearing for so long with nary a word. Any rumors of my being killed in a motorcycle accident are false ;)

I see that there are quite a few talented map makers that are doing some impressive work these days. If I ever start to make maps again, I'm going to have a lot of catching up to do.

I like the idea if allowing mesh faces to be used as team bases and teleporters (horizontal/slanted teleporters? hmmm, very neat). Discriminating teleporters sounds promising as well.

Take care all, and watch for me prowling around the servers, maybe sometime soon.

:)

Re: Special Mesh Faces

Posted: Mon Dec 21, 2009 4:57 pm
by tobylane
What's the guided missile change?

Hope to see you and your work Louman, people say you died.

Re: Special Mesh Faces

Posted: Thu May 13, 2010 12:21 pm
by trepan
Note that the source code that I posted here will no longer work:
http://my.bzflag.org/bb/viewtopic.php?p=137273#p137273

Only BZDB variables that start with '_' or '$' will be accepted by
bzflag clients from the server. This is to protect the client from
nasty servers that want to change variables they ought not be
touching.


The '_' prefixed variables are for default server variables, ex:

_jumpVelocity
_forbidDebug
_tankSpeed


The '$' prefixed variables are for user defined server variables, ex:

$dynamicColor1

$texmat1Spin
$texmat1Scale
$texmat1Shift

$phydrv1Linear
$phydrv1Angular
$phydrv1Radial
$phydrv1Slide
$phydrv1Death

$link1Block
$link1ShotBlock
$link1TankBlock


P.S. If the '$' format causes folks to retch (PHP, ick), my apologies.

Re: Special Mesh Faces

Posted: Thu Jun 24, 2010 5:29 pm
by hutty
All of this looks good, but I am a little concerned...

would it be possible to make these vertical teles and bases without having to leave the text editor..

maybe, being able to apply base properties to the top of an arc, or bottom of a cone etc..

Re: Special Mesh Faces

Posted: Thu Jun 24, 2010 5:37 pm
by joevano
huttymuncher wrote:would it be possible to make these vertical teles and bases without having to leave the text editor..

maybe, being able to apply base properties to the top of an arc, or bottom of a cone etc..
Uhm... the map is just a text file, so everything is text.... which means there are no mods needed to any text editor to support anything we do. ;-)

Re: Special Mesh Faces

Posted: Mon Jun 28, 2010 8:24 pm
by hutty
Yes It is possible to code meshes in a text editor,
however it is very very difficult (but I have done it :D)

allowing tele and base properties to be applied just like materials would be very nice