MTK5012
2011 Haxxy Finalist
Offline
Posts: 738
I was Gangsterman
|
 |
« Reply #465 on: October 18, 2011, 03:13:36 am » |
|
you need someone tthat is good with math? I am taking honors geometry, I know quadratics, algebra, and geometry. I can also do very basic trigonmetry.
ggod,calculate the demo aim code
|
|
|
|
|
Logged
|
|
|
|
Orpheon
2011 Haxxy Award Winner
Online
Posts: 5826
Developer
|
 |
« Reply #466 on: October 18, 2011, 03:20:26 am » |
|
you need someone tthat is good with math? I am taking honors geometry, I know quadratics, algebra, and geometry. I can also do very basic trigonmetry.
All right. You could try making an automatic node-generating algorithm, or you could find a direct way to calculate the demo aiming code. I'll give you details later, right now I'm a bit pressed for time. Great!
|
|
|
|
|
Logged
|
Your mind is software. Program it. Your body is a shell. Change it. Death is a disease. Cure it. Extinction is approaching. Fight it.
|
|
|
|
Machidro
|
 |
« Reply #467 on: October 18, 2011, 09:27:22 am » |
|
you need someone tthat is good with math? I am taking honors geometry, I know quadratics, algebra, and geometry. I can also do very basic trigonmetry.
Real men take calculus  But in all seriousness, right now, the equation to be solved is the demoman sticky arc, and knowing that arc, having the demoman aim where a player is going effectively. The equations tougher than it sounds, and has to be solved by the computer in real time. Good luck.
|
|
|
|
|
Logged
|
A CHALLENGER HAS ARRIVED.
|
|
|
Green Wolf
Jr. Member

Offline
Posts: 85
You ain't got no pancake mix!
|
 |
« Reply #468 on: October 18, 2011, 10:17:38 am » |
|
you need someone tthat is good with math? I am taking honors geometry, I know quadratics, algebra, and geometry. I can also do very basic trigonmetry.
Real men take calculus  But in all seriousness, right now, the equation to be solved is the demoman sticky arc, and knowing that arc, having the demoman aim where a player is going effectively. The equations tougher than it sounds, and has to be solved by the computer in real time. Good luck. thanks. The equation is pretty simple as far as quadratics go, but the problem is calculating the variables.
|
|
|
|
|
Logged
|
this guy he is enlightened
Yes, real nice Wareya. I just love how your arguements are fucking retarded and prove absolutely nothing. What's next, do you flick your favourite "Shut up, I am the developer, I MADE THE GAME" card? Or rather the "Oh, you are just a bad player then" card?
|
|
|
Orpheon
2011 Haxxy Award Winner
Online
Posts: 5826
Developer
|
 |
« Reply #469 on: October 18, 2011, 12:17:34 pm » |
|
you need someone tthat is good with math? I am taking honors geometry, I know quadratics, algebra, and geometry. I can also do very basic trigonmetry.
Real men take calculus  But in all seriousness, right now, the equation to be solved is the demoman sticky arc, and knowing that arc, having the demoman aim where a player is going effectively. The equations tougher than it sounds, and has to be solved by the computer in real time. Good luck. thanks. The equation is pretty simple as far as quadratics go, but the problem is calculating the variables. Actually, when I tried calculating it, I came on a x^4 equation. The main problem is that you have a cos() and a sin() of the searched angle. So you need to replace some stuff. Say sin(alpha)=u; then cos(alpha)=sqrt(1-u^2) That translates to a lot of pain when you put it in here: enemy_x +enemy_hspeed*time = your_x + hor_speed*time
Thus:
time = (enemy_x-your_x)/(hor_speed-enemy_hspeed)
hor_speed is the horizontal speed of your projectile, which means it's cos(aimDirection)*speed
Speed of course is a constant (12 in the case of mines), and so is gravity.
So now you have "time" as a function of aimDirection.
enemy_y = your_y + time*vertical_speed + gravity*(1/2)*(time^2)
A bit of inserting:
enemy_y = your_y + (enemy_x-your_x)/(hor_speed-enemy_hspeed)*vertical_speed + gravity*(1/2)*((enemy_x-your_x)/(hor_speed-enemy_hspeed)^2)
enemy_y = your_y + (enemy_x-your_x)/(cos(aimDirection)*12-enemy_hspeed)*sin(aimDirection)*12 + gravity*(1/2)*((enemy_x-your_x)/(cos(aimDirection)*12-enemy_hspeed)^2)
Now you can solve that to aimDirection, and you're all set.
enemy_y = your_y + (enemy_x-your_x)/(u*12-enemy_hspeed)*sqrt(1-u^2)*12 + gravity*(1/2)*((enemy_x-your_x)/(u*12-enemy_hspeed)^2) --> u=cos(alpha) or enemy_y = your_y + (enemy_x-your_x)/(sqrt(1-u^2)*12-enemy_hspeed)*u*12 + gravity*(1/2)*((enemy_x-your_x)/(sqrt(1-u^2)*12-enemy_hspeed)^2) --> u=sin(alpha) Ugh.
|
|
|
|
« Last Edit: October 18, 2011, 12:47:00 pm by Orpheon »
|
Logged
|
Your mind is software. Program it. Your body is a shell. Change it. Death is a disease. Cure it. Extinction is approaching. Fight it.
|
|
|
Orpheon
2011 Haxxy Award Winner
Online
Posts: 5826
Developer
|
 |
