CRpCreator is a command line application that can be used to create a .crp file containing replay information for a number of players of a single game. It takes a .csv file as input to allow specification of the input data in a way that can be managed using a standard spreadsheet package, such as MS Excell, to ease the batch processing of a large number of player's files. It generates a small report as output giving some details of which (if any) player's files failed to be imported into the .crp file.
CRpCreator has been designed to support the following CIV versions, mainly because they are the ones supported by GOTM from GOTM14 up to the present time.
- CIV III 1.21f (Mac)
- CIV III 1.29f (Mac and PC)
- PTW 1.14f
- PTW 1.21f
The following is a list of steps to perform to create a .crp file from multiple .SAV files. This assumes that the CIVReplay suite has installed in the standard location.
- Ensure all .SAV files are in the same directory (we'll call it CRpGen).
- Create a .csv file in the CRpGen directory (we'll call it config.csv). See the config.csv in the Example section for details of the .csv file format.
- Open a command prompt window and cd to the CRpGen directory.
- Type the following (Alternatively you can create a .bat file with this command in and double click it) :
"C:\Program Files\CFC Dianthus\CIVReplay\CRpCreator.exe" config.csv > results.csv
- Open the results.csv file and check that the Error column is empty, that the UnknownEventCount column is 0 for all rows, and that the FileCivVersion is populated for all rows.
- Open the .crp file using CRpViewer or CRpSettleLoc.
Directory structure
This example shows how you might want to organise a directory structure for multiple games, allowing you to easily recreate a bunch of .crp files whenever I update CRpCreator to extract more information.
I've created a directory structure with a folder per game, with the intention of adding more games to the structure later. The folders will end up looking as follows after adding further games (this example just adds Game1) :
I've created the structure here for Game1, complete with supporting files. The file run.bat can be double clicked on to create the Game1.crp file and Game1_Results.csv file. If you have installed the CIVReplay suite somewhere other than the default location then you will need to edit the run.bat file and change the path in the following line :
SET CRPCreator="C:\Program Files\CFC Dianthus\CIVReplay\CRpCreator.exe"
The input .csv file (config.csv)
I've placed a file named config.csv in the Game1 directory with the following contents :
Excell view :
Raw Text (I.e. using Notepad) :
Original file,Original.SAV
Output file,..\Game1.crp
PlayerName,CIVVersion,FileName,InGameScore,JasonScore,QSCScore
Player1,N/A,Player1_0825BC.SAV,2977,-1,-1
Player2,N/A,Player2_0825BC.SAV,72,-1,-1
The cells are used as follows :
- The contents of the cells A1, A2 & A3:F3 are ignored, they're just there to make it look pretty for the human reader!
- Cell B1 contains the name of the original .SAV file. This should be the .SAV file at the start of the game, before any moves have been carried out.
- Cell B2 contains the name of the output .crp file. Note that the example has ..\ at the start of the file name to output in the CRpCreatorExample directory, the directory above CRpCreatorExample\Game1.
- Rows 4 downwards contain information about all of the players to be added to the .crp file, 1 row per player. The contents of the cells is as per the header row in Row 3. A couple of things to note :
- The CIVVersion column (column B) is no longer used. CRpCreator now extracts the CIV version from the .SAV file. This columns is still here because I don't want to remove it, so causing me to have to update all of my .csv files
.
- Columns D to F are used to populate the .crp file with information about scoring. I tend to use -1 to mean not applicable. I can't remember whether it will be OK with blank fields, so just put the -1 in!
The output .csv file (Game1_Results.csv)
On running CRpCreator (by double clicking run.bat) the Game1.crp and Game1_Results.csv will be created. Lets have a look at the .csv file :
Excell view :
Raw Text (I.e. using Notepad) :
Line,PlayerName,InCivVersion,Error,Turns,EventCount,UnknownEventCount,GameType,FileCivVersion,Major.Minor
4,Player1,N/A,,88,121,0,?,PTW 1.21f,18.7
5,Player2,N/A,,87,91,0,?,PTW 1.21f,18.7
This file is just to provide some information about the success of the .crp creation. The columns are defined as follows :
- Columns A and B are just to help refer back to the config.csv file.
- Column C just passes through the CIVVersion column (Column B) from the config.csv file, and gain, this is no longer applicable.
- Column D should be empty if all goes well. A couple of common errors are :
- "ERROR Caught exception " : This is generally caused by getting the filename wrong in Column C of config.csv. Check that there is a .SAV file with a name exactly matching this on the disk. Another cause is if there is a comma (,) in the file name. CRpCreator can't currently cope with this, so just rename the file to remove the comma and update the entry in config.csv.
- "ERROR Failed to parse line" : This probably means you've left Column C blank in the config.csv file.
- A.N.Other : Contact me and I'll see what help I can offer
.
- Columns E and F are just some boring stats for those that are interested.
- Column G should hopefully be all 0's. I there is a row > 0 then this indicates an event type that I haven't encountered yet. If any of you see this I would be interested in the .SAV!
- Column H is only really applicable to GOTM, and identifies whether the .SAV was in the Conquest, Open or Predator class.
- Column I is for information only, and is just a more human readable form of Column J.