Aim AI: predictive aiming

Post your own tutorials, guides and demos.

Post » Sat Oct 08, 2011 11:02 pm

@Dunkelseele

This thread is over 3 years old!

Look HERE for the original thread and caps, although whether they will still function with the much newer version of Construct Classic is anyone's guess.
If your vision so exceeds your ability, then look to something closer.
Moderator
B
122
S
29
G
69
Posts: 4,905
Reputation: 48,996

Post » Fri Feb 17, 2012 9:02 pm

Thanks for the hint!

Well, at least the math should still work, no? I'm sure I can rebuild the rest of it.
Dunkelseele2012-02-17 21:02:24
B
3
G
2
Posts: 35
Reputation: 770

Post » Wed Feb 22, 2012 7:47 pm

Its 4 years old
B
8
S
2
G
3
Posts: 4
Reputation: 2,377

Post » Fri Dec 23, 2016 8:50 pm

Hi @Ashley and any other math geniuses,

I've re-implemented the Perfect Aim formula that Ashley created from here: http://69.24.73.172/scirra/forum/viewto ... 9399#p9399 into Construct 2.

It works great - but is there a way to get the predicted point of intersection (X, Y) or at least the TIME of when the Bullet will meet the Target?

Thank you!
B
46
S
18
G
7
Posts: 70
Reputation: 6,721

Post » Fri Dec 23, 2016 9:48 pm

Well the speed is in pixels per second, so if you have the intersection you could use distance() to figure out how long that would take.
Use pythag to get the intersection point.
Image Image
B
163
S
48
G
99
Posts: 7,433
Reputation: 71,488

Post » Fri Dec 23, 2016 10:05 pm

newt wrote:Well the speed is in pixels per second, so if you have the intersection you could use distance() to figure out how long that would take.
Use pythag to get the intersection point.


What am I inputting for Pythag, and how does that give me the intersection point?
B
46
S
18
G
7
Posts: 70
Reputation: 6,721

Post » Fri Dec 23, 2016 10:16 pm

Well you need two sides with a right angle.
Do you have that?
Otherwise I think it's getting the intersection point from two vectors.
Can't help with that.
Image Image
B
163
S
48
G
99
Posts: 7,433
Reputation: 71,488

Post » Fri Dec 23, 2016 10:21 pm

newt wrote:Well you need two sides with a right angle.
Do you have that?
Otherwise I think it's getting the intersection point from two vectors.
Can't help with that.


Yeah, it's not likely a right angle triangle every time. Thanks anyways @Newt.
B
46
S
18
G
7
Posts: 70
Reputation: 6,721

Previous

Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 0 guests