War Simulation is a project I’ve created using Game Maker which allows users to create armies to use in fantasy war simulations using the provided executable file and notepad files. The project includes a supplementary file created in Microsoft Excel 2010 which allows users to maintain a database of troops from which they can easily build their own battles to be simulated by the executable file. Some elements of simulation will use random chance to determine outcomes, but outcomes will be directly impacted by army compositions and the attributes of the troops and leaders in each army. The project will be supported through multiple YouTube videos and through the forum on my website where user feedback is encouraged. Links to the YouTube videos and forum pages will be included in the bottom of this article.
The project is contained in a zip file (WarSimulation.zip) which can be downloaded at the following website: http://esimsguru.weebly.com/. The .zip file download includes the following files: WarSimulation.exe, WarSim Database.xlsm, squad_list.ini, and a folder titled Example Battles containing HokutenVSCorps.txt and VSWeigraf.txt. It is important that the WarSimulation.exe and squad_list.ini files are always in the same folder, and the squad_list.ini file cannot be renamed. The Excel file is a supplementary file which aids in the creation of the .ini file and helps to keep an organized list of all troops for re-use in future battle scenarios. The text files in the folder are example scenarios I’ve created which can be loaded for use by clearing all information in the .ini file and replacing with all the information in either text file.
WarSimulation.exe is the executable file which will simulate a battle given the information contained within the squad_list.ini file that is located in the same folder. Just run the exe file to get a display showing the pre-battle summary, and press spacebar to begin the simulation. After the simulation you will see a results screen at which you can press the spacebar to close the simulation. If any errors are found in the simulation they can be reported using the following YouTube channel or one of the related videos on the channel: https://www.youtube.com/user/CaiusBallad77, or using the forums in which this article will be posted. More information on how this simulation works and the calculations involved can be found in future articles.
WarSim Database.xlsm is a supplementary file and isn’t required to make your own battle simulations, but is a very useful tool for staying organized and aiding in the creation of the .ini file. There are five worksheets in the WarSim Database.xlsm workbook which are the Troops, Squads, Settings, Export, and Hidden Mechanics worksheets. Hidden Mechanics can be ignored, it is only used for the macro. The Settings worksheet contains variables that affect the settings for the whole battle including: Disbanding (if true, or equal to 1, then troops will retreat when their situation gets too bad based on their Brave attribute. If equal to 0, then troops will fight to the death of every last troop in the squad), Game Speed (a multiplier to game speed with a minimum of 1. For example, a 3 would cause all actions to take 3 times as long normal and a 2 minute battle would last 6 minutes for example), Charge Cost (the stamina cost per second of charging, so if charge cost is 1 and a squad has 50 stamina then they could charge for a maximum of 50 seconds), and Charge Speed (a multiplier to a squad’s speed when it is charging). In the future new variables may be included such as weather and terrain conditions for example.
The Troops worksheet is the worksheet that contains the user defined database of individual troops and their characteristics or defining attributes. For more information on the limitations of each field and the effects the fields have on how a squad performs in battle, see Article 2: Troops and Squads. The Squads worksheet is the worksheet where squads can be created by defining a squad name and starting positions and listing valid IDs (from the Troops worksheet) for the Troops and the Leader (or list a zero for no troop or leader) along with the variables for the troop count and starting morale and where the leader is positioned within the squad. Columns K and to the right are all formulas, be sure to copy the formulas down to match the last row of data in columns A:I. For more information on the Squads worksheet see the YouTube video on setting up your own battles (LINK HERE) and refer to Article 2: Troops and Squads. The Final worksheet is the Export worksheet which contains a list that should replace the contents of the .ini file in order to run the battle in the executive file. When all troops have been defined on the Troops worksheet, all Squads created on the Squads worksheet (copy the formulas down), and all settings have been defined on the Settings worksheet, press the Alt and F8 keys together to open the macros dialogue box and run the macro. This will update the Export worksheet to reflect all the information on the other worksheets in a format that can be copied to the .ini file and used for the simulation. For more on how this works, watch the video at the following link: (LINK HERE).
squad_list.ini is a notepad file saved with a .ini extension which contains the variables used for the simulation. You may have multiple notepad files saved in the folder with variables for a different battle scenario saved in each one, as long as you make sure the file for the battle you want to simulate is saved with the exact name of squad_list.ini. When this file is in the same folder as the WarSimulation.exe file, you can run the executable file to have it load the variables from the .ini fil eto use in a battle simulation. The .ini file contains the game setting variables at the top followed by sections for each squad to be created, with each section listing all the specific variables required and their assigned values for that squad.
This was just a basic summary of the files contained within the zip file download. For more detailed information see the articles listed below (also contained within this site's blogs), and for guides and to see the project files in action check out the YouTube video links below.
YouTube:
https://www.youtube.com/watch?v=RnlIwiDKpOM