EasyBallistics plugin

Thanks, good to hear that.

By the way, made another video, covering common problem people run into with multiplayer (not just EasyBallistics, this is also relevant for default UE4 projectiles):

Question to author: as some stuff changed since the initial launch I have no idea how to spawn decals etc at the exit point on penetration? How to get a richochet event? thru a bind or something? Please help.

Impact event is fired every time the bullet hits something. Among other things it returns a bool “PassedThrough” which indicates that the bullet penetrated an obstacle, and a vector “ExitLocation” which gives you exit point of penetration. You can use that as location for spawning the decal.

EDIT: this event is only called on server. So if your project is multiplayer, you first need to use this to call your own replicated event that spawns the decal on clients. (see the bullet blueprint in the example project)

hmmm Is the exit location a worldspace or relative space transform? its a vector instead of transform : (
the event on impact is a server only restricted event. so I multicast the effect spawn from there directly.
Ive done some branching to set the effect type of penetration/ricochet/termination. it works. I can tell by the sound it makes. but still no exit proper effect. I try to spawn it at the exit location as world transform and rotation of invert actor rotation. any tips?

The location is in world space. For rotation, you can try creating rotation using ExitVelocity and MakeRotFromX.

I still have problem with spawning effects on exit point. I would love to see an example of this being done. I spawn effects all at once. sound, particle, decal - by a blueprint. so i need to place another one, and align it to surface normal on the exit hole somehow. :frowning: no luck yet.
I also wish to make some general typec of ammunition iwth different parameters - like penetration. so a full metal jacket, hollow point, tracer, and armor-piercing for example. I already got different types of bullets with different mass, spread, velocity etc. however in order to make 4 types for each of them it will get messed up.
Should I use material MAP and make physical materials efect maps for each ammo type?
Do they stack or overwrite with the values of the bullet? It’s not said in the tutorial videos or I might had missed it somehow? If they add up that would be perfect.

I also have a problem with despawning bullets at low velocity. mayby its due to object pooling?

Edit: and also apply force adds negative force. it pulls the objects toward the player instead of pushing them away. any idea why? seting the scale to -1 doesn’t help.

-Ok, i’ll add exit decals to the example project when i’ll have time to work on this (not sure when that’s going to be).
-Material map multiplies with bullet penetration. Penetration values for bullet can be changed at any point, so you don’t need multiple types, you can simply change it on BeginPlay. And yes, use material map, the old material system is deprecated and i’ll remove it soon.
-Bullets only despawn due to low velocity on impact, not in mid-air. This is intentional (imagine you’re shooting straight up, the bullet will slow down and then speed back up on its way down).
-If you mean the impulse multiplier: no idea how that could happen, the calculation is really simple force=mass*acceleration, no idea where it could reverse (unless you somehow set it up so the bullet exits the material faster than it entered).

EDIT: here’s a quick&dirty example with the exit decal: https://drive.google.com/open?id=0B20tIRBAcOlsTHpkOThUZGFIRnc

I can wait :slight_smile: Its not esential for the project. The particles and decals works pretty nice already :slight_smile:
I want players to find and track the number of bullets of specifit caliber and type - so I will use different object types regardless. However If I can make some behavior similar for “types” of ammo that would be great. I know penetration multiplies as on default it say “penetration multiplier” and is 1 ;D However all otehr values are unclear if they addup or multiply or overwrite. like angles and chances?
Thats right… but sometimes they fall next to a wall. colide with it all the way down. so its still a single hit event- dont despawn. other situation is when they hit something constantly (anoying sound spawn) and stay in place and don’t despawn. I’ll make a video.
The force strenght is perfect. the force DIRECTION on impact of object is reversed. so when I shoot a small object it get pulled toward me wqhen the force is applied. The force VALUE is a positive value and damage based on it is working perfectly.

I also added damage based on force and penetration depth. However I wonder if its posible to in example put an armor on character - as a separate component. On “receive damage” event in pawn - receive it ONLY if hit is made on component - CHAR MESH. BUT… Im not sure how backtrace works - if I have a vest for example really close to the mesh - will it account the penetration depth for entire mesh with vest, or just the vest, exit… and then enter the char mesh?

-If you have armor as a separate component, what you should do is to check if penetration depth is greater than thickness of the armor, and if yes, then pass the damage to the underlying object.
Unfortunately none of the penetration check algorithms can reliably deal with multiple “layers” directly.

Solid: best for convex collisions (ie simplified collisions, ragdolls, capsules etc), skips inside.
Backtrace: arbitrary mesh, tests collision from the other side, so if there’s multiple “layers” it skips the inside.
Forward: arbitrary mesh with double sided collision. In theory this could work if you had armor with double sided collision, and some room (collision margin) between it and next layer. However I wouldn’t recommend it, very fiddly setup. It would work for a tank, but definitely a bad idea for deforming character.

-As for how exactly the values stack: Spreads are added up, Friction and restitution are interpolated (influence controls how much, 0 is all controlled by the bullet, 1 is all controlled by the material), ricochet probability is a multiplier.

-The not despawning thing - is this in multiplayer? In multiplayer the client copies of the bullet only despawn when the server copy despawns, so if there’s any delay they might do that. However, as you said, they shouldn’t produce any additional hit events.
If it happens in singleplayer too, it could be a bug, could you try creating a small project that reproduces it?

-I still have no idea why impulse is applied in opposite direction. And even less of an idea why setting impulse multiplier to -1 doesn’t reverse it. The value isn’t clamped in any way and -1 should definitely reverse it.

I will wrap some of my work down soon and polish some mechanics - make a movie and post screens of how things are being done in the project.

V 1.8 released. Client side aim has been significantly improved. It no longer uses any bandwidth when not shooting and single shot weapons should no longer have any aim lag.

Hi moookiexl,

We have a problem ,when we want to set a velocity with (from bullet class) function “Spawn with Exact velocity”. The bullet location works as expected, but once we set own velocity there is a angle discrepancy about 2-4° (all depending on the distance). As you can see for debug purposes we add linetrace and LT works perfectly(from screen blue line, rest is from your plugin). Calculations are ok, since our debug line from LineTrace work as excepted. It looks like a bug from your plugin, but i just want to be sure that is not an our mistake. Can you please help us out on PM, skype or best on discord? As this issue is a project blocker for us and we already spend so much of our time on that without solving it. Screenshot attached also BP as example…

79aba7ea6bdc96ceec11d8bfd3457b4f76ceae06.jpeg

1b8e27a7bd9dfde9bed635fbfa2c556616556403.jpeg

Thank you for any help
Mike

You got PM

OK thx a lot it is solved… :slight_smile: Perfect support…

@moookiexl
My trigger event broke. I am pretty sure it was a reliable on server and now it jsut… is.
and stoped working except for server authority. doesnt work triggered in a “on server event” as whatever multicast functionality it did… it stoped… should I reinstall the plugin?

edit - reinstall of plugin didn’t help! :confused:

I haven’t changed changed anything in that part of the code recently. If it broke it’s because of UE 4.17. I’ll re-check it.

It not being marked as replicated is normal, it’s a wrapper function and replication happens behind the scenes. You can call it from either client or server.

EDIT: Tested. Works exactly as before. Not sure what’s wrong with your setup.
Can you create a project that shows the problem and send it to me?

And for everyone else:
since i had quite a few people asking if this can be used to simulate arrows, here’s a simple little VR archery demo.

Download: https://drive.google.com/open?id=0B20tIRBAcOlsNVZWYjZHWUprcTQ

(Only tested with Rift, if someone with a Vive tries it, please let me know if it works.)

Write priv message - i can add you to repository as the project is too big to pack it up. I nedd your microsoft email acocunt. we run repository on visualstudio.com
we run 4.16.3 and plugin version 1.80
I wlll upgrade a copy of the project to 4.17 and see if it could help.
It worked perfectly a week ago. now shoot executes only on server. its getting triggered by a plueprint interface inside a weapon directly

PM with account sent. Anyway:

Then it’s definitely some change you made. The update I released previous week was a 4.17 compatibility fix that didn’t change any code, just the .uplugin file.

Is it possible to make the arch curve more? I mean, to let the arrow drop faster