Questions tagged [aiming]

Taking focus on a target, often to shoot it, and even more often in the head.

Filter by
Sorted by
Tagged with
1
vote
1answer
69 views

How to calculate rotations for an object with scaling transformations?

I am working on implementing scaling transformations into a game engine (C++), which previously assumed only translations and rotations. Visually, the scaling works, but a lot of the game logic ...
0
votes
0answers
60 views

Leading a target with edge casting

I am trying to write a movement prediction code. I have found the quadratic method with these topics: [1]: How to calculate shot angle and velocity to hit a moving target? [2]: http://...
0
votes
1answer
205 views

Shooting the closest enemy that you can see

I'm trying to make my main character aim at the closest enemy that he can see. My issue is with the close range criterion taking priority. If the enemy is near the player but the player can't see him,...
1
vote
3answers
134 views

Targeting with a ballistic gun

I am trying to determine the gun elevation angle of a gun that fires ballistic projectiles. For a target at a certain distance D, I will have to compute an angle that increases with D. This relation ...
2
votes
2answers
2k views

Projectile Aim Prediction with Acceleration

I'm trying to solve the classic shoot moving object problem but with acceleration attached to that changes it from a quadratic to quartic formula but my math skills are not this good sadly as i prefer ...
2
votes
1answer
550 views

Rotate object such that a child object is facing a target (3D)

Given a parent object A and a child object B, how do I find the rotation of A such that B is pointing toward the position of a target C. This is a simplified way of solving 'what angle does the torso ...
1
vote
1answer
378 views

How do Aimbots get detected?

I was wondering on the programming methods which are used to detect when a player is using an Aimbot/AutoAim cheat.
3
votes
0answers
369 views

Why is my 2D mouse aim not working properly?

I'm trying to program 2D mouse aim, where the arms and the gun in the arms rotates to point at the mouse. But for some reason, the arms and gun rotate and do not follow the mouse position. The each ...
1
vote
1answer
971 views

Aim assist (GoldenEye/Perfect Dark)

Anyone remember how the aim assist works in GoldenEye on n64? Where the gun model would point at an enemy if he's within a certain area in your field of view. I'm trying to do something like that but ...
1
vote
1answer
467 views

How to calculate the ideal hit of arrow?

I am trying to make the AI shoot an arrow and always hit the target. Assuming that the target is within his range I am stuck what the correct way is to do this. I search and found some solutions but ...
0
votes
0answers
126 views

Algorithm for 2d AI aiming to compensate for gravity [duplicate]

In a 2d side-view scenario I have two riflemen aiming at each other. By normalizing the x and y difference they know the direct path to the enemy. However, gravity will pull the projectiles downwards,...
1
vote
1answer
83 views

Efficiently detect shoot direction with gravity playing a role?

How could I efficiently calculate shoot direction for enemy AI in order for it to hit the player? Things I know: player position, player velocity, gravity, bullet spawn position, bullet initial ...
0
votes
2answers
3k views

Aiming direction using mouse

I'm using the following code to rotate my object using mouse, for aiming direction. The only problem with this is that it only rotates between 0 to 180 and not full 360 degrees. Can any help me locate ...
0
votes
2answers
1k views

Calculating pitch angle to hit a target using a projectile that has fixed speed

I am trying to calculate a vertical angle needed to hit a target at [distance, elevation] 2D coordinates relative to shooter given a fixed projectile velocity, air ...
0
votes
2answers
224 views

How to get a turret to shoot at player in a shmup

I'm developing a basic vertical shoot em up on the DS and am trying to get stationary turrets to shoot at the player in a shoot em up. Early on I simply had them shooting in fixed 8 directions N, S, E ...
3
votes
1answer
288 views

Determine if an object is inside a ship's turn radius, rotation via torque

I have a 3d space game where all ships move around using physics. I am trying to determine if a given object is reachable by a ship at a given velocity and turn radius. I believe the formula for turn ...
0
votes
1answer
3k views

Aim at moving target (or predicting target's position at time it takes for projectile to hit it) [duplicate]

I have a game where I know the location and velocity of my target. I know my own location and the speed of my projectile. I want to determine either the location of the intersection between my ...
1
vote
1answer
477 views

Moving turret aiming at moving target

I've found this post Turret Aiming Formula on Reddit and a nice answer a while back. The solution in the answer works great for still sanding turrets but is almost unusable for moving turrets since ...
4
votes
1answer
4k views

How do I make a 2D character aim their gun toward the mouse?

Heli Attack is a perfect example of the shooting mechanic I'd like. The character aims perpetually toward the mouse. What's going on here? From what I've read so far, you could separate the arm and ...
0
votes
1answer
608 views

Movement / aiming algorithm in 2d / tiled based game

I'm trying to create simple 2D / tiled base game in JavaScript. Entities are able to move by any number of pixels, but only in one direction at once (can't go in diagonal way). AI for enemies is ...
3
votes
3answers
2k views

