Repository navigation
Core architecture - #8
Merged
Merged
Conversation
- Updated gamedata.json to include new locations and metadata. - Implemented auto-loading of gamedata.json in app.js with error handling and user feedback. - Improved visitLocation method in app.js to handle errors and provide feedback on location visits. - Enhanced map.js to support dynamic button creation for visiting locations. - Updated event handling in events.js to prevent infinite loops on error events. - Added progress bar handling in Generate-GameData.ps1 for better user experience. - Created new demo and test scripts for command registry and communication systems. - Added various documentation files for integration guides and architecture overviews.
…1 for improved readability
- Added PathfindingSystem module for managing unit movements and pathfinding logic. - Implemented Start-UnitMovement, Update-UnitPosition, Complete-UnitMovement, and related functions. - Introduced event handling for movement start and completion. - Created pathfinding.js for client-side pathfinding using OSRM and direct path calculations. - Developed player-movement-demo.html to demonstrate player movement on a Leaflet map with travel mode selection. - Integrated pathfinding logic with UI for real-time path calculation and display.
…ility and Consistency - Cleaned up whitespace and formatting in PathfindingSystem.psm1 for better readability. - Standardized hashtable key alignment in StateManager.psm1 for consistency. - Enhanced logging messages for clarity in both modules. - Updated HTML demo to improve path info display and travel mode selection. - Ensured consistent error handling and logging practices across functions.
…ed clarity and maintainability
- CoreGame.psd1: Updated manifest (author, company, description) - CoreGame.psm1: Added -Global flag to Import-Module calls for proper function export - StateManager.psm1: Removed non-existent Get-GameEntity from exports - Basic.Tests.ps1: Rewritten with comprehensive Pester tests (24 tests) - Architecture.md: Added Module Loading Architecture documentation - powershell-tests.yml: Enhanced with manifest validation and module checks All 24 Pester tests pass. Module exports 45+ functions across submodules.
CharacterSystem Module (1099 lines): - Character creation with cyberpunk attributes (Strength, Reflex, Technical, Intelligence, Cool, Body) - XP/leveling system with exponential curves - Complete inventory management with weight capacity - Equipment system with 8 slots (head, torso, arms, legs, feet, accessory1, accessory2, weapon) - Skills/perks system with cooldowns and costs - Combat mechanics (damage, healing, death, resurrection) - Credits/currency management Tests (47 CharacterSystem tests + fixed Unit tests): - Tests/CharacterSystem.Tests.ps1: comprehensive CharacterSystem tests - Fixed all Tests/Unit/*.Tests.ps1 files with proper path resolution - Fixed DroneSystem.psm1 syntax error (removed orphan code) - Added Initialize-WorldSystem function to WorldSystem.psm1 All 87 tests now pass.
WorldSystem.psm1 (1204 lines, 25 functions): - Time system: Initialize-WorldSystem, Get/Set/Advance-GameTime, Get-TimeOfDay - Weather system: 6 types (Clear, Rain, HeavyRain, Fog, AcidRain, Sandstorm) - District management: 6 types with security levels, gang presence, price modifiers - Location system: 8 types (SafeHouse, Shop, Bar, Clinic, Workshop, etc.) - Travel system with distance/time calculation, random encounters - Legacy map functions preserved (New-GameMap, Export/Import-GameMap) Tests: 58 new WorldSystem tests, all passing Fixes: CoreGame.Tests.ps1 unit test adjusted for module isolation
QuestSystem.psm1 (1413 lines, 25 functions): - Quest lifecycle: Start-Quest, Complete-Quest, Fail-Quest, Abandon-Quest - Quest templates with types (MainStory, Side, Faction, Repeatable, Contract, Discovery) - Objective system: 13 objective types (GoToLocation, KillTarget, CollectItem, etc.) - Difficulty scaling with XP/credit multipliers - Quest givers and available quest filtering by level/reputation - Time-limited quests with expiration handling - Event-driven objective progress (Process-QuestEvent) - Contract system for fixer jobs with upfront/completion payments - State export/import for save games Tests: 66 new QuestSystem tests, all passing
- Implement comprehensive faction management (1143 lines, 25+ functions) - Add 7 faction types per design: Corporation, Crew, Syndicate, YoungTeam, Underground, Independent, Player - Crew: Ex-military crime gangs (VeryHigh organization, VeryHigh danger) - Syndicate: Organized street gangs (High organization, High danger) - YoungTeam: Youth street gangs (Low organization, Variable danger) - Implement 5-tier reputation system: Hostile, Unfriendly, Neutral, Friendly, Allied - Add standing effects: price modifiers (0.8x-2.0x), access levels, service availability - Implement faction relationships: AtWar, Hostile, Rival, Neutral, Friendly, Allied - Add territory control system with transfer mechanics - Add event processing for QuestCompleted, QuestFailed, EnemyKilled, TerritoryContested - Support reputation spread to rival factions - Add state export/import for save games - Include 73 comprehensive tests (all passing)
- Implement complete shop and trading system (1811 lines, 40+ functions) - Add 8 vendor types: BlackMarket, Fixer, CorporateStore, StreetVendor, RipperDoc, Armorer, ChopShop, DataBroker - Each vendor type has unique markup, specialties, buyback rates - Implement 16 item categories with rarity system (Common to Legendary) - Add dynamic pricing: vendor markup, standing modifiers, supply/demand - Implement player inventory with weight system and currency management - Add transaction system: purchases, sales, with full history tracking - Support supply modifiers and automatic restocking - Add state export/import for save games - Fix array return behavior in Get-ShopInventory using ArrayList and comma operator - Include 97 comprehensive tests (all passing)
- 1641 lines of code implementing hacking/terminal system - 104 Pester tests all passing Terminal Types (7 types): - PublicTerminal, CorporateTerminal, SecurityTerminal - DataServer, BankTerminal, MilitaryTerminal, AICore - Each with unique security levels, ICE, and data types ICE (Intrusion Countermeasures Electronics) System: - 7 ICE types: Firewall, Tracer, Killer, BlackICE, Encryption, Scorcher, Sentinel - Each with unique effects, bypass difficulty, and damage Hacking System: - Get-HackChance: Calculates success based on INT, skill, programs, ICE - Start-Hack: Full hack attempt with XP, damage, detection - Invoke-DataTheft: Steal data from compromised terminals - Invoke-TerminalAction: 8 terminal actions (DisableAlarms, OpenDoors, etc.) Hacking Programs (9 programs): - BasicDecrypt, Probe, Mask, Sledgehammer, Ghost - ICEBreaker, DataVault, Worm, Neural Spike Security Features: - Security alerts with faction/location tracking - Trace level system with decay over time - Hack history and statistics tracking Data Types (24 types): - From PublicInfo to MasterCodes with varying values/legality Network Management: - Create/manage networks linking multiple terminals - Network-wide security and alerts State Management: - Export/Import terminal data - Event processing for game integration
- 8 drone types: Scout, Combat, Support, EMP, Heavy, Stealth, Carrier, Turret - 9 mission types with automated completion system - Drone inventory and deployment management - Action system: Scan, Attack, Heal, Shield, EMPBlast, Cloak, etc. - Combat: damage with EMP bonus, armor mitigation, repair, recharge - Drone override/hacking system with INT/skill checks - 7 upgrade types (ArmorPlating, ExtendedBattery, SpeedBoost, etc.) - XP and leveling system with stat progression - Event processing for time/combat/EMP integration - Full export/import state persistence - Hashtable-based pattern matching other modules
- Created Tests/Integration/Full-System-Integration.Tests.ps1 - Module initialization tests for all 7 game systems - Cross-module integration tests: - Character-Faction integration with reputation system - Quest system operations (templates, start, complete) - Shop system (items, inventory, purchases) - Drone system (deploy, actions, combat, override) - World-Location integration with shops and terminals - Terminal-Hacking integration with programs - Quest-Faction relationships - Drone vs Drone combat scenarios - Full gameplay simulation test covering: - World creation, faction setup, shop with items - Terminal creation, quest flow, drone deployment - Scanning, hacking, quest completion, purchases - State persistence export/import tests - Error handling and graceful failure tests - All 22 integration tests passing
- Created HTTP-Bridge.Tests.ps1 to test server endpoints with actual HTTP requests. - Implemented Run-FullIntegration.ps1 to execute all tests, including module and HTTP tests. - Added Run-ModuleTests.ps1 for running independent module tests without HTTP dependencies. - Introduced Start-BridgeServer.ps1 to launch the HTTP Bridge Server with configurable port and CORS settings.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR establishes the core architecture for a cyberpunk RPG game system built in PowerShell. It introduces comprehensive module implementations for world management, terminal hacking, shops/inventory, quests, factions, and drones, along with enhanced testing infrastructure and improved startup scripts.
Changes:
- Implemented comprehensive game systems (WorldSystem, TerminalSystem, ShopSystem, QuestSystem, FactionSystem, DroneSystem)
- Added extensive test coverage for module loading and function exports
- Enhanced startup scripts with dual-server architecture and port availability checks
- Refactored CoreGame module dependency loading to use manifest-based ordering
Reviewed changes
Copilot reviewed 41 out of 117 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Tests/Basic.Tests.ps1 | Comprehensive test suite validating module loading and function exports |
| Test-ModuleLoad.ps1 | Quick module loading diagnostic script with hardcoded path |
| Start-Game.ps1 | Enhanced startup with dual-server support, port checks, and job management |
| Modules/WorldSystem/WorldSystem.psm1 | Complete world system with time, weather, districts, locations, and travel |
| Modules/WorldSystem/WorldSystem.psd1 | Updated manifest with explicit exports and metadata |
| Modules/TerminalSystem/TerminalSystem.psm1 | Full hacking system with terminals, ICE, programs, and security |
| Modules/TerminalSystem/TerminalSystem.psd1 | Updated manifest with comprehensive function exports |
| Modules/ShopSystem/ShopSystem.psm1 | Complete trading system with vendors, inventory, and pricing |
| Modules/ShopSystem/ShopSystem.psd1 | Updated manifest with detailed function listing |
| Modules/QuestSystem/QuestSystem.psm1 | Quest and mission system with objectives, givers, and contracts |
| Modules/QuestSystem/QuestSystem.psd1 | Updated manifest with quest-related exports |
| Modules/FactionSystem/FactionSystem.psm1 | Faction management with reputation, relationships, and territories |
| Modules/FactionSystem/FactionSystem.psd1 | Updated manifest with faction system exports |
| Modules/DroneSystem/README.md | Comprehensive documentation for drone system features |
| Modules/CoreGame/StateManager.psm1 | Formatting fixes for else statements and export additions |
| Modules/CoreGame/GameLogging.psm1 | Added Initialize-GameLogging function with documentation |
| Modules/CoreGame/DataModels.psm1 | Changed default position from XYZ to Lat/Lng coordinates |
| Modules/CoreGame/CoreGame.psd1 | Updated metadata and improved documentation |
| Modules/CoreGame/CommandRegistry.psm1 | Simplified module imports using manifest-based loading |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
setup of core functions