Page 1 of 1

No collisions

Posted: 23 Jan 2014, 17:44
by code_man
I seem to not be able to enable physical collisions.
These is my modrules.lua.

Code: Select all

local modrules = {
    reclaim = {
        unitEfficiency = 0.5,
        allowEnemies = false,
    },
    movement = {
        allowUnitCollisionOverlap = false,
    }
}

return modrules
My units have proper collisions, as checked with /debugcolvol, tough what does the gray sphere mean?.

Using spring 0.95 still btw.

PS: I noticed that units created with lua have their footprint not properly alligned sometimes, smells like a bug to me.

Re: No collisions

Posted: 23 Jan 2014, 17:59
by FireStorm_
Guessing from the top of my head:

Gray sphere might be hitsphere (collision with projectiles so to speak)

And I would try to manipulate physical collisions by editing the Unit-definition file of the relevant units. (collision determined per unit so to speak)

Not sure, but I hope that helps... :-)

Re: No collisions

Posted: 23 Jan 2014, 18:09
by code_man
Im afraid it dont help.
From what i could gather from the wiki the hit and physical colisions should be the same thing and i saw no unitdef tag that describes anything about physical collisions.

Re: No collisions

Posted: 23 Jan 2014, 18:15
by FLOZi
Unit-Unit, Unit-Feature, or Unit-Projectile collisions?

Re: No collisions

Posted: 23 Jan 2014, 18:16
by code_man
Unit-Unit collisions, thats kind of what i mean with "physical".

The problem is they clutter and my units are fairly big and they then refuse to shoot at each other.

Re: No collisions

Posted: 23 Jan 2014, 18:23
by FLOZi
AFAIK unit-unit is based on unit radius (grey sphere in alt+v mode) which is set in the model itself (there's a tab for it in Upspring, for assimp models it is auto calculated or you can change it in the meta file).

Your modrules.lua looks correct and you are right - there's not unitdef tag to tweak radius. You might try changing footprint size but that probably only affects terrain collisions, although atleast mobile unit - structure collisions do depend on footprint/yardmap too.

As ever, pinch of salt for everything in this post as I am not an engine dev.

Re: No collisions

Posted: 23 Jan 2014, 18:33
by Silentwings
The grey sphere is the model radius (iirc) and can be modified from lua with SetUnitRadiusAndHeight. It is used for things such as telling whether a unit is underwater or not - I think this is also the one involved in unit-unit collision detection. The purple sphere/box/cylinder is the 'hitsphere' and this is the one involved in collision detection between projectiles and units.

You should try using the latest dev build from http://springrts.com/dl/buildbot/defaul ... -gd48bf73/ which has a fix for units not firing when clumped. Could also try tags like avoidFriendly=false.

Re: No collisions

Posted: 23 Jan 2014, 18:39
by code_man
Actually upspring doenst work for me, im using collada based models.

Maybe il try the latest dev build, i have a bit of mess on my end with data tough so i dont wanna develop on 2 versions right now.

I knew about avoidFriendly=false, but i wasnt sure if this is what i really wanted so id rather ask about proper collisions.

Re: No collisions

Posted: 23 Jan 2014, 18:55
by FLOZi
avoidFriendly is for unit-projectile collisions only.

If you are using collada, you can set radius by making a model piece 'SpringRadius' see http://springrts.com/phpbb/viewtopic.ph ... us#p463265

Re: No collisions

Posted: 23 Jan 2014, 19:04
by Silentwings
code_man wrote:The problem is they clutter and my units are fairly big and they then refuse to shoot at each other.
@FLoZi: avoidFriendly could help with this - when friendly units are clumped say, encircling a target at close range, they can refuse to fire for fear of hitting each other.

Re: No collisions

Posted: 24 Jan 2014, 03:11
by Forboding Angel
He's intermixing the word collisions between meaning collision volumes, and units colliding with one another.
code_man wrote:I seem to not be able to enable physical unit collisions.
These is my modrules.lua.

Code: Select all

local modrules = {
    reclaim = {
        unitEfficiency = 0.5,
        allowEnemies = false,
    },
    movement = {
        allowUnitCollisionOverlap = false,
    }
}

return modrules
My units have proper collision volumes, as checked with /debugcolvol, tough what does the gray sphere mean?.

Using spring 0.95 still btw.

PS: I noticed that units created with lua have their footprint not properly aligned sometimes, smells like a bug to me.
code_man wrote:Im afraid it dont help.
From what i could gather from the wiki the hit and physical unit collisions should be the same thing and i saw no unitdef tag that describes anything about physical unit collisions.
Maybe this might help make what you are trying to say more clear.

Code: Select all

allowUnitCollisionOverlap = false,
Should do the trick. If it doesn't, then it's likely a bug. You should use spring 96.

Re: No collisions

Posted: 27 Jan 2014, 22:03
by FLOZi
On further investigation, MCL also suffers this problem under 96. Tweaking radius and footprint (both unit and movedef) doesn't help.