No collisions

No collisions

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
code_man
Posts: 260
Joined: 19 Jan 2014, 13:10

No collisions

Post 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.
User avatar
FireStorm_
Posts: 666
Joined: 19 Aug 2009, 16:09

Re: No collisions

Post 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... :-)
User avatar
code_man
Posts: 260
Joined: 19 Jan 2014, 13:10

Re: No collisions

Post 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.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: No collisions

Post by FLOZi »

Unit-Unit, Unit-Feature, or Unit-Projectile collisions?
User avatar
code_man
Posts: 260
Joined: 19 Jan 2014, 13:10

Re: No collisions

Post 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.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: No collisions

Post 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.
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: No collisions

Post 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.
User avatar
code_man
Posts: 260
Joined: 19 Jan 2014, 13:10

Re: No collisions

Post 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.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: No collisions

Post 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
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: No collisions

Post 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.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: No collisions

Post 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.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: No collisions

Post by FLOZi »

On further investigation, MCL also suffers this problem under 96. Tweaking radius and footprint (both unit and movedef) doesn't help.
Post Reply

Return to “Game Development”