Page 1 of 2
Chain-collisions
Posted: 20 Nov 2009, 23:58
by Saktoth
When effected by impulse, tightly packed units often explode with far more impulse than was applied to them. It seems that Spring isnt exactly obeying the laws of conservation of momentum here!
See this very old thread.
Not exactly sure what the nature of the problem is, it looks something like the net impulse increases when two bodies hit eachother, more collisions creating more impusle until you get something like this:

Re: Chain-collisions
Posted: 21 Nov 2009, 00:39
by Regret
Bets are it happens because of the hitspheres getting stuck in each other resulting in huge acceleration from every moment they remain stuck.
Re: Chain-collisions
Posted: 21 Nov 2009, 01:01
by Neddie
Regret wrote:Bets are it happens because of the hitspheres getting stuck in each other resulting in huge acceleration from every moment they remain stuck.
Damn you, you beat me to it.
Re: Chain-collisions
Posted: 21 Nov 2009, 03:05
by Saktoth
This is what i always thought, yes. If it is indeed true that units inside eachothers hitspheres apply more impulse than the net amount in the system that should probably be fixed- a much milder amount of impulse will be enough to 'bounce' them apart (and prevent them ending up inside eachother) without making them explode like that.
But try a unit with a footprint slightly larger than its hitsphere. It still tends to bounce way more than it should and do the exploding like a bunch of firecrackers thing.
A unit with a footprint twice as large as its hitsphere doesnt seem to suffer from this so much, but that may be because collisions are just much less likely (Its not practical to do this anyway so its not a good workaround).
Re: Chain-collisions
Posted: 21 Nov 2009, 12:12
by Tribulex
Whats the problem here? I find this new physics model rather... enticing, to say the least.
Re: Chain-collisions
Posted: 21 Nov 2009, 16:45
by Rafal99
I have tested it yesterday as well. The bug is as old as Spring itself.
Normally when a cluster of units is hit by impulse weapon, some of them start moving/flying slowly, hit each other, but after a quick moment they all stop. But there is a bug and it seems that sometimes some random unit gets some random insane velocity after colliding with the other, even that none of them had a high velocity before the collision. When it gets such a velocity, it hits another unit, bounces, hits another etc, until the whole cluster of units is flying everywhere or is dead because of collision damage.
It also seems that this bug happens only when colliding units are overlapping their hitspheres, for example when you /cheat /give 100 cans (they have a hitsphere larger then a footprint). If you spawn 100 stumpies they don't overlap their hitspheres, and from tests it seems the bug won't occur. Note that the whole situation doesn't happen only when you /cheat /give a cluster of units, but I have observed it many times in normal games, when a tightly packed group of units gets hit by an impulse weapon, and they all start flying with absurd speed, while a single unit will never behave this way.
I will test it further, and maybe upload a replay later.
PS. It should be in Bugs forum imho, but more people read this forum so it is even better.

Re: Chain-collisions
Posted: 06 Dec 2009, 11:56
by Saktoth
I assume you're testing in CA, since stumpies hitspheres overlap in BA.
They do the chain-collide explosion thing too though. Try 100 stumpies vs a corgrav (newton). They fly everywhere instantly.
So its not just a hitsphere-larger-than-footprint thing.
Could it possibly just be a conservation of momentum thing? That when two objects strike eachother, the momentum in the system increases?
Re: Chain-collisions
Posted: 06 Dec 2009, 14:37
by 1v0ry_k1ng
I always liked this bug

Re: Chain-collisions
Posted: 06 Dec 2009, 17:38
by Wombat
in ba i made once 300 zipps and packed them terribly, so 3/4 of them blew up without any reason.
i had theory that coz of stacking them so much, they started to behave like units threw in the air and hitting ground (i think its same situation)
Re: Chain-collisions
Posted: 06 Dec 2009, 18:36
by zerver
this bug is good because it has porc reducing properties
Re: Chain-collisions
Posted: 06 Dec 2009, 20:21
by SirMaverick
zerver wrote:this bug is good because it has porc reducing properties
The porcer does not have many (mobile) units, the attacker does. This bug punishes the players with many mobile units.
Normally the attacker sends his army, they are send together, not one by one. But that may trigger the bug. So you can either send them one by one or get them distributed over the map.
How does this reduce porcing?
Re: Chain-collisions
Posted: 06 Dec 2009, 21:38
by smoth
this bug is one of the reasons I removed impulse.
Re: Chain-collisions
Posted: 07 Dec 2009, 01:13
by Forboding Angel
smoth wrote:this bug is one of the reasons I removed impulse.
Same.
Re: Chain-collisions
Posted: 08 Dec 2009, 15:24
by Saktoth
Its why AA removed impulse too, i wouldnt be surprised if its the reason why CA is the only mod AFAIK that uses impulse extensively.
So, basically, this single bug breaks the entire unit collision physics system and renders it unusable.
Re: Chain-collisions
Posted: 08 Dec 2009, 20:22
by Umbra
Why are all the best bugs only in games and not in RL? Think of all the traffic jams that could be avoided if everyone feared being flung hundreds of feet into the air!
Randomness aside, wouldn't it be possible to set up some special logic that would dampen the effects of this bug, so that instead of being flung to oblivion, they would merely get shoved aside?
Re: Chain-collisions
Posted: 08 Dec 2009, 20:33
by Tobi
I'd much rather see a proper fix and/or change to Verlet integration then even more hacks.
Re: Chain-collisions
Posted: 09 Dec 2009, 01:01
by Umbra
A proper fix may take time to implement. I would rather see a hack that limits this bug in the next release, then waiting five for a full fix or switch to a completely different system.
So unless my hack isn't as simple and as fast as I believe it to be, or the genuine fix won't in fact take as long as it is made out to be, perhaps there should be a slight bit more consideration in my idea.
That aside, how much coding and time would verlet integration take? And what level of skill would be required?
Re: Chain-collisions
Posted: 09 Dec 2009, 09:23
by KDR_11k
I'd rather kick impulse out of the engine and have people lua it because having units go flying rigidly and with little gravity fits into almost no mod.
Re: Chain-collisions
Posted: 09 Dec 2009, 09:58
by lurker
They use the same gravity as projectiles and everything else.
If you want them to fall faster you could use mygravity.
From what I've seen collisions are actually far too elastic. Unless that's what you meant by rigid. Yes, should be less of that.
The issue is just in how impulse is calculated some of the time.
Re: Chain-collisions
Posted: 09 Dec 2009, 10:16
by Google_Frog
KDR_11k wrote:I'd rather kick impulse out of the engine and have people lua it because having units go flying rigidly and with little gravity fits into almost no mod.

- unitCannon.PNG (246.09 KiB) Viewed 2134 times