

By: Michael Neus  aka  GunsJammed, RCAF_GunsJmd

Email:   GunsJammed@hotmail.com


For use with Microsoft Combat Flight Simulator 1 and 2.


Disclaimer
----------

All files in this package come as they are. Use them at your own risk. 
The author of the BRUNHOST package is not liable for any problems caused by these files.


Distribution
------------

Please do not post package on any sites.  If you wish, feel free to include a link to my site.
Since I make changes to the program from time to time, this will ensure that people will find
the newest available version.


Assumtions
----------

The following info assumes that you have followed the installation procedure outlined
in INSTALL.TXT


Files included in this package
------------------------------

In CFS main folder
brunhost.exe	The main program of the package

In BRUNHOST folder
install.txt	File containing the installation procedure.
ipselect.txt	Help info for 'IP Selection' window in Select program.
objdb.dat	Database for CFS1/CFS2 objects.
objlist.txt	List of available objects that can be used as 'targets'.  Any aircraft can also be a target.
readme.txt	This file.
select.exe	The program used to select the program that will launch and the config set to use.
techinfo.txt	Contains some technical info about how brunhost works, and why I have done.
		certain things in the way I have.
template4.dat	Template used for library object 'models' sent.  These 'models' will end up in the mp_cache
		of all players.
versinfo.txt	Information about changes made in each version.
AirFld1.dp	Damage profile for 3 of the CFS1 runways.  Place in the objects_dp folder.  Copy
		and rename for AirFld3 and AirFld4.



In the CONFIGS folder
Several sample configuration files and associated intro text files.



Features
--------

BRUNHOST is a program that hosts a CFS1/CFS2 multiplayer session.  Note that it can ONLY
host, and will not join a session.

It brings several features into CFS multiplay.  These features are
determined by the configuration info for the program.

First, teams can start at different locations.  They can start on the ground (CFS1 only) or
in the air.  They can start in a basic line type of formation as well.

Next, allows time of day to be set.

Next, allows aircraft restriction to be team based (i.e. the 'bomber' team can
be unrestricted, while the other teams can be restricted).

