Skip to content

DevStudio-AI/GreenValley_

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Green Valley Banner

Green Valley

Built with VybeCoder Execution Verified

A Pixel-Art Farming Simulation β€” Built From Scratch

A farming and life simulation game built entirely from scratch in JavaScript with no game engine. Custom rendering, custom physics, custom everything β€” just HTML5 Canvas and code. Features a deep genetic breeding system where you cross-breed plants, discover rare strains, and build a thriving farm with NPCs, quests, and a living world.

No Engine Canvas JavaScript Genetics Status


Why From Scratch?

No Unity. No Godot. No Phaser. No engine at all.

Every system in Green Valley β€” rendering, input handling, collision detection, game loop, UI, audio, saving β€” was built by hand. This means understanding every line of code that makes the game work, and having total control over how it behaves.

The game runs entirely in a web browser using the HTML5 Canvas 2D API. No installations, no plugins, just open and play.


Game Features

🌾 Farming

Full crop lifecycle from seed to harvest:

Seed β†’ Seedling β†’ Vegetative β†’ Flowering β†’ Harvestable
  • Soil management β€” Nutrients deplete as crops grow; restore with fertilizer
  • Watering system β€” Crops need water; track moisture levels per plot
  • Seasons β€” Spring, Summer, Fall, Winter affect what grows and how fast
  • Weather effects β€” Rain waters your crops; heatwaves stress them; snow halts growth
  • Quality system β€” Plant health, water efficiency, and care affect harvest quality

🧬 Genetic Breeding System

The signature feature. Cross-breed plants to create offspring with inherited traits:

Trait What It Controls
Yield How much you harvest
Quality Grade of the harvest
Growth Speed How fast it grows
Water Efficiency How much water it needs
Disease Resistance Survival against disease
Pest Resistance Survival against pests
THC% Specialized strain potency
CBD% Specialized strain properties

How breeding works:

  • Select two parent plants
  • Offspring inherits a mix of both parents' traits
  • 5% mutation chance on each trait (Β±0.2 variance)
  • Color genetics β€” visual phenotype mixing from parents
  • Multi-generation tracking β€” plants know their lineage

Strain tiers:

  • Starter strains β€” Basic cultivars for new players
  • Rare strains β€” Unlocked through skilled breeding and quests
  • Legendary strains β€” Exceptional genetics, extremely rare

πŸ‘₯ NPCs & Relationships

8-22 NPCs with daily lives:

  • Schedules β€” Each NPC has hourly routines (work, shop, walk, sleep) that vary by day
  • Relationships β€” 0-300+ point system: Stranger β†’ Friend β†’ Best Friend β†’ Close
  • Gift system β€” Every NPC has loved, liked, neutral, disliked, and hated gifts
  • Occupations β€” Herbalist, farmer, merchant, each with role-specific activities
  • Dialogue β€” Relationship-level dialogue variants, quest conversations, casual chat

🏠 Buildings & Construction

Building Function
Greenhouse Climate control, humidity regulation, automated watering, weather protection
Barn Storage + animal care
Coop Poultry management
Shed Tool and item storage
Silo Bulk crop storage
Well Water source
House Player home, rest, save point

Buildings have tiered upgrades: Basic β†’ Advanced β†’ Specialized (e.g., Hydroponics greenhouse)

πŸ”¨ Crafting

100+ recipes across multiple stations:

  • Tools β€” Hoe, Watering Can, Axe, Pickaxe, Scythe (with durability tiers)
  • Seeds β€” Craft specialized seeds from harvested genetics
  • Products β€” Transform raw harvests into sellable goods
  • Quality inheritance β€” Output quality based on input ingredient quality

πŸ“‹ Quests & Progression

Type Description
Main story 5+ chapter narrative arc
Side quests NPC-driven tasks and favors
Daily quests Repeatable daily objectives
Weekly quests Longer-term challenges

Multi-stage objectives (e.g., plant seeds β†’ water β†’ harvest β†’ deliver) with XP, gold, item, and blueprint rewards.

πŸ† Skills & Progression

Skill Levels Effect
Farming 1-10+ Crop growth speed, yield, plot management
Breeding 1-10+ Mutation rates, strain discovery, genetics mastery
Processing 1-10+ Harvest yield, drying/trimming efficiency
Social 1-10+ NPC relationship bonuses, gift effectiveness

πŸ’° Economy

  • Multiple shops with dynamic pricing and buy/sell restrictions
  • Gold currency with wallet management
  • Market fluctuations based on season and supply
  • Stock tracking β€” shops restock periodically

🌀️ Time & Weather

  • Day/night cycle β€” Syncs to your real system clock; street lanterns glow warm from dusk to dawn
  • 4 seasons β€” 30-day cycles each, affecting crops and NPC behavior
  • Dynamic weather β€” Season-specific patterns:
    • Winter: Snow (30%), Clear (70%)
    • Spring: Rain (50%), Storm (20%), Clear (30%)
    • Summer: Heatwave (20%), Rain (20%), Clear (60%)
    • Fall: Wind (30%), Rain (30%), Clear (40%)

⚑ Energy System

  • 100-point stamina pool β€” Actions drain energy (tools, sprinting, farming)
  • Regeneration β€” Sleep, food consumption
  • Fatigue β€” Reduced efficiency when tired

Architecture

Built as a modular vanilla JavaScript application with an event-driven architecture:

