Create account / Log in

Introducing Vassal Module Analyzer

Discussion area for the development team.

Moderators: uckelman, Tim M

Introducing Vassal Module Analyzer

Postby fil512 » July 27th, 2010, 8:35 pm

In struggling to fix a bug in the Through the Ages VASSAL module, I ended up building a tool that does two things:

1) Prints out a module in a human-readable, searchable format.
2) Indexes the module by keystroke so that you can instantly look up all the places that send/receive a given keystroke.

The tool is open-source and available at http://code.google.com/p/vassal-module-analyzer/

Below are the contents of the README.txt that come with the tool:

The vassal-module-analyzer project contains some tools for analyzing VASSAL modules.

Here is how to run it.
1) Place your module in src/test/resources
2) Edit src/test/java/com/kenstevens/vassal/VassalModuleLoaderTest.java and change FILENAME to point to your module
3) Run src/test/java/com/kenstevens/vassal/PieceVisitorTest as a junit test. This will produce
a file named all_pieces.txt that displays the entire module code in a human-readable,
searchable format.
4) Run src/test/java/com/kenstevens/vassal/FieldPairVisitorTest as a junit test. This will produce
a file named by_keys.txt that organizes all places in the code that send or listen for
a key-stroke, organized by key-stroke.

Using all_pieces.txt combined with by_keys.txt, it is possible to trace through everything that
happens when a particular event is triggered.

For example, I used this to fix a bug in the Through the Ages Module that was undercharging civil actions
when players took a Wonder card.
fil512
 
Posts: 160
Joined: June 27th, 2010, 5:10 pm
Location: Toronto

Re: Introducing Vassal Module Analyzer

Postby fil512 » July 27th, 2010, 9:06 pm

Would it be possible to integrate this tool into VASSAL as a new File menu option "Export as XML" or somesuch?
fil512
 
Posts: 160
Joined: June 27th, 2010, 5:10 pm
Location: Toronto

Re: [messages] [Developers] Introducing Vassal Module Analyz

Postby tmccarron » July 27th, 2010, 9:46 pm

Nice!!

I'd like to see this integrated into Vassal somehow, possibly accessible in
the editor for bug hunting and/or exportable for other mod designers to help
troubleshoot

-----Original Message-----
From: messages-bounces@vassalengine.org
[mailto:messages-bounces@vassalengine.org] On Behalf Of fil512
Sent: Tuesday, July 27, 2010 3:35 PM
To: messages@vassalengine.org
Subject: [messages] [Developers] Introducing Vassal Module Analyzer

In struggling to fix a bug in the Through the Ages VASSAL module, I
ended up building a tool that does two things:

1) Prints out a module in a human-readable, searchable format.
2) Indexes the module by keystroke so that you can instantly look up all
the places that send/receive a given keystroke.

The tool is open-source and available at
http://code.google.com/p/vassal-module-analyzer/[1]

Below are the contents of the README.txt that come with the tool:

The vassal-module-analyzer project contains some tools for analyzing
VASSAL modules.

Here is how to run it.
1) Place your module in src/test/resources
2) Edit src/test/java/com/kenstevens/vassal/VassalModuleLoaderTest.java
and change FILENAME to point to your module
3) Run src/test/java/com/kenstevens/vassal/PieceVisitorTest as a junit
test. This will produce
a file named all_pieces.txt that displays the entire module code in a
human-readable,
searchable format.
4) Run src/test/java/com/kenstevens/vassal/FieldPairVisitorTest as a
junit test. This will produce
a file named by_keys.txt that organizes all places in the code that
send or listen for
a key-stroke, organized by key-stroke.

Using all_pieces.txt combined with by_keys.txt, it is possible to trace
through everything that
happens when a particular event is triggered.

For example, I used this to fix a bug in the Through the Ages Module
that was undercharging civil actions
when players took a Wonder card.

[1] http://code.google.com/p/vassal-module-analyzer/


_______________________________________________
Read this topic online here:
viewtopic.php?p=18889#p18889
I'm doing something Vassal related all the time
User avatar
tmccarron
 
Posts: 19
Joined: July 17th, 2010, 12:36 pm

Re: Introducing Vassal Module Analyzer

Postby DrNostromo » July 28th, 2010, 2:46 am

Awesome!
User avatar
DrNostromo
 
Posts: 1061
Joined: December 21st, 2007, 3:54 am
Location: Wine Country, Cal. USA


Return to Developers

Who is online

Users browsing this forum: No registered users and 3 guests