Ticket #18 (closed enhancement: fixed)

Opened 7 years ago

Last modified 12 months ago

[PATCH] Realistic ranged attack

Reported by: stuart Owned by: quantumstate
Priority: Must Have Milestone: Alpha 11
Component: Core engine Keywords: patch
Cc:

Description (last modified by k776) (diff)

  • Ranged attack projectiles should not guaranteed to hit target
  • Splash damage should be implemented when the projectile hits something (target, ground, or otherwise)

Attachments

advanced_attack.diff (31.4 KB) - added by quantumstate 15 months ago.
advanced_attack-220212.diff (33.8 KB) - added by quantumstate 15 months ago.
templates_splash.diff (2.3 KB) - added by quantumstate 15 months ago.
Example template modifications adding splash for siege
status_bars_hack.diff (639 bytes) - added by quantumstate 15 months ago.
This makes status bars show at all times, useful for watching the effect of splash damage
advanced_attack-160312.diff (35.0 KB) - added by quantumstate 14 months ago.
New version with fixed square footprint bug
advanced_attack-250412.diff (39.3 KB) - added by quantumstate 13 months ago.
updated to latest svn

Change History

comment:1 Changed 3 years ago by anonymous

  • Milestone Advanced Playability Demo deleted

Milestone Advanced Playability Demo deleted

comment:2 Changed 3 years ago by wacko

  • Milestone set to Backlog

comment:3 Changed 15 months ago by quantumstate

  • Status changed from new to assigned
  • Description modified (diff)
  • Summary changed from Entity - Attack - Area Ranged to [PATCH] Entity - Attack - Area Ranged
  • Owner set to quantumstate
  • Milestone changed from Backlog to Alpha 9
  • Keywords review added

I have attached a patch. The graphical arrow collision is not a perfect match for the gameplay one but it should be close enough.

The code uses a Gaussian distribution and defines spread which determines the scaling of the gaussian. The Gaussian will have width Spread at distance 40m from the archer. This means about 2/3 of the missiles will hit a target of size spread at 40m. The spread is linearly proportional to distance.

Issues: If the entity being attacked dies before the missile arrives then the missile has no effect.

I consider these to be minor

Changed 15 months ago by quantumstate

Changed 15 months ago by quantumstate

comment:4 Changed 15 months ago by quantumstate

Attached an updated diff. Now ProjectileManager? gets told when to remove a projectile that has hit the target.

Also I added some speed based inaccuracy and removed the distance based inaccuracy, this can be easily changed if people want it to work differently.

comment:5 Changed 15 months ago by k776

  • Priority changed from Nice to Have to Should Have

comment:6 Changed 15 months ago by historic_bruno

Can you post a patch with some templates changed for demonstration? (or maybe some new templates to compare with the current behavior) I want to test it but have no idea what combination of parameters is sensible.

Changed 15 months ago by quantumstate

Example template modifications adding splash for siege

Changed 15 months ago by quantumstate

This makes status bars show at all times, useful for watching the effect of splash damage

comment:7 Changed 15 months ago by k776

This is where the patch to make tab toggle health bars (#1187) would be helpful. Lets try get that one into Alpha 9.

comment:8 Changed 15 months ago by k776

  • Type changed from task to enhancement
  • Milestone changed from Alpha 9 to Alpha 10

comment:9 Changed 15 months ago by k776

  • Priority changed from Should Have to Must Have
  • Description modified (diff)
  • Summary changed from [PATCH] Entity - Attack - Area Ranged to [PATCH] Realistic ranged attack

Changed 14 months ago by quantumstate

New version with fixed square footprint bug

comment:10 Changed 14 months ago by quantumstate

I have attached a new patch version fixing a bug where rectangular buildings were treated as being twice as big as defined. For the final version I will make <Spread> a non-optional attribute but my templates are a mess currently so it was easier to leave it optional at this point.

comment:11 Changed 14 months ago by FeXoR

Does this patch only check if the projectile hits the original target or where the projectile lands and if there is a unit? Does it take in account the targets movement?

comment:12 Changed 13 months ago by k776

  • Keywords patch, added

Changed 13 months ago by quantumstate

updated to latest svn

comment:13 Changed 13 months ago by k776

  • Keywords patch added; patch, removed
  • Milestone changed from Alpha 10 to Alpha 11

comment:14 Changed 12 months ago by quantumstate

  • Status changed from assigned to closed
  • Resolution set to fixed

In 11886:

Added randomized arrow positions with hit detection when the missile lands and splash damage. Fixes #18.

comment:15 Changed 12 months ago by historic_bruno

  • Keywords review removed
Note: See TracTickets for help on using tickets.