#Javelin missile launcher

156 messages ยท Page 1 of 1 (latest)

chilly crag
#

I think it would be cool to have a realistic Javelin missile launcher in the game.

I do not know how to do the lock-on and projectile animations and custom particle effects.

The real-world Javelins lock onto a target or point, ejects the missile out, then the missile fires straight up into the sky and flies down onto the locked location/target.
How difficult would this implementation be?

chilly crag
#

I managed to get the projectile to go up and then follow any actor that has a specific tag. The issue now is I cannot figure out ray-casting.
My plan is to create an empty actor with the relevant tag at the ray-cast hit of where the player is aiming, but I am having issues with implementing ray-casting

graceful willow
#

loving the arm break when reloading! ๐Ÿ˜‚

chilly crag
soft wave
vagrant spear
#

Also I'm curious do you have an ADS?

slim elk
#

Hey, I would love to help in making the missile behave more "realistically". What FGM-148 Javelin launcher variation is it and what is the name of the primary missile fired in your showcase?

#

Also your trajectory should look more like this than a Parabola.

chilly crag
chilly crag
chilly crag
chilly crag
vagrant spear
slim elk
# chilly crag Interesting. Could you elaborate a bit?

Sorry, Figure 4 is what the motion of the missile should look like, with height of the missile on the Y-axis and range on the X-axis. Without making it overly complex and simulating the flight path, you could just draw this graph with Bezier curves and then scale it up based on distance. This would also allow for the iconic deployment look of the FGM-148 Javelin launcher.

chilly crag
slim elk
chilly crag
slim elk
#

Also, here is a really good video of a showcase of the screen and controls of the FGM-148 Javelin launcher: https://www.youtube.com/watch?v=plrYVkZsWp4

Soldiers assigned to 3rd Squadron, 4th Cavalry Regiment, 3rd Brigade Combat Team, 25th Infantry Division, use a TOW missile trainer and a Javelin Enhanced Producibility Basic Skills Trainer (EPBST) at Schofield Barracks, Hawaii. The trainers allow the Soldier to view a screen of simulated surroundings to located and destroy a target.

AiirSour...

โ–ถ Play video
chilly crag
chilly crag
#

Current state of project:
Struggling to get the scope of the javelin to look right. Something with the material color is giving me problems.
(See images)

#

Future concerns:

  1. I use the player character blueprint for the lock-on system, which I am worried will give the lock-on functionality to any player from any faction.
  2. Ray-casting sometimes hits the player and doesn't lock-on at the range you always want. (I think the ray-cast is bound to the player and hits anything in front at ground level)
  3. Animations (I am not good with making custom animations)
  4. Usability by bots (I have no idea if bots will be able to use the javelin, due to requiring a lock-on first)
  5. The same actor is used as the lock-on object, which means that all players' lock-ons might confuse the projectiles, if there are too many on the map.
vagrant spear
chilly crag
vagrant spear
#

Hmmm that is curious how it ended up like that

placid meadow
#

@chilly crag, I think I have a little something for you! ๐ŸŽ

chilly crag
placid meadow
#

๐Ÿ‘€ You'll see

vagrant spear
#

๐Ÿ‘€

past patio
#

awsome guys

chilly crag
proud crow
#

What vehicle mod you using?

placid meadow
#

FGM148_Mod_Source.zip

#

Just drop in the same folder next to your mod and you can see how I did everything in the test map

#

This includes just enough for you to get started on the overylay, I made all of the elements by hand, but you're free to use them.

#

The thermal post process material instance, in MaterialLibrary/MI_FLIR_FGM148, is applied to the scope weapon, but that's a child of the old scope weapon so you should just use the new scope component and apply the post process material there.

#

Overlay WBP, textures, and audio are all included

#

BP_HDPlayerCharacter_ATGM is necessary to set these properties on the character meshes, that's the only modification necessary to make in character though

#

The thermal material uses custom stencil value as a the base temperature value, and applies others parts of the buffer to make it look more realistic

placid meadow
#

In the material instance you can set the Resolution Y value to a higher value if you don't like the pixelated effect as much, or you can disable the Use FLIR Resolution option altogether, but I think it adds a lot of realism

