Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Poll

Is this utility helpful?

Yes
No
Can't figure out how to use it

Pages: [1] 2 3

Author Topic: New utility: ParseDFLogs  (Read 6964 times)

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
New utility: ParseDFLogs
« on: July 16, 2008, 05:27:07 pm »

I'm really interested in all the new world-gen wars and whatnot, but found going through the region1-world_sites_and_pops.txt and whatnot files to be kinda difficult. So, to help myself out, I made a little perl script to parse them and give me a summary of the various races and civs out there.

It's not perfect, but it helps quite a bit while I try to search through the legends for interesting stuff. It's also good for my modding tests, since I can see how the various races are doing, and how well my new megabeasts and semi-megabeasts are doing.

You will see:
Each Civilization, with overall ruler. Each site in that civ, with the local ruler. A summary of every entity in that civ.
A summary of every civ, by race
A listing of every Ruin
A listing of the total populations of cave critters
A listing of the total populations of civilized creatures

For the entity lists, it now tries to handle merging the single creature listings in with the overall listing. So a single Human for a civ will get added to the Humans listing. It works ok for everything I've got, but modded in creatures may have issues.
Right now, follows a few basic rules.
Anything ending in -f becomes -ves (such as Dwarf to Dwarves)
Anything ending in -man becomes -men (except humans)
Anything ending in -i or -s is left alone (such as Dyansauri)
Anything else is pluralized to -s.

You can get it here: http://dffd.wimbli.com/file.php?id=299

Version history:
1.0: Initial version
1.1: Fixed a bug with civs without Kings (such as humans in the currant version)
1.2: Added in a listing of all ruined sites
1.3: Added in code to deal merge single entities in with the multiple groups.

Here's some snipits from an output file (From my mod, so it has extra races in it):
Spoiler (click to show/hide)


EDIT: Let me know if you have any issues with it, or if there is some information you'd like that it isn't giving you.
« Last Edit: July 21, 2008, 04:22:12 pm by Mephansteras »
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

PTTG??

  • Bay Watcher
  • Kringrus! Babak crulurg tingra!
    • View Profile
    • http://www.nowherepublishing.com
Re: New utility: ParseDFLogs
« Reply #1 on: July 16, 2008, 08:32:05 pm »

Oh, wow! This looks great!
Logged
A thousand million pool balls made from precious metals, covered in beef stock.

Techhead

  • Bay Watcher
  • Former Minister of Technological Heads
    • View Profile
Re: New utility: ParseDFLogs
« Reply #2 on: July 16, 2008, 08:42:30 pm »

One problem I see:
-snip-
  20 giant bat
  14 giant bats
  7 giant cave spider
  3 giant cave spiders
  17 giant cave swallow
  6 giant cave swallows
  37 giant mole
  39 giant moles
  39 giant rat
  30 giant rats
  34 gremlin
  6 gremlins
-snip-
That was just a snippit of the cave creature list.
Notice a pattern here?
Also, the sequel will be "Iron Man 2", not "2 Iron Man"
Logged
Engineering Dwarves' unfortunate demises since '08
WHAT?  WE DEMAND OUR FREE THINGS NOW DESPITE THE HARDSHIPS IT MAY CAUSE IN YOUR LIFE
It's like you're all trying to outdo each other in sheer useless pedantry.

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: New utility: ParseDFLogs
« Reply #3 on: July 16, 2008, 08:50:50 pm »

Yeah, it doesn't handle the difference between single and plural. Haven't put in the extensive logic that would be required for that, since there are so many creatures to keep track of and they don't all use the basic s on the end for plural.

Still, it's better then trying to keep track by yourself.
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

JoRo

  • Bay Watcher
    • View Profile
Re: New utility: ParseDFLogs
« Reply #4 on: July 16, 2008, 09:17:19 pm »

