Allow for continuous logs on the test builds.

For what's not in 'Top Priority Game Design'. Post your ideas, visions, suggestions for the game, rules, modifications, etc.
Post Reply
Message
Author
User avatar
Oberlus
Vacuum Dragon
Posts: 662
Joined: Mon Apr 10, 2017 4:25 pm

Allow for continuous logs on the test builds.

#1 Post by Oberlus » Mon Jun 12, 2017 12:03 pm

The fact that the logs get reset each time you load a game is a nuisance to track down AI's problems that only appear on mid/late game (if the problems only get apparent way after the AI made the decision that caused it, you will have lost the logs in which the AI's decision was logged).

A workaround for this is to backup all the logs each time you exit a game, but this is annoying and awkward, and I very often fail to do so since I mostly play late on night when I'm already tired and not very professional.

Would it be possible to allow test builds of FO to keep the information of the whole game no matter when you (re)load?

I realise it is not as simple as opening the log files with append mode instead of write. If you save a game on turn N, then play until turn N+10, then reload the turn N save, you don't want to just open the logs of turn N+10 to append, you would need the logs that you had on turn N. Moreover, you don't want to have hundreds of previous logs with endless repeated information, so you don't want to keep the logs of previous games, nor to keep the logs of every turn on separated files (because at turn N you will have the info of turn 1 repeated in N files. This could easily snowball and clutter your disk.

So I can reformulate the question as this:

Would it be possible to save the logs along the saved game when using the save game option in the FO test builds?

Thus, auto saves wouldn't keep logs, but user saved games would copy the logs along with the game (for example, using path save/<save name>_<log_name>, like "save/my_last_saved_game_AI_5.log") and on loading it would copy (overwrite) the corresponding logs over the their standard location and open them on append mode.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12245
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Allow for continuous logs on the test builds.

#2 Post by Geoff the Medio » Mon Jun 12, 2017 2:14 pm

The game doesn't save the log text in memory; it just writes it immediately to file after each log message.

It should be possible to give log files distinct names with a timestamp, and have an option to not delete any of them, though.

User avatar
Oberlus
Vacuum Dragon
Posts: 662
Joined: Mon Apr 10, 2017 4:25 pm

Re: Allow for continuous logs on the test builds.

#3 Post by Oberlus » Mon Jun 12, 2017 3:30 pm

Geoff the Medio wrote:It should be possible to give log files distinct names with a timestamp, and have an option to not delete any of them, though.
Yeah. That would work.

It could also consist of just:
- When saving a game, make a copy of the current log files into the save folder appending the save name in front of the log files (prefix).
- When loading a saved game, copy the saved log files from the save folder into ".." (removing the save game prefix), and then open them in append mode (instead of write) to continue the logging.

Assuming that would be the correct way (seems too simple to be true for a client/server application), I acknowledge it is not quite straightforward (or maybe it is and it's just my lack of C++ skills, I haven't touched it in like 15 years). I understand the saving part would be done in SaveGame(), and the loading part in LoadGame(), both in server/SaveLoad.cpp. But I bet the logging processes are started before LoadGame() so something may have to be done out of those functions. Right now I'm trying to locate the declaration of DebugLogger(), just by web-browsing the repository, but I know I should get time to learn git, pull the repository into my machine and use an IDE for this.
I ran out of time for now.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12245
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Allow for continuous logs on the test builds.

#4 Post by Geoff the Medio » Mon Jun 12, 2017 4:35 pm


Post Reply