#

There is also a Use FLIR Color Gradient, instead of a simple color this use a texture gradient (included) as a look-up table

#

You can also use the 3Color option and set a 3 color gradient

placid meadow
#

White hot / black hot polarity

#

Primary FLIR controls for gain / contrast

chilly crag
#

Cool, thanks so much @placid meadow

placid meadow
#

Made a few parameter changes to make things less confusing ๐Ÿ˜„

#

Feel free to ping me any time if you have questions

chilly crag
past patio
#

this is awsome

#

you guys are so good at this

#

will you guys release this as a source code or a packaged mod?

chilly crag
chilly crag
placid meadow
#
  1. Ray-casting sometimes hits the player and doesn't lock-on at the range you always want. (I think the ray-cast is bound to the player and hits anything in front at ground level)
#

What are you using this for specifically? Line of sight check?

#

If it is for line of sight from the launcher to the target, use this instead

#

This is a very consistent function

#

For performance I do something like this

#

First check if distance is within some threshold (very cheap)
Check if player is on screen even if they are occluded (fairly cheap)
Light of sight check (more expensive, but very accurate)

#

Is On Screen function

chilly crag
placid meadow
#

Yeah, for both the lock-on by the launcher and the missile line of sight check will work better

#

You can modify the Is On Screen function to check if the actor is within a smaller area on screen, so a lock-on box basically, if it is within that area then you check line of sight

#

For the missile I might do an off angle check from the missile's forward vector

#

That is, if you plan to simulate the seeker at all

chilly crag
placid meadow
#

Did you already implement a DIRECT / TOP attack mode select?

chilly crag
#

Another main issue I worry about is the lock-on method when other players/bots are in-game with Javelins. I currently spawn an actor with a specific tag, and that's how the projectile knows where to go. The issue is that I need to separate everyone's actors so their missiles only fly to their own actors...

chilly crag
placid meadow
#

Your concern is absolutely valid, it will get the first actor index with that tag, and tags have other issues

#

So when you spawn the target, just pass the actor object to a custom event on the Projectile, something like SetTarget(Actor)

#

Then, when the Projectile initializes On BeginPlay, it should just check if target is set yet, as it won't be for a few miliseconds

#

The Javelin actually doesn't seek until after the boost / climb phase anyway, so you'll only need the target after motor burnout

chilly crag
placid meadow
#

Search for "Spawn Actor From Class", then in the class select Actor or a custom actor

#

If you want to track a moving target, you should attack Actor to Target Actor

sacred furnace
#

Would most likely be cleaner to have the var exposed if you're spawning the actor when setting the target ref

chilly crag
placid meadow
#

After attaching your actor to the target actor, you can get the actor bounds origin and set world location so that the actor the projectile is locked on to hits the center of the target, not the origin which could technically be anywhere

#

If you check Only Colliding Components, than it will calculate the bound from active collision meshes only, this could be useful if there was some component that made the actual bounds much bigger

#

Now your missile should be able to lock on to a moving target's center of collision bounds

#

Then you just pass the reference to the projectile via a custom event, which will happen after it has initialized anyway, and that function will set its own target variable

#

In your seeker you would probably have to use a line trace by channel (visibility) with complex collision enabled, tracing from the missile seeker to the target

#

That is again if you want to be able to break lock or any such functionality

chilly crag
placid meadow
#

Depending on speed though you would have to lead the target's velocity vector, so it gets complicated fast

placid meadow
# chilly crag I see this as a "bells-and-whistles" item, so not yet ๐Ÿ˜…

I would say that even for a fairly basic implementation of the Javelin this will be necessary. Being able to select between DIRECT / TOP attack is fairly fundamental.

TOP attack has a much lower minimum range limit, because of the climb phase of the flight profile, it is used against armor at a considerable distance away.

DIRECT still climbs, but much less so and can arm the warhead and hit a much closer target

placid meadow
#

Something cool about the NLAW, it only fires in DIRECT mode, where it does not have a passive seeker at all, but tries to fly a perfectly straight line to the aim point, and has a magnetic fuse to detonate over the target

#

This is why the NLAW does not need TOP attack mode to kill armor, because the warhead flies over and the shaped charge is aimed down

