Home
Main Features
User Manual
Screenshots
Downloads
How to buy
Updates
Add-on boats
Add-on scenery
Add-on Library
Tools
Boat design
Scenery design
VS forum
User survey
Links
Mirror
Boat data structure
Boat data structure | Boat design sample | Instrument panels | Weapons


Adding new boats to Virtual Sailor is simple, all files were created using standard file types to allow use of simple text and image editing tools to create or modify them.

The boats directory inside the Virtual Sailor directory containes the available boats, each boat is placed in a seperate directory inside the Virtual Sailor\boats directory.

Inside the boat directory are the following files:

Boat.cfg this file is used to describe the boat parameters.
X files these files are the boat parts.
Bmp files these are the textures used by the boat parts.
Wav files these are the custom sounds used by the boat.
Deck.cfg this is the deck transparency layout file.
Views.cfg this is the viewpoint definition file.
Smokes.cfg this is the smoke sources definition file.
Panel.cfg this is an optional customized panel file.
Pilot#.cfg this is a configuration files for animated pilots or parts in the boat.

The Boat.cfg file


The boat.cfg file is composed of variable number of lines composed of two elements:
Numeric data, String keyword.

The numeric data is translated using the string keyword attached to it, and may appear in any order in the file, if certain types of data are not required, they can be omitted from the boat.cfg file.

These are the allowable keywords and their meanings, most of these parameters are optional, omitting them will make the program used default values.

boat_length the length of the boat in ft.
boat_alt the submerged depth (draft) of the boat in ft.
mass mass of the boat in kg.
cdf drag coefficient of submerged part.
cross_section_sur reference area for submerged part drag in square meters.
max_tilt maximum allowable heel angle in radians.
stability_body leverage factor for inertial forces acting on the boat.
stability_sails leverage factor for forces acting on sails of a sailboat.
keel_area area of submerged part of hull (sqare m)
rudder_area area of ruddder (square m)
pitch_dampening factor of dampening in pitch
yaw_dampening factor of dampening in yaw
roll_dampening factor of dampening in yaw
induced_drag factor of water drag induced by skid or slip of body.
thrust_vectoring angle of thrust vectoring in radians. 
clmax_sailb maximum lift factor obtainable by the main sail
clmax_sails maximum lift factor obtainable by the jib sail
   
has_sails 1 for sailboat , 0 for boat without sails.
sur_sailb the main sail area in square meters.
sur_sails the jib sail area in square meters.
sur_spin the spinnaker sail area in square meters.
   
has_engine 1 for a boat with engine , 0 for a boat without one.
max_fuel_time maximum time at full RPM given in seconds.
motor_hp maximum motor shaft horse power.
   
bridge_x pilot's viewpoint x location in ft.
bridge_y pilot's viewpoint y location in ft.
bridge_z pilot's viewpoint z location in ft.
   
helm_x helm x location in ft.
helm_y helm y location in ft.
helm_z helm z location in ft.
   
panel_number type of panel to be used.
panel_name name of panel to be used ( instead of number ).
panel_scale scale of panel to be used.
panel_x panel x location in ft.
panel_y panel y location in ft.
panel_z panel z location in ft.
panel_dx panel direction vector, x component.
panel_dy panel direction vector, y component.
panel_dz panel direction vector, z component.
panel_ux panel up vector, x component.
panel_uy panel up vector, y component.
panel_uz panel up vector, z component.
   
weapon_number type weapon to be used.
weapon_name name of weapon to be used ( instead of number ).
weapon_x weapon x location in ft.
weapon_y weapon y location in ft.
weapon_z weapon z location in ft.
   
