Page 1 of 2
saw a commit about crushable units
Posted: 12 Dec 2011, 07:43
by knorke
Noticed this commit by Kloot and thought it was kinda cool:
https://github.com/spring/spring/commit ... acca07f90d
make units crushable like features (extends Spring.SetUnitBlocking with an optional 4th argument)
---
I was wondering if it applies to enemy/allied (or both) units? It seems to apply to all units but I can not really tell.
Both might be usefull but primary use would probally be "vehicles running over enemy infantry while friendly infantry just gets pushed aside (as currently)"
Will that be possible?
Also it does not seem to require the (expensive?) watchUnit-Unit-collision function thing?
Re: saw a commit about crushable units
Posted: 12 Dec 2011, 10:29
by PicassoCT
This is getting kind of creepy, like Kloot reading minds.
Oh, wait i dont have to dirt_workaround that in lua? All praise be upon Kloot.
Question: Can we have a specialised feature that is only called for units, once they get stomped? Want to make a 2dscaled version of mine :D
Bonuspoints if you can define a piecewere the "rolled" over unit would be moved towards, before feature converted. Would allow for controlled "vannishing" of infantry at exact spot..

christmaslist-> nextElement

Re: saw a commit about crushable units
Posted: 12 Dec 2011, 18:40
by PicassoCT
bumPinging this because it deserves to stay on the map
Re: saw a commit about crushable units
Posted: 13 Dec 2011, 02:11
by Kloot
Is our esteemed
Bong requesting an audience?
I was wondering if it applies to enemy/allied (or both) units? It seems to apply to all units but I can not really tell.
Only enemy units by default, unless you set the allowCrushingAlliedUnits mod-rule. I may also add an explicit allowCrushingEnemyUnits if desired.
Both might be usefull but primary use would probally be "vehicles running over enemy infantry while friendly infantry just gets pushed aside (as currently)"
Will that be possible?
yes
Also it does not seem to require the (expensive?) watchUnit-Unit-collision function thing?
Crushing happens just before the events are sent, you do not need to listen to them.
Question: Can we have a specialised feature that is only called for units, once they get stomped? Want to make a 2dscaled version of mine :D
You can spawn any feature you want by registering for and reacting to the UnitUnitCollision callin, which tells you whether a collidee was crushed.
Of course, that feature might then itself be crushed, so you would probably want it to be non-blocking.
Bonuspoints if you can define a piecewere the "rolled" over unit would be moved towards, before feature converted. Would allow for controlled "vannishing" of infantry at exact spot..
nein (too messy at present, just use SetFeaturePosition und so weiter)
Re: saw a commit about crushable units
Posted: 13 Dec 2011, 02:39
by KingRaptor
How is unit crush resistance determined?
Re: saw a commit about crushable units
Posted: 13 Dec 2011, 02:42
by zwzsg
Their mass IIRC.
Re: saw a commit about crushable units
Posted: 13 Dec 2011, 18:02
by knorke
You can spawn any feature you want by registering for and reacting to the UnitUnitCollision callin, which tells you whether a collidee was crushed.
Feels like I posted this before but how about a parameter
bool crushed to UnitDestroyed() and FeatureDestroyed?
Or even better,
number deathType: 1=death by weapon, 2=reclaimed, 3=crushed (possibly more)
Bonuspoints if you can define a piecewere the "rolled" over unit would be moved towards, before feature converted. Would allow for controlled "vannishing" of infantry at exact spot..
just use SetFeaturePosition und so weiter
better use SetUnitPosition and keep the crushed unit alive with Sleep() or loops in script.Killed() so it can wiggle while being vanished!
Can two units of the same type crush each other and both get crushed?
---
just collecting links to related commits for later reference:
new tag "crushStrength" which defaults to mass:
https://github.com/spring/spring/commit ... 231cde368e
modrules to crush allied units
https://github.com/spring/spring/commit ... 7aaefd2163
Re: saw a commit about crushable units
Posted: 13 Dec 2011, 19:12
by zwzsg
knorke wrote:new tag "crushStrength" which defaults to mass
New? Really? I recall it being added years ago, to crush features, especially wreckages. Also, beware, it belongs to the movement class and not the unit def.
Re: saw a commit about crushable units
Posted: 13 Dec 2011, 19:30
by knorke
unit.cpp:
+ crushStrength = udTable.GetFloat("crushStrength", mass);
but did not look closer, i just posted while game was loading. (from iphone)
so possible non-sense.
Re: saw a commit about crushable units
Posted: 13 Dec 2011, 21:01
by PicassoCT
i-phones are still hip?`And i thought they would die like a parasitic plague, once the great mother alien dies, who gave birth to all those flat stones.
Re: saw a commit about crushable units
Posted: 14 Dec 2011, 00:20
by FLOZi
zwzsg wrote:knorke wrote:new tag "crushStrength" which defaults to mass
New? Really? I recall it being added years ago, to crush features, especially wreckages. Also, beware, it belongs to the movement class and not the unit def.
Look at commit (and my comment). It's a new tag which determines the minimum value of 'crushStrength' (in the movedef) that is required to crush the unit or feature (before this was controlled solely by mass, now mass is the default)
Re: saw a commit about crushable units
Posted: 14 Dec 2011, 04:10
by zwzsg
Re: saw a commit about crushable units
Posted: 14 Dec 2011, 07:30
by FLOZi
LOOK AT COMMIT.
Re: saw a commit about crushable units
Posted: 14 Dec 2011, 14:47
by AF
Is that not for crushing features, whereas the commit is for crushing other units?
Re: saw a commit about crushable units
Posted: 14 Dec 2011, 18:22
by FLOZi
It's for units *being* crushed. Different tag, same name ---> confusion city.
Re: saw a commit about crushable units
Posted: 14 Dec 2011, 20:29
by PicassoCT
still, i had hope that i would get around the work to manually shove the unit to be crushed to the zone(s) were it could be crushed.
But enough complaining this is something that can be accomplished.
Re: saw a commit about crushable units
Posted: 15 Dec 2011, 20:16
by zwzsg
FLOZi wrote:It's for units *being* crushed. Different tag, same name ---> confusion city.
What?
You called the same a unitdef tag and a movementdef tag that do opposite things? How much you resist to crushing vs how much you crush? No wonder I got confused!
Please rename that new crushStrength into crushResistance!
Re: saw a commit about crushable units
Posted: 15 Dec 2011, 21:41
by FLOZi
I suggested to kloot minCrushStrength, crushResistance is another alternative. I wholeheartedly agree it must not remain the same.
Re: saw a commit about crushable units
Posted: 15 Dec 2011, 21:47
by zwzsg
I like crushResistance which makes it clear it's the complementary opposite of crushStrength.
minCrushStrength is not only too long but sounds like it plays the same role of crushStrength in absence of crushStrength or something.
Re: saw a commit about crushable units
Posted: 15 Dec 2011, 22:20
by PicassoCT
yeah, but crushstrength has this wordMazeSon qualitys, that maxdamage posseses. The Foo is strong in this one.