Page 1 of 1

Close combat units

Posted: 18 Oct 2019, 23:57
by hangyaoy
Sorry for trivial question.

Can I create close combat units in spring engine?

Re: Close combat units

Posted: 19 Oct 2019, 05:00
by PicassoCT
Yes, but animations are difficult

To elaborate more in depth. Spring provides no adhoc physical simulation for "real" close combat, cause nobody can do that reliable.

Most rtses use instant hits.
Animations are either broad (huge swing, generic hit animation), allowing for units to be still free moving. Or coupled animations, where one unit basically transports the other during engsgements(Finnish moves in dawn of war).

A third option in theory was to have kinemTiks for the units run on a gpu and have real ragdoll physix per unit.

Did not see that anywhere yet.

Close Combat has priority for me though. All the visually appealing combat in cinema is either close combat or close ups ob Ranged Combat. We didn't venture into the savannah for artillery duels.

Re: Close combat units

Posted: 24 Oct 2019, 20:15
by ThinkSome
The Cursed has them.

Re: Close combat units

Posted: 24 Oct 2019, 22:12
by PicassoCT
Cursed them for their sudden but inevitable betrial

Re: Close combat units

Posted: 25 Oct 2019, 02:07
by Forboding Angel
Invisible lasers work well for this.

Re: Close combat units

Posted: 25 Oct 2019, 08:35
by azaremoth
I did use invisible Cannon type weapons in the Cursed. That also works nicely.

Re: Close combat units

Posted: 25 Oct 2019, 09:09
by PicassoCT
If you want to get drastic, both types should work.

Spring.GetUnitLastAttackedPiece

Should give you the last attacked piece, and if you follow the piecemap down recursively allow you to sever arms, heads and legs. Plausible animation afterwards might be difficult.

Ps, you can e en drop limbs to the floor. Just reverse all unit rotations from root up to the limb and then treat it like aphysim

Re: Close combat units

Posted: 27 Oct 2019, 11:08
by Forboding Angel
Honestly not really needed. You can use hitbyprojectile or whatever it's called and have sparks, blood, oil, etc fly when the unit is hit.

I would say invisible lasers is better because no possible drop and they don't suddenly just not hit if you give them insane velocity (like cannons).

Technically we have a hitscan weapontype, but it's garbage.

Re: Close combat units

Posted: 11 Dec 2019, 20:37
by hangyaoy
Thank you for the answers.

I don't want physical simulation. I'm perfectly happy with an RPG like instant hit. Random damege between min and max SP or missing, based on attack / defence.

But if I understand good. There is no close combat unit implemented.
I can create a very short range invisible cannon or laser, and I have constant dps. (local weaponDefs=...) Wich isn't realy bad, this would do for now.

Re: Close combat units

Posted: 12 Dec 2019, 00:36
by Forboding Angel
Technically the only difference between spring and any other engine is that we don't really have a hitscan weapon that is worth a crap, but an invisible laser or cannon projectile that is super close range with say 10k velocity is effectively hitscan. As a result, there never has been much of a push for hitscan weapons.

That said, personally I can think of a bunch of scenarios where my life would have been easier with a hitscan weapontype.

Re: Close combat units

Posted: 12 Dec 2019, 00:44
by Forboding Angel
I mantised a feature request for it:
https://springrts.com/mantis/view.php?id=6354

I wouldn't necessarily hold my breath for it to happen, but I can think of multiple situations to where I would find it useful.

Re: Close combat units

Posted: 13 Dec 2019, 01:28
by Google_Frog
Technically the only difference between spring and any other engine is that we don't really have a hitscan weapon that is worth a crap, but an invisible laser or cannon projectile that is super close range with say 10k velocity is effectively hitscan. As a result, there never has been much of a push for hitscan weapons.
I disagree, based on my understanding of the definition of hitscan. An invisible laser with a properly set up LUS and appropriate parameters is exactly an instant raytrace damage type, ie a hitscan. You have control over what it hits with tags like collideEnemy.

I think you're requesting a weapon that instantly damages a target in range regardless of raytracing checks. This could be useful, since changing the range of BeamLaser to non-spherical is tricky. That said, I have messed around with making agile melee units with BeamLaser, and have never had problems.

Re: Close combat units

Posted: 13 Dec 2019, 03:25
by Forboding Angel
Well, as I said earlier and in my request, lasers also will sometimes not impact the target, even if it is inside their range. The faster the laser, the more erratic the behavior you end up with. Even with the tag enabled that does the extra checking. With a stupid fast laser, it's somewhat unreliable, therefore a hitscan weapon is desirable. Additionally, it's useful for things where you want instant effects, like spellcasters as an example.

I requested the ability to have it hit, ignoring terrain, which would especially be useful for spellcaster units so that the spell can be cast wherever you like and you don't have to worry about whether you have LOS on the target area.

In my request I requested that it be possible to define a hitceg like we have for other weapons. Firing animations are all triggered in the script anyway so those aren't a concern.
I think you're requesting a weapon that instantly damages a target in range regardless of raytracing checks.
This is the definition of a hitscan weapon, yes.



There more serious thought I put into a hitscan weapon, the more I see it's usefulness and utilitarian purposes.

Re: Close combat units

Posted: 14 Dec 2019, 00:50
by Google_Frog
I think you're requesting a weapon that instantly damages a target in range regardless of raytracing checks.
https://en.wikipedia.org/wiki/Hitscan
A hitscan in computer games, most commonly in first person shooters, is where the programming system determines where the gun/ object is pointing, casts out a ray in that direction when shot, for a certain range programmed into the system, and see if that ray comes in contact with any object in the line of fire. Hit scan is a term that could also be classified as “hit instantly” because it instantly hits the target when shot.
I don't disagree that what you are describing sounds like a useful feature, I just think it is important to get the name right when requesting the addition of a named entity to the engine. Every definition of hitscan I have found refers to raytraces, which makes BeamLaser a suitable replacement. If a new game or engine dev sees a weapon type named HitScan, then I would expect them to think it involves raytracing. I'd call what you are requesting something like NoTest or InstantHit.

It also sounds like you have been trying to implement instant weapons with a LaserCannon. Of course, LaserCannon will miss since it has speed, for now you should use BeamLaser instead. I do not know of a relatively lua-free ways to make a spellcaster that instantly casts a spell at a point. You can make a BeamLaser aim through and ignore terrain, allies, and enemies, but then the projectile would not explode.

Re: Close combat units

Posted: 18 Dec 2019, 17:53
by sprunk
Spring supports Rifle, which is a projectile-less raytrace: https://github.com/spring/spring/blob/d ... le.cpp#L25
And Melee, which just deals damage unconditionally: https://github.com/spring/spring/blob/d ... on.cpp#L10

Those could potentially become useful with some tweaks:
  • Rifle suffers from hardcoded low-quality particles. Here's a PR https://github.com/spring/spring/pull/489
  • Rifle disobeys collision flags. Here's a PR: https://github.com/spring/spring/pull/490
  • Both suffer from poor ground hit detection. All you can do at the moment is to poll the weapon for its target when it fires but that doesn't take ground collisions into account. Unsure what the interface should be (probably call Explosion?).

Re: Close combat units

Posted: 19 Dec 2019, 23:24
by Google_Frog
Since it is possible to make a BeamLaser invisible, what is the purpose of Rifle? If the difference is just in particle creation then it sounds more maintainable to make tags that prevent the creation of the particles and projectile.

Re: Close combat units

Posted: 20 Dec 2019, 23:23
by Forboding Angel
Can we stop trying to hack shit together to make something work and just get a proper weapontype for spellcasters? This would also solve the needed requirements for melee weapons.