### Install GameWikiTooltip from Source Code Source: https://github.com/rimulu030/gamewiki/blob/master/docs/QUICKSTART.md This snippet outlines the steps to clone the GameWikiTooltip repository, set up a Python virtual environment, install dependencies, and run the application from source. It's recommended for developers or users who want to build from the latest code. ```bash # 1. Clone the repository git clone https://github.com/rimulu030/gamewiki.git cd gamewiki # 2. Create virtual environment (recommended) python -m venv venv venv\Scripts\activate # Windows # 3. Install dependencies pip install -r requirements.txt # 4. Run the application python -m src.game_wiki_tooltip ``` -------------------------------- ### Install Python Dependencies Source: https://github.com/rimulu030/gamewiki/blob/master/docs/BUILD.md Installs all required Python packages listed in the 'requirements.txt' file using pip. Ensure you have Python and pip installed and activated in your environment. ```bash pip install -r requirements.txt ``` -------------------------------- ### Build Executable for 32-bit Architecture Source: https://github.com/rimulu030/gamewiki/blob/master/docs/BUILD.md Builds a 32-bit version of the executable using a 32-bit Python installation and PyInstaller. This is necessary for compatibility with older 32-bit Windows systems. ```bash # Use 32-bit Python installation C:\Python38-32\python.exe -m PyInstaller game_wiki_tooltip.spec ``` -------------------------------- ### Upgrade Pip and Install Requirements Source: https://github.com/rimulu030/gamewiki/blob/master/docs/BUILD.md Upgrades the pip package installer to the latest version and then installs all project dependencies from the 'requirements.txt' file. This ensures you have the necessary libraries for building the application. ```bash # Upgrade pip pip install --upgrade pip # Install all requirements pip install -r requirements.txt ``` -------------------------------- ### Build Executable for ARM64 Architecture Source: https://github.com/rimulu030/gamewiki/blob/master/docs/BUILD.md Builds an executable for the ARM64 architecture using PyInstaller. This requires a Windows environment with ARM64 support and a compatible Python installation. This is experimental. ```bash # Requires ARM64 Windows and Python pyinstaller --target-arch=arm64 game_wiki_tooltip.spec ``` -------------------------------- ### Clone GameWiki Repository Source: https://github.com/rimulu030/gamewiki/blob/master/docs/BUILD.md Clones the GameWiki repository from GitHub and navigates into the project directory. This is the first step in building the application from source. ```bash git clone https://github.com/rimulu030/gamewiki.git cd gamewiki ``` -------------------------------- ### Configure PyInstaller for UPX Compression Source: https://github.com/rimulu030/gamewiki/blob/master/docs/BUILD.md Installs PyInstaller with UPX support and shows how to specify the UPX directory in the build command. UPX can reduce the executable file size but may trigger antivirus warnings. ```bash pip install pyinstaller[upx] # Add --upx-dir=path/to/upx in build command ``` -------------------------------- ### Run GameWiki Application Source: https://context7.com/rimulu030/gamewiki/llms.txt Instructions to clone the repository, install dependencies, set the Gemini API key, and run the GameWiki application from the command line. Requires Python and pip. ```bash # Clone and setup git clone https://github.com/rimulu030/gamewiki.git cd gamewiki pip install -r requirements.txt # Set Gemini API key for AI features export GEMINI_API_KEY=your_key_here # Linux/Mac set GEMINI_API_KEY=your_key_here # Windows # Run the application python -m src.game_wiki_tooltip ``` -------------------------------- ### Install WebView2 Runtime Programmatically Source: https://github.com/rimulu030/gamewiki/blob/master/WEBVIEW2_WINRT_MIGRATION.md Demonstrates how to programmatically install the Microsoft Edge WebView2 Runtime using a Python script. This is useful when the runtime is not pre-installed on the system. ```python from src.game_wiki_tooltip.webview2_winrt import install_webview2_runtime install_webview2_runtime() ``` -------------------------------- ### Install Dependencies for PyWinRT WebView2 Source: https://github.com/rimulu030/gamewiki/blob/master/WEBVIEW2_WINRT_MIGRATION.md Installs the necessary Python packages for the PyWinRT-based WebView2 implementation, including the WinRT runtime, WebView2 core projection, and optional Qt async integration. ```bash pip install winrt-runtime>=3.2 pip install webview2-Microsoft.Web.WebView2.Core>=3.1 pip install qasync>=0.27 ``` -------------------------------- ### Create Portable Package with PowerShell Source: https://github.com/rimulu030/gamewiki/blob/master/docs/BUILD.md Creates a ZIP archive of the portable application package using PowerShell's Compress-Archive cmdlet. This is used to distribute the application. ```powershell # Using PowerShell Compress-Archive -Path GameWikiAssistant_Portable/* -DestinationPath GameWikiAssistant_Portable.zip ``` -------------------------------- ### Build GameWiki Assistant Application using Python and PyInstaller Source: https://github.com/rimulu030/gamewiki/blob/master/docs/BUILD.md This Python script automates the build process for the GameWiki Assistant. It cleans previous build artifacts, uses PyInstaller to create executables from a spec file, and then packages the application into a portable directory and a ZIP archive. The script relies on the 'subprocess', 'shutil', and 'os' modules. ```python import subprocess import shutil import os def build(): # Clean previous builds shutil.rmtree('dist', ignore_errors=True) shutil.rmtree('build', ignore_errors=True) # Run PyInstaller subprocess.run(['pyinstaller', 'game_wiki_tooltip.spec']) # Create portable package os.makedirs('GameWikiAssistant_Portable', exist_ok=True) shutil.copytree('dist/GameWikiAssistant', 'GameWikiAssistant_Portable/GameWikiAssistant') # Create ZIP shutil.make_archive('GameWikiAssistant_Portable', 'zip', 'GameWikiAssistant_Portable') print("Build complete!") if __name__ == '__main__': build() ``` -------------------------------- ### Run GameWiki from Source (Bash) Source: https://github.com/rimulu030/gamewiki/blob/master/README.md This snippet demonstrates how to clone the GameWiki repository, install its dependencies using pip, and run the application from the source code. It also shows how to set the GEMINI_API_KEY environment variable for AI features on Windows. ```bash # Clone and setup git clone https://github.com/rimulu030/gamewiki.git cd gamewiki pip install -r requirements.txt # Configure API key for AI features (optional) set GEMINI_API_KEY=your_key_here # Windows # Run python -m src.game_wiki_tooltip ``` -------------------------------- ### Configure Logging System in Python Source: https://github.com/rimulu030/gamewiki/blob/master/docs/ARCHITECTURE.md Shows the setup for a Python logging system, including creating a logger instance, setting its level, and configuring handlers for both file and console output. ```python import logging logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) # Log to file and console file_handler = logging.FileHandler('app.log') console_handler = logging.StreamHandler() ``` -------------------------------- ### Create Portable Package with 7-Zip Source: https://github.com/rimulu030/gamewiki/blob/master/docs/BUILD.md Creates a ZIP archive of the portable application package using the 7-Zip command-line utility. This is an alternative method for creating the distribution package. ```bash # Using 7-Zip 7z a -tzip GameWikiAssistant_Portable.zip GameWikiAssistant_Portable/* ``` -------------------------------- ### Basic CSS for Helldivers 2 Guide Styling Source: https://github.com/rimulu030/gamewiki/blob/master/src/game_wiki_tooltip/assets/html/helldiver2_en.html This CSS code styles the basic elements of the Helldivers 2 beginner's guide, including font family, background color, card styling, text highlighting, section titles, keywords, timestamps, icons, tip boxes, video links, and responsive video containers. It uses a dark theme with yellow accents. ```css body { font-family: 'Inter', sans-serif; background-color: #111827; /* Dark gray background */ color: #E5E7EB; /* Light gray text */ } .guide-card { background-color: #1F2937; /* Slightly lighter dark card background */ border: 1px solid #374151; border-radius: 0.75rem; padding: 1.5rem; margin-bottom: 1.5rem; transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; } .guide-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px -3px rgba(250, 204, 21, 0.1), 0 4px 6px -2px rgba(250, 204, 21, 0.05); } .title-highlight { color: #FACC15; /* Helldivers Yellow */ font-weight: 900; text-shadow: 0 0 10px rgba(250, 204, 21, 0.3); } .section-title { font-size: 1.875rem; font-weight: 700; color: #F3F4F6; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid #FACC15; display: flex; align-items: center; gap: 0.75rem; } .keyword { background-color: #374151; color: #FACC15; padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.875rem; font-weight: 600; } .timestamp { font-size: 0.8rem; color: #9CA3AF; background-color: #374151; padding: 2px 8px; border-radius: 8px; } .icon { width: 24px; height: 24px; display: inline-block; vertical-align: middle; } .tip-box { background-color: rgba(250, 204, 21, 0.05); border-left: 4px solid #FACC15; padding: 1rem; margin-top: 1rem; border-radius: 0.25rem; } .video-link { color: #60A5FA; text-decoration: underline; margin-left: 0.5rem; } .video-link:hover { color: #93C5FD; } /* Aspect ratio wrapper for responsive video */ .aspect-w-16 { position: relative; padding-bottom: 56.25%; /* 16:9 aspect ratio */ } .aspect-w-16 > * { position: absolute; height: 100%; width: 100%; top: 0; right: 0; bottom: 0; left: 0; } ``` -------------------------------- ### Configure Custom Spec File Options for PyInstaller Source: https://github.com/rimulu030/gamewiki/blob/master/docs/BUILD.md Shows advanced configuration options for a PyInstaller `.spec` file, including adding version information and defining a custom Windows manifest for elevated privileges. ```python # game_wiki_tooltip.spec # Add version information exe = EXE( ... version_file='version_info.txt', ... ) # Custom manifest for Windows manifest = ''' ''' ``` -------------------------------- ### Add Binaries to PyInstaller Spec File Source: https://github.com/rimulu030/gamewiki/blob/master/docs/BUILD.md Illustrates how to include necessary binary files (like DLLs) in the PyInstaller build by adding them to the 'binaries' list in the `.spec` file. This is crucial for resolving DLL loading issues. ```python binaries = [ ('path/to/dll', '.'), ] ``` -------------------------------- ### Download Vosk Voice Models Source: https://github.com/rimulu030/gamewiki/blob/master/docs/BUILD.md Downloads the necessary Vosk voice models, which are required for voice recognition support in the application. This is an optional step if voice features are not needed. ```bash # For voice recognition support python download_vosk_models.py ``` -------------------------------- ### Build Executable with PyInstaller Command Source: https://github.com/rimulu030/gamewiki/blob/master/docs/BUILD.md Manually builds the standalone Windows executable using PyInstaller. This command specifies the application name, windowed mode, icon, data files, and hidden imports. ```bash pyinstaller --name GameWikiAssistant \ --windowed \ --icon src/game_wiki_tooltip/assets/app.ico \ --add-data "src/game_wiki_tooltip/assets;src/game_wiki_tooltip/assets" \ --add-data "data;data" \ --hidden-import PyQt6 \ --hidden-import google.generativeai \ src/game_wiki_tooltip/qt_app.py ``` -------------------------------- ### Include Data Files in PyInstaller Spec File Source: https://github.com/rimulu030/gamewiki/blob/master/docs/BUILD.md Demonstrates how to include data files and directories (like assets) in the PyInstaller build by configuring the 'datas' list in the `.spec` file. This ensures that all necessary resources are packaged with the executable. ```python datas = [ ('src/game_wiki_tooltip/assets', 'src/game_wiki_tooltip/assets'), ] ``` -------------------------------- ### Generate Streaming AI Summaries with GeminiSummarizer (Python) Source: https://context7.com/rimulu030/gamewiki/llms.txt Demonstrates how to use the GeminiSummarizer class to generate streaming AI responses from knowledge chunks. It covers creating a summarizer instance with custom configurations or using a convenience function, providing example knowledge chunks, and initiating the streaming summarization process. ```python from src.game_wiki_tooltip.ai.gemini_summarizer import GeminiSummarizer, create_gemini_summarizer from src.game_wiki_tooltip.ai.rag_config import SummarizationConfig import asyncio # Create summarizer with configuration config = SummarizationConfig( api_key="your_gemini_api_key", model_name="gemini-2.5-flash-lite", temperature=0.3, language="auto", # Auto-detect language from query enable_google_search=True, # Enable Google Search grounding thinking_budget=-1 # Dynamic thinking budget ) summarizer = GeminiSummarizer(config=config) # Or use convenience function summarizer = create_gemini_summarizer( api_key="your_gemini_api_key", enable_google_search=True ) # Example knowledge chunks from search results chunks = [ { "topic": "Bile Titan Weaknesses", "summary": "The Bile Titan's main weak points are its head and belly...", "keywords": ["Bile Titan", "boss", "weakness"], "structured_data": { "enemy_name": "Bile Titan", "weak_points": [{"name": "Head", "health": 1500}], "recommended_weapons": ["Railgun", "Autocannon"] } } ] # Generate streaming response async def generate_summary(): async for chunk in summarizer.summarize_chunks_stream( chunks=chunks, query="How to kill Bile Titan?", original_query="how do i kill bile titan", context="HELLDIVERS 2" ): print(chunk, end="", flush=True) asyncio.run(generate_summary()) ``` -------------------------------- ### Run Test Script for WebView2 WinRT Source: https://github.com/rimulu030/gamewiki/blob/master/WEBVIEW2_WINRT_MIGRATION.md Executes the comprehensive test script for the new PyWinRT-based WebView2 implementation. This script verifies runtime detection and installation, ensuring the migration is successful. ```bash python test_webview2_winrt.py ``` -------------------------------- ### Run Main Application Source: https://github.com/rimulu030/gamewiki/blob/master/WEBVIEW2_WINRT_MIGRATION.md Launches the main Game Wiki tooltip application, which now utilizes the PyWinRT-based WebView2 implementation. ```bash python -m src.game_wiki_tooltip ``` -------------------------------- ### Initialize WebView2 with PyWinRT Source: https://github.com/rimulu030/gamewiki/blob/master/WEBVIEW2_MIGRATION_COMPLETE.md Demonstrates the correct pattern for initializing WebView2 using PyWinRT. This involves COM initialization, creating an environment, a window reference, and the controller before navigating. It requires the 'winrt-runtime', 'webview2-Microsoft.Web.WebView2.Core', and 'winrt-Windows.Foundation' packages. ```python import ctypes from webview2.microsoft.web.webview2.core import ( CoreWebView2Environment, CoreWebView2ControllerWindowReference ) # 1. Initialize COM ole32 = ctypes.windll.ole32 ole32.CoInitialize(None) # 2. Create environment environment = await CoreWebView2Environment.create_async() # 3. Create window reference window_ref = CoreWebView2ControllerWindowReference.create_from_window_handle(hwnd) # 4. Create controller controller = await environment.create_core_webview2_controller_async(window_ref) # 5. Get WebView2 webview = controller.core_web_view2 # 6. Navigate webview.navigate("https://example.com") ``` -------------------------------- ### Game Data Structure for Survival Guide (JavaScript) Source: https://github.com/rimulu030/gamewiki/blob/master/src/game_wiki_tooltip/assets/html/dst_en.html This JavaScript object defines the structure for game tasks and phases within the survival guide. It includes titles, introductory text, and detailed task breakdowns for different game stages and seasons. This data is likely used to dynamically generate content on a web page. ```javascript const tasksData = { start: { title: "Getting Started: The Initial Setup", intro: "Welcome to The Constant! Before you tackle the challenges of the seasons, the right initial setup and character choice will greatly increase your chances of survival. This section will guide you through the most important preparations.", phases: [ { title: "Phase 1: Creating Your World", tasks: [ { title: "Recommended World Settings", details: "For beginners, we strongly recommend the 'Survival' game mode and always enabling 'Caves' for much more content. If you're playing solo, setting the server to 'Local Only' can prevent lag. Other settings can be left at their defaults, which are friendly to new players." }, { title: "Essential Client Mods", details: "For a better experience, it's recommended to subscribe to and enable two client mods: 'Geometric Placement' helps you place structures neatly, and 'Craft Pot' shows all Crock Pot recipes, which is extremely useful for beginners." } ] }, { title: "Phase 2: Choosing Your Character", tasks: [ { title: "Recommended Beginner Characters", details: "While all characters can survive, some are more beginner-friendly. They help you learn the game's core mechanics without overly complex special abilities. Recommended characters: Wilson, Wendy, Willow, Woodie." } ] } ] }, autumn: { title: "The Bountiful Autumn (Days 1-20)", intro: "Autumn is the most lenient season in the game, your golden preparation period. The goal this season is to transition from a nomadic scavenger to a survival expert with a stable base. Every decision you make here will determine life or death in winter.", phases: [ { title: "Phase 1: Nomadic Exploration (Days 1-7)", tasks: [ { title: "Exploration & Gathering (Days 1-2)", details: "As soon as the game starts, run along the coastline to map the continent's outline. Simultaneously, constantly gather 8 basic resources: Twigs, Grass, Flint, Wood, Rocks, Gold, Flowers, and Food (Berries/Carrots). Prioritize mining rocks with golden veins to get both gold and rocks efficiently." }, { title: "Crafting Core Gear (Day 3)", details: "Build a Science Machine as soon as possible with the resources you've gathered. Immediately unlock and craft four core items: a Backpack (greatly increases carrying capacity), a Spear (for self-defense), a Log Suit (provides 80% damage reduction, key for early survival), and a Shovel (for transplanting resources). Hammer the Science Machine to take away the materials" }, { title: "Transplanting & Continued Exploration (Days 4-7)", details: "With your toolkit equipped, continue exploring. Use the shovel to dig up and carry any grass, saplings, and berry bushes you encounter. This is preparation for your future base farm and the first step towards resource sustainability." } ] }, { title: "Phase 2: Laying the Foundation (Days 8-15)", tasks: [ { title: "Strategic Base Location (Days 8-10)", details: "After exploring the map, choose a central location for your permanent base. An ideal" } ] } ] } }; ``` -------------------------------- ### Troubleshoot Import Error: 'No module named "winrt_runtime"' Source: https://github.com/rimulu030/gamewiki/blob/master/WEBVIEW2_WINRT_MIGRATION.md Provides the correct pip installation command to resolve the 'No module named "winrt_runtime"' error, ensuring the winrt-runtime package is installed. ```bash # Correct installation command pip install winrt-runtime webview2-Microsoft.Web.WebView2.Core ``` -------------------------------- ### Build Executable with PyInstaller Source: https://github.com/rimulu030/gamewiki/blob/master/WEBVIEW2_WINRT_MIGRATION.md Builds the standalone executable for the Game Wiki tooltip application using PyInstaller, incorporating the new PyWinRT WebView2 dependencies. ```bash python build_exe.py ``` -------------------------------- ### Initialize and Navigate WebView2 in Python Source: https://github.com/rimulu030/gamewiki/blob/master/docs/ARCHITECTURE.md Demonstrates the initialization of a WebView2 component and its ability to navigate to a specified URL. This is used for displaying wiki content within the application. ```python class WikiView(WebView2): def __init__(self): self.create_webview() self.bind_javascript_interface() def navigate(self, url): self.webview.Navigate(url) ``` -------------------------------- ### CSS Styling for Elden Ring Guide Source: https://github.com/rimulu030/gamewiki/blob/master/src/game_wiki_tooltip/assets/html/eldenring_en.html This CSS code defines font families and creates an aspect ratio wrapper for responsive video embeds. It ensures consistent typography and proper display of video content across different screen sizes. ```css body { font-family: 'Inter', sans-serif; } h1, h2, h3, h4, .font-cinzel { font-family: 'Cinzel', serif; } /* Aspect ratio wrapper for responsive video */ .aspect-w-16 { position: relative; padding-bottom: 56.25%; /* 16:9 aspect ratio */ } .aspect-w-16 > * { position: absolute; height: 100%; width: 100%; top: 0; right: 0; bottom: 0; left: 0; } ``` -------------------------------- ### Build Vector Indexes for Game Knowledge Bases Source: https://context7.com/rimulu030/gamewiki/llms.txt Command-line tool to build vector indexes for game knowledge bases using FAISS or Qdrant. Supports building for specific games, all games, or from custom JSON files. Includes options to list available games. ```bash # Build index for a specific game python src/game_wiki_tooltip/ai/build_vector_index.py --game helldiver2 # Build indexes for all available games python src/game_wiki_tooltip/ai/build_vector_index.py --game all # Build from a custom JSON file with custom collection name python src/game_wiki_tooltip/ai/build_vector_index.py \ --file data/knowledge_chunk/terraria_test.json \ --collection-name terraria_test_vectors # List available games python src/game_wiki_tooltip/ai/build_vector_index.py --list-games # Use Qdrant instead of FAISS python src/game_wiki_tooltip/ai/build_vector_index.py --game helldiver2 --vector-store qdrant ``` -------------------------------- ### Exclude Modules in PyInstaller Spec File Source: https://github.com/rimulu030/gamewiki/blob/master/docs/BUILD.md Demonstrates how to exclude unnecessary modules from the PyInstaller build by editing the `.spec` file. This can help reduce the final executable size. ```python excludes = ['tkinter', 'matplotlib', 'scipy'] ``` -------------------------------- ### Add Hidden Imports to PyInstaller Spec File Source: https://github.com/rimulu030/gamewiki/blob/master/docs/BUILD.md Shows how to add missing modules to the 'hiddenimports' list in a PyInstaller `.spec` file to resolve 'Module not found' errors during the build process. ```python hiddenimports = ['missing_module_name'] ``` -------------------------------- ### Enable Debug Mode Configuration Source: https://github.com/rimulu030/gamewiki/blob/master/docs/ARCHITECTURE.md Provides an example of a JSON configuration object to enable debug mode, set the log level, and control the display of timing information within the application. ```json { "debug": true, "log_level": "DEBUG", "show_timings": true } ```