Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 1, 2009, 12:37:16 AM (15 years ago)
Author:
landauf
Message:

Extended PongAI:

  • Random prediction errors depend on the vertical ball-speed
  • Fixed a bug: Position correction was also affected by the reaction delay. Now it works instantly.
  • Added oscillation avoidance system (the already implemented hysteresis avoidance system failed at low framerates)

Additionally fixed auto-respawn in Pong Gametype.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/objects/worldentities/PongBall.cc

    r2839 r2885  
    3737{
    3838    CreateFactory(PongBall);
     39
     40    const float PongBall::MAX_REL_Z_VELOCITY = 1.5;
    3941
    4042    PongBall::PongBall(BaseObject* creator) : MovableEntity(creator)
     
    7981                            position.x = this->fieldWidth_ / 2;
    8082                            velocity.x = -velocity.x;
    81                             velocity.z = distance * distance * sgn(distance) * 1.5 * this->speed_;
     83                            velocity.z = distance * distance * sgn(distance) * PongBall::MAX_REL_Z_VELOCITY * this->speed_;
    8284                        }
    8385                        else if (position.x > this->fieldWidth_ / 2 * (1 + this->relMercyOffset_))
     
    9799                            position.x = -this->fieldWidth_ / 2;
    98100                            velocity.x = -velocity.x;
    99                             velocity.z = distance * distance * sgn(distance) * 1.5 * this->speed_;
     101                            velocity.z = distance * distance * sgn(distance) * PongBall::MAX_REL_Z_VELOCITY * this->speed_;
    100102                        }
    101103                        else if (position.x < -this->fieldWidth_ / 2 * (1 + this->relMercyOffset_))
Note: See TracChangeset for help on using the changeset viewer.