Soccer Field Dimensions - PowerPoint PPT Presentation

About This Presentation
Title:

Soccer Field Dimensions

Description:

Sophisticated attack code for circling onto the ball and kicking it directly in ... The circling attack took too long to make contact with the ball, opponents would ... – PowerPoint PPT presentation

Number of Views:582
Avg rating:3.0/5.0
Slides: 12
Provided by: itMurd
Category:

less

Transcript and Presenter's Notes

Title: Soccer Field Dimensions


1
Soccer Field Dimensions
(65, 65)
(-65, 65)
130
(65, -65)
(-65, -65)
130
Angles are measured in radians going
anti-clockwise from the positive x axis. Goal
Size (radius) was 7.5m by default, I had to
increase it to 13m to cover the actual goal nets
adequately. All other parameters were left at
their defaults. Parameters are set inside
default.sma inside the engine sub-directory of
Gun-Tactyx
2
Math Requirements
  • You must be competent with basic trigonometry and
    geometry.
  • You need to be confident converting between Polar
    and Cartesian coordinates.
  • Youll need to convert between relative and
    absolute vectors and handle vector arithmetic
    such as normalising vectors, adding vectors and
    doing dot and cross products.
  • You also need to remember your SOHCAHTOA rules
    and how to calculate distances between two
    Cartesian points using the Pythagoras formula.

3
Useful Functions 1
floatBoundAngle(floatangle) if(angle gt
0.0) angle mod(angle, 2PI) else
angle 2.0PI - mod(-angle, 2PI) if(angle
gt PI) angle - (2.0PI) return
angle //end BoundAngle
Takes an unbounded angle and returns a bounded
angle between 0 and 2p, without using any loops.
4
Useful Functions 2
ConvertCartesian(floatyaw,floatdist,floatx,fl
oaty) x dist cos(yaw) y dist
sin(yaw) //end ConvertCartesian
Takes a Polar coordinate, such as returned by one
of the sensor functions and converts it to
Cartesian coordinates.
5
Useful Functions 3
ConvertPolar(floatx,floaty,floatyaw,floatdis
t) //new const float PI 3.1415 dist
sqrt(xx yy) if((x lt 0.01)(x gt -0.01))
if(y gt 0) yaw
PI / 2.0 else
yaw PI 3.0 / 2.0 //end if
- check if x is close to zero else
yaw atan(y / x) if(x lt 0.0) yaw
PI else if(y lt 0.0) yaw (2.0
PI) //end else yaw BoundAngle(yaw)
Takes a Cartesion coordinate, such as the goal to
aim for and converts it to polar coordinates to
steer the bot with.
6
Last Years League Winners
Rank Name Win/Loss Win/Loss
1 David 43/47 91.489 2 Roland 30/36 83.333
3 Jeff 23/30 76.667 4 Recruit 26/43 60.
465
Map Field Teams 2 Players 8 Match
Length 30 mins Start Corners 0 and 1, 2 and 3
(opposite sides) Description All on all
tournament, each bot played every other bot 4
times, once from each starting corner (total 48
matches per bot). Drawn game results not shown.
7
Davids bot
  • Pros
  • Only bot that could accurately kick towards the
    goals (calculated a vector between the ball and
    the goals, then projected a perpendicular vector
    from the bots position to the ball to
    sideswipe the ball in the right direction).
  • Often made it to the ball before opponents since
    it took a very direct approach.
  • Premier bot, consistently beat every other
    opponent.
  • Very simple code, one of the smallest bots in
    terms of source code.
  • Cons
  • No team play whatsoever, each bot behaved exactly
    the same and ignored team mates.
  • Could only kick the ball within 90 degrees of the
    direction it was currently travelling.
  • Prone to kicking own goals if the ball was on the
    opposite side of the bot to the direction it
    wanted to kick in.

8
Rolands bot
  • Pros
  • Best team play, reserved 3 bots as defenders and
    while the rest roamed.
  • Defenders were well organised and effective.
  • Attackers were reasonable and never kicked own
    goals.
  • Cons
  • Attacking bots had no memory, when they got too
    close to the ball it would go beneath their field
    of vision and they would forget it was there,
    turning away at the last moment to look for the
    ball else where.

9
Jeffs bot
  • Pros
  • Sophisticated attack code for circling onto the
    ball and kicking it directly in the desired
    direction.
  • Best coding standards, most readable and
    efficient code (all the useful functions copied
    straight from Jeffs code).
  • Also showed team behaviour with three bots
    allocated to defensive (but not as effective as
    Rolands).
  • Cons
  • The circling attack took too long to make contact
    with the ball, opponents would often kick it away
    first.
  • Had poor thrashing behaviour, so could get
    tangled up with allied and opposing bots easily
    and never break free.

10
Recruit
  • Pros
  • Took the most direct path to the ball, usually
    making contact before the opponents and spoiling
    their more sophisticated tactics.
  • Would widely disperse around the field and rarely
    get tangled up when colliding for long.
  • Despite completely goalless behaviour still beat
    all last years the students bots (in every
    league that was played) with the exception of
    Davids, Rolands and Jeffs bots.
  • Cons
  • Just wanted to kick the ball, doesnt care where.
    So just as likely to kick own goals as opposing
    goals.

11
General tips
  • Take the time to learn the keys, especially the
    time modifiers (-/) on the number pad Watching
    games in x1 speed gets boring really fast and
    its a big waste of time.
  • Remember the bots angles are absolute, not
    relative, use the functions in these notes to
    take a relative angle you wish to turn and add it
    to the bots absolute angle. Otherwise your bots
    will spend most of their time spinning in
    circles.
  • The 2d view is generally more useful for judging
    the bots behaviours and team play.
  • Use the provided gtplaylist and gtstat command
    line tools to set up your own tournaments to play
    at high speed. They are simple to use and let you
    quickly evaluate the performance of your bot
    versus the others. They also allow you to specify
    the start locations of the bots, which saves time
    having to reset when the bots are not assigned
    goals which are opposite one another.
Write a Comment
User Comments (0)
About PowerShow.com