Calculating 2D Physics Prediction of Shot Angle with Moving Velocity of both targets

I currently have the math right to hit a moving target with 99% accuracy as long as I don't move. When I start moving the aim is nearly 80%, it should also be 99% accuracy because the target is moving ...
2
votes
1answer
1k views

One to one aiming in 2D platformer

Hello all I have been having an issue with a 2D platformer I'm working on in Unity. It has an aiming style similar to Shadow Complex where the aiming will rotate around the character in direction to ...
3
votes
1answer
3k views

Aim prediction along a parabola - How to make a Tower Defence Mortar aim accurately

I am building a very basic tower defence game in Unity3D where one tower is your standard long range mortar/artillery. I want the projectile it fires to follow a parabola curve to make its movement ...
2
votes
0answers
196 views

How can I use iteration to lead targets?

In my 2D game, I have stationary AI turrets firing constant speed bullets at moving targets. So far I have used a quadratic solver technique to calculate where the turret should aim in advance of the ...
4
votes
3answers
3k views

Given an angle for an arrow, how do I find its X and Y velocities?

I want to fire an arrow toward the mouse location. X0 = the players X location X1 = the mouse X location Y0 = the players Y location Y1 = the mouse Y location I ...
11
votes
2answers
5k views

Algorithm to shoot at a target in a 3d game

For those of you remembering Descent Freespace it had a nice feature to help you aim at the enemy when shooting non-homing missiles or lasers: it showed a crosshair in front of the ship you chased ...
7
votes
5answers
6k views

How to lead a moving target from a moving shooter

I saw this question: Predicting enemy position in order to have an object lead its target. My situation is a little different though. My target moves, and the shooter moves. Also, the shooter's ...
9
votes
1answer
423 views

Targeting a vehicle with complex movement?

Targeting a vehicle with known constant velocity is simple, and collision is guaranteed (see Predicting enemy position in order to have an object lead its target, Find meeting point of 2 objects in 2D,...
9
votes
2answers
11k views

How to calculate shot angle and velocity to hit a moving target?

I am developing a 2D Android game and I am making an aiming algorithm for AI projectiles to hit enemies either following a path, or free moving. At the moment it just calculates where the target will ...
4
votes
2answers
1k views

Is this aiming mechanic usable in a third-person top-down game?

Long story short: I've switched to a third person - top down perspective. The camera is fixed and looks down at the player. How can I implement 3d aiming ? The player needs to aim left and right as ...
10
votes
4answers
1k views

Calculating missile trajectory around orbits before shooting

I'm building a game with Unity3D. It's a Gravity Wars clone. Both player and AI turrets shoot missiles at each other (giving an Angle and a Power variables), trying not to crash missiles on planets. ...
6
votes
4answers
1k views

How can I draw a sprite that inverts the colors behind it for an aiming reticle?

In XNA, how can I draw a sprite on the screen that inverts the colors behind that sprite (i.e. the colors that would appear if the sprite weren't in the way of them)? I feel this is the best ...
38
votes
1answer
6k views

Mouse aim in an FPS

I would like to make a First Person Shooter and move the camera with the mouse. The problem is that when the cursor reaches the limits of the screen, the camera won't turn anymore. How can I keep the ...
12
votes
3answers
8k views

Predicting enemy position in order to have an object lead its target

In my 2D game I have AI turrets that should assist the player by automatically firing towards enemies. I would like to make them fire intelligently and lead their target instead of just targeting an ...
24
votes
5answers
6k views

Target Tracking: When to accelerate and decelerate a rotating turret?

Say I have a moving circular target defined as: Vector2 position; Vector2 velocity; float radius; And a rotating ...
5
votes
2answers
788 views

What makes aiming on a PC first person shooter feel good?

I liked this question: What makes aiming in a console first person shooter feel good? So here it is for PC (and its not a dupe because a mouse is hugely different from an analog stick) You've ...
11
votes
5answers
4k views

What makes aiming in a console first person shooter feel good?

I think it's pretty much universally agreed that simply mapping the analog stick to rotational speed of the character is not good enough to make console first person shooter feel good. So what are ...