main.js (entry point)
β”‚
β”œβ”€β”€ Game.js (core game loop + state)
β”‚
β”œβ”€β”€ Core Systems
β”‚   β”œβ”€β”€ InputManager      β€” Keyboard + mouse handling
β”‚   β”œβ”€β”€ AudioManager      β€” Web Audio API sounds
β”‚   β”œβ”€β”€ SaveManager       β€” LocalStorage persistence
β”‚   β”œβ”€β”€ EventBus          β€” Pub/sub event system
β”‚   └── GameBootstrap     β€” Initialization sequence
β”‚
β”œβ”€β”€ Rendering
β”‚   β”œβ”€β”€ EnhancedRenderer  β€” Canvas 2D rendering + camera
β”‚   β”œβ”€β”€ Animation         β€” Sprite frame animation
β”‚   β”œβ”€β”€ SpriteSheet       β€” Texture atlas system
β”‚   β”œβ”€β”€ Particles         β€” Particle effects
β”‚   β”œβ”€β”€ Lighting          β€” Day/night visual effects
β”‚   └── Transitions       β€” Scene fade/wipe transitions
β”‚
β”œβ”€β”€ World
β”‚   β”œβ”€β”€ GameWorld         β€” Zone management
β”‚   β”œβ”€β”€ TileMap           β€” Tile-based collision + interaction
β”‚   β”œβ”€β”€ Camera            β€” Viewport tracking
β”‚   └── Zones: Farm, Forest, Cave, Town, Greenhouse
β”‚
β”œβ”€β”€ Game Systems
β”‚   β”œβ”€β”€ FarmingSystem     β€” Crop lifecycle management
β”‚   β”œβ”€β”€ QuestSystem       β€” Quest tracking + completion
β”‚   β”œβ”€β”€ AchievementSystem β€” Achievement tracking
β”‚   β”œβ”€β”€ TimeSystem        β€” Day/night, seasons, year
β”‚   β”œβ”€β”€ WeatherSystem     β€” Dynamic weather patterns
β”‚   β”œβ”€β”€ EconomySystem     β€” Pricing + transactions
β”‚   β”œβ”€β”€ EnergySystem      β€” Stamina management
β”‚   β”œβ”€β”€ ShopSystem        β€” Buy/sell interface
β”‚   β”œβ”€β”€ CraftingSystem    β€” Recipe processing
β”‚   └── ToolSystem        β€” Tool durability + tiers
β”‚
β”œβ”€β”€ Entities
β”‚   β”œβ”€β”€ Player            β€” Stats, skills, inventory
β”‚   β”œβ”€β”€ NPCs              β€” Dialogue, relationships, schedules
β”‚   └── Plants            β€” Growth, genetics, health
β”‚
β”œβ”€β”€ Genetics Module
β”‚   β”œβ”€β”€ Genome            β€” Trait container
β”‚   β”œβ”€β”€ Breeding          β€” Cross-breed logic
β”‚   β”œβ”€β”€ Mutations         β€” Random trait variance
β”‚   β”œβ”€β”€ ColorGenetics     β€” Visual phenotype mixing
β”‚   └── StrainRegistry    β€” Starter/Rare/Legendary
β”‚
└── UI
    β”œβ”€β”€ HUD               β€” Heads-up display
    β”œβ”€β”€ MenuSystem        β€” Main/pause/settings
    β”œβ”€β”€ DialogSystem      β€” NPC conversations
    β”œβ”€β”€ InventoryUI       β€” 32-slot grid (8Γ—4)
    β”œβ”€β”€ JournalUI         β€” Quest + achievement log
    └── MapUI             β€” Zone overview

Full architecture deep-dive in ARCHITECTURE.md


Tech Stack

Component Technology Notes
Language JavaScript ES6+ Vanilla β€” no frameworks
Rendering HTML5 Canvas 2D API Pixel-perfect with imageSmoothingEnabled: false
Audio Web Audio API Deferred init (browser requirement)
Persistence LocalStorage Compressed save data (Base64)
Architecture ES6 Modules Native browser imports, no build pipeline
Input Keyboard + Mouse events Centralized InputManager
PWA Service Worker + Manifest Installable, offline-capable
Assets PNG spritesheets Optimized texture atlases

No game engine. No bundler. No transpiler. Just JavaScript, Canvas, and hand-crafted game systems.

Full breakdown in TECH_STACK.md


Controls

Key Action
WASD / Arrow Keys Move
E / Space Interact
I Inventory
1-9 Tool/item hotbar
Left Click Use tool / interact
Right Click Context action

Screenshots

Screenshots coming soon.


Project Status

Green Valley is playable with major systems functional:

  • βœ… Custom game engine (rendering, input, physics, audio)
  • βœ… Full farming lifecycle (seed β†’ harvest)
  • βœ… Genetic breeding system with mutations and strain tiers
  • βœ… NPC system with schedules, relationships, and dialogue
  • βœ… Building construction with tiered upgrades
  • βœ… 100+ crafting recipes
  • βœ… Quest system with multi-stage objectives
  • βœ… Day/night cycle, seasons, and weather
  • βœ… Economy with shops and dynamic pricing
  • βœ… Achievement system
  • βœ… Save/load with compressed LocalStorage
  • βœ… PWA support (installable, offline-capable)
  • πŸ”„ Story chapters and endgame content

How This Was Built

This project was built using VybeCoder β€” an execution-verified AI software system that plans, generates, debugs, and verifies complete applications.

Unlike traditional AI coding assistants that generate snippets and leave you to debug, VybeCoder manages the entire lifecycle: architecture decisions, multi-file coordination, error detection, automated repair, and runtime verification.

What does that mean in practice?

  • Every file was planned, generated, and tested through VybeCoder's build pipeline
  • Errors were caught and fixed automatically β€” not manually
  • The final output was verified to run, not just compile

Want to build something like this? Start building with VybeCoder β€” no coding experience required.


License

This repository contains documentation and architecture references only. The source code is proprietary and not publicly available.

Β© 2024-2026 DevStudio AI Inc.. All rights reserved.

See LICENSE for details.