sailb_x main sail x location in ft.
sailb_y main sail y location in ft.
sailb_z main sail z location in ft.
sailb_dx main sail direction vector, x component.
sailb_dy main sail direction vector, y component.
sailb_dz main sail direction vector, z component.
sailb_ux main sail up  vector, x component.
sailb_uy main sail up  vector, y component.
sailb_uz main sail up  vector, z component.
has_sailb2 1 if boat has a second main, 0 for boat without second main.
sailb2_x main2 sail x location in ft.
sailb2_y main2 sail y location in ft.
sailb2_z main2 sail z location in ft.
sailb2_dx main sail2 direction vector, x component.
sailb2_dy main sail2 direction vector, y component.
sailb2_dz main sail2 direction vector, z component.
sailb2_ux main sail2 up  vector, x component.
sailb2_uy main sail2 up  vector, y component.
sailb2_uz main sail2 up  vector, z component.
has_sailb3 1 if boat has a third main, 0 for boat without second main.
sailb3_x main3 sail x location in ft.
sailb3_y main3 sail y location in ft.
sailb3_z main3 sail z location in ft.
sailb3_dx main sail3 direction vector, x component.
sailb3_dy main sail3 direction vector, y component.
sailb3_dz main sail3 direction vector, z component.
sailb3_ux main sail3 up  vector, x component.
sailb3_uy main sail3 up  vector, y component.
sailb3_uz main sail3 up  vector, z component.
   
sails_x jib sail x location in ft.
sails_y jib sail y location in ft.
sails_z jib sail z location in ft.
sails_dx jib sail direction vector, x component.
sails_dy jib sail direction vector, y component.
sails_dz jib sail direction vector, z component.
sails_ux jib sail up vector, x component.
sails_uy jib sail up vector, y component.
sails_uz jib sail up vector, z component.
   
has_jib2 1 if boat has a second jib, 0 for boat without second jib.
sails2_x jib2 sail x location in ft.
sails2_y jib2 sail y location in ft.
sails2_z jib2 sail z location in ft.
sails2_dx jib2 sail direction vector, x component.
sails2_dy jib2 sail direction vector, y component.
sails2_dz jib2 sail direction vector, z component.
sails2_ux jib2 sail up vector, x component.
sails2_uy jib2 sail up vector, y component.
sails2_uz jib2 sail up vector, z component.
   
has_jib3 1 if boat has a third jib, 0 for boat without second jib.
sails3_x jib3 sail x location in ft.
sails3_y jib3 sail y location in ft.
sails3_z jib3 sail z location in ft.
sails3_dx jib3 sail direction vector, x component.
sails3_dy jib3 sail direction vector, y component.
sails3_dz jib3 sail direction vector, z component.
sails3_ux jib3 sail up vector, x component.
sails3_uy jib3 sail up vector, y component.
sails3_uz jib3 sail up vector, z component.
   
sails_separate 1 if second or third jib is not parallel with first, 0 if it is.
sailb_separate 1 if second or third main is not parallel with first, 0 if it is.
   
has_prop 1 if boat has a propeller, 0 for boat without propeller.
attach_props 1 if propellers are attached to rudders, used for thrust vectoring.
prop_x propeller x location in ft.
prop_y propeller y location in ft.
prop_z propeller z location in ft.
prop_dx propeller direction vector, x component.
prop_dy propeller direction vector, y component.
prop_dz propeller direction vector, z component.
prop_ux propeller up vector, x component.
prop_uy propeller up vector, y component.
prop_uz propeller up vector, z component.
   
prop2_x propeller2 x location in ft.
prop2_y propeller2 y location in ft.
prop2_z propeller2 z location in ft.
prop2_dx propeller2 direction vector, x component.
prop2_dy propeller2 direction vector, y component.
prop2_dz propeller2 direction vector, z component.
prop2_ux propeller2 up vector, x component.
prop2_uy propeller2 up vector, y component.
prop2_uz propeller2 up vector, z component.
   
prop3_x propeller3 x location in ft.
prop3_y propeller3 y location in ft.
prop3_z propeller3 z location in ft.
prop3_dx propeller3 direction vector, x component.
prop3_dy propeller3 direction vector, y component.
prop3_dz propeller3 direction vector, z component.
prop3_ux propeller3 up vector, x component.
prop3_uy propeller3 up vector, y component.
prop3_uz propeller3 up vector, z component.
   
prop4_x propeller4 x location in ft.
prop4_y propeller4 y location in ft.
prop4_z propeller4 z location in ft.
prop4_dx propeller4 direction vector, x component.
prop4_dy propeller4 direction vector, y component.
prop4_dz propeller4 direction vector, z component.
prop4_ux propeller4 up vector, x component.
prop4_uy propeller4 up vector, y component.
prop4_uz propeller4 up vector, z component.
   
