Chapter 6: Ship Simulators


 Download CD Content

 On the CD    In this program, we will import an excellent 3D image of a destroyer from the book s CD-ROM and make it move in a realistic way through the water. In addition, we will learn how to display an instrument panel with pertinent information, as shown in Figure 6.1.

click to expand
Figure 6.1: Ship simulator screenshot.

Basics of Ship Controls

Large ships have a host of controls that allow them to maneuver properly. One of the most important controls are the bow thrusters, which are propellers situated near the front (bow) of the ship; these are used to move the bow sideways . The bow thruster propellers are at right angles to the propellers that move the ship ahead, and they are usually electrically driven from a generator that runs off of the main engines ”usually big diesel engines.

The bow thrusters maneuver the ship while it is not in motion or is moving very slowly; they are great for making docking maneuvers easier. Many larger ships also have stern thrusters (the stern is the back end of the ship) for even greater maneuverability. When used together, the bow thrusters and the stern thrusters allow the ship to move completely sideways. Our model will include only bow thrusters for the sake of simplicity.

Thrusters are controlled from the ship s bridge (the control cabin of the ship) and are usually activated by moving a handle to the right or to the left, depending on the direction the captain wants the ship to move. We will have a similar control on our bridge console; ours will be displayed as a sprite on the screen.

Bow thrusters are not effective once the ship picks up speed because they are not very powerful. Once the ship gets moving just a few knots (one knot is one nautical mile per hour, or about 6000 feet per hour ), the forces required to make the ship turn increase dramatically. Bow thrusters cannot effectively overcome this resistance.

Once the ship is in motion, its direction is controlled by moving the rudder, which is located at the stern. The rudder is relatively small compared to the size of the ship, but the force exerted by the rudder becomes greater and greater as the ship s speed increases . The rudder is usually not very effective for turning at very slow speeds because there is not enough water rushing over it to create any substantial force.

The rudder is controlled from the bridge by turning the ship s wheel (a big steering wheel). This is how our rudder control will be displayed as well. The more the wheel is turned, the greater the rate of the turn. Incidentally, the ship s captain usually does not steer the ship ”this is a job reserved for the helmsman, who merely responds to what the captain says. The captain may command something like Right 15 degrees rudder, and the helmsman is to answer back as he initiates the turn Right 15 degrees rudder aye, which is a very salty-sounding language. The 15 degrees refer to the angle of the rudder, measured from an imaginary line running lengthwise through the center of the ship.

Applying right rudder moves the back of the rudder to the right (if seen from above, the rudder would rotate counter-clockwise), causing a force on the rudder that pushes the stern to the left, which turns the bow to the right. Think of the rudder as a wing immersed vertically in the water ”when you angle it slightly to the water flow, it generates a lift force that makes the stern move. The rudder is typically not moved by cables connected to the ship s wheel; this would require the helmsman to be a world-class body-builder since huge forces are required to move the rudder once the ship gets moving. Instead, the rudder is moved by a hydraulic steering system assisted by electric motors.

If the ship is moving backward and the rudder is moved right, the opposite happens. The force on the rudder/stern is then to the right, causing the bow to turn to the left. Confusing? Believe it or not, it s similar to what happens in a car. If you are moving forward and you turn the wheel right, the front of the car goes right. If you are moving backward and you turn the wheel to the right, the front of the car goes left!

The speed of the engine is used to control the ship s speed, much as it does in an automobile. The more the throttle handle on the bridge is pushed forward, the faster the engine turns; the more the handle is pulled back, the slower the engine turns. Pulling back on the handle beyond a certain point causes the engine to turn in reverse, which eventually causes the ship to move backward. As with the rudder, the captain usually does not control the throttle on big ships. Instead, the captain barks commands like All ahead full or All ahead slow and the action is executed for him. Captains are usually stern (and we do not mean the rear of the ship!).

The engine turns the propellers via a transmission, which can be directly connected to the engine. In some cases, the engine turns an electric generator, which then drives an electric motor, which then drives the propeller. The advantage of this system is that with it, naval architects (ship designers) have more freedom as to where they place the engines and they don t have to worry about long and complicated transmission systems.

Nothing (except collisions) happens very quickly on a ship. When the throttle is pushed forward, the ship responds slowly due to its huge mass and the resistance of the water. In the same way, if the throttle is pulled back, the ship takes a while to come to a stop. This tendency to remain at rest or in motion is called inertia , and we must account for it. Our ship cannot turn or change speed immediately; if we set up our simulation so that it did, it might make the ship much easier to control, but it would also make the simulation unrealistic .

Our game will meet the following requirements:

  • The view of the ship will be from the outside and the entire ship will be visible. The camera will follow the ship as it moves.

  • The ship s bridge console with controls and instruments will be visible in an unobtrusive location on the screen.

  • Controls will include a bow thruster, a rudder, and a throttle.

  • The display will show the ship s wheel turning, the bow thruster s setting, the throttle setting, the speed in knots, and the water depth (this will be inoperative for this simulation).

  • The ship will respond to all controls in a realistic fashion; in other words, it will obey the laws of inertia.

  • The ship will have a maximum speed of 30 knots forward, and 20 knots astern.




Elementary Game Programming and Simulators Using Jamagic
Elementary Game Programming & Simulations Using Jamagic (Charles River Media Game Development)
ISBN: 1584502614
EAN: 2147483647
Year: 2002
Pages: 105
Authors: Sergio Perez

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net