# Simmons

Robo Home | Changes | Preferences | AllPages

Difference (from prior major revision) (minor diff, author diff)

Changed: 52c52,69
 If those really are your numbers then you should expect to hug the walls. This in ANTIgravity movement, because it repels. Enemy bots and walls should both repel, the way you have it is bots repel and walls attract. Make the walls force negative, and it should work. -- Tango
 If those really are your numbers then you should expect to hug the walls. This in ANTIgravity movement, because it repels. Enemy bots and walls should both repel, the way you have it is bots repel and walls attract. Make the walls force negative, and it should work. -- Tango No, if you look at Hanji/AGravEngine and Hanji/GravPoint, both of which are used in my bot, the wall force, when positive repels, and the grav points force are repulsive when negative. It is a small thing with the math, you change the update method, ie switch around the +/- operators in some places, they can be set so both can be positive or negative repulsive. This is the math: ` //this calculates the force the gravpoint exerts on the bot xForce += force * Math.sin(angle); yForce -= force * Math.cos(angle); //this calculates the force the walls exert on the bot xForce -= wallForce/Math.pow(curX, wallDropoff); xForce += wallForce/Math.pow(width-curX, wallDropoff); yForce += wallForce/Math.pow(height-curY, wallDropoff); yForce -= wallForce/Math.pow(curY, wallDropoff); ` As you can see, if you were to switch the +'s and -'s in, say the gravpoint section, positive would become repulsive, negative attractive. The same thing is in Hanji's comment's for those classes. Burk3, Good Luck. --Dan Red vs Blue rules :D -- Qetu

Simmons, a Robot by burk3
Update: 0.1a

Doesn't run. Null pointer exception in the modified AGravEngine? code during update. Probably due to my conversion of GravPoint? to Point2D.

Update: 0.1a

Well, it runs, sorta. At least there's no NullPointerException anymore. Now, Simmons just runs straight into the wall. I've got a feeling that it has to do with the way I'm applying the forces that AGravEngine? returns.

How does it move?

Simmons uses AntiGrav? type movement in which it tracks the enemy with a GravPoint?, and will attempt to track an enemy's fired bullet with a gravPoint as well.

How does it fire?

No targeting implemented yet. Planning to implement VirtualBullets if I a) can understand just how it works and b) if I have time (1v1 tourney in java class is in about a week).

How does it dodge bullets?

Senses if the enemy has fired a bullet based on change in energy, and assumes enemy has fired directly at Simmons (most kids in my java cllass don't have advanced targeting systems). Creates a gravPoint based on predicted location of the bullet, and will dodge accordingly.

How does the melee strategy differ from one-on-one strategy?

1v1 only

Where did you get the name?

Well, I had recently recieved the Blood Gulch Chronicles DVD, from Red vs Blue.com in the mail, and felt like naming my bot after one of the characters on the show. The first one to pop in to my mind was Simmons, so I decided to use that.

Sure, though it isn't very useful unless you are trying to help me out. I've just gotta figure out where I should host the files (probably my site).

Implementation of a targeting system, after I get the robot working that is.

What I need

I'd like a bit of help doing something with the vectors (vector in terms of physics) the AGravEngine? spits out.

What other robot(s) is it based on?

I use modified versions of Hanji's Hanji/AGravEngine, and Hanji/GravPoint classes.

How are you applying the X and Y forces to your movement?--Dan
I'm using some math stuff i found somewhere. It doesn't seem to be working though. The robot basically hugs the walls and occasionaly gets stuck on them. I think it might stil be the values I have set for the power of the grav points and walls. Do you think you could just tell me what values you use? I need to be done really soon. --Burk3
I'm not looking at my code right now but here is most of it. Wall force is 10000000. Center and corner grav points are -50000, My random points range from 75000 to -75000. The way I add the X and Y force is goTo(getX()-xForce,getY()-yForce); with goTo being a GoTo? function. For more see Cinnamon, it uses Hanji's classes and has the numbers you want.--Dan Burk3

If those really are your numbers then you should expect to hug the walls. This in ANTIgravity movement, because it repels. Enemy bots and walls should both repel, the way you have it is bots repel and walls attract. Make the walls force negative, and it should work. -- Tango

No, if you look at Hanji/AGravEngine and Hanji/GravPoint, both of which are used in my bot, the wall force, when positive repels, and the grav points force are repulsive when negative. It is a small thing with the math, you change the update method, ie switch around the +/- operators in some places, they can be set so both can be positive or negative repulsive.
This is the math:

```//this calculates the force the gravpoint exerts on the bot
xForce += force * Math.sin(angle);
yForce -= force * Math.cos(angle);
//this calculates the force the walls exert on the bot
xForce -= wallForce/Math.pow(curX, wallDropoff);
xForce += wallForce/Math.pow(width-curX, wallDropoff);
yForce += wallForce/Math.pow(height-curY, wallDropoff);
yForce -= wallForce/Math.pow(curY, wallDropoff);
```
As you can see, if you were to switch the +'s and -'s in, say the gravpoint section, positive would become repulsive, negative attractive. The same thing is in Hanji's comment's for those classes. Burk3, Good Luck. --Dan

Red vs Blue rules :D -- Qetu

Robo Home | Changes | Preferences | AllPages