#

Crazy weapons, but for the FGM-148, DIRECT / TOP attack modes are essential

past patio
#

NLAW has a pretty complex inertial guidance tho

#

to make it realistic of course

placid meadow
#

Absolutely. In games you can basically set gravity to very low just add a little up/down/left/right random movement during flight, which simplifies it

#

Javelin is a beast to simulate ๐Ÿ˜„

#

(exp: 8+ years in military simulation ๐Ÿ˜…)

past patio
#

yeah javelin is fucked up

#

the tricky thing I see in modelling the NLAW 100% correctly is that the inertial navigation fir the NLAW can be set to follow a angoular velocity for a moving target

#

but idk if that is actually hard or not to model as I am a mod noob

placid meadow
#

Constant angle rate guidance isn't too hard

past patio
#

even when that angle rate has to be picked on the spot based on the movement of the sight?

placid meadow
#

Yep, not hard if you don't fully simulate the missile as an aerodynamic projectile, once you add aerodynamics everything gets hard though

#

Most games just simulate missiles as basic kinematic objects, no actual physics

past patio
#

yeah fair

#

not very much added value in that much level of modelling especially for such weapons

visual ice
#

Nice ๐Ÿ˜„

chilly crag
# placid meadow

This is a bit complex for me to figure out how to use it in my setup. I might need some guidance or an explanation, please ๐Ÿ˜ฌ . This is my current ray-cast setup to spawn the prefab where your character is looking. You will probably see the flaw (the fact that it is raycasting from the character itself)

#

And this is what makes the projectile lock on and fly upwards

#

I'm still a bit new to blueprint logic, sorry

visual ice
#

Pretty nice. I've often thought you just need to use splines to make missile locking reliable

chilly crag
# visual ice Does it account for a moving target?

No, this is very basic.
It's basically: When projectile is spawned, fly up for X seconds, then find actor with tag "Homing" and fly to it.

It MIGHT work on a moving target, but it may not be very accurate or effective

visual ice
#

Bonus points if it homes in on where it thinks the vehicle WILL be ๐Ÿ˜„

slim elk
slim elk
placid meadow
#

I don't know, I absolutely suck at math and was able to implement a quartic solver to calculate the ballistic trajectory for intercepts between two moving objects. I can't stress enough how bad I am at math. ๐Ÿ˜„

#

@chilly crag Bluedrake said your Javelin will support direct and top attack modes in a video, so now you have to implement it! ๐Ÿคฃ

chilly crag
visual ice
#

The missile just tries to keep you in the same area of its view

slim elk
slim elk
visual ice
#

You can't be that bad at math if you have the tolerance to even copy someone else's implementation for a quartic solver lmao

#

Quartic equation, for anyone curious

#

not a joke^

#

I think it's also expensive to calculate. At least every frame/tick

#

You don't need the mathematically perfect aim orientation. But I get the desire for it

#

Battlefield does "pure pursuit"

#

which is basic bitch missile tech

slim elk
slim elk
chilly crag
placid meadow
#

You absolutely would not implement are quartic solver for missile guidance in a game, that's the wrong solution to begin with

#

Pure pursuit would be for a SAM, while a ATGM could use a fairly simple PID loop with simple lead estimation only if the target velocity vector is above some minimum threshold

#

The key for Javelin will be the flight profile, which consists of climb, glide, terminal phases, where the angle of each is defined by the attack mode

#

Climb phases is unguided, while glide and terminal are guided but with different PIDs

past patio
#

absolutely correct

#

SAMs needs to take an interception path becouse they need to deal with much higher velocities

placid meadow
#

Terminal needs different PIDs than glide because as the missile closes distance with the target any amount of off angle will increase exponentially. Glide PIDs are tuned for low anglular deviation, while terminal PIDs are tuned for high angular deviation.

chilly crag
#

But won't this target-interception only be required for high-speed targets, such as jets?

placid meadow
#

Still required for a moving vehicle, it just needs to lead the target though, nothing like actual missile guidance

placid meadow
#

@chilly crag are you still working on this? Let me know if you're stuck or something

chilly crag
placid meadow