• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Pathing - Collision Size values into real values?

Status
Not open for further replies.
Level 12
Joined
May 9, 2009
Messages
735
This is a question about unit (not building) collision and the 'pathing - collision size' field.

When you open the field you can enter numbers into it. What do these numbers one enters represent? Well I thought they represented some warcraft 3 measurement of how much space the unit is taking up. To make sense of this I decided to do some testing with the help of the small grid in the editor.

171555-albums7933-picture102907.png


^ Here you see the small grid and approximately how much space 1 unit on this grid takes up. The spooky skeleton's collision is set to 0 and in-game he takes up 1 grid unit of space. However, at both 16 and 25 values of collision size he STILL takes up only 1 grid unit.

The scorpion takes up 9 grid units. You can get 9 skeletons all clumped together on the place where he is standing. His collision size is set to 36.

As you see there is a disconnect from the measurable and visible grid measurements and the inputted values into the collision size field.

Does anyone know what is the logic behind this? Is it possible to make a unit take up 4 grid units? Are there only some collision sizes that are allocated a specific number that has to be entered into the field?
 
Level 12
Joined
May 9, 2009
Messages
735
No, I haven't. The selection scale has nothing to do with the amount of space the unit takes up. You can do the same tests that I did and you will come to the same findings.

171555-albums7933-picture102911.png


^ Here you have 4 footmen with the collision size of 0 trapped in an area with only 4 grid units of space. They cannot move. If another one is placed into the area in the editor he is moved outside the area in-game as there is no room for him. This indicates the amount of grid units the unit is taking up.

It takes time to test for each collision size value so I was wondering if there is some sort of formula or logic or secret that somebody knows about that makes sense of this difference between the the actual grid units that the unit takes up and the collision size value inputted in the object editor.
 
Level 12
Joined
May 28, 2015
Messages
382
I think the grid isn't connected with collision sizes. I think the collision size is similar to radius on the field data of spells. Thats why most units have an average of 35 - 37 collision size depending on what is set in the field data.

Try setting the collision size to 150 and attack range to 100 and see what happens.
 
Level 12
Joined
May 9, 2009
Messages
735
I think the grid isn't connected with collision sizes. I think the collision size is similar to radius on the field data of spells. Thats why most units have an average of 35 - 37 collision size depending on what is set in the field data.

Try setting the collision size to 150 and attack range to 100 and see what happens.

Changing the collision size value does impact the grid units being taken up but in what looks like to me random and incoherent way.
 
I see what you mean. I played a little around and found that the map editor doesn't refresh the collusion size properly. If you place 2 peasants far from each other and set the collusion to 256, the editor won't allow you to place them next to each other. If you set collusion size back to 16 then the map editor doesn't realize that the collusion size changed and keeps preventing your form placing them next to each other.

On the other hand - If two peasants are close to each other and you set collusion size to 256, then the map editor won't force you to give them more distance. If you run the map then the 2 peasants will snap to a proper distance between them. I suggest you use triggers to play with collusion size in-game since the map editor doesn't set things up properly.

EDIT:
Try setting the collision size to 150 and attack range to 100 and see what happens.
When a unit attack, the distance is measured between the closest edges of the unit's collusion size
 
Level 11
Joined
Jun 2, 2013
Messages
613
So my understanding is this. A collision size of 1 is the same as of those smallest (grey) squares. If you notice, there are 4x4 grey squares meaning a unit with a Collision Size 16 should take up the space of a single (white) square (16 grey squares).

In retrospect, the Collision size doesn't necessarily pertain to the grid, but rather how many units it can get to another unit before there is collision. The Grid in my experience is helpful for determining pathing of structures and doodads, not units.

For example, I think a pathing size of 2x2 is technically 4 White Squares = 64 Grey Squares, which may be the same as a collision size of 64, not sure...

However, this is just my two cents and I cannot confirm that any of it's accurate.
 
Level 12
Joined
May 9, 2009
Messages
735
I did some more testing.

0-16 collision size value = taking up 1 grid unit
16-31 collision size value = taking up 4 grid units
31-36-?? collision size value = taking up 9 grid units

I am certain there is some maths to this where one can predict how much collision size do you need to take up 16 grid units.
 
Level 12
Joined
May 9, 2009
Messages
735
Yeah it looks similar to that. At 64 collision size 16 grid squares are taken up but it doesn't get any higher than that. Even at 1000 collision size only 16 grid squares are taken up.

Also now that I check again 16 is not taking up 1 square. 10 is however.
 
Last edited:
Level 21
Joined
Mar 27, 2012
Messages
3,232
I did some more testing.

0-16 collision size value = taking up 1 grid unit
16-31 collision size value = taking up 4 grid units
31-36-?? collision size value = taking up 9 grid units

I am certain there is some maths to this where one can predict how much collision size do you need to take up 16 grid units.

1*1=1
2*2=4
3*3=9

If you could figure out the upper value that takes 9 grid units, I could figure out the exact formula.
Also, you can change max collision size in Gameplay Constants up to some amount.
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
Here's a better layout after I did some more testing

0-15 = 1
16-31 = 4
32-47 = 9
48-1024 = 16 (max)

Okay, it's essentially steps of 16 with a downwards shift of 1 to include 0.
Since the lowest actual size that the editor thinks about is 32x32, then collision size must be a radius, but otherwise works the same as all positional data in the editor.

0-15 = 1 * 1 cells
16-31 = 2 * 2 cells
32-47 = 3 * 3 cells
48-63 = 4 * 4 cells (if you change max collision size to something bigger)
 
Status
Not open for further replies.
Top