• 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.

Problem with creating Buildings with a 4x4 pathing next to each other

Status
Not open for further replies.
Hello guys!

For testing, this trigger is creating a matrix of 17x17 buildings:
Code:
TEST
    Ereignisse
        Map initialization
    Bedingungen
    Aktionen
        Set Temp_Point = (Center of Gebiet 002 <gen>)
        For each (Integer A) from 0 to 16, do (Actions)
            Schleifen - Aktionen
                Set Temp_Point_2 = (Temp_Point offset by ((Real((Integer A))) x 128.00) towards 0.00 degrees)
                For each (Integer B) from 0 to 16, do (Actions)
                    Schleifen - Aktionen
                        Set Temp_Point_3 = (Temp_Point_2 offset by ((Real((Integer B))) x 128.00) towards 90.00 degrees)
                        Einheit - Create 1 Carved Wall for Neutral passiv at Temp_Point_3 facing Vorgabe für Gebäude-Ausrichtung degrees
                        Custom script:   call RemoveLocation (udg_Temp_Point_3)
                Custom script:   call RemoveLocation (udg_Temp_Point_2)
        Custom script:   call RemoveLocation (udg_Temp_Point)
Problem: If there's a pathing map set (4x4), the buildings will overlap.

If i remove the pathing map, the buildings will be created as i wish.

I tried using a 4x4 yellow pathing map.
I made the buildings themselves to be buildable.
I tried removing the collision.
I tried creating dummy units, gave them an expiration timer betweet 1-10. On death, the buildings (with pathing map) have been created. With the same result: Overlapping units...

with_pathing_map-jpg.293239

without_pathing_map-jpg.293240


I can't figure out why this happens.

Does anyone ever had that problem?
I would be happy to read a solution. Thanks =)
 
Thanks Dr Super Good! The offset of 32 works pretty well. But i still wonder why a building can't be created right at the actual position of a point if it got a pathing map?

Here's the code with the 32 offset
Code:
For each (Integer A) from 0 to 16, do (Actions)
    Schleifen - Aktionen
        Set Temp_Point_2 = (Temp_Point offset by (0.00 + ((Real((Integer A))) x 128.00)) towards 0.00 degrees)
        For each (Integer B) from 0 to 16, do (Actions)
            Schleifen - Aktionen
                Set Temp_Point_3 = (Temp_Point_2 offset by (32.00 + ((Real((Integer B))) x 128.00)) towards 90.00 degrees)
                Set Temp_Int = (Temp_Int + 1)
                Einheit - Create 1 Carved Wall for Neutral passiv at Temp_Point_3 facing Vorgabe für Gebäude-Ausrichtung degrees
                Custom script:   call RemoveLocation (udg_Temp_Point_3)
        Custom script:   call RemoveLocation (udg_Temp_Point_2)
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,286
Thanks Dr Super Good! The offset of 32 works pretty well. But i still wonder why a building can't be created right at the actual position of a point if it got a pathing map?
Because you are likely creating the buildings at a logic boundaries for where the building gets displaced. Such boundaries exist for buildings because buildings have to be pathing map aligned. In theory this should be fine since the building should always be offset consistently in the same direction if placed in a 128x128 grid, however since placement uses floating points that means that the position has a floating point error associated with it.

The game engine mostly offset the buildings in the desired direction except where the floating point error meant the buildings were offset in the other direction, hence this occurred in lines which represent the same floating point values. By offsetting placement by 32 units the engine has no doubts where to displace the buildings as 32 is significantly larger than the floating point error for any reasonable map position.
 
Status
Not open for further replies.
Top