Yup! Here’s the prompt, so you can give it a try.
SummaryProject: Sengoku Nexus
A Modern Single-File Grand Strategy Game Inspired by Nobunaga’s Ambition
Nobunaga’s Ambition is a historic turn-based strategy series created by Koei.
- 1983: Original Japanese release on the PC-8801.
- 1986: English IBM PC release and Nobunaga’s Ambition: Zenkokuban.
- 1989: Nintendo Entertainment System (NES) release.
Players assume the role of a daimyo during Japan’s Sengoku (Warring States) period, balancing economics, agriculture, diplomacy, military expansion, and conquest to unify Japan.
Classic Gameplay
- Setting: Sengoku Japan
- Goal: Unify the country
- Management: Gold, rice, peasant loyalty, flood control, troop training
- Historical Scenarios: 1560, 1582, and similar starting years featuring different regional daimyos
TASK
Create a complete, playable grand strategy game as a single index.php file using only:
- PHP (document shell only)
- HTML5
- Bootstrap 5
- Vanilla JavaScript (ES6+)
- SVG
- HTML5 Canvas
Everything must exist inside one file, even if it becomes several thousand lines long.
SYSTEM DIRECTIVE
Project Codename
SENGOKU NEXUS
Generate a modern grand strategy game inspired by Nobunaga’s Ambition that introduces two major innovations:
- Officer-Driven Deckbuilding
- The Web of Grudges
The result should feel like:
Nobunaga’s Ambition × Crusader Kings × Slay the Spire
without copying any of them directly.
Technical Constraints
- Output exactly ONE code block containing the complete
index.php - Bootstrap 5 via CDN
- Vanilla JavaScript (ES6+ classes)
- HTML5 Canvas
- SVG for the province map
- Browser
localStoragesave/load - No React
- No Vue
- No Angular
- No jQuery
- No external image assets
Canvas graphics should use Unicode symbols such as:
- ♞ Cavalry
- ♙ Ashigaru
- ⛫ Castle
Shrine
Everything must be procedurally drawn.
Innovation A — Officer-Driven Deckbuilding
Instead of a static command menu:
Draft
Develop
Attack
Tax
actions come from Edict Cards.
Base Deck
Every daimyo begins with cards such as:
- Basic Tax
- Basic Draft
- Develop Markets
- Irrigation
- Rice Relief
- March
- Hold Council
Officer Cards
Hiring officers permanently expands the deck.
Examples:
Ninja Master
Adds:
- Assassinate
- Sabotage
- Night Raid
- Smoke Bomb
- Escape Route
Jesuit Missionary
Adds:
- Import Matchlocks
- Foreign Trade
- Mission School
- Volley Fire
Brilliant Engineer
Adds:
- Rapid Fortress
- Road Network
- Supply Train
- Peasant Genius
Seasonal Draw
Every season:
- Rebuild the dynamic deck
- Shuffle
- Draw 5 cards
- Gain 3–5 Command Seals
- Play cards until Command Seals are exhausted
Normally the player plays approximately:
- 3 cards
- occasionally 4
- rarely 5
depending on leadership and bonuses.
Living Deck
Officer cards exist only while that officer serves you.
If an officer:
- dies
- defects
- is imprisoned
their cards disappear from:
- Draw pile
- Hand
- Discard pile
- Future deck construction
immediately.
Innovation B — The Web of Grudges
Replace the traditional Loyalty stat.
Every officer tracks:
- Bond with Daimyo
- Grudge
- Stress
- Hidden Ambition
and maintains relationships with at least two other officers.
Examples:
- Sworn Brother
- Bitter Rival
- Secret Lover
- Mentor
- Student
- Family
- Political Ally
Relationship Consequences
Examples:
Battle
Ordering an officer to attack his sworn brother may cause:
- refusal
- hesitation
- mid-battle defection
Promotion
Promoting a low-born officer over proud samurai fills hidden Grudge meters.
Eventually those grudges create negative cards:
- Resentful Murmurs
- Treason
- Conspiracy
which pollute the player’s deck.
Screen Layout
Use Bootstrap with d-none to swap fullscreen views.
Screen 1 — Start Screen
#screen-start
- ASCII castle
SENGOKU NEXUS- New Game
- Continue
- Help
Screen 2 — Grand Strategy
#screen-map
Left (30%)
Player hand
Display five Edict Cards using Bootstrap cards.
Center (50%)
Interactive SVG map
- 10 provinces
- clickable polygons
- color coded by clan
Right (20%)
Information panel
Contains:
- Event log
- Warnings
- Relationship alerts
- Balance of power
Screen 3 — Tactical Battle
#screen-tactical
Fullscreen Canvas battle.
Draw everything procedurally.
Data Models
class Card
{
id
name
description
cost
effectFn()
}
class Officer
{
id
clanId
stats:
Leadership
Valor
Intelligence
Politics
cardsProvided
relationships
}
class Province
{
id
ownerId
wealth
yield
troops
unrest
fortification
floodControl
}
Game Loop
One turn equals one season.
1. Draw Phase
- rebuild deck
- shuffle
- draw five cards
2. Action Phase
Player:
- plays cards
- targets provinces
- targets officers
Updates the UI immediately.
3. AI Phase
Each AI clan chooses actions using weighted decision making.
Possible actions:
- Develop
- Draft
- Recruit
- Attack
- Diplomacy
4. Upkeep Phase
Autumn only.
Calculate:
- Rice harvest
- Flood control
- Army upkeep
If rice becomes negative:
- troops desert
- unrest rises
- loyalty falls
5. Event Phase
Evaluate:
- Relationships
- Grudges
- Rivalries
- Secret lovers
- Ambitions
If Grudge exceeds 80:
Trigger:
- rebellion
- assassination
- defection
- civil war
Combat
Playing a March card opens the tactical battle screen.
Canvas:
Draw units with Unicode.
Examples:
♞ Cavalry
♙ Ashigaru
⛫ Castle
Battle Flow
- Select commander
- Choose troop count
- Choose formation
- Play optional Tactic Card
- Auto-resolve one round
- Repeat for multiple rounds
Rock–Paper–Scissors foundation:
- Spear beats Cavalry
- Cavalry beats Volley
- Volley beats Spear
Modified by:
- Leadership
- Intelligence
- Terrain
- Weather
- Morale
- Officer relationships
- Tactic cards
Example tactic cards:
- Volley Fire
- False Retreat
- Furinkazan
- River Trap
- Night Raid
Implementation Order
Generate the code in this exact order:
- HTML/PHP shell
- Bootstrap + CSS
- DOM layout
- Constants
- Starting database
- Base cards
- 10 provinces
- 5 clans
- 15 historical officers
- ES6 classes
- Card
- Officer
- Province
- Clan
- GameEngine
- Save/Load
- UI renderer
- SVG map renderer
- Canvas battle renderer
- Initialization
window.onload = () => showStartScreen();