Be the first to post for 'Ranged Attack Problem' TEMP

As there is not a tagged topic yet as the video has recently been uploaded i made a temporary topic to post to. When the links go up and the proper topic raised and linked then either the team or I will moderate this (hopefully i can move posts) to the new topic.

The problem is with the controller only controls is we cannot target.
This creates a problem as in we cannot attack at all whilst in this mode.
A solution and preplanning for me was to use the shoulder buttons on the gamepad to change target.

  1. using a coded method to select targets in range and cycle though them closet to the furthest.
  2. Be able to rotate back to the first target again after last target in range was selected.
  3. Ensure to make it so it only worked in (isDirectInput), This is to prevent controller control during (!isDirectInput).

In preplanning i also planned to change skills up and down the skill list via the controller shoulder buttons as well.
(We need more controller buttons!)

2 Likes

I immediately thought of locking targets for ranged attacks. Since we’re already using ray casts the solution could be the following:

  • Apply joystick input to rotation of the character
  • Cast a ray in the forward-direction of the character and make it’s reach visual (length of raycast = distance for range attacks)
  • Whenever the ray hits an attackable/destroyable object, (1) initialize a snap or (2) you can also have the select-radius of the target be a bit bigger than the size of the target to prevent the raycast from deselecting it too fast. Anyway, show visually that the target is being selected and is lockable.
  • Apply a lock with a button on the gamecontroller. You can select next target based on another buttonpress.
  • If locked, you can fire at the target. Even if you run away from the target and become out of shooting reach, this does not matter. The attack simply does not reach the target but you can fire towards the correct direction of it.
  • eventually you can add camera motion to keep player and target in the game window.

Just coming here to say that:

A) the links still aren’t hooked up on the YT video and

B) A great programmer friend of mine always said “a good programmer isn’t afraid to throw away their code”. When you hang on to cruft that’s when you get into all kinds of mess with spaghetti code, bad games/software and legacy support. Blech!

C) I agree with the solution to just let them shoot as far as they like. I think that can be combated with less chance to hit with the further the projectile flies or a damage fall off so it is less affective once it goes beyond a certain point. I guess we’ll see how it’s handled soon! :slight_smile:

Privacy & Terms