zephoid Posted June 11, 2007 Report Posted June 11, 2007 brain was saying that there might be a new wep for lancs in the form of a bot turret. It would take the gun slot so as not to be overpowered. There was a big discussion in game about how do make it so it can hit. I decided to make a thread to see what ideas yall have and see if any1 can find a formula to help brain with the calculations. personaly, id go with a flak turret that has no anticipation at all but it has a large spread so it can hit. l2 no bounce fletch-like turret. another idea is the tracking turret that anticipates where the enemy will be. For this we need a formula that incoporates your speed, enemy speed, distance, and maby turning on one or both of the ships. Any1 got any idea. another problem with this idea is basing. How do u make a turret that can base? i think a l1 beam array with no multifire on a turret would b kina cool. it just fires straight ahead in bases but roatates outside. i cant think of a way to make it understand what way the enemy are coming from otherwise. the gun would just try to hit people through walls and that wouldnt work. all the coding on these would be similar to brick atack, where another bot joins the arena when its used. i think that the bot should have a low total energy(500?) but a high recharge to support its wep. if its destroyed, make it respawn in something like 10 sec on to the lanc so if people use bombs, they can knock out the turret for a while. If anything, when this comes out, i hope its underpowerd more than overpowered. that way, brain can tweak the system over time to make it better, instead of having everyone getting it as soon as it comes out. Quote
Dr Brain Posted June 11, 2007 Report Posted June 11, 2007 The development of the algorithm is heavily based in two dimensional vector calculations. Not really something I get help with from the general public. Besides, the algorithm is only a small part of the module. The harder part is getting all the conditions right for when the turret should attach, and not attach. Quote
cdrom Posted June 12, 2007 Report Posted June 12, 2007 if they add it could there be a turret to take gun and a turret to take bomb? (ex:flechette and harpy) Quote
phuzy buny Posted June 13, 2007 Report Posted June 13, 2007 The development of the algorithm is heavily based in two dimensional vector calculations. Not really something I get help with from the general public. Besides, the algorithm is only a small part of the module. The harder part is getting all the conditions right for when the turret should attach, and not attach. I learned 2d vectors in discrete...they're not that bad...granted, not a topic the general public will know Quote
phuzy buny Posted June 13, 2007 Report Posted June 13, 2007 Why not jsut use the algorithm used in the fields and shoot towards the nearest ships with a flechette-like gun? I doubt predicting the movement will be very efficient or effective; sometimes, the simple things are best. And plus, is the purpose of the auto turret to replace a teammate completely? Would it be better if the auto turret was better than having other people on the lanc? Quote
Dr Brain Posted June 13, 2007 Report Posted June 13, 2007 Vectors aren't bad. Solving vector equations with quadratics are. Shooting "toward" the nearest ship would miss if they were doing anything besides flying directly toward you, even with multifire. Quote
phuzy buny Posted June 13, 2007 Report Posted June 13, 2007 give me one of the quadratic vectors for me, lemme see if i can do them Quote
Dr Brain Posted June 14, 2007 Report Posted June 14, 2007 cos(fireangle)*bulletspeed*t + ship_x + ship_v_y * t = target_x + target_v_x * t + target_a_x * t^2/2sin(fireangle)*bulletspeed*t + ship_y + ship_v_y * t = target_y + target_v_y * t + target_a_y * t^2/2 Get a single equation for fireangle. That's a simple one. Ideally, I'd like to make it interpolate arcs as well. Additionally, that acceleration term only work up to the target's max_v, and then becomes 0, but that's not taken into account in those equations. Quote
zephoid Posted June 15, 2007 Author Report Posted June 15, 2007 cos(fireangle)*bulletspeed*t + ship_x + ship_v_y * t = target_x + target_v_x * t + target_a_x * t^2/2sin(fireangle)*bulletspeed*t + ship_y + ship_v_y * t = target_y + target_v_y * t + target_a_y * t^2/2 Get a single equation for fireangle. That's a simple one. Ideally, I'd like to make it interpolate arcs as well. Additionally, that acceleration term only work up to the target's max_v, and then becomes 0, but that's not taken into account in those equations. is "t" time? because that doesn't really makes sense seeing as the formula is for instantaneous fire angle. or are u using "t" for finding where they will be in the time it takes for the bullet to reach the enemy ship.if i could figure that out, i might be able to solve the problem. Quote
Dr Brain Posted June 15, 2007 Report Posted June 15, 2007 t is time. When the two sides are equal, t is the time elapsed between firing and the bullet hitting the center point of their ship. Quote
zephoid Posted June 15, 2007 Author Report Posted June 15, 2007 (edited) cos(fireangle)*bulletspeed*t + ship_x + ship_v_y * t = target_x + target_v_x * t + target_a_x * t^2/2sin(fireangle)*bulletspeed*t + ship_y + ship_v_y * t = target_y + target_v_y * t + target_a_y * t^2/2 Get a single equation for fireangle. That's a simple one. Ideally, I'd like to make it interpolate arcs as well. Additionally, that acceleration term only work up to the target's max_v, and then becomes 0, but that's not taken into account in those equations. under cos of fireangle, should it b ship_v_x * t instead of ship_v_y * t ? ps, this is probibly the ugliest problem ive ever seen, and ive gone through some general relitivity time dialation problems that took 1.5 hous to finish. Edited June 15, 2007 by zephoid Quote
Dr Brain Posted June 15, 2007 Report Posted June 15, 2007 Yes, that should be velocity in the x direction. I'm pretty sure there is no closed form solution to those equations. To make an algorithm to solve it, you have to be creative. Quote
James1293 Posted June 16, 2007 Report Posted June 16, 2007 cos(fireangle)*bulletspeed*t + ship_x + ship_v_y * t = target_x + target_v_x * t + target_a_x * t^2/2sin(fireangle)*bulletspeed*t + ship_y + ship_v_y * t = target_y + target_v_y * t + target_a_y * t^2/2 Get a single equation for fireangle. That's a simple one. Ideally, I'd like to make it interpolate arcs as well. Additionally, that acceleration term only work up to the target's max_v, and then becomes 0, but that's not taken into account in those equations. I'd LOVE to help cause i'm really good at math. Just one problem. I'm good at math that is...say... 1-2grades above me? I just got out of 8th grade? =P Quote
Deathmonger Posted June 16, 2007 Report Posted June 16, 2007 Robocode is a bot AI arena where it's all targeting bots all the time. What you're talking about falls under the category of Linear Targeting here: http://robowiki.net/cgi-bin/robowiki?Targeting That site should be helpful. Btw I believe that the arc tangent function will give you the angle between two points that you are looking for without interpolation. You would of course need to factor in the two velocity vectors to come up with a full firing solution. You might have to interpolate. I'm too lazy to go much further. And yet still I went further than BlueWyvern who thinks he knows physics. Quote
Dr Brain Posted June 16, 2007 Report Posted June 16, 2007 atan is basic trig. Thanks for the site. What I originally wanted to do was what they refer to as CircularTargeting, though the example I gave was indeed linear. Quote
»D1st0rt Posted June 21, 2007 Report Posted June 21, 2007 oh man robocode was so hardcore in high school computer science Quote
zephoid Posted June 28, 2007 Author Report Posted June 28, 2007 this link has exactly what ur looking for, including diagrams. http://www.codeproject.com/cs/library/Miss...ance_System.asp it actualy also includes acceleration of the target and notes that the acceleration of the firer does not matter. im to lazy to read all the way through, but the yellow formulas at the end are, im pretty sure, what ur looking for. the formula that is realy long in the box at the bottom was as far as i got. i showed it to blue cuz i couldnt solve it on my own. i couldnt get 't' by itself but i think this person may have got it. if you wish to skip a bit o reading, just jump down to the yellow boxes where the formula begins. hope u can use this. Quote
*rc 1223* Posted June 28, 2007 Report Posted June 28, 2007 o.O I could probly help tooIm very good at math lol but im in summer school for failing it lolbut im VERY good at it if u need ne help juss gimme the formula im sure i could solve it lol juss gimme in simplest form or w.e Quote
Sharpflame Posted June 28, 2007 Report Posted June 28, 2007 o.O I could probly help tooIm very good at math lol but im in summer school for failing it lolbut im VERY good at it if u need ne help juss gimme the formula im sure i could solve it lol juss gimme in simplest form or w.e But you don't have the english skills of a 5th Grader... haha I'm just kidding I bet you could type right if you felt. Quote
Dr Brain Posted June 28, 2007 Report Posted June 28, 2007 o.O I could probly help tooIm very good at math lol but im in summer school for failing it lolbut im VERY good at it if u need ne help juss gimme the formula im sure i could solve it lol juss gimme in simplest form or w.e If you're too mentally challenged to read the topic, I doubt you can help. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.