[RELEASED] Fire Arrows - Smart and Performant AI Ballistics With or Without Flame!

Rain fire death on the enemy with this simple nifty package.

Designed so NPC or AI can strike out with projectile arrows with perfect (or imperfect) accuracy.

No coding knowledge required - but complete source code comes with!

1452164--78565--$logo.png

WebPlayer Demo - watch but can’t shoot

WebPlayer Demo - First Person - shoot away!!

Arrow will ‘stick’ in designated objects (even those other than target objects - like terrain or buildings) and child to them - so that hitting an arrow embedded in a zombie’s skull will move along with the zombie.

Optional rigidbody (works fine without - physics calculations are handled manually) allows you to load up a scene with many many arrows without the physics overhead. (NOTE that you must have a rigid body on any objects that an arrow can hit IF you go this route)

Set your own arrow ‘force’ to limit range or forcing ‘arcing’ of arrows to reach targets.

Predictive targeting available with configurable sampling rate to ‘lead’ targets (hit a moving target)

Handles different shooter/target heights. Will arc higher if force is too low to hit target on direct shot

Random ‘inaccuracy’ parameters

Ability to randomly aim for targets in scene or track a specific gameobject.

Arrow and flame ‘destroy’ time parameters

Optional/additional Blue and Green fire arrows.

Message callbacks to struck targets (to apply damage or whatever)

Multiple scenes with examples aplenty.

No use of tags - Targetable and Embedable scripts you can add to any gameobject

v1.5 additions!!

.Boom arrows. Arrows that go ‘boom’ when they hit something. Including explosion effect, sound and physics force
.Some sound effects - pool of ‘woosh’ and ‘twang’ and ‘thunk’ sounds.
.Changes to ‘random’ target selection logic to allow for only targeting those ‘in range’.
.Revamped tracking system for predictive firing to track multiple targets simultaneously
.Added ‘shred’ capability to ‘explode’ simple meshes upon impact.
.Added first-person launcher capability with both ‘straight’ and ‘perfect’ fire methods.

Asset Store link

I posted a webplayer demo:

https://googledrive.com/host/0B42_t04JD1sYR0lQV1lUa2d4M0k/FireArrowWeb.html

