Page 1 of 1
Non-Physical Cover System
Posted: 28 May 2009, 01:03
by Evil4Zerggin
A non-physical cover system (that is, not based on engine physics). To use, define features as providing cover using customParams cover_strength > 1 and cover_radius > 0. Damage to mobile non-flying units is reduced by a factor of the best cover_strength they are within. Requires UnitPreDamaged callin, new in 0.79.
Be sure to enable the gadget and widget if you want to use them.

The rifleman in the background is taking less damage than the rifleman in the foreground due to cover.
Gadget:
http://spring1944.svn.sourceforge.net/v ... _cover.lua
Display Widget:
http://spring1944.svn.sourceforge.net/v ... radius.lua
VERY crude right now, especially where optimization is concerned, so you may want to hold off on obvious suggestions.
Re: Non-Physical Cover System
Posted: 28 May 2009, 10:04
by hoijui
nice! :D
i see you further and further approaching a certain other game :D
Re: Non-Physical Cover System
Posted: 28 May 2009, 11:14
by imbaczek
yeah, but it only makes sense.
Re: Non-Physical Cover System
Posted: 28 May 2009, 11:30
by Neddie
Considering the only WWII RTS besides this he and I have ever played is Hearts Of Iron II, we'd have no idea.
Re: Non-Physical Cover System
Posted: 28 May 2009, 17:26
by hoijui
really??!
the game i mean is: Company of Hereos
i was so sure that this was one of the favourite games of all S44 devs!
@imbaczek
it surely makes sense, i see nothing bad in this.. i like it!
Re: Non-Physical Cover System
Posted: 28 May 2009, 17:47
by Otherside
yeh this reminds me of CoH and DoW2 cover system i.e made of win
Re: Non-Physical Cover System
Posted: 28 May 2009, 19:04
by KDR_11k
But is it directional? I.e. will an attack from the rear side of the cover hit at full strength?
Re: Non-Physical Cover System
Posted: 28 May 2009, 19:13
by thesleepless
cool, this is one of the things i liked most in dawn of war 2. troops automatically running towards cover when attacked could be cool... but i suspect a bit more difficult. i'm sure you could do it with lua.
Re: Non-Physical Cover System
Posted: 28 May 2009, 19:17
by imbaczek
you could, but it won't be efficient unfortunately. these kinds of things are best done in the engine.
Re: Non-Physical Cover System
Posted: 28 May 2009, 19:56
by Evil4Zerggin
KDR_11k wrote:But is it directional? I.e. will an attack from the rear side of the cover hit at full strength?
Not ATM, I may consider something like that although it might be tricky to keep performance under control.
Re: Non-Physical Cover System
Posted: 28 May 2009, 20:04
by imbaczek
a simple dot product should be enough - once a unit is in cover, you should know the direction cover is in, and you always know the direction of hits. updating cover every N frames intead of every frame would make it feasible IMHO.
Re: Non-Physical Cover System
Posted: 28 May 2009, 20:15
by Evil4Zerggin
I suppose I was more concerned about the possibility of multiple cover, although now that I think of it, it shouldn't be too bad in practice as long as we're reasonable about cover ranges.
Re: Non-Physical Cover System
Posted: 29 May 2009, 17:00
by KDR_11k
Evil4Zerggin wrote:KDR_11k wrote:But is it directional? I.e. will an attack from the rear side of the cover hit at full strength?
Not ATM, I may consider something like that although it might be tricky to keep performance under control.
It might work to simply modify the flankingbonus settings (I think we can do that now? Lurker?) to give the unit cover instead of the current damage reduction, that way it's also easier to micro and you can assume the unit will take cover so that its front is protected.
Re: Non-Physical Cover System
Posted: 29 May 2009, 17:47
by lurker
Yay, finally the fact that it's a unit setting instead of a unitdef setting will come in handy!
You'll have to use getunitcobvalue, as I didn't make any lua bindings at the time. I suppose I'll make some now.
I also need to make it use explosion location now that that's more accurate.
Re: Non-Physical Cover System
Posted: 29 May 2009, 22:26
by SpikedHelmet
I've not played CoH ever either. Infact the only WW2 RTS game I can think of having played is one of the old, old, pixel-based Close Combat series (I believe A Bridge Too Far, and then only the demo). Which is where I personally get most of my inspiration from, except I'm in no way shape or form involved with anything other than modelling and texturing so such inspiration is completely wasted. Well, that and a couple of good WW2 FPS games.
Cover is a natural extension of the realism we've strived to create. Solid-slug shells that slow down and do less damage the further they travel, accurate-ish armour directional relations, suppression and pinning, etc, all came out of our own asses.
Re: Non-Physical Cover System
Posted: 29 May 2009, 22:36
by FLOZi
I've played CoH, and I think Nemo has as well. But yeah, everything CoH-like that's in S44 we wanted to do ourselves anyway.
Dunno why I didn't think of this.

Then again it wasn't so trivial before the new callin.
edit: we should also use this to replace the currently rather not at all working tank-fear-shield system.
Re: Non-Physical Cover System
Posted: 01 Jun 2009, 06:13
by Nemo
I've not played CoH, but played Close Combat ABTF a fair bit.
This is going to be an exciting change once we refine it.
Re: Non-Physical Cover System
Posted: 01 Jun 2009, 06:26
by kburts
this is soo stronghold crusader, i remember back in the time when i thought the roofs of towers made you guys invincible.
no, they just gave them a temparaly health boost of about 10* so if you ran your guys in and out of towers, for some reason they'd heal

Re: Non-Physical Cover System
Posted: 01 Jun 2009, 19:57
by Argh
Yeah, the PreDamage callin greatly helped me speed up my version of NoSelfPwn, too, by removing some checks.
Might want to look at that, if you're using the one from CA (and it hasn't already been fixed).