Operation Flashpoint: Dragon Rising is a direct sequel to 2001's hit combat simulation game Operation Flashpoint: Cold War Crisis and the expansion pack Operation Flashpoint: Resistance.
The OFP:DR Dedicated Server is a script written for AutoHotkey 1.0.48.05 and compiled into an exe to provide automatic hosting of PVP multiplayer games. This is performed by automated control of the keyboard and mouse to configure a Dragon Rising server using parameters provided via text files. Up to four text files can be used to set a respective number of server profiles that are changed at the completion of all maps in a rotation. The server can be configured to use fixed maps lists of up to 10 maps per settings file. Alternatively the server can randomly select a game type and/or map list.
Operation Flashpoint Dragon Rising Dedicated Server v2.0
Scripting - Zeewolf
Testing - DR Operative
FIXED: Script can handle "Connection error there are not enough players to continue" message
ADDED: Server Name setting in Settings.txt
FIXED: Script can handle Bandwidth warning dialog
FIXED: Blindside and infiltration game times
FIXED: Private slots
CHANGED: Extended key timings on respawn selection and ranked server options
ADDED: Custom server message of the day in settings.txt
FIXED: Further extended key timings for ranked server options
FIXED: Supremacy match point limit not selected properly
FIXED: Trying to send MOTD after mission launched
CHANGED: Server chat messages now 3 custom MOTDs, removed fixed chat messages
FIXED: Supremacy match point limit
ADDED: Active end game detection using V1.bmp
ADDED: Deep sleep mode
ADDED: Game window detection during active game detection and before starting a new server
ADDED: Script now uses 4 seperate settings files which it cycles through sequentially
ADDED: Random game mode setting
ADDED: Random map setting
CHANGED: Split match score limit into seperate annihilation and supremacy settings
ADDED: Use File setting to set a variable number of settings files (1 to 4)
FIXED: Random game type now performed for every new server
FIXED: Random map shuffle option now performed every new server
ADDED: Shuffle setting for fixed map list
Compiled the script into a FULLY PORTABLE "STANDALONE" exe file
What it does
The OFP:DR Dedicated Server is a script written for AutoHotkey 1.0.48.05 and compiled into an exe to provide automatic hosting of PVP multiplayer games.
This is performed by automated control of the keyboard and mouse to configure a Dragon Rising server using parameters provided via text files.
Up to four text files can be used to set a respective number of server profiles that are changed at the completion of all maps in a rotation.
The server can be configured to use fixed maps lists of up to 10 maps per settings file. Alternatively the server can randomly select a game type
and/or map list.
The following graphics settings are essential for correct operation of the script:
Screen Mode Windowed
Aspect Ratio 16:9
96 DPI is the recommended windows display setting for the dedicated server (this will affect script image searching).
The following graphics options are recommended for increased performance:
Vsync Enabled On
Texture Quality Low
Shadow Size Low
Shadow Quality 128
Object Draw Distance Low
Ground Cover Low
Tree Draw Distance Low
Texture Filering Bilinear
How to use it
1. Copy the DR Server folder to a location of your choice it is recommended to create a shortcut to ofp-dedicated-server.exe.
2. Open the Settings\Settings1.txt file in a text editor and set the desired parameters. Lines starting with a semicolon are considered comments.
The first setting in the file (File used) determines if the given settings file will be used. At least one of the four text files must be enabled for the server to function.
To set the desired missions used in the map rotation you must enter the corresponding number of each map in the settings (i.e. the number of each map as listed in the "Available Maps" panel of your Map List menu for the game mode selected).
Alternatively the server may be configured to randomly select a mission, in this case the minimum and maximum map number must be provided for the selected game type
(or all game types if random game type is used).
3. Repeat step 4 for Settings2.txt, Settings3.txt and Settings4.txt.
4. Start Dragon Rising and enter the above graphics settings via the options menu.
5. From the main menu select Multiplayer; Online; Login; Login to your online account.
6. If you wish to use active end game detection mode rather than deep sleep mode (see step 12 for a description of these terms) you must now take a screen shot of the game window using Alt-Prt Scr.
Paste the captured image into an image editor (e.g. paint), select a 15x15 pixel block around "V1" in the bottom left corner of the screen (refer to the provided V1.bmp for an example) and crop the image to the selection
(or cut and paste the selection to a new image). Save the 15x15 pixel image of V1 as a 24-bit bmp in your DR Server folder. See the trouble-shooting section below for more details. Note this step should not need to be repeated
unless you change windows display settings (e.g. dpi) or advanced graphics card settings.
7. Once "ONLINE" menu has loaded task switch to your desktop and launch AutoHotkey. The script should refocus to the game window and move it to the top left corner of the screen.
The script will attempt to setup a server according to the settings provided in Settings.txt. Avoid moving the mouse or task switching while the script is navigating the menus.
If any dialog boxes are displayed an error has occurred and AutoHotkey will close.
8. Once the script reaches the Multiplayer lobby it will enter "Poll mode".
In Poll mode the script will periodically attempt to launch the game by refocussing to the game window and pressing the F8 key (start countdown or start).
The period at which the game refocusses and presses F8 can be set using Settings.txt. While in the lobby the script will enter the three message of the day lines (set in settings.txt) as chat text every 5 minutes.
9. Once the minimum number of players have joined the server and the polling mode refresh period has elapsed the game will start the game.
The script detects when a game has launched by searching for a black 13x14 pixel block in the lower part of the screen (in the strip containing the navigation keys).
If this block is not found the game assumes the game has started and will enter "sleep mode". The server will "sit-out" the game by not selecting a slot from the in mission lobby.
10. In sleep mode the script will remain inactive for a period calculated from the server settings. The sleep period is calculated as follows:
Sleep period (in minutes) = Game time + Loading time + 1
Where Game time = Maps in rotation x Game length
Loading time = Maps in rotation x 2
If "Deep Sleep" mode is set, the script will not monitor the game window for the end of game state and will not interfere with keyboard and mouse movement, after the sleep period has expired the script will reawake
and configure a new server. Due to this deep sleep mode can result in prolonged periods of server downtime if missions end earlier than the sleep period.
When deep sleep mode is not set, the script will use "Active end game detection" mode. This means the script will continue to monitor the game window in an attempt to detect the end of a game.
The rate at which the server refocusses to the window to check for the end of game, is determined by the server refresh rate setting. If the server does not detect the end of game within by the end of the sleep period the script
assumes the game has ended but it has failed to detect it (see troubleshooting below)
and will proceed to launch a new server.
11. After the sleep period has elapsed or the end of game is detected the script will assume that all maps in the set rotation have been played and the game has returned to the online menu. The script will then attempt to refocus to the
game window and configure a new server.
Troubleshooting and notes
Stopping the script:
To stop the script, alt-tab from the game, click on the Autohotkey icon in the system tray/notification area and select exit from the menu. It is recommended that Windows 7 users customise their notification area to specify that
the autohotkey icon is always displayed. It is also recommended not to attempt to stop the script while the script is entering server parameters. Although the script does check for the presence of the game window and focus on it
at specific intervals (before entering server parameters, in poll mode and in active end game detection mode) the script does not do so before performing every mouse click or keystroke, hence alt-tabbing or closing the game while
the script is entering keystrokes will result in these being entered into an unrelated window or the desktop. It is therefore good practice to stop the script prior to exiting multiplayer.
The script was tested on Windows 7 and XP. It has been found that in XP AutoHotkey is not always able to refocus, move or restore the game window.
If you find this occuring it is recommended to manually move the window to the top left corner of the screen and not to minimise the game.
The game's aspect ratio affects the position of menu items on the screen. Altering the aspect ratio or resolution from those listed will cause the script to "miss" menu items when it attempts to click on them.
If the script is failing to navigate the menus properly make sure you have the above graphics options set and the window is located at the top left corner of the screen.
The weakest point of the server script is the shift from Poll mode to Sleep mode and active end game detection which rely on matching source images to the game screen to detect certain states.
The image search feature of AutoHotkey was found to be unreliable with anything larger than 16x16 pixel blocks. Graphics and display settings also present an obstacle to locating preset images.
It is for this reason that the script searches for black pixels in the lobby screen. If your script is configuring the server correctly but is not entering sleep mode then it may be necessary to replace the provided black.bmp image.
This should be done by taking a screenshot (Alt-Prnt Scr) pasting into an image editor of the lobby screen and cropping a similar sized black pixel block. The image must be saved as a 24-bit bmp file.
If the script does not detect it has entered the game and remains in poll mode it may eventually unintentionally select a role and spawn into the mission.
This happens because the script attempts to send a server message of the day while in the mission.
You can distinguish when the server is refreshing in "poll" mode vs "active end game detection" mode. In poll mode the mouse cursor will be moved to a position in the top centre of the screen (coords 400, 100 of the 800x600 window).
In active end game detection mode the mouse cursor is moved further to the right at each refresh (coords 450, 100) than in poll mode.
For the detection of the end game state the script searches the game window for V1.bmp an image of the "V1" from "V1.02" present in the bottom left corner of the menu screens. Testing has shown that this image can only be reliably found
if the source image used was produced on the PC running the script. I.e. to detect the end of game you must produce the V1.bmp on your PC by taking a screenshot of the "Online" menu and cropping a 15x15 pixel block of "V1". The provided
copy of V1.bmp IS AN EXAMPLE ONLY it is very unlikely that the script will be able to find this example in your game window.
If you do not wish to create your own V1.bmp for reliable end game detection it is recommended to use Deep Sleep mode.
Two small test scripts for checking the image search function has been provided AutoHotkey black search.ahk and AutoHotkey V1 search.ahk
The test scripts will search the same area of the game screen as the server script and move the mouse pointer to the first matching pixel block. This allows you a relatively quick method of checking your source images are working.
If you have any questions or problems you may contact Zeewolf or DR Operative via the Codemasters forums or visit the project homepage at Ofp-dedicated-server.subdomain10.info for video tutorials and demonstrations.
AutoHotkey 1.0.48.05 is distributed under the included seperate GNU license.
The following is the license to the Dragon Rising dedicated server autohotkey script, license to use and distribute this script is granted under the following terms:
You are free:
* to Share — to copy, distribute and transmit the work
* to Remix — to adapt the work
Under the following conditions:
* Attribution — You must attribute the work to the author (but not in any way that suggests that they endorse you or your use of the work).
* Noncommercial — You may not use this work for commercial purposes.
* Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.
IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.