• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

tskunka

Recruit
28 Badges
Dec 17, 2020
5
0
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis 4: Emperor
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines Industries
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Parklife
  • Cities: Skylines - Green Cities
  • Hearts of Iron IV: Death or Dishonor
  • Cities: Skylines - Mass Transit
  • Hearts of Iron IV: Together for Victory
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Europa Universalis IV
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines
  • Semper Fi
  • Europa Universalis IV: Res Publica
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
I have a use case where I need to heavily filter the output sent to the game log text file.
e.g. no saved game messages
e.g. no [whatever line prefix] before each message
If I could also redirect the stats and score into separate files, it would be great as well.
Any ideas how to do this without having an external text parser go at it?
In a perfect world, I would love to see an internal web server like the mod for Cities:Skylines where one could monitor everything about a game in progress and do real-time queries.
 

Siddy00

First Lieutenant
47 Badges
May 2, 2016
236
572
  • Victoria 3 Sign Up
  • Empire of Sin - Premium Edition
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Hearts of Iron IV: Expansion Pass
  • Hearts of Iron IV: Death or Dishonor
  • Surviving Mars
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: Expansion Pass
  • Crusader Kings III
  • Europa Universalis IV: Pre-order
  • Battle for Bosporus
  • Europa Universalis IV: Call to arms event
  • Empire of Sin
  • Europa Universalis 4: Emperor
  • Europa Universalis IV
  • Crusader Kings II
  • Hearts of Iron IV: Cadet
  • Imperator: Rome
  • Pillars of Eternity
  • Tyranny: Archon Edition
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Res Publica
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Crusader Kings II: The Old Gods
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Mandate of Heaven
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Third Rome
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sword of Islam
Just out of curiosity, why would you prefer to do it internally as opposed to post-processing the log file? Both your examples seem easy to accomplish by setting up some scripts to filter the log file afterwards, which would be my first approach, but then again, I know (at least roughly) how to do that and have no idea how to implement something like the C:S mod you mention, so I am somewhat biased.
 
Last edited:
  • 1
Reactions:

alexti

Field Marshal
24 Badges
Jul 25, 2010
3.644
1.432
  • Europa Universalis III
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Europa Universalis IV: Res Publica
  • Europa Universalis III Complete
  • Heir to the Throne
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Wealth of Nations
  • Divine Wind
  • Crusader Kings II
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Cadet
  • Stellaris
  • 500k Club
  • Victoria 2
  • Europa Universalis IV
  • Stellaris - Path to Destruction bundle
I am not sure what you mean by external text parsers, but the simplest way to achieve what you want would be to stream log file content through a filter and send the output wherever you like. For example, if you want to remove [whatever line prefix], you could run something like:
Code:
tail -f game.log | sed 's/\[.*\]: //'
which you could redirect to the desired place. You can obviously chain multiple filters before redirection and if you want to split content into several stream, you could run several such commands with different filters redirecting to different places.
 
  • 1
Reactions:

tskunka

Recruit
28 Badges
Dec 17, 2020
5
0
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis 4: Emperor
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines Industries
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Parklife
  • Cities: Skylines - Green Cities
  • Hearts of Iron IV: Death or Dishonor
  • Cities: Skylines - Mass Transit
  • Hearts of Iron IV: Together for Victory
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Europa Universalis IV
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines
  • Semper Fi
  • Europa Universalis IV: Res Publica
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
I've gone the external route and have the basics of a Powershell creating a filtered and cleaner shadow copy of the game.log. It is centered around this: Get-Content -path 'path to log\game.log' -Tail 1 -Wait | Mirror. The -Wait makes it real-time (picking off every new line) and I pipe it through a filter called Mirror that will ignore the lines I want, reformat others, and write them to another file. My big let down is that going into observe mode cuts off the flow of most information to the log file. I would love to have a way to say "sendlog rom" or "sendlog rom romelog.txt" to send the logs for a specific country e.g. Rome to the game log or another log.
 

tskunka

