Automatic logging utility (mod)

DaveShack

Inventor
Retired Moderator
Joined
Feb 2, 2003
Messages
13,109
Location
Arizona, USA (it's a dry heat)
Well, we're only a month into widespread availability of Civ4, and one of the DG's long-standing problems is being solved. We have always given our Designated Players a somewhat onerous task of recording everything they do. We get varying degrees of information depending on how much time the DP has, whether he/she agrees with the "record everything" philosophy, how much the chat is bugging them, etc. Most of the time the chat log is presented as a play log, which just doesn't give the people who want details what they want.

Others also see the same need for logging during Succession Games, the difficulty in Civ4 in alt-tabbing to another program, and the Python based design, and you get the perfect opportunity to actually automate this stuff.
Enter the autoevent logger mod. Take these files and put them in your customAssets folder in the mygames tree, and out pops a log of the things you do playing the game.

Rather than inundate eotinb with individual requests, let's decide here if we want to require DP's to use this logging feature, and what things we want to see in a DemoGame log. Then we can either collarborate with eotinb on adding the features we want into the mod, or build a special version ourselves (giving him credit for the initial idea of course).
 
This is a great idea - if we ever decide to do offline turnsessions, this would be handy as well. I have to wait until I get the game to test it out and see what features would need to be added, but for now, I would make it mandatory. Even if we didn't, it saves us lots of time, so most would use it.

However, is there any way you could do something so that it outputs it to the chatroom? If you could do that, well, time would be saved.
 
Ginger_Ale said:
This is a great idea - if we ever decide to do offline turnsessions, this would be handy as well. I have to wait until I get the game to test it out and see what features would need to be added, but for now, I would make it mandatory. Even if we didn't, it saves us lots of time, so most would use it.

However, is there any way you could do something so that it outputs it to the chatroom? If you could do that, well, time would be saved.

I have several ideas on the chatroom idea. If the Python code can write to a port, then we could have an additional module which dumps the log directly into the chat room. A second idea would be to have a mIRC script which scans the log file and writes new entries to the chat room.

It would be cooler still to have an IRC client inside the game. It has a "chat with teammates" capability, so hopefully that wouldn't be a big deal. I'm not up to programming it myself just yet, and it might be something to bounce off the developers. If we have someone who is an IRC client guru who can hook into the python, that would be fantastic.
 
A second idea would be to have a mIRC script which scans the log file and writes new entries to the chat room.

I think the best way to do it might be to have a winbot that reads from a file, and writes any new line into the chatroom. There's one important thing, though... It can't post lines very fast, otherwise the server will kill the bot for flooding (and then ultimately G-line the bot using the IP address, which means you'd probably be G-lined, too).

So, something like stack-attacking 10 units in a city with your 10 catapults, then 10 macemen would output 20 lines all at once, flooding the room unless there was some timed delay.


As for the in-game IRC chatroom, I'm not sure if it can be done -- atleast with python. The SDK could probably do it, since you'd have to add code. But, there's a problem with that. Whoever wants to view the save, would need the new dll file(s). The code would need to be updated everytime there's a patch, too.
 
Chieftess said:
I think the best way to do it might be to have a winbot that reads from a file, and writes any new line into the chatroom. There's one important thing, though... It can't post lines very fast, otherwise the server will kill the bot for flooding (and then ultimately G-line the bot using the IP address, which means you'd probably be G-lined, too).

So, something like stack-attacking 10 units in a city with your 10 catapults, then 10 macemen would output 20 lines all at once, flooding the room unless there was some timed delay.

I think this would be best though, if there was no time delay. Can't you set exceptions for g-lines? A time delay would get bad during war times; the whole purpose of this is to save time, and a time delay would take a while to wait for all the units' actions.

A bot I guess would work, but I like DaveShack's idea better, if it works: see if you can output the Python to a port (6667) to a room (#turnchat).
 
Well...

1 - It's not our IRC server, so we can't set g-lines or g-line exceptions.
2 - It would create a vulnerability. Any bot that randomly goes into rooms could find the #turnchat room and start spamming in it.


BTW, screenshots can be taken by pressing shift-printscreen (or ctrl, can't remember which). A python util could be made to upload those using a file-naming convention to the uploads server (or the demogame website).

i.e., upload Civ4_DG#_(BC/AD)YEAR_DESCRIPTION.JPG to demogame.civfanatics.net/someuploaddir. (yes, we'll have to use Civ4_ for the naming convention now).


I think that a bot would have to be logged on. I seem to remember once accidently logging on/off too fast a few times, and the server prevented me from doing so for 5 minutes. (logon spam). Even if we could, we'd have to remember to keep the "allow external messages" flag off, but that also invites spambots, too.
 
A little delay on posting the log to the chat is fine, the only issue with delay would be if it held up the DP's ability to play the game, which I'll assume it wouldn't.

An upload script would be extremely cool, especially if it also logged the uploaded filename to the chat room. The autologger can also output to a text file which can then include forum tags to the uploaded files. Uploading games that way would be very nice too. I've always wanted to do something other than launch the forum's java-based upload, would we be able to use a direct upload?

The chat room inside the game comment was equal parts "can we mod this" and "I wonder if Firaxis would be interested in adding it to the base game". I haven't looked to see if the "chat with team" function is in the python code or elsewhere.
 
Chieftess said:
Well...

1 - It's not our IRC server, so we can't set g-lines or g-line exceptions.
2 - It would create a vulnerability. Any bot that randomly goes into rooms could find the #turnchat room and start spamming in it.

What's a g-line?

BTW, screenshots can be taken by pressing shift-printscreen (or ctrl, can't remember which). A python util could be made to upload those using a file-naming convention to the uploads server (or the demogame website).

Pretty sure it's just printscreen with no modifier. There is a modifier one too which asks for a filename but it didn't work very well in the 1.0 version because the filename prompt obscured what you were taking a screenshot of.

I think that a bot would have to be logged on. I seem to remember once accidently logging on/off too fast a few times, and the server prevented me from doing so for 5 minutes. (logon spam). Even if we could, we'd have to remember to keep the "allow external messages" flag off, but that also invites spambots, too.

This bot thing, doesn't it look like an ordinary user from the room's perspective? I wouldn't think we'd need it to log on / off in sequence, except maybe during test? What's the effect of this external messages flag?
 
i agree some of us arn't too skilled at turnchating. (although i only ever done one then chieftess scared me away)
 
Honestly, this would allow the DP to report on the general stuff and skip a fair amount of information, knowing that we'll have a log of the events available. DP
s would provide 3 things - game saves, chat log, event log.

DS - nice find.

-- Ravensfire
 
DaveShack said:
What's a g-line?

Come to the chatroom. I'll show 'ya! :mischief:

Actually, it's like a permban.


Pretty sure it's just printscreen with no modifier. There is a modifier one too which asks for a filename but it didn't work very well in the 1.0 version because the filename prompt obscured what you were taking a screenshot of.

No, with shift-printscreen, you get a popup asking you for a filename. Just type in the filename without the extension, and it'll save it as a jpg image. Right now, it puts 4 0s at the end. Minor, but maybe they'll change it...

This bot thing, doesn't it look like an ordinary user from the room's perspective? I wouldn't think we'd need it to log on / off in sequence, except maybe during test? What's the effect of this external messages flag?

True, but you *DO* need to login, or rather, connect (it's called login...). The external flag simply tells the room if it should accept external messages or not. So, someone who's not in a room can type /msg #turnchat some-jibberish, and it would display in the room if the "don't allow external messages" flag is checked.
 
Chieftess said:
1 - It's not our IRC server, so we can't set g-lines or g-line exceptions.

I know, but even as a System Admin you can't? I would've expected that.

So it seems we have some big plans, but useful ones:
  • A script to save log to a .txt for uploading, without chatroom discussion.
  • A script to upload screenshots to civfanatics.net/upload.html (and subsequently post that in the chatroom).
  • A script to convey the text from the events log to the chatroom.
And it seems the best way would be to do this with a bot...
 
I'm system co-admin for the goldfish server, but I still don't run the entire network. :)
 
I've got a possible idea for this. I run several domains, and host the servers on my own equipment at my house. Needless to say, I've got a fair amount of control over what happens.

We could investigate setting something up where we send the information from the mod to a program that continually adds them to a web page. This would give us a long-term history, and quick display of the events as they happen.

It would require some rework of the mod to send the information to an external program, and an external program to take that information and somehow display it on a webpage. I can probably do the latter, but the former is beyond me.

Thoughts?
-- Ravensfire
 
Why not use the demogame webpage itself? It's on demogame.civfanatics.net, and can easily be hosted. Unless you're talking about an IRC server.
 
We'd need a program on that server that can accept incoming connections and write to a file. Is that something that can be done on that server? What languages could be used?

-- Ravensfire
 
The server uses php. You can email Thunderfall about it, since he'd have more information. (It's his brother's server)
 
Right, you could just have a folder (ie; demogame.civfanatics.net/log/) where you could have a program output all the data from a .txt file (compiled from the autologging utility, even customized if we want) or directly from the events log. I'd imaging Perl or CGI could be used if you wanted it to as well...I'd ask TF though, too.
 
PHP is beyond my skills, but if there's someone that's willing to work on it ..

-- Ravensfire
 
Back
Top Bottom