psoqi, a tool for extracting enemy counts and other information from quest files

Wilhuf

Overanalyzer
Gender
Male
Guildcard
42011395
This program will not be improved anymore since I'm working on a quest editor that can do the same and much more: http://www.phantasmal.world/. Bugs will still be fixed though.

I've written a small command line program for extracting quest name, short description and enemy counts from quest files. It also tries to determine the episode by looking at the kind of enemies the quest contains and in which areas they're located, it defaults to episode I.

Usage
psoqi.exe --help
Info and usage.​
psoqi.exe my_quest.qst my_other_quest.qst
Display enemy counts and other information from the provided quest files.​
psoqi.exe a_directory
Parse all files in a_directory, recursively.​
psoqi.exe --csv my_quest.qst
Output information in CSV format.​

Limitations
  • It only supports the .qst format at the moment, but supporting other formats should not be hard
  • It silently eats parsing errors. It could parse a huge directory and output everything to a CSV file (using a pipe), and you wouldn't know which files it was or wasn't able to parse unless you checked manually
  • There's only a 64 bit Windows and 64 bit Linux version at the moment, let me know if you need anything else
Last release: 0.1.1 (2016-12-26)

TODO (in order of priority)
  1. Better error reporting
  2. Extract box counts
  3. Support more formats (tell me which ones you'd like to see)
  4. Open source the code and publish it on Github
  5. Extract more information
  6. Detect corrupted files
  7. Builds for more platforms (Mac OS, Windows 32 bit)
Source Code
https://github.com/DaanVandenBosch/psoqi

Please try it out and let me know what you think. If you have ideas for improving it, don't hesitate to tell me.

Feel free to share this program with anyone.
 

Attachments

Last edited:
@Andy, as Soly said, see todo #3. :p I need to figure out which license makes the most sense first (I'm thinking MIT), and then the logistics (do I put the license at the top of every single file?).

The executables are so big because it's written in Rust, so they include Rust's standard library, a memory allocator and debug symbols. I also use several libraries for text encoding, argument parsing, CSV generation, etc.

Edit: forgot how sketchy running random programs is. I'll work on open sourcing it, so people can verify and compile the code themselves. Compiling a Rust program is ridiculously easy, you only need to install Rust and run one command.
 
Last edited:
wow i read it and it completely didn't register. my bad :oops:
 
Oh ok.. makes sense.

I decided to poke a bit on this, seems pretty easy to get the data out of the qst file, haven't coded anything and was going to make some sort of documenting but the stuff is pure packets so it would be sort of useless...

Edit: Well.. I pretty much have it done, except that I need to write down the big ass switch in the ship server to figure out which monster I'm looking at, this will be quite useful when I get around making that C# ship server.
 
Last edited:
Yeah it's not that hard once you know that a .qst file is just a bunch of packets written to a file and how PRS compression works. The libraries are just there to make it even easier. I'm using the encoding library to decode ascii and utf-16le strings instead of just casting to wchar_t* for example. That way I'm absolutely sure it's *valid* text and won't make something else crash. And the argument parsing library prints nice help text, verifies that required arguments are there and even makes suggestions when you misspell e.g. a switch. And it only takes a couple of lines of code.

This definitely bloats the executables, but I don't think people care about a few MB these days. Especially when the result is a cross-platform, rock solid, dependable tool.

As to open sourcing this code, I've decided on the MIT license. Apparently adding a LICENSE file to your source code directory is enough. It's not like I'll be able to enforce it, but it's my first open source project and I want to do it right. It's the same with the code and libraries, it's my first Rust project so I want to give the language a good test drive.

The whole thing is 800 SLOC, uses 4 libraries and compiles to a multi-megabyte binary. It might be a bit over-engineered but it has a secondary purpose as a pedagogical exercise. I'm having fun learning Rust, learning about open source software development and learning more about the technical side of PSO. :)

I'll push to code to Github this evening after I add the license.

And also, good to know you're interested in server development. This can only be good for the PSO community, you never know what will come of it. Having lots of technical people who can help each other out is a good thing.
 
The whole thing is 800 SLOC, uses 4 libraries and compiles to a multi-megabyte binary. It might be a bit over-engineered but it has a secondary purpose as a pedagogical exercise. I'm having fun learning Rust, learning about open source software development and learning more about the technical side of PSO.
That's probably the most important reason... I really haven't coded anything that is not for PSO (at least not something important), but it has helped me quite a lot... mostly WPF which is the framework I use for GUI tools.

And also, good to know you're interested in server development. This can only be good for the PSO community, you never know what will come of it. Having lots of technical people who can help each other out is a good thing.
Indeed and it already has given some nice stuff like a login with sqlite (like the move Sodaboy/Tofuman did, but in C#), quite a few programs (available in the forum), other tools not available yet :P, but yeah... at least, nothing bad can come out of it.
 
The code is now on GitHub. My first open source program. I'm so proud, even though it barely does anything. ^_^
 
Has anyone run this on a ton of quests yet and compiled a list of enemy counts?
 
Has anyone run this on a ton of quests yet and compiled a list of enemy counts?

I sort of responded to you in another thread but I'll do it again here for anyone who has the same question. The "Methods" tab of this spreadsheet is basically a list of all standard Tethealla quests run though psoqi:
https://docs.google.com/spreadsheet...pzpsWlwOpW0kjFnC6Ls7fDMQo/edit#gid=1261148380

It also has a bunch of other information and a multi-item hunt optimizer that can help you figure out which quests to do to get specific items ASAP.
 
Back
Top