op2_sdk:programming_scenario_dlls

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
op2_sdk:programming_scenario_dlls [2016/03/27 20:59] – [Scenario Programming Index] vagabondop2_sdk:programming_scenario_dlls [2021/01/05 07:51] (current) – [Outpost Universe Repository] blackbox222
Line 1: Line 1:
 ====== Programming a Scenario ====== ====== Programming a Scenario ======
  
-Each Outpost 2 mission or scenario requires 3 files:+A complete Outpost 2 scenario (or mission) requires 3 files to work: a DLL, a MAP file, and a tech tree file. This page focuses on programming the DLL file. Outpost 2 scenarios are coded in C++ and require using legacy features of the language. See the [[op2_sdk:Software_Development_Kit_SDK|Software Development Kit Page]] for an overview of the MAP file and Tech tree file.
  
-  * **DLL (Dynamic Link Library) File (.DLL)**: Contains the logic behind the scenario such as victory conditions, frequency of disasters, starting resources, etc. Each DLL file represents a single scenario.+===== Scenario Programming Index =====
  
-  * **MAP File (.MAP)**: Contains the terrain used on the map, associated move speed, accability of tiles, etc. Each map file can support multiple scenarios.+**Develop Environment Setup** 
 +  [[op2_sdk:ProjectCreation|Visual Studio Project Creation]] 
 +  * [[op2_sdk:ProjectSettings|Advanced Visual Studio Project Settings]] 
 +  * [[op2_sdk:Scenario Naming Conventions|Scenario Naming Conventions]] 
 +  * [[op2_sdk:Debugging Scenarios]] 
 +  * [[opu:repository|Outpost Universe Repository]] 
 +  * [[outpost_2:technical_review:operating_system_compatibility|Operating System Compatibility]]
  
-  * **Technology (tech) Tree File (.TXT)**: A file containing the technology tree available for the scenario. Tech tree files are human readable, but must be written in a specific syntax so the game can parse the file. Each tech tree can support multiple scenarios. +**Scenario Setup** 
- +  [[op2_SDK:PlayerColor|Player Color]] 
-Below is an overview of these three files and how they relate. Each section contains links to more detailed information. +  [[op2_SDK:Setting Alliances|Setting Alliances]]
- +
-===== Scenario DLL overview ===== +
- +
-Each scenarios is stored in .DLL (Dynamic Link Library) file. A DLL file contains code that can be linked into from other applications, like Outpost2.exe. DLLs are created by compilers that take code files and compiles them into and intermediate language or directly into assembly language. While many different programming languages can be compiled into DLLs, Outpost 2 requires C++.  +
- +
-Code is usually written in special text editors that have knowledge of the programming language. Notepad++ is a good example. After writing the code, you have to find a compiler to compile the code into a DLL (or other file type).  +
- +
-Text editors designed for coding are also included in an Integrated Development Environment (IDE). IDEs are software packages that usually contain both a special text editor and a compiler. This allows you to write the code and compile the program in the same application. A good example of an IDE is Microsoft Visual Studio.  +
- +
-The Outpost 2 SDK comes packaged in a Microsoft Visual Studio 2015 C++ solution. Unless you are already knowledgeable enough to transfer the SDK to another IDE, it is recommended that you use Visual Studio since it will be easier to start coding without worrying about compiler setup requirements. Microsoft Visual Studio is free to use. +
- +
-===== Scenario Programming Index ===== +
- +
-**Initial Game Setup**+
   * [[op2_sdk:Setting Resources|Setting Resources]]   * [[op2_sdk:Setting Resources|Setting Resources]]
 +  * [[op2_sdk:TubesAndWalls|Placing Tubes and Walls]]
   * [[op2_sdk:Placing Units|Placing Units]]   * [[op2_sdk:Placing Units|Placing Units]]
-  * [[op2_sdk:TubesAndWalls|Placing Tubes and Walls]] 
  
 **Environmentals** **Environmentals**
Line 48: Line 40:
   * [[op2_sdk:TextDialogBox|Text Dialog Box]]   * [[op2_sdk:TextDialogBox|Text Dialog Box]]
   * Yes/No Dialog Box   * Yes/No Dialog Box
-===== MAP File Overview ===== 
  
-Each scenario will require a supporting .MAP file. With the OP2Mapper, you can create new maps or modify existing maps. Also, pre-existing maps may be used for new scenarios with no modifications. For inspiration, see the current maps here: [[outpost_2:maps|Maps Page]]. Each map file can support multiple scenarios. +----
  
-**WARNING:** If you wish to modify an existing map file, ensure you change the name first. Otherwise, when you modify the map file, it will modify all scenarios already linked to the map.+===== Scenario DLL overview =====
  
