Log in

View Full Version : Is there a way to extract mission results to a file?


4Shades
03-04-18, 09:06 PM
Hello everybody.

I am new to SHIV and I am doing a survey of its functions with a view to integrating SHIV with several other titles to form a combined operations WW2 campaign system (already working with IL2 1946 and Arma 2/Iron Front). If that concept interests you, you can find a little more about it at http://seowhq.net/seowwiki-en/index.php?title=What_is_meta-SEOW%3F

Be that as it may, my present question is this. Is it possible to use scripting or some other means to extract SHIV (or SH5) mission data (objects, locations, damage states) into a readable text file, e.g. at the end of a mission or save time? I see the game produces binary save files (yuk).

I have looked at Kim Ronhof's SH4Report tool which looks fabulous and easy to use, but there is no documentation of the methods he employed, just the .exe file. I would like to be able to extract the mission data myself somehow if I can - this helps with the integration stage.

Any tips or pointers would be helpful to me!

Cheers,
4Shades

cdrsubron7
03-04-18, 09:27 PM
Welcome to Subsim, 4Shades. Happy to have you with us. :salute:

aanker
03-05-18, 10:58 AM
..... I have looked at Kim Ronhof's SH4Report tool which looks fabulous and easy to use, but there is no documentation of the methods he employed, just the .exe file. I would like to be able to extract the mission data myself somehow if I can - this helps with the integration stage.

Any tips or pointers would be helpful to me!

Cheers,
4Shades
I remember now, I had to make the PDF in the Patrol Report generator download more user friendly, so I provided step by step pictures. I was getting swamped with questions and the pictures solved that - 'one picture is worth a thousand words : )

Here you go:
The following files are used:
SHReport.ini – this is a file that the program generates, if it doesn’t exit’s – the sole purpose is to save the information of the users command name and suborn number + the last patrol area.

Replayinfo.rep this file saves the name of the mission (the name you save the game under in SH4), it is used to generate the list to choose the report from.

ActiveUserPlayerUnits.upc - the name of the boat is saved here.

SaveData.clg – the ships that have been sunk are saved her with date time and location. This is where the actual information is located.

SaveData.crp – many crew remarks are saved her – the last entry date is used to generate the date of the report. The Torpedo firing data is taken from the crew remarks (ex. "Firing tube 2, sir!")

GamePlaySettings.cfg – the information of the level of realism is saved here – the program adds the % of each feature to make up the setting% = the JANAC %. SH4 Report generator ver. 5102
http://www.subsim.com/radioroom/downloads.php?do=file&id=3560

If someone wants Start Patrol & End Patrol dates, as soon as you're dropped on your boat from the Office, make a command or ask for a weather report if your install has that option. Be sure to Save at the end of your patrol with a name like Patrol End, then end your patrol. Use this Patrol End save for the report tool to use. Use your regular patrol end patrol save for your career.

Hope this helps, Welcome to Subsim!

Happy Hunting!

4Shades
03-05-18, 07:36 PM
Many thanks for the information! I am investigating now ...

Cheers,
4Shades

4Shades
03-05-18, 08:48 PM
OK, a couple of questions, regarding SaveData.clg and JSGME.

Question 1
I ran a stock mission (Battle off Samar) for a few minutes and a few ships got sunk, 3 or 4, but I did not shoot any torpedoes. Then I made a Save file and exited the game to examine the files you list.

Replayinfo.rep: found it, a binary file but should be easy to parse.

ActiveUserPlayerUnits.upc: readable text, no problems.

SaveData.clg: zero-length file? Does this only contain the player kills maybe? What about all the AI kills?

SaveData.crp: readable text, no problems.

GamePlaySettings.cfg: readable text, no problems.


Question 2
As a second (minor) issue, I found a problem running the report tool. I started SH4Report_5102.exe, double-clicked my Save file and the following error came up:

Cannot open file "...GAMEPATH\Mods\JSGMEini". The system cannot find the path specified.

My game install is a stock Steam d/l with no mods/addons at all. I guess SH4Report requires JSGME to be present.

Cheers,
4Shades

propbeanie
03-05-18, 09:25 PM
What folder do you have Steam installed in, and which Windows OS are you using there, 4Shades?

4Shades
03-05-18, 09:34 PM
Hi there propbeanie,

