Special Mesh Faces

Place all meeting requests / announcements here...
Post Reply
trepan
Dev Wizard
Dev Wizard
Posts: 704
Joined: Fri Feb 21, 2003 7:50 pm

Special Mesh Faces

Post by trepan » Sun Apr 26, 2009 3:26 am

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)


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

User avatar
Spazzy McGee
Sergeant Major
Sergeant Major
Posts: 1403
Joined: Mon Mar 21, 2005 4:59 pm
Location: Planet MoFo, Sheffield Division; United Kingdom
Contact:

Re: Special Mesh Faces

Post by Spazzy McGee » Sun Apr 26, 2009 12:13 pm

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]
"Life is what happens to you while you're busy making other plans." - John Lennon

User avatar
claytonghobbs
Private First Class
Private First Class
Posts: 272
Joined: Thu Jan 10, 2008 1:45 am
Location: The Fourth Dimension

Re: Special Mesh Faces

Post by claytonghobbs » Sun Apr 26, 2009 6:12 pm

WOW! This sounds amazing! Horizontal teleporters! Bases with drivethrough bottom! I can't wait for BZFlag 3 now!
FKA Ratfink

User avatar
allejo
Breaker of Builds
Breaker of Builds
Posts: 659
Joined: Sun Feb 17, 2008 10:01 pm
Location: /dev/null
Contact:

Re: Special Mesh Faces

Post by allejo » Mon Apr 27, 2009 11:39 pm

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.
Here's my personal website and my open source projects are available on GitHub; I work on a lot of cool things.

Image

trepan
Dev Wizard
Dev Wizard
Posts: 704
Joined: Fri Feb 21, 2003 7:50 pm

Re: Special Mesh Faces

Post by trepan » Thu Apr 30, 2009 2:01 am

I've since added tank flag and shot flag discrimination. As well,
you can now block tank and shot passage by using BZDB variables.

User avatar
Bambino
Private First Class
Private First Class
Posts: 1210
Joined: Mon Apr 21, 2008 10:27 pm
Location: Alberta, Canada

Re: Special Mesh Faces

Post by Bambino » Thu Apr 30, 2009 2:15 am

Ok, now I am drooling :P
"Anyone who has never made a mistake has never tried anything new." -- Albert Einstein
GU League | Ducati League | OpenLeague

User avatar
claytonghobbs
Private First Class
Private First Class
Posts: 272
Joined: Thu Jan 10, 2008 1:45 am
Location: The Fourth Dimension

Re: Special Mesh Faces

Post by claytonghobbs » Thu Apr 30, 2009 3:28 pm

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.
FKA Ratfink

trepan
Dev Wizard
Dev Wizard
Posts: 704
Joined: Fri Feb 21, 2003 7:50 pm

Re: Special Mesh Faces

Post by trepan » Thu Apr 30, 2009 11:46 pm

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

User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Re: Special Mesh Faces

Post by joevano » Thu Apr 30, 2009 11:53 pm

The universe ends???
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln

User avatar
claytonghobbs
Private First Class
Private First Class
Posts: 272
Joined: Thu Jan 10, 2008 1:45 am
Location: The Fourth Dimension

Re: Special Mesh Faces

Post by claytonghobbs » Fri May 01, 2009 3:48 pm

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.
FKA Ratfink

trepan
Dev Wizard
Dev Wizard
Posts: 704
Joined: Fri Feb 21, 2003 7:50 pm

Re: Special Mesh Faces

Post by trepan » Fri May 01, 2009 4:56 pm

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.

User avatar
LouMan
Chief Sgt. of Cartography
Chief Sgt. of Cartography
Posts: 338
Joined: Mon Jan 31, 2005 3:05 am
Location: Michigan, USA

Re: Special Mesh Faces

Post by LouMan » Mon Dec 21, 2009 3:53 am

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.

:)

tobylane
Private First Class
Private First Class
Posts: 130
Joined: Thu Jan 29, 2009 4:21 pm

Re: Special Mesh Faces

Post by tobylane » Mon Dec 21, 2009 4:57 pm

What's the guided missile change?

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

trepan
Dev Wizard
Dev Wizard
Posts: 704
Joined: Fri Feb 21, 2003 7:50 pm

Re: Special Mesh Faces

Post by trepan » Thu May 13, 2010 12:21 pm

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.

User avatar
hutty
Private First Class
Private First Class
Posts: 227
Joined: Thu Jul 02, 2009 8:09 pm

Re: Special Mesh Faces

Post by hutty » Thu Jun 24, 2010 5:29 pm

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..
For all of you who have asked what a hutty is, there is one as my avatar.

instant map... just add water

User avatar
joevano
General
General
Posts: 1863
Joined: Sat Jun 18, 2005 1:08 pm
Location: South Bend, Indiana, USA

Re: Special Mesh Faces

Post by joevano » Thu Jun 24, 2010 5:37 pm

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. ;-)
There is nothing worse than aggressive stupidity. -- Johann Wolfgang von Goethe
"How many legs does a dog have if you call his tail a leg? Four. Calling a tail a leg doesn't make it a leg." -- Abraham Lincoln

User avatar
hutty
Private First Class
Private First Class
Posts: 227
Joined: Thu Jul 02, 2009 8:09 pm

Re: Special Mesh Faces

Post by hutty » Mon Jun 28, 2010 8:24 pm

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
For all of you who have asked what a hutty is, there is one as my avatar.

instant map... just add water

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest