Ren'Py Text Analyzer
Ren'Py Text Analyzer is a VS Code extension providing detailed statistics about your Ren'Py scripts, helping you track writing progress, analyze character voice, and understand script structure. Originally created for personal use, it aims to offer valuable insights for Ren'Py developers.
While the dialogue parsing and character resolution are quite robust, complex or unusual script structures might occasionally lead to minor variations compared to other tools.
Note: This extension counts words and dialogues differently than the Ren'Py Lint tool in some cases. See the "Important Notes" section below.
Key Features
1. Comprehensive Statistics
- Word Count: Displays total words within identified dialogue/narration/thoughts. Features configurable filtering (stopwords, character names, tags, interpolation). Also shows counts for selected dialogue text.
- Dialogue Count: Shows the total number of dialogue lines identified based on Ren'Py syntax and configuration.
- Keyword Analysis: Identifies and displays the most frequent words used in dialogue, with options to include/exclude stopwords.
- Ren'Py Element Counts (Beta): Counts occurrences of common Ren'Py statements like
scene , show , menu , label , python , etc.
- Time Estimates: Provides estimated reading and speaking times based on the filtered word count and configurable WPM settings.
2. Detailed Character Analysis
- Accurate Character Resolution: Intelligently resolves character variables defined using
define x = Character(...) , handling variable references ([name_var] ) and chains. Works only if character defined in the currently analyzed file.
- Per-Character Stats: Breaks down statistics for each resolved character, showing their dialogue line count, filtered word count, and percentage contributions.
- Sentiment Analysis (Optional): Calculates and displays the average sentiment score for each character's dialogue lines (can be enabled in settings). Scores reflect overall tone and are not strictly bound to a -1/+1 range.
3. Intelligent Dialogue Parsing
- Format Recognition: Understands various dialogue formats, including standard
character "dialogue" , simple quotes ("dialogue" ), multi-line strings ("""...""" ), centered narration, and menu choices.
- Special
narrator Handling: Correctly classifies lines using the specific narrator variable according to Ren'Py conventions (configurable).
extend Handling: Interprets extend statements as continuations of the previous dialogue block.
4. Integrated View & Experience
- Status Bar Display: Shows the filtered word count (total and selection) directly in the VS Code status bar. Tooltips explain applied filters.
- Tree View Visualization: Presents all statistics in an organized tree view: Overview, Characters, Top Keywords, and Ren'Py Elements.
- Configurable View: Sections for Keywords and Ren'Py Elements are collapsed by default. Sentiment analysis can be hidden via settings.
- Automatic & Debounced Updates: Statistics refresh automatically as you type or change selection, with a slight delay (debounce) to optimize performance.
Important Notes (Comparison to Ren'Py Lint)
This extension's counting methodology may differ from the Ren'Py Launcher's Lint statistics:
- Word Splitting: Words connected by an em dash (
— ) will be counted as two words by the extension, while Lint usually count them as one.
extend Statements: This extension merges extend text with the previous dialogue line for word counting; Lint count extend blocks separately.
- Menu Choices: This extension includes text from menu (text in dialogue box while waiting for player choice) and the menu choices (as "Thoughts") in its dialogue and word counts; Lint typically excludes them.
- Filtering: This extension applies configurable filters (stopwords, character names, tags, etc.) to its primary word count, resulting in a potentially lower count than Lint's raw count.
Usage
- Open a Ren'Py script file (
.rpy ) in VS Code.
- Find the Ren'Py Analyzer icon in the Activity Bar (sidebar) and click it to open the view.
- View statistics in the tree view or the basic word count in the status bar at the bottom.
- Select text within dialogue lines to see selection-specific counts update in the status bar.
- Expand sections (like "Characters") in the tree view for more detail.
- Configure filtering, parsing, and view options via VS Code Settings (
Ctrl+, or Cmd+, , search for "Ren'Py Analyzer").
Configuration
This extension offers several settings to customize the analysis. Access them via the standard VS Code settings UI:
- Filtering: Control whether to filter stopwords, character names, text tags, and how to count
[...] interpolation in the main word count.
- Keyword List: Configure whether stopwords appear in the keyword list and set the number of keywords shown.
- Dialogue Parsing: Define custom narration keywords or change how simple quotes and the
narrator variable are classified.
- View Options: Toggle visibility for Narration, Thoughts, and character Sentiment scores in the analysis view.
- Time Estimates: Set custom Words Per Minute (WPM) for reading and speaking time calculations.
(See the VS Code Settings UI under "Extensions > Ren'Py Analyzer" for the full list and detailed descriptions.)
Donations
This project is developed and maintained in spare time. If you find it useful and would like to show your support, any donations are greatly appreciated!

| |