« Reply #470 on: October 18, 2011, 12:46:04 pm » |
|
Every time i try to read your coders coding, a part of my brain dissolves.
This isn't code. This is math. Code is a ton simpler, believe me. It's actually figuring out what the computer should do in exact terms, and then finding out why it isn't doing it, that's hard. The actual coding resumes itself to "if this then that", "while this do that" and some occasional array/list stuff. Oh, and stuff like "draw_circle()".
|
|
|
|
« Last Edit: October 18, 2011, 12:49:42 pm by Orpheon »
|
Logged
|
Your mind is software. Program it. Your body is a shell. Change it. Death is a disease. Cure it. Extinction is approaching. Fight it.
|
|
|
Green Wolf
Jr. Member

Offline
Posts: 85
You ain't got no pancake mix!
|
 |
« Reply #471 on: October 18, 2011, 06:12:00 pm » |
|
I found a way to create demo aim code. Good demo men can judge where the mine will land, give or take a little, just by looking at the angle of the gun. So how about this. If distance to target is between x and y, aim z amount of pixels above target. This will also mean that the bot is not accurate 100% of the time, just close. This gives the appearance of the intuition found in good demomen. By using a similar code in the other bots, we can make them be just as good as a human player, because they won't hit all the time.
|
|
|
|
« Last Edit: October 18, 2011, 06:17:02 pm by Green Wolf »
|
Logged
|
this guy he is enlightened
Yes, real nice Wareya. I just love how your arguements are fucking retarded and prove absolutely nothing. What's next, do you flick your favourite "Shut up, I am the developer, I MADE THE GAME" card? Or rather the "Oh, you are just a bad player then" card?
|
|
|
MTK5012
2011 Haxxy Finalist
Offline
Posts: 738
I was Gangsterman
|
 |
« Reply #472 on: October 18, 2011, 11:33:50 pm » |
|
I tried it and i think orpheon did it too.i failed.it's possible but idk how yet
|
|
|
|
|
Logged
|
|
|
|
|
Unsung Hero
|
 |
« Reply #473 on: October 18, 2011, 11:56:51 pm » |
|
In addition, it'd be tedious to calculate the position at which you should launch a sticky, for you also need to factor in whether or not you're moving forwards, backwards, or just staying still.
|
|
|
|
|
Logged
|
 Swimming is all about speshul powah. I have mastered swimming in 721 different strokes. Proud member of [PHS]
|
|
|
Green Wolf
Jr. Member

Offline
Posts: 85
You ain't got no pancake mix!
|
 |
« Reply #474 on: October 19, 2011, 12:15:21 am » |
|
stickybombs travel at the same speed regardless of whether you are moving or not. Also, for the intuition code, just play as demoman with one other person, have them stand still, and record where you aim based on where you target is. I'll do it for you if you want.
|
|
|
|
« Last Edit: October 19, 2011, 12:21:06 am by Green Wolf »
|
Logged
|
this guy he is enlightened
Yes, real nice Wareya. I just love how your arguements are fucking retarded and prove absolutely nothing. What's next, do you flick your favourite "Shut up, I am the developer, I MADE THE GAME" card? Or rather the "Oh, you are just a bad player then" card?
|
|
|
Orpheon
2011 Haxxy Award Winner
Online
Posts: 5826
Developer
|
 |
« Reply #475 on: October 19, 2011, 03:14:23 am » |
|
The problem is that it changes to the distance to the target :/
I want a clean way to calculate it.
|
|
|
|
|
Logged
|
Your mind is software. Program it. Your body is a shell. Change it. Death is a disease. Cure it. Extinction is approaching. Fight it.
|
|
|
|
Machidro
|
 |
