
VillageAI
Intelligent village defense system. Villages centered on bells automatically detect nearby villagers. Friendly players gain reputation by trading. Hostile players lose reputation by attacking villagers. When hostile players are nearby reputation drops belo
100
3
Список изменений
VillageAI Changelog
[2.0.0] - 2026-03-04 - Economy System Expansion
🏘️ Major New Feature: Village Economy System
Dynamic Trading System
- Supply & Demand Mechanics: Villages now track item supply and demand in real-time
- Dynamic Pricing: Prices fluctuate based on village needs (formula: demand/(supply+1))
- Trade Offers: Automatic generation of buy/sell offers based on village inventory
- Price Caps: Minimum 1 emerald, maximum 1000 emeralds per item to prevent exploitation
Quest System Integration
- Auto-Generated Quests: Villages create delivery quests based on their current needs
- Quest Types: Delivery quests for food, building materials, and tools
- Dynamic Rewards: Quest rewards scale with item rarity and village urgency
- Quest Tracking: Players can accept, track, and complete quests for reputation gains
Reputation-Based Economics
- 6 Reputation Tiers: Despised, Disliked, Neutral, Liked, Respected, Honored
- Price Modifiers: Reputation affects trade prices (50% discount for Honored, 50% markup for Despised)
- Reputation Gains: +1 per trade, +5 per completed quest
- Reputation Decay: Optional passive reputation decay over time
Multi-Village Economy
- Independent Economies: Each village maintains its own supply/demand data
- Spatial Trading: Players interact with nearest village's economy
- Cross-Village Competition: Different villages may offer different prices
🎮 New Commands & Interface
Village Trade Commands (/vtrade)
/vtrade trade: View current village trade offers with reputation-adjusted prices/vtrade quests: Display available quests with rewards and deadlines/vtrade reputation: Show current reputation level and benefits/vtrade prices: Display current market prices for common materials/vtrade accept <quest_id>: Accept a specific quest/vtrade villagers: Show villager names and village demographics
Command Aliases
/vt: Short alias for quick access/vshop: Shop-style alias for player familiarity
Tab Completion System
- Smart Completion: Context-aware tab completion for all commands
- Material Suggestions: Auto-complete material names for trading
- Quest ID Completion: Show available quest IDs with titles
- Quantity Suggestions: Common quantities (1, 16, 32, 64)
� Villager Naming System
Unique Identities
- Realistic Names: Each villager gets a unique name (John Smith, Mary Johnson)
- Profession Suffixes: 30% chance for profession-based names ("James the Blacksmith")
- Consistent Naming: Same villager always has same name across restarts
- Name Pools: 50+ first names and 50+ last names for variety
Village Demographics
- Statistics Tracking: Track profession distribution and name frequency
- Village Identity: Each village has unique population characteristics
- Visual Integration: Names displayed via
/vtrade villagerscommand - Performance Optimized: Name updates every 5 minutes, not every tick
�🔧 Technical Architecture
New Package Structure
vn.duong2012g.villageai.economy: Complete economy system package- Core Classes:
VillageEconomy,SupplyData,PriceCalculator,TradeOffer - Quest System:
Quest,DeliveryQuest,QuestGenerator - Name System:
VillagerName,VillagerNameManager - Commands:
EconomyCommand,VillageTradeTabCompleter
Thread Safety & Performance
- ConcurrentHashMap: All economy data structures use thread-safe collections
- Atomic Operations: Trade execution and reputation updates are atomic
- Efficient Updates: Economy updates every 24 game hours (configurable)
- Memory Management: Proper cleanup of expired offers and completed quests
Configuration System
economy_config.yml: Comprehensive economy configuration- Base Prices: Configurable base prices for 50+ materials
- Village Needs: Customizable daily requirements and production
- Quest Settings: Adjustable generation probabilities and rewards
📊 Economy Mechanics
Price Calculation Formula
basePrice = material-specific value
ratio = demand / (supply + 1)
finalPrice = basePrice × ratio
adjustedPrice = finalPrice × reputationMultiplier
Reputation Multipliers
- Despised (-50): 1.5x price (50% markup)
- Disliked (-25): 1.3x price (30% markup)
- Neutral (0): 1.0x price (standard)
- Liked (+25): 0.85x price (15% discount)
- Respected (+50): 0.7x price (30% discount)
- Honored (+100): 0.5x price (50% discount)
Quest Generation Logic
- Food Quests: Generated when village wheat < daily needs
- Building Quests: Triggered when wood/stone supplies are low
- Tool Quests: Created when blacksmiths need iron
- Emergency Quests: Special quests during village attacks
🔄 Configuration Updates
plugin.yml Changes
- New Command: Added
vtradecommand with aliases[vt, vshop] - New Permission:
villageai.economyfor economy system access - Command Description: Updated to reflect village trade focus
New Configuration Files
economy_config.yml: Complete economy system configuration- Base Price Tables: Pre-configured prices for 50+ materials
- Village Needs: Default daily requirements for realistic economy
🐛 Bug Fixes & Improvements
Command Conflicts Resolution
- Renamed Command: Changed from
/economyto/vtradeto avoid conflicts with other plugins - Unique Aliases:
vtandvshopare unique to VillageAI - Clear Naming: "Village Trade" better reflects plugin's theme
Type Safety Fixes
- UUID Conversion: Fixed VillageId to UUID conversions in economy classes
- Material References: Updated deprecated
WOODtoOAK_PLANKS - Exception Handling: Improved error handling in command processing
🎯 Compatibility & Migration
Backward Compatibility
- Existing Villages: All existing villages automatically get economy systems
- No Data Loss: Current village data preserved during upgrade
- Optional Features: Economy system can be disabled via configuration
Server Requirements
- Java 21: Required for modern API usage
- Paper/Spigot 1.21+: Full compatibility with latest Minecraft versions
- Memory: Additional ~50MB memory usage for economy data (100 villages)
🏆 Impact Summary
This major update transforms VillageAI from a defense-focused plugin into a comprehensive village simulation with living, breathing economies. Players can now:
- Trade Smart: Buy low, sell high based on village needs
- Build Reputation: Earn discounts and exclusive access through quests
- Shape Economy: Your trades directly impact village prosperity
- Experience Living Villages: Watch villages evolve based on player interactions
- Know Your Villagers: Each villager has a unique name and identity
The economy system adds hundreds of hours of gameplay while maintaining the plugin's legendary performance and stability.
Файлы
VillageAI-2.0.0.jar(66.98 KiB)
ОсновнойМетаданные
Канал релиза
Release
Номер версии
2.0.0
Загрузчики
BukkitPaperPurpurSpigot
Версии игры
1.21–1.21.11
Загрузок
3
Дата публикации
3 нед. назад
