mvnForum Homepage


Print at Jan 27, 2021 9:25:43 AM

Posted by Silverstar at Nov 6, 2003 10:26:05 AM
Re: [Request] Improved messages
Tee_Beard wrote: 
Plug the logs into a perl or python script, and Bob's you're uncle...


Which is exactly what I am doing - I have a perl script which puts scans half a dozen different log lines, cross-references data from them, and eventually can make a pretty good overview of battles.

At this point, I've rewriting it using perl modules and objects. I've actually have the basic structure of the modules done, and most of the objects I need to define so far.

My basic premise is to group stats by voyage, and is event based, so I have a Voyage object which has a ship name and list of event objects. Each event object contains a timestamp, event type, and (optionally) data - in the case of some events, that's a name (for things like boarding a vessel) for others, that is itself the reference to another object (Battle, to group all the statistics related to a Battle, and Port, to group all statistics related to being in Port)

I'm pretty new with writing perl modules and objects, but this seems sensible.

I have the following modules written already, (each representing one object type)

YPP::Util
(non-object utility subroutines used inside the rest)

YPP::Voyage
YPP::Voyage::Event
Track a voyage of a ship - minimally, hop from one island to another, but I intend to have it merge multiple voyages of the same ship if they occur within the same time. Events are start (pseudo event), board (pirate boarded the vessel, contains name), port (put into port, ref port object), battle (sea battle, ref seabattle object), leave (pirate leaves vessel, contains name) and helm (pirate takes helm, contains name)

YPP::Voyage::Battle
YPP::Voyage::Battle::Event
Track a specific battle - has two ship objects, each containing ship name [if available] and crewmembers [if available], battle event log (every step of the battle), etc.

YPP::Voyage::Ship
Ship object. This is simply the name of the ship (if known) and the crew members of the ship (if known) - it's meant to contain battle-related ship data, but could be expanded to also be more general, and allow setting of ship state - crew name, flag, hold, booty, maps, etc, although none of this is needed for battle data.

I still plan (but haven't written)
YPP::Voyage::Port
YPP::Voyage::Port::Event
Port object - in reality, all I can put here right now is ported, deported and foraged - nothing else relevant is logged that I've noticed yet (but I do occasionally find new ways to get data, and may come up with something else - it was only earlier this week it occured to me I could find the crew roster of the losing ship in battle by looking at the 'Eliminated' messages and subtracting winners from the full list.

Anyways, that's about the state of the rewrite, and it may not be as well designed as it could be (I'm not that familiar with object programming, but it seems to make sense here) I haven't rewritten the core code to use this yet, so it is entirely untested, but if people are curious and know perl, I can make it available.

Actually, with the current log data, I can get a pretty complete picture of a voyage - what I can't get is: island names, items traded and state of goods on the vessel. Other data I can get, but need to do some grunt work. (IE: if you're on a ship, and I've already been able to determine the name of it, I can put a name with a battle where one ship disengaged, even though your ship name is only displayed at one point - when the swordfight starts (the X and Y collided and a meelee breaks out) but once you put in at an island, or someone leaves the vessel, I don't know anymore what the name of your ship is. Likewise, I don't know crew until after a swordfight is over, and I guess at which side goes with which ship based on whether one side was entirely NPPs, or if it was PvP, by looking for certain names in the crew lists) It actually works amazingly, given all that.
----------------------------------------
Silvermoon, First Mate, Silver Dragon Trading Company
Silverstar, Instructor, Puzzle Pirates Academy (retired)

Puzzle Pirates™ © 2001-2020 Grey Havens, LLC All Rights Reserved.   Terms · Privacy · Affiliates