has_rudder 1 if boat has a rudder ( means it is submersible), 0 for boat without rudder.
has_door 1 if boat has rudder which is used as door to swivel up or down.
rudder_x rudder x location in ft.
rudder_y rudder y location in ft.
rudder_z rudder z location in ft.
rudder2_x rudder2 x location in ft.
rudder2_y rudder2 y location in ft.
rudder2_z rudder2 z location in ft.
rudder3_x rudder3 x location in ft.
rudder3_y rudder3 y location in ft.
rudder3_z rudder3 z location in ft.
   
has_elevator 1 if boat has an elevator, 0 for boat without elevator.
elev_x elevator x location in ft.
elev_y elevator y location in ft.
elev_z elevator z location in ft.
   
radar_x radar x location in ft.
radar_y radar y location in ft.
radar_z radar z location in ft.
   
radar2_x radar2 x location in ft.
radar2_y radar2 y location in ft.
radar2_z radar2 z location in ft.
   
radar3_x radar3 x location in ft.
radar3_y radar3 y location in ft.
radar3_z radar3 z location in ft.
   
crew_mass the mass that is shifted when moving point of view in kg.
   
wing_sur wing surface sqrm. ( flying sub )
wing_cd0 wing zero incidence drag coefficient. ( flying sub )
wing_cla wing lift line slope. ( flying sub )
wing_ki wing induced drag coefficient. ( flying sub )
wing_al0 wing install angle. ( flying sub )
can_fly 1 if boat can fly, 0 if boat can dive. ( flying sub )
   
has_hydrofoil boat has hydrofoil or planning hull
hydro_rise speed of hydrofoil affectivity start (m/sec)
hydro_cruise speed of hydrofoil affectivity max (m/sec)
hydro_alt draft when hydrofoil effect is max (ft)
hydro_cdf cdf when hydrofoil effect is max (ft)
hydro_angle pitch angle when hydrofoil effect is max (rd)
   


The X files:


DirectX geometry files are called X files ( no kidding ... ) , these files are used in Virtual Sailor for modeling the ships and the static objects in the scenery, such as trees and buildings.

To create an X file, use any 3D graphic software that can export this format directly or use one that can export 3DS files and convert these files using conv3ds converter written by Microsoft.

The most whidely known program to create 3DS files is 3D studio, but others exist which can be also downloaded and evaluated to give you a quick lauch into the fascinating world of 3D object creation.

To convert 3DS files to X files use conv3ds converter by Microsoft, it can be download from Download Zone.

Any x file used in the program can be encoded to keep copyrights of the author, the encoding program is attached inside the main directory of the program, the encoded files have a suffix of .XX instead of .X

The boat is made out of several parts, for each part there is an X file that defines it's geometry, these files are optional and may include the following types:

boat.x - the hull of the boat ( can have much detail for virtual exlopring )

boat1.x - the hull for distant boats ( much less detailed than main boat )

sailbf.x the main sail, when the sail is fully reefed.

sailbr.x the main sail, when it is cambered to the right and fully extended.

sailbl.x the main sail, when cambered to the left and fully extended.

The second main has similar files which are named:

sailb2f.x when the sail is fully reefed.

sailb2r.x when it is cambered to the right and fully extended.

sailb2l.x when cambered to the left and fully extended.

The third main has similar files which are named:

sailb3f.x when the sail is fully reefed.

sailb3r.x when it is cambered to the right and fully extended.

sailb3l.x when cambered to the left and fully extended.

sailsf.x the jib, when the sail is fully reefed.

sailsr.x the jib, when it is cambered to the right and fully extended.

sailsl.x the jib, when cambered to the left and fully extended.

The second jib has similar files which are named:

sails2f.x when the sail is fully reefed.

sails2r.x when it is cambered to the right and fully extended.

sails2l.x when cambered to the left and fully extended.

The third jib has similar files which are named:

sails3f.x when the sail is fully reeefed.

sails3r.x when it is cambered to the right and fully extended.

spin.x - this is the spinnaker of the boat.

wheel.x - this is the helm of the boat.

elevator.x - this is the elevator of submersible boat, or door for normal boat.

radar.x - this is the turning radar of the boat.

radar2.x - this is the turning radar2 of the boat.

radar3.x - this is the turning radar3 of the boat.

lights.x - this is the lights of the boat, part which lights at night.

rudder.x - this is the rudder or tiller of the boat.

rudder2.x - this is the rudder 2 or tiller 2 of the boat.