Looks pretty nifty, though there's something wrong.  It's reporting all the human civs as ruled by kobolds.  Probably related to the humans not having any ruler.  The kobold it's picking is the ruler of the kobold civ immediately above the entry for the human civ in world_history.txt.
edit:  Getting human civs ruled by non-human non-kobold rulers now. 
« Last Edit: July 16, 2008, 09:20:21 pm by JoRo »
Logged
You have been struck down.
The giant cave spider spits out your head.

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: New utility: ParseDFLogs
« Reply #5 on: July 16, 2008, 09:20:13 pm »

Haven't seen that, but it should be pretty easy to fix.

Could you e-mail me the history and sites files you're getting that with? It'll make it easier to debug. Just send it to my username at gmail.com.

Thanks!
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: New utility: ParseDFLogs
« Reply #6 on: July 16, 2008, 10:17:28 pm »

Ok. Version 1.1 is now up.

Basically, it had an issue with the fact that Humans don't have Civ leaders right now, just local leaders. So it was filling in. Not too hard to fix.
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

Dasqoot

  • Bay Watcher
  • He-wenching for the cause.
    • View Profile
Re: New utility: ParseDFLogs
« Reply #7 on: July 17, 2008, 01:32:18 am »

I was reading the legends screen for about 2 hours now just trying to get an idea of wtf was going on with my population numbers. This is a great tool!

(any chance it can parse the symbols for sites/civs? I guess this would require a rich-text out-file or something...idk the first thing about PERL or text files tbh. 3 trillion bonus points if the site symbols and names are bullet pointed under the civ symbol and name =P)
Logged

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: New utility: ParseDFLogs
« Reply #8 on: July 17, 2008, 09:44:42 am »

Sadly, those aren't kept in the log files that DF spits out when it makes a world. I haven't even THOUGHT about trying to get something that would be able to grab information from the Legends screens themselves. Although I agree that it would be awesome.

I was thinking of adding in a list of all of the destroyed sites, though, just for kicks. Anyone interested in that?
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: New utility: ParseDFLogs
« Reply #9 on: July 17, 2008, 03:39:39 pm »

I decided to add in the ruin code, just for kicks.

Here's what it outputs:
Spoiler (click to show/hide)

So, new version is now available, if you want the ruins list.
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

JoRo

  • Bay Watcher
    • View Profile
Re: New utility: ParseDFLogs
« Reply #10 on: July 17, 2008, 03:46:30 pm »

Ruins list sounds cool.
Logged
You have been struck down.
The giant cave spider spits out your head.

Untelligent

  • Bay Watcher
  • I eat flesh!
    • View Profile
Re: New utility: ParseDFLogs
« Reply #11 on: July 17, 2008, 05:10:12 pm »

I tried to get it to work, and I got an error saying "Can't open perl script "ParseDFLogs.pl." No such directory."

Also, is there a way to get this to work without using the command line? It's annoying having to type in all that text.
Logged
The World Without Knifebear — A much safer world indeed.
regardless, the slime shooter will be completed, come hell or high water, which are both entirely plausible setbacks at this point.

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: New utility: ParseDFLogs
« Reply #12 on: July 17, 2008, 06:04:24 pm »

Are you in the same directory as the file? Did you rename it from ParseDFLogs.txt to ParseDFLogs.pl? Those are the most likely causes of that error.


As for running it, you actually have a few options.

1) You can use the command line. Kinda annoying, but doable.

2) You can make a .bat file that will do the command line stuff for you. Only problem is that you have to make multiple bat files for each region.

3) You can use an IDE. I use the OpenPerl IDE http://open-perl-ide.sourceforge.net/. With this, you just have to load up the program, put the arguments (--places=[FILE] --history=[FILE] (optional) --output=[FILE]) into the Start parameter section near the bottom, and hit Run from the menu.
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: New utility: ParseDFLogs
« Reply #13 on: July 17, 2008, 06:27:35 pm »

The thing I'd really like to see is the current wars summary, to know which race is at war with the one you're gonna to play.
This thing is cool, thanks. It really helps to playtest my custom races.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: New utility: ParseDFLogs
« Reply #14 on: July 17, 2008, 06:29:18 pm »

Yeah, I'd like that too.

Maybe we can get Toady to add in that kind of information into the Site/Civ file. I'll put up a suggestion for it.
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One
Pages: [1] 2 3