Next, it brings 'targets' into the game that all see detroyed.  Note that currently
only static, stationary targets are supported (they don't move or fire weapons).

Next, it allows team colors to be set to any valid color, not the default CFS team
colors.  This allows bombers and escorts to be on different teams, but have the
same colors.

Next, allows a No Lock/No Radar feature.  When used, players and/or targets cannot be locked
on and will not show up on radar.  NO, I CANNOT DO ANYTHING ABOUT NAME TAGS.  Sorry.




Included in this package is a program called SELECT.EXE that allows you to change 
which program is your current active program.  The active program will be launched
by the Zone, or by your CFS shortcut(s) in the case of IP games.  SELECT.EXE also allows
you to select a config/intro pair for BRUNHOST to use from a set configs.

Note:  Make sure that CFS and BRUNHOST are not running before you run SELECT.EXE
SELECT will not make any changes is either program is running.


Note that the installation of this package makes no changes to the registry.  If you
decide you don't want the program or wish to delete it for any reason, run SELECT and
set CFS as active, then simply delete BRUNHOST.EXE and the BRUNHOST folder from the
CFS main folder.



Getting it up and running
-------------------------

1.  Run SELECT using the shortcut you created on your desktop.  The first time you do this, an
    'IP Selection' dialog will come up.  If any adapters other than PPP adapters appear in the
    left window, see IPSELECT.TXT for instructions.  If only PPP adapters are listed in the left 
    window, click on 'Done'.  Then, in the 'Select active program' box of the Select window, 
    check BRUNHOST.  'Auto Run CFS' will be checked.  For now, leave 'BRH default' as the active 
    config.  Then click on 'Done'.

2.  Double click on your Combat Flight Simulator shortcut on your desktop (or from the Start
    menu).

3.  This will launch BRUNHOST, which will in turn start up CFS for you.

4.  Click on 'Multiplayer'.

5.  Make sure TCP/IP is selected.

6.  There should be an IP address in the 'Enter address' box.  If one is there, click on 'Ok'.
    Otherwise, see IPSELECT.TXT for instructions

7.  The session SHOULD show up in the 'Status of session' box below.  If no session shows up, 
    see IPSELECT.TXT for instructions  

8.  If you reach this step, the BRH default session is listed.  Click on 'Join'.  DO NOT click
    on 'Host'.  BRUNHOST is hosting the session, and you are JOINING that session with CFS.

9.  You should now arrive in the Ready Room, and there should be 2 'targets' there as well.

10. Go ahead and join one of the non-target teams and select a new aircraft if you wish.  When
    you are ready, just ready up, and you will be launched into the game.

11. If you joined the Defend team, you will be parked next to the runway at Berne.  The targets
    will be to your left.

12. If you joined the Attack team, you will be enroute from Interlaken to Berne, and should see
    the targets on the ground in front of you about 20,000 meters away.


That's all there is to it.  If you are going to host a BRUNHOST session on the Zone, you
basically follow the same procedure, except you will not perform step #2.  The Zone will
launch BRUNHOST, and BRUNHOST will start up CFS in the same way.  Follow the same procedure to
get your CFS connected to the session.  Also, when you finish a session, make sure you shut
down BOTH CFS and BRUNHOST.

If you want to fly in a regular game without BRUNHOST, run SELECT and set CFS as the active
program.

When creating new config files, I suggest you run a local session to check things out before
you try hosting a game with other players.  You can try joining each team to make sure you
have the starting locations correct, and can make sure you have the targets setup correctly.





Configuration description
-------------------------

The Select program creates/updates a file called BRUNHOST.INI which contains things that don't 
really belong in a BRUNHOST session config file.  The AUTORUN_CFS switch is now found here.  Info
needed by BRUNHOST to determine the hosts IP address (the address found in the 'Enter address' box
in the CFS multiplayer window) is found here.  The name of the config set is also found here.  The 
Select program manages all the info in this file for you.

There are several example config/intro file sets also found in the CONFIGS folder.  The SELECT allows
you to select which set is active.  NOTE:  BRUNHOST must be active to change the active config/intro 
set. Files with the .cfg extension contain session/team/target info.  Files with the .txt extension 
contain intro text sent to each player when they arrive in the Ready Room.  Info contained in the .cfg
files is outlined below.  See the examples to see how it all works.



Any line that begins with a ';' is ignored.  (Used for comments)  If you wish to temporarily
remove a section, place a ';' at the start of each line in that section.



Session settings
----------------

Session settings are like those found in COMBATFS.CFG, but several of those
found in COMBATFS.CFG are omitted for BRUNHOST.  There are also a few entries
that are not found in COMBATFS.CFG.  These are the settings that will show up
in the 'Host options summary' window in BRUNHOST.  These settings will show up
in the same window in each player's CFS when they arrive in the Ready Room.  Once
a player joins a team, that player will recieve new settings specific to that player.
Note that these settings are NOT related to the Targets.  Their config info overrides
this info.

Currently, when BRUNHOST attempts to establish a connection to a player, it will send
a chat message to the player indicating the fact.  BRUNHOST will also send a chat message
indicating the success or failure of the connection attempt.  MAX_PLAYERS will no longer
change to 0 when the connection is established.


[brh_settings]					
SESSION_NAME=BRH Default	The name of the session
SESSION_NOTES=Default config	The session description
MAX_PLAYERS=16			Self explanitory
MAX_PLAYERS_PER_TEAM=8		"
WIN_CRITERIA=2			0 = No vic reqs, 2 = Last Alive, First player to destroy X not supported
RECOMMENDED_LEVEL=0		0 = All, 1 = Novice, 2 = Novice-Veteran, 3 = Veteran, 4 = Veteran - Ace, 5 = Ace
ALLOW_PAUSE=0			0 = No pause, 1 = Pause allowed  (Use with caution, LOL)
FLIGHT_MODEL=1			0 = Easy, 1 = Medium, 2 = Hard
UNLIMITED_FUEL=1		0 = Limited fuel, 1 = Unlimited fuel
UNLIMITED_AMMO=1		0 = Limit ammo, 1 = Unlimited ammo
SUN_GLARE=0			0 = Sun glare off, 1 = Sun glare on
G_EFFECTS=0			0 = G effects off, 1 = G effects on
WEAPON_EFFECTIVENESS=0		0 = Normal, 1 = Strong, 2 = Strongest
TIME_OF_DAY=10:00		24 hour clock,  HH:MM
NO_LOCK_OR_RADAR_PLAYERS=0	If set to 1, players can't be locked on, don't show up on radar
NO_LOCK_OR_RADAR_TARGETS=0	If set to 1, targets can't be locked on, don't show up on radar
LA_WINDOW_SEC=45		Number of seconds the Last Alive reentry window is open.  Allows players to
				reenter the game if they return to the Ready Room for whatever reason (i.e.
				if they crash, forget fuel, etc.)  Only used if WIN_CRITERIA=2.
BTEAMS_DESTROY_TARGETS=0	If set to 1, only players on 'bomber' teams can destroy targets.
				Note that targets can now be set as bombing targets individually.  If
				this is set to 1, ALL targets will be bomber targets!!!				
RQD_TG_VERS=2.00.12		Forces players to have at least this version of TG installed in order
				to join the game.  They can reach Ready Room, but will not get launched
				into game.  They will be sent a chat message informing them that they
				need a newer version of TG, and where they can get it.  If you do not
				want to require TG (any version), then do not include this switch!!!
TAG_DIST=4500.0			Distance at which tags will show up.  TG 2.00.12 required for this.
LOCK_DIST=1000.0		Distance at which you can lock onto players.  TG 2.00.12 required for this.




Target object settings
----------------------

Target objects are 'aircraft' in your CFS AIRCRAFT folder (or found in the CFS object library(s)).  
Currently, a maximum of 8 objects are supported.  If you do not include a target object in config, 
a default one will be created because there must be a target player to act as the host.  If a default
target player is created it will enter game at N0*, W0*.  You will not see this target then unless 
team starting locations are near this point.


[BRH_OBJECT.0]			First target, next would be [brh_object.1]
NAME=targetname			If not included, a default name is used (Target#X) note that X is 1 greater 
				than object section number
TARGET_TEAM=0			Number must match target teams' section number, default is 0
				If target team number does not exist, target will not be on a team
AIRCRAFT=He111H			Name of 'aircraft' as it shows in CFS (or object in objlist.txt file).
START_LAT=N46* 55.02'		Decimal degrees, minutes or seconds are allowed
START_LONG=E7* 32.08'		"
START_ALT=1981			Ground altitude in feet, decimal allowed
START_HEADING=225		Note that this is True heading, not magnetic heading, decimal allowed
COLLISIONS_DESTROY=0		If set to 1, collisions with object will destroy it, default is 0.
LIFE_POINTS=1500		Life points of the object, 1500 is default.
DISABLE_COLLISIONS=0		If set to 1, target cannot be collided with. (Note that it also cannot
				be locked on and will not show up on radar).
IS_BOMBING_TARGET=0		Set to 1 to allow only players on 'Bomber' teams to destroy.
UNHITTABLE=0			Set to 1 to prevent players from hitting this object with guns.  Mainly
				used when 3 or more objects are close to each other.  Used to prevent
				CFS shutting down when hitting multiple targets at the same time.
MOTION_TYPE=1			If not found or set to 0, object doesn't move.  If set to 1, allows basic
				motion.  Is straight line motion based on START_ALT, START_HEADING and SPEED.
				Note that altitude does NOT change!  Mainly suited to ships and aircraft.  Not
				good for ground targets due to changing altitudes.
SPEED=38			When MOTION_TYPE=1, this is the objects speed in MPH.
MODEL_TYPE=1			If using stock CFS aircraft as moving objects, this switch will result
				in the aircraft showing up with gear up and props spinning.





Team settings
-------------

[BRH_TEAM.N0]			See Note #1						
COLOR=0				Color index 0-15, selects one of the 16 CFS colors for team
START_LAT=N046* 49' 41"		Decimal degrees, minutes or seconds are allowed
START_LONG=E007* 36' 58"	"
START_RADIUS=3000		In meters, 500 min, 8000 max
START_IN_AIR=1			See Note #2
START_ALT=15000			In feet, 215007 max
START_SPEED=180			120 min, 300 max
FORMATION_TYPE=1		See Note #3
FORMATION_HEADING=330		The direction that the player aircraft in the formation are facing.
PLAYER_SPACING=200		Spacing between players (in meters) in line type formations.
NAME=teamname			Only used for namable teams, the other teams have default names
RESTRICT_AIRCRAFT=0		Set to 1 to restrict for this team
MAX_PLAYERS=1			Max players for THIS team, overrides MAX_PLAYERS_PER_TEAM if found.
TYPE=1				Include this switch in namable team sections to make them 'Bomber' teams
				to allow them to destroy bombing targets.



Note #1

Current possible teams are:

Bomber
Escort
Attack
Defend
Target
Nameable team

[brh_team.B0] would be first bomber team
[brh_team.E0] would be first escort team
[brh_team.A0] would be first attack team
[brh_team.D0] would be first defend team
[brh_team.T0] would be first target team
[brh_team.N0] would be first namable team

[brh_team.BX] would be Xth bomber team
[brh_team.EX] would be Xth escort team
etc.


Also, only color of Target teams is needed as target object info covers everything else.

A Target team will ALWAYS be created.  If no Target team is found in config, color
for Target team is defaulted to color 2.

Multiple target teams are allowed.



Note #2

If start_in_air=0, start_alt and start_speed are defaulted to 0, and do not need to be included.



Note #3

Possible formation types

0 = spawn in circle as is normal for multiplay.  Best for air starts.  Better to use line formations.
1 = line abreast, centered on start location, extending to left and right
2 = line left, line extending to left of start location
3 = line right, line extending to right of start location
4 = line forward, line extending forward of start location
5 = line back, line extending backward of start location

Formation heading is the heading of planes in the formation.

Player spacing is the distance between players in a formation, in meters.





Additional info
---------------

'Change options'
----------------

The 'Change options' button allows the host to change most of the settings for the current
session.  NOTE: Changing these settings WILL NOT make changes to the config file that is 
currently active.

For the most part, changing settings works like you'd pretty much expect.  The only things
that are a bit different are:

1.  For starting time, times are listed in 1/2 hour increments.  I did this to keep the list
    fairly small.  If the need arises for finer increments, I can change this.  However, you
    can still set TIME_OF_DAY in the [BRH_SETTINGS] section to ANY time.

2.  Checking the 'Unrestrict all teams' box does pretty much what it says.  Team restiction 
    settings will be overridden, and ALL teams will be unrestricted.  Unchecking this sets
    restriction back to team based restriction.  I have chosen to do it this way since a large
    number of the configs I have come across include at least one team that NEEDS to be 
    unrestricted (i.e. a bomber team).  In these cases, normal restriction would really cause
    problems.


'Capture player location'
-------------------------

To aid in determining information for the configuration file, I have included a
button in BRUNHOST named "Capture location".

To best use this feature, make sure that BRUNHOST is active (using the SELECT program).
Launch BRUNHOST using the Combat Flight Simulator shortcut, and when CFS comes up, connect
to the session.

You are then in a local multiplayer session, with just you in CFS, and the Targets in BRUNHOST.
Fly to wherever you wish to place a target (or team), and make sure you are facing the proper
direction.  Click on yourself in the BRUNHOST player list box so you are highlighted.  Then, 
click "Capture location".  BRUNHOST will capture the location information for your location,
format it, and write it to a file called CAPTURE.TXT located in the BRUNHOST folder.  Note
that new information is added to this file.  Old info is maintained.  The info in this file
is in the same format as target objects in the config.  You can simply cut and paste.  You
can also use this feature to aid in determining starting locations for teams.  Just cut and
paste the appropriate info.

Note that the altitude you see in your plane when you do a capture will not be the same as
the altitude written to CAPTURE.TXT.  The reason is that the altitude you see in your plane
is NOT the ground altitude, but rather the altitude of the COG of you aircraft.  BRUNHOST
adjusts for this, and writes the GROUND altitude.  When targets are placed in the game, their
airfiles are read, and the location of their COG is used in conjunction with their altitude
from the config to place then properly.  This way, you can use the same exact location info
for ANY object, without having to adjust the altitude in the config.

Also note that during my testing, I discovered that many airfiles are not done very well in
this area.  The stock flyable CFS aircraft work fine, as do the few BR aircraft I have tested.
Many of the non-flyable CFS aircraft have air files that are flawed, even the Sopwith Camel.
The only reason I mention this is that if you place a target in the game, and it hovers above
the ground, or has it's landing gear in the ground, it most likely due to problems with
the air file itself.  Try placing a stock flyable CFS aircraft at that same location to see
how it looks.  If it looks fine, then the other object you tried has a faulty air file that
should be adjusted.

*** New info (vers 1.32) ***
The capture feature has been changed somewhat.  In all previous versions, BRUNHOST would wait
for the NEXT location packet sent by the player, and would use that info.  Now, BRUNHOST saves
the last location packet that was sent by all players.  This info is used now.  What this means
is that you can now PAUSE the game, then capture your location (the last one you sent) and BRUNHOST
will capture the last location packet you sent.  This also means no more waiting for the next
packet to arrive, which made me at least wonder if the capture button did anything.

You can also save a short description with each capture.  Should help when doing multiple captures
in the same session.


'Autoboot'
----------

The 'Eject pilot' button in BRUNHOST brings up a dialog allowing a couple of options.  You
can eject a player and alow them back into the game (good for when a player loses connection
but is still 'in the game or Ready Room').  You can eject them and not allow them back into
the current session (for those people that you just want gone).  You can also eject them, and
prevent them from ever joining any BRUNHOST session you run by adding them to the 'Autoboot'
list.  When you do this, their nickname in the game will be added to a text file called
AUTOBOOT.TXT.  When ever a player joins the game, this list is checked.  If the player is
found in the autoboot list, the are immediately and automatically ejected from the game.  To
later allow that player into your sessions (if you change your mind), just delete that players
nickname from the AUTOBOOT.TXT file.



Want to learn more?
-------------------

Read the file TECHINFO.TXT to learn more about why the program works the way it does (and
in some cases doesn't) and features that MAY show up in later versions.



Acknowledgements
----------------

First off, I'd like to thank my wife and children.  They have put up with my obsession with
this program for a long time, and have been VERY cooperative and supportive of my efforts.
There was one day that I just had to take a break from this program, and decided to watch TV
instead.  My daughter asked if I was going to get on the computer, and I said no.  She then
said, "But dad, you're ALWAYS on the computer".  That gives you some idea of what it's been
like working on this project.

Next, I'd like to thank Badjoints.  Without him, this project would never have come this far.
He has helped me test it many times, and has helped a great deal in helping determine exactly
what this program should and should not do.  The hours of testing and discussion have made this
program what it is today.  There were also a number of time that the frustration of working on
this almost made me give up, and BJ was always able to give me the boost I needed to continue
the work.

I'd also like to thank RAF_Nello.  His Pinball Factory was the original inspiration for this
work.  The idea of player controlled targets was great, but I thought that these targets should
be able to be computer controlled, and so started my long quest.  Originally, I only intended
on trying to bring targets into multiplayer, but the more I learned, the more I realized that
if my program were to host MP sessions, it would open up a whole new world.

I'd like to thank JG2_Shake for his ideas on how to get around Directplay and for all his help
in trying to sort out all the communications and host IP problems.

I'd like to thank XL_Wing_ripper for getting me interested in the inner workings of CFS in 
multiplayer in the first place.

I'd like to than HoT_MadDog for his help in trying to help me deal with multiple IP addresses
on some players systems.  He has been a BIG help here, running test runs and sending me the
text files that have been generated.

I'd like to thank RCAF_pointy1 for his help in figuring out how to deal with AOL users.  I'd
also like to thank him for creating the CFS killing 'Ark Raid' config set.  LOL.

I'd like to thank all of those that have help me test, and all those that have given me feedback.
Without your help, this program would not exist.

And finally, I'd like to Microsoft for CFS and Visual C++.  (Yes, that hurt like he**)  CFS
totally ROCKS, but I sure wish they'd give us more support for the game.  It's also been a
real trip trying to learn C++ while creating this program.  When I started on this journey,
I didn't know C++, knew nothing about DirectPlay or DirectX, and knew virtually nothing about 
network communication protocals.  I've had to learn it all on the fly.  What a rush.




I hope you enjoy my little program.  If you have any questions, comments, complaints or 
suggestions about the program, I can be reached at:

GunsJammed@hotmail.com

If you are reporting bugs, please include the BRUNHOST.CFG you were using. Also, please include
XCONNECT.TXT if you experienced connection problems (player(s) starting in ocean).

Also, please send BRHERROR.TXT if it contains errors OTHER THAN configuration errors.

And PLEASE include the version number that you were using.

Also, please let me know what version of Windows your are running, and the version of DirectX
you are currently using.


