Steve Benner / Ben Morris
A brand new construct, developed by Raven Software for Hexen is the PolyObj--short for Polygonal Object. This object permits the addition of a spectacular new feature to the Hexen map: moving lines!
A PolyObj is a logical construct, consisting of a number of component parts. In essence, a PolyObj is merely a collection of one-sided lines. What marks them out as a PolyObj is:
The PolyObj_StartLine and PolyObj_ExplicitLine arguments provide an identification of the particular PolyObj they define, (and also implicate another PolyObj in their own PolyObj's actions: more on this later.)
Because PolyObjs are simply collections of lines, they can be drawn anywhere on the level map: usually far away from other map lines, so as to not interfere with the "normal" map lines. These lines cannot be two-sided and do not need any sector information applying to their single SIDEDEF (it will not be used, anyway). The polygonal object that the engine renders on screen during play will derive its size, shape, and initial orientation from the lines laid out on the map. Its actual location will not, however: that is determined by the PolyObj location mechanism described shortly. The rendered height of the lines comprising the object will be determined by the sector that the PolyObj finds itself in during play.
The precise form of a PolyObj is determined by the rendering order of its component lines. This is determined differently depending upon the method used by the designer to define the PolyObj:
Whichever method of marking out a PolyObj is adopted, each PolyObj must have a unique PolyObj identification number. This number is assigned by means of the first argument of the defining function, PolyObj_StartLine or PolyObj_ExplicitLine.
So as not to interfere with normal map lines, PolyObjs are usually constructed by the designer well away from these other lines. The PolyObj is moved to its operating location by the game as the level is loaded. It does this through the use of three special THINGS:
The two StartSpot THING-types are each used to define the location on the map where a particular PolyObj is to appear during the game: which is used will determine the behavior of the PolyObj in play. The Anchor point THING marks the PolyObj's origin, or centre of rotation.
Note: The Anchor point and Start Spot are each associated with a particular PolyObj by assigning the PolyObj's identifying number to the Facing Angle field of each of these THINGS. The PolyObj stuff was done before any of the THING ID special code was implemented, so Raven did this temporary hack, which became permanent, as the designers had already done a ton of PolyObjs, and didn't want to have to go back and replace them!
The relocation of the PolyObj is done by maintaining a constant spatial relationship between the PolyObj's lines and its anchor point while that anchor point is shifted to the designated Start Spot (each tagged to the PolyObj lines through their Facing Angle value).
The operation and actions of PolyObjs is triggered through the use of the PolyObj Special Actions. Through these special codes, the lines of the PolyObj can be made to move and rotate. Particular sounds can be associated with them, too. These sounds are assigned at the time the PolyObj is defined with the PolyObj_StartLine or PolyObj_ExplicitLine Specials.
The two different types of Start Spots determine whether the action of the PolyObj will be crushing or not. When a PolyObj moves and strikes an object, it will first attempt to move it. If that fails it will then either try to damage the object, or just stop moving depending upon the type of Start Spot.
In addition to moving itself, a PolyObj's actions can also be mirrored by a second PolyObj. This Mirror PolyObj is again specified in the definition of the PolyObj through the PolyObj_StartLine or PolyObj_ExplicitLine Specials.
The Mirror PolyObj acts as a true mirror of the first. For instance, if a PolyObj is rotated to the right by 90 degrees, then that PolyObj's mirror will rotate left 90 degrees. Note that having two PolyObjs mirror each other is not considered to be a good thing, but in general won't cause problems because a PolyObj can only do one particular action at a time, so won't be free to participate in any conflicting actions that may be demanded of it as a mirror.
Here, then, in summary is how to build a PolyObj:
![]() |
↑ Menu ↑ | HTML-Version new styled on Nov 2008 by Dieter Heinrich | ↑ top ↑ |