Recruit
28 Badges
Dec 17, 2020
5
0
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis 4: Emperor
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines Industries
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Parklife
  • Cities: Skylines - Green Cities
  • Hearts of Iron IV: Death or Dishonor
  • Cities: Skylines - Mass Transit
  • Hearts of Iron IV: Together for Victory
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Europa Universalis IV
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines
  • Semper Fi
  • Europa Universalis IV: Res Publica
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
I've also discovered another big bummer that the runyear command doesn't seem to work. My ambition involves long runs with the game in observe mode - manipulating the game in various ways with console commands. I want all the log information for an overlay of what is happening with the focus country. Essentially...let's see if we can get Rome to NOT fall if we do x, y, and z...and watch for 8-16 hours. I can automate some with command files and my StreamDeck, but I was hoping for even more automation from the commands that were said to exist.
 

tskunka

Recruit
28 Badges
Dec 17, 2020
5
0
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis 4: Emperor
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines Industries
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Parklife
  • Cities: Skylines - Green Cities
  • Hearts of Iron IV: Death or Dishonor
  • Cities: Skylines - Mass Transit
  • Hearts of Iron IV: Together for Victory
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Europa Universalis IV
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines
  • Semper Fi
  • Europa Universalis IV: Res Publica
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
I hate to keep going on, but as a technology professional, I can't figure out why the console commands seem so haphazard and logical things such as I am wanting simply are not there, or are not working. Yes, my particular case is unusual. I want to set up situations, let the AI run, automate, tweak on the fly, see what various countries do in various situations. If anything, the developers might want such tools to see how the game runs.
 

alexti

Field Marshal
24 Badges
Jul 25, 2010
3.644
1.432
  • Europa Universalis III
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Europa Universalis IV: Res Publica
  • Europa Universalis III Complete
  • Heir to the Throne
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Wealth of Nations
  • Divine Wind
  • Crusader Kings II
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Cadet
  • Stellaris
  • 500k Club
  • Victoria 2
  • Europa Universalis IV
  • Stellaris - Path to Destruction bundle
You could save after every turn and analyze the save file to have access to more or less complete information. That would slow down the game considerably (in comparison to speed 5), but in your case it might not matter. To minimize performance impact you could set save directory inside of /dev/shm or equivalent (seeing that you're on Windows) to avoid overhead of file system and the disk.
 

tskunka

Recruit
28 Badges
Dec 17, 2020
5
0
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis 4: Emperor
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines Industries
  • Hearts of Iron IV: Expansion Pass
  • Cities: Skylines - Parklife
  • Cities: Skylines - Green Cities
  • Hearts of Iron IV: Death or Dishonor
  • Cities: Skylines - Mass Transit
  • Hearts of Iron IV: Together for Victory
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Colonel
  • Hearts of Iron IV: Cadet
  • Hearts of Iron IV Sign-up
  • Europa Universalis IV
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: El Dorado
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines
  • Semper Fi
  • Europa Universalis IV: Res Publica
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
You could save after every turn and analyze the save file to have access to more or less complete information. That would slow down the game considerably (in comparison to speed 5), but in your case it might not matter. To minimize performance impact you could set save directory inside of /dev/shm or equivalent (seeing that you're on Windows) to avoid overhead of file system and the disk.

Interesting idea. I'll look into it. If one couldn't guess, I am looking to live stream on Twitch (or YouTube)...just a general aim for the run, AI going at it with as few console commands as possible to get there...good music in the background, overlays, video, chat, and some audio commentary and general chat. Like a EU4 watch party. See if the AI does X again. Can the fall of the Roman Empire be prevented? What would a more advanced country on the Indian subcontinent do? Do any of the oddball console commands do anything at all? I started doing it last week...and I actually had viewers. 8 hour runs. They stuck around most of the day. I'm guessing they put it on in background at work. Lol Not sure if it will stick, but if I can provide some value in the overlays and commentary...who knows...heck my cat is an active co-host. Lol