« Reply #476 on: October 19, 2011, 09:08:59 am » |
|
The problem is that it changes to the distance to the target :/
I want a clean way to calculate it.
Take the instantaneous slope between you and the target using the equation, plugging in X and Y to calculate the theta of the angle, with X and Y as inputs with your answer in terms of the guns direction? You could probably use the Atan2 with the output of the above equation to calculate the angle to aim your gun at.
|
|
|
|
|
Logged
|
A CHALLENGER HAS ARRIVED.
|
|
|
Orpheon
2011 Haxxy Award Winner
Online
Posts: 5826
Developer
|
 |
« Reply #477 on: October 19, 2011, 11:04:30 am » |
|
The problem is that it changes to the distance to the target :/
I want a clean way to calculate it.
Take the instantaneous slope between you and the target using the equation, plugging in X and Y to calculate the theta of the angle, with X and Y as inputs with your answer in terms of the guns direction? You could probably use the Atan2 with the output of the above equation to calculate the angle to aim your gun at. So basically, guess, and then try to correct it? The old demoman scriptIt might actually work if I had a good way to guess.
|
|
|
|
« Last Edit: October 19, 2011, 11:09:53 am by Orpheon »
|
Logged
|
Your mind is software. Program it. Your body is a shell. Change it. Death is a disease. Cure it. Extinction is approaching. Fight it.
|
|
|
Green Wolf
Jr. Member

Offline
Posts: 85
You ain't got no pancake mix!
|
 |
« Reply #478 on: October 19, 2011, 09:12:27 pm » |
|
to determine where the bot aims, just create a series of 9 invisie nodes that move with the bot. So taking into account that the bot is in the ceter of the scree, the first node is a a half a screen away from bot (at the edge of screen). The second node would be halfway between the third node and first node. the third node will be halfway between bot and first node, and fourth node will be halfway between third node and bot. Mirror this on the otherr side of the bot, then place a node on the bot. 9 nodes. When a target comes within a nodes area (meaning it is closer to one node than another) the bot will aim at a predetermined point above the node, the aim point being decided through trial and error ( I suggest using lorgan'a pluginloader because of it's plugin for drawing the path mines will follow). After that we just determine what priority targets are.
|
|
|
|
|
Logged
|
this guy he is enlightened
Yes, real nice Wareya. I just love how your arguements are fucking retarded and prove absolutely nothing. What's next, do you flick your favourite "Shut up, I am the developer, I MADE THE GAME" card? Or rather the "Oh, you are just a bad player then" card?
|
|
|
Orpheon
2011 Haxxy Award Winner
Online
Posts: 5826
Developer
|
 |
« Reply #479 on: October 20, 2011, 03:24:14 am » |
|
The problem is that it changes to the distance to the target :/
I want a clean way to calculate it.
Take the instantaneous slope between you and the target using the equation, plugging in X and Y to calculate the theta of the angle, with X and Y as inputs with your answer in terms of the guns direction? You could probably use the Atan2 with the output of the above equation to calculate the angle to aim your gun at. So basically, guess, and then try to correct it? The old demoman scriptIt might actually work if I had a good way to guess. Found an equation system on wikipedia that may help, called the angle of reach.  So, whatever gg2's gravity acceleration rate is, compared to the target's polar distance, at an initial velocity of 10 (Stickybomb speed). For distance, you could just plug in the point_distance output from self to them. I went over the way to solve this problem with my calculus teacher, along with movement prediction. I can't remember the steps of his proof, should have wrote them down. I'll ask again tomorrow if he's feeling patient. Woah what? This compensates for current enemy hspeed? to determine where the bot aims, just create a series of 9 invisie nodes that move with the bot. So taking into account that the bot is in the ceter of the scree, the first node is a a half a screen away from bot (at the edge of screen). The second node would be halfway between the third node and first node. the third node will be halfway between bot and first node, and fourth node will be halfway between third node and bot. Mirror this on the otherr side of the bot, then place a node on the bot. 9 nodes. When a target comes within a nodes area (meaning it is closer to one node than another) the bot will aim at a predetermined point above the node, the aim point being decided through trial and error ( I suggest using lorgan'a pluginloader because of it's plugin for drawing the path mines will follow). After that we just determine what priority targets are.
That's unflexible, and you need far more than 9 nodes, since you need several in all directions.
|
|
|
|
« Last Edit: October 20, 2011, 03:25:10 am by Orpheon »
|
Logged
|
Your mind is software. Program it. Your body is a shell. Change it. Death is a disease. Cure it. Extinction is approaching. Fight it.
|
|
|
|