I have Win10. Steam is in C:\Program Files (x86)\Steam but for disk space reasons SH4 is in a separate registered Steam folder on E:\SteamLibrary\steamapps\common\Silent Hunters Wolves of the Pacific.

Cheers,
4Shades

aanker
03-05-18, 09:43 PM
OK, a couple of questions, regarding SaveData.clg and JSGME.
Question 1
I ran a stock mission (Battle off Samar) for a few minutes and a few ships got sunk, 3 or 4, but I did not shoot any torpedoes. Then I made a Save file and exited the game to examine the files you list.

Replayinfo.rep: found it, a binary file but should be easy to parse.
Replayinfo.rep this file saves the name of the mission (the name you saved the game under in SH4), it is used to generate the list of Saves to use to choose the report from. ActiveUserPlayerUnits.upc: readable text, no problems.

SaveData.clg: zero-length file? Does this only contain the player kills maybe? What about all the AI kills?
Yes, only player kills SaveData.crp: readable text, no problems.

GamePlaySettings.cfg: readable text, no problems.
Question 2
As a second (minor) issue, I found a problem running the report tool. I started SH4Report_5102.exe, double-clicked my Save file and the following error came up:
This tool is meant more for career mode but the files have the same function. Anyway, to install it, follow my pictures, you need to navigate to where SH4.exe is and highlight that folder. The report tool goes in /documents/SH4/data/cfg/SaveGames. This needs to be done first to create the ini file. The error below is because the ini file wasn't created. Cannot open file "...GAMEPATH\Mods\JSGMEini". The system cannot find the path specified.
My game install is a stock Steam d/l with no mods/addons at all. I guess SH4Report requires JSGME to be present.
Yes, install JSGME. Good luck with your project, now you know what each file is for. BTW, Steam didn't exist or nobody used it when the report tool was made. I prefer a DVD.

Happy Hunting!
Cheers,
4Shades

4Shades
03-05-18, 10:29 PM
OK, I installed JSGME and got the SH4Report tool to work. Wonderful!

@aanker: you say that only player kills are recorded in SaveData.clg. Yes this is perfectly fine for player-centric reports for career mode etc. But for my purposes I would like to have location and status for all ships/subs/boats at the end of the mission (or at save time). The game must record all of this information somewhere, e.g. InstantSave.rep or maybe SaveFile.rep, so it can continue the game from a save file(s). The real issue is the format of the .rep files, and whether it is even permissible to work out that format.

Many thanks for all the help so far!

Cheers,
4Shades

propbeanie
03-06-18, 08:08 AM
Hi there propbeanie,

I have Win10. Steam is in C:\Program Files (x86)\Steam but for disk space reasons SH4 is in a separate registered Steam folder on E:\SteamLibrary\steamapps\common\Silent Hunters Wolves of the Pacific.

Cheers,
4Shades
In this case, it's a good thing you had "disk space reasons". A Library Folder on another drive keeps Windows from "protecting" the folder with UAC, so you are good to go with the "E:\" drive setup for the game. Stay away from the folder on the C: drive, since Windows "protects" it from edits, including mods... :salute:

4Shades
03-06-18, 09:38 AM
Yes, agreed. UAC is horrific.

aanker
03-06-18, 11:57 AM
OK, I installed JSGME and got the SH4Report tool to work. Wonderful!

@aanker: you say that only player kills are recorded in SaveData.clg. Yes this is perfectly fine for player-centric reports for career mode etc. But for my purposes I would like to have location and status for all ships/subs/boats at the end of the mission (or at save time). The game must record all of this information somewhere, e.g. InstantSave.rep or maybe SaveFile.rep, so it can continue the game from a save file(s). The real issue is the format of the .rep files, and whether it is even permissible to work out that format.

Many thanks for all the help so far!

Cheers,
4Shades
It would be interesting to learn where SH4 does save mid-action data when a player saves to restart later. (You thought Replayinfo.rep??) - I don't know what I would use this information for other than to keep the file name(s) and purpose in my notes for future reference to be able to answer this question in case someone asks.

I have a load of mid patrol Saves I could dig through when I have a reason and time. If you trace it down, as I'm sure you will, please post where SH4 hides that info.... lol

Happy Hunting!