Opened 18 years ago

Closed 12 years ago

Last modified 12 years ago

#18 closed enhancement (fixed)

[PATCH] Realistic ranged attack

Reported by: Stuart Walpole Owned by: Jonathan Waller
Priority: Must Have Milestone: Alpha 11
Component: Core engine Keywords: patch
Cc: Patch:

Description (last modified by Kieran P)

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

Attachments (6)

advanced_attack.diff (31.4 KB ) - added by Jonathan Waller 12 years ago.
advanced_attack-220212.diff (33.8 KB ) - added by Jonathan Waller 12 years ago.
templates_splash.diff (2.3 KB ) - added by Jonathan Waller 12 years ago.
Example template modifications adding splash for siege
status_bars_hack.diff (639 bytes ) - added by Jonathan Waller 12 years 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 Jonathan Waller 12 years ago.
New version with fixed square footprint bug
advanced_attack-250412.diff (39.3 KB ) - added by Jonathan Waller 12 years ago.
updated to latest svn

Download all attachments as: .zip

Change History (21)

comment:1 by (none), 14 years ago

Milestone: Advanced Playability Demo

Milestone Advanced Playability Demo deleted

comment:2 by Andrew, 14 years ago

Milestone: Backlog

comment:3 by Jonathan Waller, 12 years ago

Description: modified (diff)
Keywords: review added
Milestone: BacklogAlpha 9
Owner: set to Jonathan Waller
Status: newassigned
Summary: Entity - Attack - Area Ranged[PATCH] Entity - Attack - Area Ranged

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

by Jonathan Waller, 12 years ago

Attachment: advanced_attack.diff added

by Jonathan Waller, 12 years ago

Attachment: advanced_attack-220212.diff added

comment:4 by Jonathan Waller, 12 years ago

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 by Kieran P, 12 years ago

Priority: Nice to HaveShould Have

comment:6 by historic_bruno, 12 years ago

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.

by Jonathan Waller, 12 years ago

Attachment: templates_splash.diff added

Example template modifications adding splash for siege

by Jonathan Waller, 12 years ago

Attachment: status_bars_hack.diff added

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

comment:7 by Kieran P, 12 years ago

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 by Kieran P, 12 years ago

Milestone: Alpha 9Alpha 10
Type: taskenhancement

comment:9 by Kieran P, 12 years ago

Description: modified (diff)
Priority: Should HaveMust Have
Summary: [PATCH] Entity - Attack - Area Ranged[PATCH] Realistic ranged attack

by Jonathan Waller, 12 years ago

Attachment: advanced_attack-160312.diff added

New version with fixed square footprint bug

comment:10 by Jonathan Waller, 12 years ago

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 by FeXoR, 12 years ago

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 by Kieran P, 12 years ago

Keywords: patch added

by Jonathan Waller, 12 years ago

Attachment: advanced_attack-250412.diff added

updated to latest svn

comment:13 by Kieran P, 12 years ago

Keywords: patch, review → patch review
Milestone: Alpha 10Alpha 11

comment:14 by Jonathan Waller, 12 years ago

Resolution: fixed
Status: assignedclosed

In 11886:

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

comment:15 by historic_bruno, 12 years ago

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