Also - I found a glitche as I was working on that scene (predictive logic doesn’t have time to ‘predict’ when switching between random targets (works fine with single dedicated target).
I have a fix queued up but need to get Asset Store approval before I can push it. Will be happy to provide any purchasers with ‘fix’ if necessary before hand if you PM me.

Plans for version 1.2 (1.1 is minor glitch fix I talked about above)

.Creating arrow object ‘pool’ so people who want katrillions of arrows can have them with improved performance
.Boom arrows. Arrows that go ‘boom’ when they hit something. Including explosion effect, sound and physics force
.Some sound effects - pool of ‘woosh’ and ‘twang’ and ‘thunk’ sounds.
.Changes to ‘random’ target selection logic to allow for only targeting those ‘in range’.
.Better predictive logic (more expensive computationally- but will be optional)
.Ability to ‘queue’ up arrow visually and ‘pause’ before launching.

v1.1 is released - fixed glitch with predictive firing and random target selection (makes it more better). Essentially when ‘switching’ targets, it will wait a cycle before firing in order to better ‘predict’ the path of the target.

Future versions (2.0?) will track multiple targets at the same time - so switching targets will be quick and easy.

I think that I will work up a new webplayer demo that allows YOU to fire an arrow - based on target closest to center of mouse (or a crosshair system) - still using predictive techniques to land on target.

Boom Arrows - Work in Progress…
Delayed ‘fuse’ technique and “boom on impact” - then some color booms. Blue ones are POWERFUL.

http://youtu.be/fkcwYFDPArU
http://youtu.be/bH9X6qI-ItE
http://www.youtube.com/watch?v=dr7WhBhrNrY

Watching boom arrows from the ground…

And finally…
A crazy onslaught

Having fun now…
Exploding (shredding) targets.

I’m using a very simple script to break the gameobject mesh into component triangles - which works well on unscaled simple cube primitives - totally UNOPTIMIZED and unsuited for complex meshes or scaled objects.

I HIGHLY recommend THIS asset - it totally rocks for this sort of thing
http://u3d.as/content/ndp-tools/mesh-explosion/3Fd.

Hoping to have v1.2 done by end of weekend - I also want to throw in a first person demo scene where YOU can shoot and some prefab helpers.

…trying to come up with more ‘performant’ particle effects for those of you targeting mobile…(currently uses tweaked ones from Standard Assets)

Sound effects added and multi-target predictive tracking improvements.
Also tuned up the FPS control considerably including zoom- allowing for ‘perfect’ aim or non-perfect (wherever I point at current force).

In video below, quick-time caused stutters and sound sync issues - it is really much better in reality.
WATCH WITH SOUND!

Ok - Cleaning up code and prepping documentation.

In the meantime, here is a webplayer demo of some of the First Person elements seen in the above video.

https://googledrive.com/host/0B42_t04JD1sYR0lQV1lUa2d4M0k/FireArrowFPSWeb.html

(In most browsers, you can ‘right click’ for perfect-aim shots instead of toggling with P)

BTW - probably going to bump the price up to $10. Lots more work and features…
So buy while you can at lower price if you are interested in getting the new updates for cheap.

v1.5 coding and documentation is complete. Submitted to Asset Store - waiting on approval

Changes include:

.Boom arrows. Arrows that go ‘boom’ when they hit something. Including explosion effect, sound and physics force
.Some sound effects - pool of ‘woosh’ and ‘twang’ and ‘thunk’ sounds.
.Changes to ‘random’ target selection logic to allow for only targeting those ‘in range’.
.Revamped tracking system for predictive firing to track multiple targets simultaneously
.Added ‘shred’ capability to ‘explode’ simple meshes upon impact.
.Added first-person launcher capability with both ‘straight’ and ‘perfect’ fire methods.

Revised version 2.0 goals:

.Creating arrow/explosion object ‘pool’ so people who want katrillions of arrows can have them with improved performance.
.Mobile-friendly particle effects (for flame and explosions)
.Better predicative techniques that detect obstacles in flight path and adjust force/angle as appropriate
.Better predicative technique that uses iterative simulations to better handle targets moving up/down and forward/back.
.Realistic looking arrow model(s)
.Destroy arrows on boom and also make fade instead of abrupt disappear with no boom.

As I wait for v1.5 approval by Asset Store, I have been working on more realistic looking arrow models. Be gentle - my first Blender work.

1463925--80102--$4.png

V1.5 is now live!!

As I have been working on using Fire Arrows in my own came concept, I came across some shortcomings of the ArrowTargetable implementation and have since added a ‘side’ designation to allow multiple ‘entities’ with multiple launchers to target other ‘sides’ but not themselves.
This will be wrapped up in v 2.0 as well.

Also - look out for a sister package - Fire Balls! coming soon…

This looks cool! How difficult would it be to adapt this to a 2d platformer? Also, is the ai smart enough to know if there are objects in the way? For example if an enemy was behind a wall would they know to shoot over it or just try to shoot through it?

As far as 2D goes - actually - assuming that all ‘units’ are on the same Z, I’m pretty sure it would work fine. Are you talking about using the new 2d physics in Unity though? If so - I’ll probably have to create a special 2d version.

As far as obstacles - yeah that’s a version 2.0 item. Coming soon!!

Sweet good to here that obstacles are in the pipeline.

I didn’t think about the issues 2d physics would cause. Still this only effects collisions right? When I get to the point in development where I want to add this functionality I’ll more than likely pick this up and try to get it working. Based on the videos it really does seem like a cool asset. I can’t help but think of ranged combat in Skyrim lol.