Jump to content
SubSpace Forum Network

Recommended Posts

Posted

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.

Posted

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.

Posted
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

Posted
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?
Posted

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.

Posted

cos(fireangle)*bulletspeed*t + ship_x + ship_v_y * t = target_x + target_v_x * t + target_a_x * t^2/2

sin(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.

Posted
cos(fireangle)*bulletspeed*t + ship_x + ship_v_y * t = target_x + target_v_x * t + target_a_x * t^2/2

sin(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.

Posted (edited)
cos(fireangle)*bulletspeed*t + ship_x + ship_v_y * t = target_x + target_v_x * t + target_a_x * t^2/2

sin(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 by zephoid
Posted

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.

Posted
cos(fireangle)*bulletspeed*t + ship_x + ship_v_y * t = target_x + target_v_x * t + target_a_x * t^2/2

sin(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

Posted

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.

Posted

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.

Posted

o.O I could probly help too

Im very good at math lol but im in summer school for failing it lol

but 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

Posted
o.O I could probly help too

Im very good at math lol but im in summer school for failing it lol

but 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.

Posted
o.O I could probly help too

Im very good at math lol but im in summer school for failing it lol

but 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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...