• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Get your art tools and paintbrushes ready and enter Hive's 34th Texturing Contest: Void! Click here to enter!

[General] Dynamically rotated bridges sometimes have odd collision properties

In the following sample map, when I use the "channel" spell to create a bridge over a grove of trees sometimes the bridge works as intended, usually if its summoned in an area with no obstacles, and sometimes its visual model and pathing seem to differ. If there are buidlings or trees in the way it doesn't seem to work. What am I missing about bridges? My goal is to create a temporary bridge in front of the caster based on the angle they are facing that allows units to walk over the tree line.

p.s. Ignore "TriggerSleepAction" since this is a proof of concept.
 

Attachments

  • bridge builder.w3m
    132.1 KB · Views: 1
I believe that is happening because wc3 only supports rotating a pathing map 90 degrees. You can see an example here:

1745879407719-png.531217
1745880018880-png.531220


Even if the model is visually rotating to the angle you specified, the pathing map "snaps" to the nearest "supported" orientation. For your bridge, the supported orientations are vertical and horizontal:
1750705740011.png
1750705763834.png


That's why Blizz made variations for each bridge orientation (vertical, horizontal, diagonal 1, diagonal 2). In fact, the vertical and horizontal one use the same underlying pathing texture, it's just that one of them has a different fixed rotation set in the object editor (same for diagonal 1 and diagonal 2).

So in your case, I'd suggest making a "diagonal" version of your bridge as well. Depending on the angle between the caster and the target point, you'll want to create either a "vertical" bridge (with a rotation of either 0 or 90 for a horizontal bridge) or a "diagonal" bridge (again, with a rotation of either 0 or 90 depending on which way the bridge should go). Instead of allowing any arbitrary angle, I'd recommend just "snapping" the bridge rotation to those fixed angles (0, 45, 90, etc.).

The main reason Blizz probably did this was because the pathing for most "static" objects (destructables, bridges, buildings, etc.) are defined by a bunch of small 32x32 squares--and you can't easily rotate that pathing map to any arbitrary angle and get it to work accurately without sacrificing some squares. So they likely settled on what they have today. But if you wanted to support more angles, you could always make your own custom pathing maps for those orientations--and then make a separate object editor object for that too.
 

Attachments

  • 1750705739717.png
    1750705739717.png
    1.5 MB · Views: 0
  • 1750705763651.png
    1750705763651.png
    1.1 MB · Views: 0
Top