(March 12th, 2013, 10:13)novice Wrote: Is anybody interested in contributing to this experiment? I was thinking of doing a proof of concept with a python mod dumping the map state to a text file whenever the game is saved, and a simple web viewer displaying the info. If somebody wanted to contribute on the mod part that would be cool, it's not really my area of expertise.
I tried adding some simple code to hook into the game and output info to a file, but I seem to have run into issues where the python code has very limited permissions. We don't really want to have to run Civ in Administrator mode or anything. Maybe there's a better way to output the info, I notice Civ has message logs and debug logs but I don't know how that framework functions. Well we know there's a good way to solve this, since e.g. the spanish AptMod does the same thing conceptually - I just don't know what the best practice is, personally.
By the way, Seven: The file \Beyond the Sword\Assets\Python\EntryPoints\CvAppInterface.py has methods onSave() and onLoad() that look like hooks into the save process to me. I don't know if studying them will reveal any information about the save file format itself, maybe it won't.
I don't see what the problem is with Civ4 in admin mode. If it is a problem, you could set up a server to communicate with Civ4 and write it out.
"Right, as the world goes, is only in question between equals in power, while the strong do what they can and the weak suffer what they must."
“I have never understood why it is "greed" to want to keep the money you have earned but not greed to want to take somebody else's money.”
(March 17th, 2013, 07:12)nabaxo Wrote: How did this go?
Posting data to a (REST) web service seems to work fine using urllib2 and urllib. And a web service is probably needed anyway if you're using the mod on a pitboss server and want to run the observer web application on a different server. Just need to code a simple web service that accepts the data, or maybe use an FTP server as the server component and just upload data directly from memory to the FTP server.
This plumbing problem should actually be very similar to what the spanish APT mod has solved, although I'm not sure their solution would be a good reference.
Anyway, this should be very doable but I'm not sure who's going to do it...