beyond-all-reason / beyond-all-reason/RecoilEngine

weapons with LaserCannon type get less range than what the weapondef says

Open
#729 14 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
679
Forks
290
Avg merge
3d 2h
Merged PRs (30d)
40

Description

this is an old issue, was reported for engine 104
https://springrts.com/mantis/view.php?id=6384

The culprit code is this :
https://github.com/beyond-all-reason/spring/blob/BAR105/rts/Sim/Weapons/LaserCannon.cpp#L32

```
// round range *DOWN* to integer multiple of projectile speed
//
// (val / speed) is the total number of frames the projectile
// is allowed to do damage to objects, ttl decreases from N-1
// to 0 and collisions are checked at 0 inclusive

```

--------------- how to reproduce
Can be reproduced on engine BAR105-1544, metal factions v2.07. Enable cheat mode, type

`/give aven_skimmer ` (400 range cannon after weapondefs_post)
`/give claw_wolverine ` (400 range laserCannon after weapondefs_post)

to spawn them side by side. Select them and press A to view the range circles. The one for wolverine is noticeably smaller.

Type `/give upgrade_red_1_range` to trigger an upgrade of +3.5% range on all units, do so repeatedly and check how to range circles grow : skimmer's grows continuously, while wolverine's grows in steps of 67.73 every few upgrades

-------------------------------------

They should be allowed to have any range.

I think it may be easier to just use either the cannon or missileLauncher's behavior code and just render the projectile differently.

Cannon projectile's behavior would allow it to scale in range normally with heightBoostFactor and heightMod and also allow cylinderTargetting. MissileLauncher allows tracking, the trail, but doesn't get heightBoostFactor.

Contributor guide

Open the contributing guide

Research direction

Read rts/Sim/Weapons/LaserCannon.cpp around line 32 and compare its range handling with the weapon definition behavior described in the issue. Reproduce the difference on engine BAR105-1544 using the /give commands, then apply repeated range upgrades to compare the range circles. Done means LaserCannon weapons can use the full defined range and scale normally with upgrades.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.