Top Down Shooter & Aiming

Hi Everyone,

I posted this in the general forum and realized it was probably the wrong forum. So here we go.

I’ve been scouring around the web for a elegant way to handle elevation changes in a 3D twin stick shooter and need some direction on how best to implement this in UE4 or if it is even a good idea to do. It opens up much needed dynamism but certainly presents some challenges on the back-end.

Valve’s Alien Swarm does this though I haven’t been able to dig in to find how they do it. Basically if there’s an alien on terrain above or below, one can aim with the cross-hairs, and shots automatically angle to reflect this to fire at the target. In most other cases, the shots continue on the same plane as the actor like any twin stick shooter.

Now I see two potential options here though perhaps there’s more:

  1. Shots only angle up or down if the cross-hair is over the enemy.
  • This means aim has to be accurate and no real chance for suppression or environment destruction of objects.
  • I think Alien Swarm uses this method.
  1. If the cross-hair is over a different plane, the shots auto-angle towards that plane.
  • I can’t think of any downsides compared to #1 as it would require accurate positioning.

Collision challenges with angle shots will exist so elevation gets the advantage from a cover perspective which is realistic. Are there any other thoughts on this topic?

Thanks!

I think the second approach would be the one I would go for. As a player it would annoy me if my character shoots in a sloping face whenever I do not aim super correctly. And in addition to that I guess it is also easier to implement? For determining the angle of the shot you consitently always take into account the position (i.e. elevation) of the player and the cursor.

Hey MrSlinky.

I’ve done something like this with a current project and tried both options. Ultimately I found it much easier to implement this when I changed from a projectile weapon to a trace instant hit weapon.

I think that the game Torchlight uses your first technique too, and in fact one of the frustrations I had with that game was difficulty in aiming at higher or lower elevations (as says). I abandoned the approach in my own project. I’ve instead gone with your second technique and integrated it with a general interaction system. You could go with a hybrid perhaps, where aim remains on the same plane of the character unless the player holds a button, which enables shots to angle up or down according to the plane the cursor is over.

One issue I’ve found with the second technique is that my characters are always looking down into the ground due to aim offsets. I imagine there’s something simple that can be done in the animBP to avoid that but I’ve not found it yet.

Hope these thoughts helps a little. :slight_smile:

Is there any chance of you posting up part of your solution Kev? I’ve been having issues when trying to implement the elevation changes.

Hey @SithHunter . Sorry for the late response, I don’t check the forum as much as I used to. I don’t have the project any longer but I’m pretty sure what I did in the end was:

1 - Get the impact point under the cursor when fire was pressed.
2 - Run a capsule trace from the player’s weapon to the impact point.

If the trace’s impact point hit world geometry or another obstacle then I’d try to get the first enemy that the capsule hit and the shot would hit them - a limited form of aim assist that avoided the player wasting shots aiming at something too far away. This is possible when using a trace hit weapon, but probably not with a projectile weapon.

My ultimate takeaway was that aiming up and down in a top down shooter was hard to implement and that I’d probably try to keep combat areas pretty flat if I tried to implement a top down game again.

Hope this helps you out a little.

Hey, sorry @kevdotward for not responding sooner. I’ve been tied up and haven’t had much of a chance to really dig into my project until this weekend. I’ll give this a try and let you know how it goes. Thanks for the suggestion!