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

Unintuitive ceg tag behaviour for spawned cannon projectiles

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

Description

If you use `Spring.SpawnProjectile` to spawn a projectile of weapontype `Cannon` it will not draw its CEG trail. This is because Cannon only draws when `ttl > 0` and SpawnProjectile defaults to infinite ttl which is negative.

https://github.com/beyond-all-reason/spring/blob/2deba2827e8dc52e694700bd14895c4d2509553b/rts/Sim/Projectiles/WeaponProjectiles/ExplosiveProjectile.cpp#L52-L53

I think `SpawnProjectile` defaulting to infinite is good. I think it would be good if cannon just drew the trail regardless of TTL but I don't know if that would make things look bad visually near expiration. Perhaps draw if `ttl != 0` so it doesn't impact "real" projectiles with positive TTL (since they explode when they reach 0) without affecting infinite negative TTL.

Contributor guide

Open the contributing guide

Research direction

Start with ExplosiveProjectile.cpp at the linked TTL check and trace how Spring.SpawnProjectile supplies an infinite TTL for Cannon projectiles. Reproduce a spawned Cannon projectile and verify the CEG trail behavior near expiration. Done means infinite-TTL Cannon projectiles draw their trail without changing the behavior of regular positive-TTL projectiles.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.