-===== Technology Tree File Overview =====+The required code for a scenario is stored in its own DLL (Dynamic Link Library) file. A DLL file contains code that can be linked into from other applications, like Outpost2.exe. DLLs are created by compilers that take code files and compiles them into and intermediate language or directly into assembly language. While many different programming languages can be compiled into DLLs, Outpost 2 scenarios are coded in C++. 
  
-Each scenario requires tech treeScenarios can use an already created tech tree, such as the one used by the Outpost 2 campaignsor customize tech tree. Tech trees are created in .TXT files and are human readable. Syntax must be followed closely to ensure Outpost 2 can properly parse the tech tree.+Code is usually written in special text editors that have knowledge of the programming language. Notepad++ is good exampleAfter writing the codeyou have to find compiler to compile the code into a DLL (or other file type)
  
-**WARNING:** If you wish to modify an existing tech tree file, ensure you change the name firstOtherwise, when you modify the tech tree file, it will modify all scenarios already linked to the tech tree.+Text editors designed for coding are also included in an Integrated Development Environment (IDE)IDEs are software packages that usually contain both a special text editor and a compiler. This allows you to write the code and compile the program in the same application. A good example of an IDE is Microsoft Visual Studio
  
-----+The Outpost 2 SDK comes packaged in a Microsoft Visual Studio 2015 C++ solution. Unless you are already knowledgeable enough to transfer the SDK to another IDE, it is recommended that you use Visual Studio since it will be easier to start coding without worrying about compiler setup requirements. Microsoft Visual Studio is free to use. 
 + 
 +The filename of a scenario DLL must follow strict naming conventions to be recognized by Outpost 2. See the [[op2_sdk:Scenario Naming Conventions|Scenario Naming Conventions Page]] for details.
  
-====== Scenario Administration ======+===== Scenario Administration =====
  
 Programming Outpost 2 scenarios requires detailed knowledge of Integrated Development Environment (IDE) setup. The best way to share your scenario source code and access other Outpost Universe source code is through the Outpost Universe Repository. Programming Outpost 2 scenarios requires detailed knowledge of Integrated Development Environment (IDE) setup. The best way to share your scenario source code and access other Outpost Universe source code is through the Outpost Universe Repository.
Line 68: Line 61:
 ==== Development Environment Settings ==== ==== Development Environment Settings ====
  
-Typically, Outpost 2 scenarios are created using an Integrated Development Environment (IDE). Since new scenarios must be compatible with the Outpost 2 executable, which was compiled in 1997, several unusual IDE Project and compiler settings must be selected. See the [[op2_sdk:ProjectCreation|Project Creation Wiki Page]] for detailed instructions.+Typically, Outpost 2 scenarios are created using an Integrated Development Environment (IDE). Since new scenarios must be compatible with the Outpost 2 executable, which was compiled in 1997, several unusual IDE Project and compiler settings must be selected. See the [[op2_sdk:ProjectCreation|Project Creation Page]] for detailed instructions.
  
-Once you have an Integrated Development Environment (IDE) installed and editing scenario DLLs, review [[op2_sdk:ProjectSettings|Project Settings Wiki Page]] for additional recommended settings that streamline the build process and debugging process.+Once you have an Integrated Development Environment (IDE) installed and editing scenario DLLs, review [[op2_sdk:ProjectSettings|Advanced Project Settings Page]] for additional recommended settings that streamline the build process and debugging process.
  
 ==== Outpost Universe Repository ==== ==== Outpost Universe Repository ====
  
-Source code meant for public access should be stored on the Outpost Universe SVN Repository under the Outpost2 folder. For more information on how to use the repository, go to the [[opu:repository|Outpost Universe Repository Wiki Page]]. +Source code meant for public access should be stored on the Outpost Universe Repository under the Outpost2 folder. For more information on how to use the repository, go to the [[opu:repository|Outpost Universe Repository Wiki Page]].
- +
-Outpost2 Repository Location: [[https://svn.outpostuniverse.org:8443/!/#outpost2]] +
 ==== Project Management ==== ==== Project Management ====
  
Line 85: Line 75:
  - //Go Back to [[op2_sdk:Software_Development_Kit_SDK|Software Development Kit]]//\\  - //Go Back to [[op2_sdk:Software_Development_Kit_SDK|Software Development Kit]]//\\
  - //Go Back to [[outpost_2:outpost_2|Outpost 2 Main page]]//\\  - //Go Back to [[outpost_2:outpost_2|Outpost 2 Main page]]//\\
- - //Go Back to [[http://wiki.outpostuniverse.org/doku.php?id=start|Wiki Home Page]]//+ - //Go Back to [[http://wiki.outpost2.net/doku.php?id=start|Wiki Home Page]]//
  • op2_sdk/programming_scenario_dlls.1459112379.txt.gz
  • Last modified: 2016/03/27 20:59
  • by vagabond