rudder3.x - this is the rudder 3or tiller 3 of the boat.

prop.x - this is the propeller of the boat.

prop2.x - this is the propeller 2 of the boat.

prop3.x - this is the propeller 3 of the boat.

prop4.x - this is the propeller 4 of the boat.

sails3l.x when cambered to the left and fully extended.

The engine.wav file:

The boat has several sound files that accompany it and define it's distictive sounds, all these sounds can be also located inside the boat's directory to make the boat sounds different than the default ones.

The texture files:

The boat has several texture  files that accompany it and define it's color scheme, panel and buttons, these consist of the following files:

boat.bmp - this is the file that shows a preview image of the boat.
anyname.bmp - this is any texture file that can be used in the x files of the boat, can be also jpg or dds files.

The Wav files:

The boat has several sound files that accompany it and define it's distictive sounds, all these sounds can be also located inside the boat's directory to make the boat sounds different than the default ones.

These wav files should be 8 bit mono files, preferably 11 or 22 khz.


The Deck.cfg files:

The Deck.cfg file boat defines the outline of the deck and the height of waterline, this file is used to prevent the water in cabin problem by defining a transparent area inside this outline.

The file containes the following data:

deck_alt the height of deck
pos x/length coordinate
width y/width coordinate
This data defines the outline of the deck along 10 stations, each station has an x and y coordinates which are normalized to the lenght and width of the boat.

This is a sample deck.cfg file:

pos width  
  7.5 [deck_alt]
0.04 0.4 [pos_width]
0.1 0.45 [pos_width]
0.2 0.5 [pos_width]
0.3 0.6 [pos_width]
0.4 0.7 [pos_width]
0.5 0.6 [pos_width]
0.6 0.5 [pos_width]
0.7 0.4 [pos_width]
0.8 0.3 [pos_width]
0.9 0.2 [pos_width]
1.0 0.0 [pos_width]


The Views.cfg and Smokes.cfg files:

These files have a simple form of the same structure:

number of lines.

x, y, z positions of view or smoke.
x, y, z positions of view or smoke.
x, y, z positions of view or smoke.
...

The views.cfg file is defined by the program when moving the camera to desired location on the boat and pressing the add-view button.

This same file can be renamed to smokes.cfg and used for smoke origin locations.

The panel.cfg file:

This file is identical to the standard panels used in the panels directory of the program, and shown when pressing P, this file has the following structure:

panel_power       panel_name

0.25                     panel_scale
0.0                       panel_x
-0.7                      panel_y
1.75                     panel_z
0                         panel_dx
-0.173                 panel_dy
0.984                  panel_dz
0                        panel_ux
0.984                  panel_uy
0.173                  panel_uz

The Pilot#.cfg file

There can be up to 12 animated pilots or parts in the boat, these parts or pilots has special functionality given inside the pilot#.cfg where # is a value from 0 to 11, each pilot.cfg file contains a name of animation x file to be loaded into the boat at the given position and orientation.

The structure of this file is the following:

name of pilot animation x file

x_pos - x position of pilot
y_pos - y position of pilot
z_pos - z position of pilot
alfa - direction of pilot

fps - animation frame per scond
fps_rpm - animation frame per scond depending on motor_rpm

loop0 - animation is looping from this frame
loop1 - animation is looping until this frame

steer0 - the pilot can steer from this frame
steer1 - the pilot can steer until this frame

throt0 - the pilot can set throttle from this frame
throt1 - the pilot can set throttle until this frame

sailb0 - the pilot can move main sail from this frame
sailb1 - the pilot can move main sail until this frame

sails0 - the pilot can move jib sail from this frame
sails1 - the pilot can move jib sail until this frame

reefb0 - the pilot can reef main sail from this frame
reefb1 - the pilot can reef main sail until this frame

reefs0 - the pilot can reef jib sail from this frame
reefs1 - the pilot can reef jib sail until this frame

delay - animation of loop is delayed by this amount in seconds
auto_loop - the pilot animation loops while playing
auto_hide - the pilot is hidden when too close or too far

scale_steer - steering animation is repeated by this scale
scale_throt - throttle animation is repeated by this scale
scale_sailb - main sail animation is repeated by this scale
scale_sails - jib sail animation is repeated by this scale



Copyright Ilan Papini 1999 - 2017
All Right Reserved