Page 1 of 1

[Klonan] Min range bugged?

Posted: Wed Jun 13, 2018 2:38 am
by bobucles
I dunno how serious these are as bugs, but they seemed odd so I figured I'd mention them.

- Weapons don't seem to respect min_range settings. Tested with shotgun, tank machine gun and tank cannon at range 10. The range is listed on the weapon card, but they all still fire and deal damage at point blank range.

- The weapon "cooldown_modifier" does not seem to affect the time a player is slowed down by using a weapon. This may be intended, since it allows a way to have the player slow duration different from a weapon's cooldown time.

Re: Min range bugged?

Posted: Wed Jun 13, 2018 2:14 pm
by Klonan
Min range only really works with ammo target type == "position",

For direction, it will always just shoot in the direction of the cursor,
And with Entity, it will always shoot the enitity if its not outside the max range,

Internally it looks like this

Code: Select all

  if (ammoType.targetType == AmmoType::Direction)
    return CanFireResult::True;
  if (target.isZero())
    return CanFireResult::False; // May be caused by missing substitute entity
  if (ignoreDistance)
    return CanFireResult::True;
  if (attackParameters->range * ammoType.rangeModifier < (source.targetPosition() - target.targetPosition()).distance() - source.getRadius() - target.getRadius())
    return CanFireResult::NotInRange;
  return CanFireResult::True;
I will see if I can fix it for 0.17, but it will only be for Entity target types

So for things like the shotgun and tank cannon, they use TargetType::Direction, so min range is never a consideration,
The bug here is that it is shown in the GUI, when it shouldn't

Re: [Klonan] Min range bugged?

Posted: Wed Jun 13, 2018 2:45 pm
by Klonan
bobucles wrote:- The weapon "cooldown_modifier" does not seem to affect the time a player is slowed down by using a weapon. This may be intended, since it allows a way to have the player slow duration different from a weapon's cooldown time.
Doesn't seem like a bug,
Also you can manually set "movement_slow_down_cooldown" in the attack parameters, the default is the same as the cooldown

Re: [Klonan] Min range bugged?

Posted: Mon Jun 18, 2018 12:16 pm
by bobucles
What I was seeing is that the rocket launcher has full slowdown time for normal rockets, but nukes do not. Nukes have a separate slower shooting speed, but the slowdown time stays the same so you can scoot between shots. Can weapon types change slowdown time the same way as shooting speed? It may be a strange behavior related to that.

I think I have a half decent minimum range working for the tank shells. They'll still explode in my face if I shoot something point blank (whatever happened to safety fuses ;) ), but the targeting will try to aim them a safe distance. I just use the cannon's minimum range for the UI's sake.

The minimum range tank shell behavior can be observed in that mod below. Works pretty well, but you can still have the tank go full speed into its own explosions. Not a huge deal.