View Javadoc

1   package cz.cuni.amis.pogamut.ut2004.bot.command;
2   
3   import java.util.logging.Logger;
4   
5   import javax.vecmath.Vector3d;
6   
7   import cz.cuni.amis.pogamut.base.communication.worldview.IWorldView;
8   import cz.cuni.amis.pogamut.base.communication.worldview.object.IWorldObjectEventListener;
9   import cz.cuni.amis.pogamut.base.communication.worldview.object.event.WorldObjectUpdatedEvent;
10  import cz.cuni.amis.pogamut.base3d.worldview.object.ILocated;
11  import cz.cuni.amis.pogamut.base3d.worldview.object.Location;
12  import cz.cuni.amis.pogamut.base3d.worldview.object.Rotation;
13  import cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot;
14  import cz.cuni.amis.pogamut.unreal.communication.messages.UnrealId;
15  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.Configuration;
16  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.ContinuousMove;
17  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.Dodge;
18  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.Jump;
19  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.Move;
20  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbcommands.TurnTo;
21  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Item;
22  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Player;
23  import cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.Self;
24  
25  /**
26   * Class providing Pogamut2 UT2004 advanced locomotion commands for the bot -
27   * strafing, advanced turning, dodging...
28   * 
29   * @author Michal 'Knight' Bida
30   */
31  public class AdvancedLocomotion extends SimpleLocomotion {
32  
33  	/** 
34  	 * Self object holding information about our agent. 
35  	 **/
36  	Self self = null;
37  
38  	/**
39  	 * {@link Self} listener.
40  	 * this is needed because self can be updated during the simulation
41  	 * and in multiPogamut we are stuck with the old version
42  	 */
43  	private class SelfListener implements IWorldObjectEventListener<Self, WorldObjectUpdatedEvent<Self>>
44  	{
45  		private IWorldView worldView;
46  
47  		/**
48  		 * Constructor. Registers itself on the given WorldView object.
49  		 * @param worldView WorldView object to listent to.
50  		 */
51  		public SelfListener(IWorldView worldView)
52  		{
53  			this.worldView = worldView;
54  			worldView.addObjectListener(Self.class, WorldObjectUpdatedEvent.class, this);
55  		}
56  
57  		@Override
58  		public void notify(WorldObjectUpdatedEvent<Self> event) {
59  			self = event.getObject();			
60  		}
61  	}
62  
63  	/** {@link Self} listener */
64  	private SelfListener selfListener = null;
65  	
66  	/**
67  	 * Used to set focus when strafing left and right, holds the distance of
68  	 * focus location.
69  	 */
70  	private static final double FOCUS_DISTANCE = 3000;
71  
72  	/**
73  	 * Makes the bot to move through first location to second location (may be
74  	 * specified directly or some ILocated object may be supplied - carefull
75  	 * with objects traversability). Usage is when you want to have your bot to
76  	 * move really smooth. Where is the problem? If you would want to achive the
77  	 * same thing with 2 moveTo functions (first move to location1, when there
78  	 * move to location2), there may be a little lag - you have to check if you
79  	 * are already at first location and etc. This function can solve this
80  	 * problem as the check is done in UnrealScript.
81  	 * 
82  	 * (issues GB MOVE command)
83  	 * 
84  	 * @param firstLocation
85  	 *            First location we will go through.
86  	 * @param secondLocation
87  	 *            Second location we will go to (after reaching first).
88  	 * 
89  	 * @see moveContinuous()
90  	 */
91  	public void moveAlong(ILocated firstLocation, ILocated secondLocation) {
92  		Move moveAlong = new Move();
93  
94  		moveAlong.setFirstLocation(firstLocation.getLocation());
95  		moveAlong.setSecondLocation(secondLocation.getLocation());
96  
97  		agent.getAct().act(moveAlong);
98  	}
99  
100 	/**
101 	 * This makes the bot to run straight ahead continuously. Will stop when
102 	 * other move command is issued - stopMovement, strafeTo, moveTo, moveAlong
103 	 * even turn commands will interrupt this.
104 	 * 
105 	 * (issues GB CMOVE command)
106 	 * 
107 	 * @see moveAlong(ILocated, ILocated)
108 	 * 
109 	 */
110 	public void moveContinuos() {
111 		agent.getAct().act(new ContinuousMove());
112 	}
113 
114 	/**
115 	 * Bot strafes right. The length of the strafe is specified by distance
116 	 * attribute (in UT units, 1 UT unit equals roughly 1 cm). The bot will be
117 	 * looking to object specified by the attribute focusId.
118 	 * 
119 	 * @param distance
120 	 *            - how far the bot strafes (in UT units, 1 UT unit equals
121 	 *            roughly 1 cm).
122 	 * @param focusId
123 	 *            - UnrealId of the object that should be the bot focus.
124 	 * @see strafeLeft(double,ILocated)
125 	 */
126 	public void strafeRight(double distance, UnrealId focusId) {
127 		if (self == null) {
128 			self = agent.getWorldView().getSingle(Self.class);
129 		}
130 		if (self != null) {
131 			Location startLoc = self.getLocation();
132 			Location directionVector = self.getRotation().toLocation();
133 			Location targetVec = directionVector.cross(new Location(0, 0, 1))
134 					.getNormalized().scale(-distance);
135 
136 			agent.getAct().act(
137 					new Move().setFirstLocation(startLoc.add(targetVec))
138 							.setFocusTarget(focusId));
139 		}
140 	}
141 
142 	/**
143 	 * Bot strafes right. The length of the strafe is specified by distance
144 	 * attribute (in UT units, 1 UT unit equals roughly 1 cm). The bot will be
145 	 * looking to location specified by the attribute focusLocation.
146 	 * 
147 	 * @param distance
148 	 *            - how far the bot strafes (in UT units, 1 UT unit equals
149 	 *            roughly 1 cm).
150 	 * @param focusLocation
151 	 *            - location where the bot should look
152 	 * @see strafeLeft(double,ILocated)
153 	 */
154 	public void strafeRight(double distance, ILocated focusLocation) {
155 		if (self == null) {
156 			self = agent.getWorldView().getSingle(Self.class);
157 		}
158 		if (self != null) {
159 			Location startLoc = self.getLocation();
160 			Location directionVector = self.getRotation().toLocation();
161 			Location targetVec = directionVector.cross(new Location(0, 0, 1))
162 					.getNormalized().scale(-distance);
163 
164 			agent.getAct().act(
165 					new Move().setFirstLocation(startLoc.add(targetVec))
166 							.setFocusLocation(focusLocation.getLocation()));
167 		}
168 	}
169 
170 	/**
171 	 * Bot strafes right. The length of the strafe is specified by distance
172 	 * attribute (in UT units, 1 UT unit equals roughly 1 cm). Note that this
173 	 * will reset the bot focus. The bot will be looking straight ahead (however
174 	 * if the strafe is really long - more than 500 UT units - it will be
175 	 * visible the bot is turning slightly performing the strafe).
176 	 * 
177 	 * @param distance
178 	 *            - how far the bot strafes (in UT units, 1 UT unit equals
179 	 *            roughly 1 cm).
180 	 * @see strafeLeft(double)
181 	 */
182 	public void strafeRight(double distance) {
183 		if (self == null) {
184 			self = agent.getWorldView().getSingle(Self.class);
185 		}
186 		if (self != null) {
187 			Location startLoc = self.getLocation();
188 			Location directionVector = self.getRotation().toLocation();
189 			Location targetVec = directionVector.cross(new Location(0, 0, 1))
190 					.getNormalized().scale(-distance);
191 
192 			agent.getAct().act(
193 					new Move().setFirstLocation(startLoc.add(targetVec))
194 							.setFocusLocation(
195 									startLoc.add(directionVector
196 											.getNormalized().scale(
197 													FOCUS_DISTANCE))));
198 		}
199 	}
200 
201 	/**
202 	 * Bot strafes left. The length of the strafe is specified by distance
203 	 * attribute (in UT units, 1 UT unit equals roughly 1 cm). The bot will be
204 	 * looking to object specified by the attribute focusId.
205 	 * 
206 	 * @param distance
207 	 *            - how far the bot strafes (in UT units, 1 UT unit equals
208 	 *            roughly 1 cm).
209 	 * @param focusId
210 	 *            - UnrealId of the object that should be the bot focus.
211 	 * @see strafeRight(double,ILocated)
212 	 */
213 	public void strafeLeft(double distance, UnrealId focusId) {
214 		if (self == null) {
215 			self = agent.getWorldView().getSingle(Self.class);
216 		}
217 		if (self != null) {
218 			Location startLoc = self.getLocation();
219 			Location directionVector = self.getRotation().toLocation();
220 			Location targetVec = directionVector.cross(new Location(0, 0, 1))
221 					.getNormalized().scale(distance);
222 
223 			agent.getAct().act(
224 					new Move().setFirstLocation(startLoc.add(targetVec))
225 							.setFocusTarget(focusId));
226 		}
227 	}
228 
229 	/**
230 	 * Bot strafes left. The length of the strafe is specified by distance
231 	 * attribute (in UT units, 1 UT unit equals roughly 1 cm). The bot will be
232 	 * looking to location specified by the attribute focusLocation.
233 	 * 
234 	 * @param distance
235 	 *            - how far the bot strafes (in UT units, 1 UT unit equals
236 	 *            roughly 1 cm).
237 	 * @param focusLocation
238 	 *            - location where the bot should look
239 	 * @see strafeRight(double,ILocated)
240 	 */
241 	public void strafeLeft(double distance, ILocated focusLocation) {
242 		if (self == null) {
243 			self = agent.getWorldView().getSingle(Self.class);
244 		}
245 		if (self != null) {
246 			Location startLoc = self.getLocation();
247 			Location directionVector = self.getRotation().toLocation();
248 			Location targetVec = directionVector.cross(new Location(0, 0, 1))
249 					.getNormalized().scale(distance);
250 
251 			agent.getAct().act(
252 					new Move().setFirstLocation(startLoc.add(targetVec))
253 							.setFocusLocation(focusLocation.getLocation()));
254 		}
255 	}
256 
257 	/**
258 	 * Bot strafes left. The length of the strafe is specified by distance
259 	 * attribute (in UT units, 1 UT unit equals roughly 1 cm). Note that this
260 	 * will reset the bot focus. The bot will be looking straight ahead (however
261 	 * if the strafe is really long - more than 500 UT units - it will be
262 	 * visible the bot is turning slightly performing the strafe).
263 	 * 
264 	 * @param distance
265 	 *            - how far the bot strafes (in UT units, 1 UT unit equals
266 	 *            roughly 1 cm).
267 	 * @see strafeRight(double)
268 	 */
269 	public void strafeLeft(double distance) {
270 		if (self == null) {
271 			self = agent.getWorldView().getSingle(Self.class);
272 		}
273 		if (self != null) {
274 			Location startLoc = self.getLocation();
275 			Location directionVector = self.getRotation().toLocation();
276 			Location targetVec = directionVector.cross(new Location(0, 0, 1))
277 					.getNormalized().scale(distance);
278 
279 			agent.getAct().act(
280 					new Move().setFirstLocation(startLoc.add(targetVec))
281 							.setFocusLocation(
282 									startLoc.add(directionVector
283 											.getNormalized().scale(
284 													FOCUS_DISTANCE))));
285 		}
286 	}
287 
288 	/**
289 	 * Makes the bot to move to location while looking at focusLocation. (issues
290 	 * GB STRAFE command)
291 	 * 
292 	 * @param location
293 	 *            Location we will strafe to.
294 	 * @param focusLocation
295 	 *            Location we will look at while strafing.
296 	 * 
297 	 * @see strafeTo(ILocated, UnrealId)
298 	 */
299 	public void strafeTo(ILocated location, ILocated focusLocation) {
300 		Move move = new Move().setFirstLocation(location.getLocation())
301 				.setFocusLocation(focusLocation.getLocation());
302 		agent.getAct().act(move);
303 	}
304 
305 	/**
306 	 * Makes the bot to move at location, while looking at focus object. Note
307 	 * that when you support focus object, the bot will update his focus (place
308 	 * he is looking at) according to focus object location (this will be
309 	 * provided by GB UnrealScript code). Usefull when you want to track some
310 	 * player position while moving somewhere else. (issues GB STRAFE command)
311 	 * 
312 	 * @param location
313 	 *            Location we will strafe to.
314 	 * @param focus
315 	 *            Object with UrealId. We will look at this location while
316 	 *            strafing. We will update our focus location according to the
317 	 *            current position of this obejct in UT.
318 	 * 
319 	 * @see strafeTo(ILocated, ILocated)
320 	 * 
321 	 * @todo To check if supported object is also ILocated? see below
322 	 */
323 	public void strafeTo(ILocated location, UnrealId focus) {
324 		Move move = new Move().setFirstLocation(location.getLocation())
325 				.setFocusTarget(focus);
326 		// TODO: To check if this object is also ILocated?
327 		// How this could be done? We need to check if supported IWorldObject
328 		// implements interface ILocated
329 		/*
330 		 * ILocated tmpILocatedCheck; if (tmpILocatedCheck.getClass() ==
331 		 * focus.getClass().getInterfaces()[0]) {
332 		 * 
333 		 * }
334 		 */
335 		agent.getAct().act(move);
336 	}
337 
338 	/**
339 	 * Makes the bot to double jump instantly (issues GB JUMP command) with default settings.
340 	 * 
341 	 * @todo How to convince javadoc see to link to method in super class
342 	 * @see jump()
343 	 * @see dodge(Vector3d)
344 	 */
345 	public void doubleJump() {
346 		Jump jump = new Jump();
347 		jump.setDoubleJump(true);
348 		
349 		// TODO: [Michal Bida] remove when GB is fixed
350 		jump.setForce((double)680);
351 		
352 		agent.getAct().act(jump);
353 	}
354 	
355 	/**
356 	 * Makes the bot to jump instantly (issues GB JUMP command) with custom settings.
357 	 * <p><p>
358 	 * See also {@link SimpleLocomotion#jump()}.
359 	 * 
360 	 * @param doubleJump whether the bot should double jump
361 	 * @param secondJumpDelay If doubleJump, than after time specified here, the bot performs second jump of a double jump (if DoubleJump is true). Time is in seconds. GB2004 default is 0.5s.
362 	 * @param jumpZ than this is a force vector specifying how big the jump should be. Can't be set more than 2 * JumpZ = 680 for double jump.
363 	 * 
364 	 * @see jump()
365 	 * @see dodge(Vector3d)
366 	 */
367 	public void generalJump(boolean doubleJump, double secondJumpDelay, double jumpZ) {
368 		Jump jump = new Jump();
369 		jump.setDoubleJump(doubleJump);
370 		if (doubleJump) {
371 			jump.setDelay(secondJumpDelay);			
372 		}
373 		jump.setForce(jumpZ);
374 		agent.getAct().act(jump);
375 	}
376 	
377 	/**
378 	 * Makes the bot to double jump instantly (issues GB JUMP command) with custom settings.
379 	 * <p><p>
380 	 * See also {@link SimpleLocomotion#jump()}.
381 	 * 
382 	 * @param secondJumpDelay After time specified here, the bot performs second jump of a double jump (if DoubleJump is true). Time is in seconds. GB2004 default is 0.5s.
383 	 * @param jumpZ Force vector specifying how big the jump should be. Can't be set more than 2 * JumpZ = 680 for double jump.
384 	 * 
385 	 * @see jump()
386 	 * @see dodge(Vector3d)
387 	 */
388 	public void doubleJump(double secondJumpDelay, double jumpZ) {
389 		Jump jump = new Jump();
390 		jump.setDoubleJump(true);
391 		jump.setDelay(secondJumpDelay);
392 		jump.setForce(jumpZ);
393 		agent.getAct().act(jump);
394 	}
395 
396 	/**
397 	 * Makes the bot to dodge in the selected direction (this is in fact single
398 	 * jump that is executed to selected direction). (issues GB DODGE command)
399 	 * 
400 	 * @param direction
401 	 *            Vector (that will be normalized) that specifies direction of
402 	 *            the jump.
403 	 * @param bDouble
404          *            Wheter we want to perform double dodge.
405 	 * @see jump()
406 	 * @see doubleJump()
407 	 */
408 	public void dodge(Location direction, boolean bDouble) {
409 		agent.getAct().act(new Dodge().setDirection(direction).setDouble(bDouble));
410 	}
411 	
412 	/**
413 	 * Dodges to the right... direction is taken as vector(botPosition, inFrontOfTheBot).
414 	 * @param botPosition current bot position
415 	 * @param inFrontOfTheBot usually the enemy of the bot
416 	 */
417 	public void dodgeRight(ILocated botPosition, ILocated inFrontOfTheBot) {
418 		if (botPosition == null || inFrontOfTheBot == null) return;
419 		Location inFront = inFrontOfTheBot.getLocation();
420 		ILocated bot = botPosition;
421 		Location direction = new Location(inFront.getLocation().x - bot.getLocation().x, inFront.getLocation().y - bot.getLocation().y, 0);
422 		direction = direction.getNormalized();
423                 
424 		double x = direction.getX();
425 		double y = direction.getY();
426 		
427 		direction = new Location(y, -x, 0);
428 				
429 		direction = direction.scale(100);
430 		
431 		dodge(direction, false);
432 	}
433 	
434 	/**
435 	 * Dodges to the right... direction is taken as vector(botPosition, inFrontOfTheBot).
436 	 * @param botPosition current bot position
437 	 * @param inFrontOfTheBot usually the enemy of the bot
438 	 * @param z allows you to dodge to the air, usual const is 50-100
439 	 */
440 	public void dodgeRight(ILocated botPosition, ILocated inFrontOfTheBot, boolean bDouble) {
441 		if (botPosition == null || inFrontOfTheBot == null) return;
442 		Location inFront = inFrontOfTheBot.getLocation();
443 		ILocated bot = botPosition;
444 		Location direction = new Location(inFront.getLocation().x - bot.getLocation().x, inFront.getLocation().y - bot.getLocation().y, 0);
445 		direction = direction.getNormalized();
446                 
447 		double x = direction.getX();
448 		double y = direction.getY();
449 		
450 		direction = new Location(y, -x, 0);
451 				
452 		direction = direction.scale(100);
453 		
454 		dodge(direction, bDouble);
455 	}
456 
457 	/**
458 	 * Dodges to the left... direction is taken as vector(botPosition, inFrontOfTheBot).
459 	 * @param botPosition current bot position
460 	 * @param inFrontOfTheBot usually the enemy of the bot
461 	 */
462 	public void dodgeLeft(ILocated botPosition, ILocated inFrontOfTheBot) {
463 		if (botPosition == null || inFrontOfTheBot == null) return;
464 		Location inFront = inFrontOfTheBot.getLocation();
465 		ILocated bot = botPosition;
466 		Location direction = new Location(inFront.getLocation().x - bot.getLocation().x, inFront.getLocation().y - bot.getLocation().y, 0);
467 		direction = direction.getNormalized();
468 
469 		double x = direction.getX();
470 		double y = direction.getY();
471 
472 		direction = new Location(-y, -x, 0);
473 		
474 		direction = direction.scale(100);
475 
476 		dodge(direction, false);
477 	}
478 	
479 	/**
480 	 * Dodges to the left... direction is taken as vector(botPosition, inFrontOfTheBot).
481 	 * @param botPosition current bot position
482 	 * @param inFrontOfTheBot usually the enemy of the bot
483 	 * @param z allows you to dodge to the air, usual const is 50-100
484 	 */
485 	public void dodgeLeft(ILocated botPosition, ILocated inFrontOfTheBot, boolean bDouble) {
486 		if (botPosition == null || inFrontOfTheBot == null) return;
487 		Location inFront = inFrontOfTheBot.getLocation();
488 		ILocated bot = botPosition;
489 		Location direction = new Location(inFront.getLocation().x - bot.getLocation().x, inFront.getLocation().y - bot.getLocation().y, 0);
490 		direction = direction.getNormalized();
491 
492 		double x = direction.getX();
493 		double y = direction.getY();
494 
495 		direction = new Location(-y, -x, 0);
496 		
497 		direction = direction.scale(100);
498 
499 		dodge(direction, bDouble);
500 	}
501 	
502 	/**
503 	 * Dodges to the back... direction is taken as vector(botPosition, inFrontOfTheBot).
504 	 * @param botPosition current bot position
505 	 * @param inFrontOfTheBot usually the enemy of the bot
506 	 */
507 	public void dodgeBack(ILocated botPosition, ILocated inFrontOfTheBot) {
508 		if (botPosition == null || inFrontOfTheBot == null) return;
509 		Location inFront = inFrontOfTheBot.getLocation();
510 		ILocated bot = botPosition;
511 		Location direction = inFront.sub(bot.getLocation()).setZ(0);
512 		direction = direction.getNormalized();
513 
514 		double x = direction.getX();
515 		double y = direction.getY();
516 
517 		direction = new Location(-x, -y, 0);
518 		
519 		direction = direction.scale(100);
520 		
521 		dodge(direction, false);
522 	}
523 	
524 	/**
525 	 * Dodges to the back... direction is taken as vector(botPosition, inFrontOfTheBot).
526 	 * @param botPosition current bot position
527 	 * @param inFrontOfTheBot usually the enemy of the bot
528 	 * @param z allows you to dodge to the air, usual const is 50-100
529 	 */
530 	public void dodgeBack(ILocated botPosition, ILocated inFrontOfTheBot, boolean bDouble) {
531 		if (botPosition == null || inFrontOfTheBot == null) return;
532 		Location inFront = inFrontOfTheBot.getLocation();
533 		ILocated bot = botPosition;
534 		Location direction = inFront.sub(bot.getLocation()).setZ(0);
535 		direction = direction.getNormalized();
536 
537 		double x = direction.getX();
538 		double y = direction.getY();
539 
540 		direction = new Location(-x, -y, 0);
541 		
542 		direction = direction.scale(100);
543 		
544 		dodge(direction, bDouble);
545 	}
546 
547 	/**
548 	 * Sets the speed multiplier for the bot. By this number the bots default
549 	 * speed will be multiplied by. (issues GB CONF command)
550 	 * 
551 	 * @param speedMultiplier
552 	 *            Ranges from 0.1 to 2 (max may be set in ini in [RemoteBot]
553 	 *            MaxSpeed)
554 	 * 
555 	 * @see setRotationSpeed(Rotation)
556 	 */
557 	public void setSpeed(double speedMultiplier) {
558 		Configuration configure = new Configuration();
559 		configure.setSpeedMultiplier(speedMultiplier);
560 		agent.getAct().act(configure);
561 	}
562 
563 	/**
564 	 * Sets the rotation speed (rotation rate) for the bot. Default rotation
565 	 * rate can be set in GameBots INI file in UT2004/System directory ( look
566 	 * for DefaultRotationRate attribute). Default rotation rate is now
567 	 * Pitch=3072, Yaw=60000, Roll=2048 (pitch = up/down, yaw = left/right, roll
568 	 * = equivalent of doing a cartwheel).
569 	 * 
570 	 * (issues GB CONF command)
571 	 * 
572 	 * @param newRotationRate
573 	 *            Default is Pitch=3072, Yaw=60000, Roll=2048. To achieve best
574 	 *            results we suggest to multiply the default setting.
575 	 * 
576 	 * @see setSpeed(double)
577 	 */
578 	public void setRotationSpeed(Rotation newRotationRate) {
579 		Configuration configure = new Configuration();
580 		configure.setRotationRate(newRotationRate);
581 		agent.getAct().act(configure);
582 	}
583 
584 	/**
585 	 * Constructor. Setups the command module based on given agent and logger.
586 	 * 
587 	 * @param agent
588 	 *            AbstractUT2004Bot we will send commands for
589 	 * @param log
590 	 *            Logger to be used for logging runtime/debug info.
591 	 */
592 	public AdvancedLocomotion(UT2004Bot agent, Logger log) {
593 		super(agent, log);
594 		this.selfListener = new SelfListener( agent.getWorldView() ); //register self listener
595 	}
596 
597 	@Override
598 	public void jump() {
599 		super.jump();
600 	}
601 	
602 	/**
603 	 * Makes the bot to jump instantly (issues GB JUMP command) with custom settings.
604 	 * <p><p>
605 	 * See also {@link SimpleLocomotion#jump()}.
606 	 * 
607 	 * @param jumpZ Force vector specifying how big the jump should be. Can't be set more than JumpZ = 340 for single jump.
608 	 * 
609 	 * @see jump()
610 	 * @see dodge(Vector3d)
611 	 */
612 	public void jump(double jumpZ) {
613 		Jump jump = new Jump();
614 		jump.setForce(jumpZ);
615 		agent.getAct().act(jump);
616 	}
617 	
618 	/**
619 	 * Makes the bot to jump (or double jump) instantly (issues GB JUMP command) with custom settings.
620 	 * <p><p>
621 	 * See also {@link SimpleLocomotion#jump()}.
622 	 * 
623 	 * @param doubleJump whether to perform double jump
624 	 * @param secondJumpDelay After time specified here, the bot performs second jump of a double jump (if DoubleJump is true). Time is in seconds. GB2004 default is 0.5s.
625 	 * @param jumpZ Force vector specifying how big the jump should be. Can't be set more than 2 * JumpZ = 680 for double jump.
626 	 * 
627 	 * @see jump()
628 	 * @see dodge(Vector3d)
629 	 */
630 	public void jump(boolean doubleJump, double secondJumpDelay, double jumpZ) {
631 		Jump jump = new Jump();
632 		jump.setDoubleJump(doubleJump);
633 		jump.setDelay(secondJumpDelay);
634 		jump.setForce(jumpZ);
635 		agent.getAct().act(jump);
636 	}
637 
638 	@Override
639 	public void moveTo(ILocated location) {
640 		super.moveTo(location);
641 	}
642 
643 	@Override
644 	public void setRun() {
645 		super.setRun();
646 	}
647 
648 	@Override
649 	public void setWalk() {
650 		super.setWalk();
651 	}
652 
653 	@Override
654 	public void stopMovement() {
655 		super.stopMovement();
656 	}
657 
658 	@Override
659 	public void turnHorizontal(int amount) {
660 		super.turnHorizontal(amount);
661 	}
662 
663 	@Override
664 	public void turnTo(ILocated location) {
665 		super.turnTo(location);
666 	}
667 
668 	@Override
669 	public void turnTo(Player player) {
670 		super.turnTo(player);
671 	}
672 
673 	@Override
674 	public void turnTo(Item item) {
675 		super.turnTo(item);
676 	}
677 
678 	@Override
679 	public void turnVertical(int amount) {
680 		super.turnVertical(amount);
681 	}
682 
683 }