Un RPG écrit avec fxcgIO et fxcgTUI dans le style ASCII-art de la grande époque
Find a file
2026-03-18 21:34:07 +01:00
assets Map Viewer / Explorer for PC 2026-03-14 20:18:21 +01:00
assets-cg savegame/loadgame fetaure for v0.4 2026-02-22 20:22:42 +01:00
assets-fx initial public commit 2026-02-18 22:22:53 +01:00
docs Corrected some bugs 2026-03-15 20:18:22 +01:00
pc cleaning 2026-03-18 21:34:07 +01:00
pcmapcreator cleaning 2026-03-18 21:34:07 +01:00
src corrected a bug with the locked door in the castles 2026-03-17 21:47:50 +01:00
.gitignore cleaning 2026-03-18 21:34:07 +01:00
AUDIT.md split main.c in several files 2026-03-14 10:54:09 +01:00
build.sh initial public commit 2026-02-18 22:22:53 +01:00
cleanall.sh added cleaning script 2026-02-22 20:28:43 +01:00
CMakeLists.txt multiple small debugs and improvements 2026-03-16 21:09:30 +01:00
config.h added dynamic memory allocation + new difficulty levels 2026-02-20 22:10:23 +01:00
README.md Corrected some bugs 2026-03-15 20:18:22 +01:00
README_FR.md Corrected some bugs 2026-03-15 20:18:22 +01:00

fxcgRPG !!

ASCII-Art Roguelike RPG for Casio fx-CG50

fxcgRPG Title Screen

Overview

I wanted to write a game for the fx-CG50 in the grand tradition of old-school text-mode RPGs — the kind that ran on green-phosphor monitors in the early 1980s and made up for their lack of graphics with sheer depth of world and system. No bitmaps, no sprites, no fancy rendering. Just characters, colour, and a good world to explore.

fxcgRPG is an ASCII-art roguelike set in the procedurally generated realm of Caldoria. The display uses a custom RPG 5×7 pixel font giving a grid of 66 columns × 28 rows — every character is hand-crafted to look good at that resolution. The world is a 250×200 tile map with mountains, forests, deserts, rivers, villages, castles, harbours, and caves. It is different every time you start, but always feels like a coherent place.

The game includes four character classes, a full turn-based combat system, dungeon crawling, crafting, quests, sea travel between harbour ports, a village economy with merchants, a day/night cycle, multi-language support (EN/FR), a fog of war that gradually reveals the world as you explore, a rich in-game history with enigmas to uncover, and a persistent save system. It is by far the most complex thing I have built for a calculator, and I hope it shows.

fxcgRPG is based on:


Compatibility and Requirements

Model Supported
fx-CG50 ✔ Yes
fx-CG90 ✔ Yes
PC (Linux x86) ✔ Yes — via pc/ CMake build
fx-CG10 / 20 No

What fxcgRPG Contains

Character Creation

Before the world generates, the player creates their character. The creation screen shows a class ASCII-art panel on the right (6 lines × 16 chars) that updates live as you cycle through choices.

Field Choices
Gender Male / Female — changes the preset name list
Name 5 presets per gender, or type your own (up to 12 characters)
Class Warrior / Mage / Elf / Rogue
Difficulty Easy / Normal / Hard / For Kids / Peaceful
World Type Continental (~40 harbours) / Archipelago (~75 harbours)

Player Classes:

Class HP MP ATK DEF Playstyle
Warrior 30 5 6 4 Melee tank — high HP and DEF
Mage 15 20 3 1 Magic user — high MP, very fragile
Elf 22 15 5 2 Balanced ranger — all-rounder
Rogue 18 8 7 1 High ATK — strikes hard and fast

XP needed for the next level starts at 50 and multiplies by ×1.5 each level. A level-up fully restores HP and MP.

Character creation screen

The World of Caldoria

The world is a 250 × 200 tile grid generated once per game with a fixed seed. The viewport shows 43 × 28 tiles centred on the player. Fog of war covers the world at start; a Euclidean radius-7 circle of tiles is revealed around the player after every step.

Caldoria has a 850-year history. Six Archelders once governed the realm from Ashenfell Keep through the Elder Compact. Their betrayer — Archelden Malachar — shattered the Accord Stone on the Night of Shattered Stars (Year 350 AC) and became the Dark Lord. Three kingdoms rose from the ashes: Ironhold (northwest), Verdania (northeast), and Sandhaven (south). Uniting them is the only way to challenge Ashenfell.

World Biomes:

Biome Symbol Walkable Random Encounter % Notes
Deep Ocean ~ No 0% Impassable
Coast . Yes 8% Crabs, Pirates
Plains . Yes 12% Starting area
Forest ! Yes 18% Wolves, Spiders, Bandits
Dense Forest T Yes 25% Bears, Trolls — highest rate
Hills n Yes 15% Skeletons, Ogres; cave access
Mountain ^ Yes 10% Wyverns, Giants; cave access
Desert , Yes 12% Scorpions, Mummies
Village H Yes 0% Enter with EXE
Castle C Yes 0% Enter with EXE
Harbour P Yes 0% Open port compass
Cave > Yes 0% Walk onto to enter
Bootcamp M Yes 0% Restores energy & hydration

Encounter rolls happen every 4 steps and are scaled by the chosen difficulty.

World map — Continental

Dungeons and Castles

Caves are procedurally generated dungeon maps (BSP room layout). Inside, encounters are more frequent (20% per step) and rewards are greater. Caves go two levels deep; > stairs lead to a harder second floor with scaled enemies and more treasure.

Castle interiors are procedurally generated (80 × 48 tiles) with three floors, each seeded from the castle's world position (consistent between visits). Fog of war is active inside castles.

Floor Name Contents
0 Entry Level Entry Hall, Guard Barracks, Armory (locked), Chapel,
Store Room, Great Hall (> stairs); optional labyrinth
spurs (50%) and secret passages (20%)
1 Throne Level Prison Wing (24 variable cells), Treasure Vault (locked),
Throne Room (ruler NPC + elite guards), optional Library
(33%); > stairs in Prison Wing
2 Catacombs 7 Crypts, vertical spine with 2 locked doors, 2 hidden
keys, optional secret bypasses (25% each)

Each locked door requires a key found somewhere on the same floor.

Cave level

Combat

Turn-based combat triggered by walking onto an enemy or by a random encounter. A 10-char HP bar for the enemy is shown alongside a 5-line ASCII-art portrait unique to each enemy type.

  • Attack --- deals ATK enemy DEF damage (minimum 1)
  • Magic --- costs MP; deals damage based on player level and class spell
  • Skill --- class-specific skill (Berserk, Fireball, Arrow x2, Backstab)
  • Item --- use a healing potion or buff item from inventory
  • Run --- 50% chance to escape (reduced on Hard difficulty)

Defeating enemies grants XP and gold. When fighting The Dark Lord with all three kingdoms unified, a one-time VORETHAL effect deals +25 bonus damage on the first attack — but only if the player has assembled all three pieces of Oma's Prophecy.

Combat screen

NPCs and Villages

Each village interior contains a selection of NPCs. Walk onto an NPC tile to interact.

NPC Type Service
Merchant Buy consumables (potions, food, water)
Tavern Rest for gold (restore HP/EN/HY to max)
Forgemaster Upgrade ATK (+2 for 30 g) or DEF (+2 for 20 g)
Elder Lore keeper and main quest giver
Herbalist Brew Herbal Tea from herbs for a fee
Bard Tells the tale of the Night of Shattered Stars
Priest Blesses the player (HP/MP restore) for gold
Guard Warns intruders; patrols castle corridors
King / Queen / Caliph Castle throne NPC — quest progression, Prophecy fragments

World map NPCs also wander the overworld:

Type Encounter
Hermit Gives lore hints about the Dark Lord's nature
Trader Greets the player
Scout Reveals a 15-tile fog-of-war radius around them
Bard Shares the tale of Malachar and the Void
Refugee Fled Ashenfell; hints that names have power

Notice boards (N tiles in villages) display 8 locally-seeded rumours mixing gameplay tips with lore fragments from Caldoria's history — read carefully for enigma clues.

The Enigmas

Three mysteries are woven into the world for players who explore deeply.

  1. The Prophecy in Three Parts — Defeat each regional boss and return to the ruling monarch. Each reveals their kingdom's fragment of Elder Oma's prophecy: "When iron, wood and sand bind as one, the Void shall crack. No crowned head shall speak the word. Vorethal."

  2. VORETHAL — the Binding Word — Assembled from the three prophecy fragments, this is Malachar's binding word. Unify all three kingdoms to unlock an alternate Dark Lord dialogue and a +25 HP combat bonus on the first attack.

  3. The Accord Stone Shards — Notice boards hint that each kingdom unknowingly holds a shard of the shattered Accord Stone. Their reunification partially restores the Accord's binding power, weakening the Void Nexus that sustains the Dark Lord.

Full world lore is in docs/lore.md.

Quests

The quest system tracks active and completed quests in a scrollable Quest Log (press Q).

Main quest chain (12 steps):

  1. Find a village Elder
  2. Reach each of the three kingdom castles (Ironhold, Verdania, Sandhaven)
  3. Defeat each regional boss in the ! boss cave
  4. Return to each ruler to earn their pledge
  5. Find Ashenfell (revealed at the world centre when all three kingdoms are unified)
  6. Defeat the Dark Lord

Side quests are given by Elders and Kings and cycle through kill, fetch, and explore variants. Completing a side quest awards gold and XP, then a new one is immediately offered.

Crafting and Inventory

The player carries up to 8 item slots. Items include potions, weapons, armour, food, water, and crafting materials. The crafting screen shows a 3-line ASCII-art icon for each craftable item next to the ingredient list.

  • Food and Water --- the survival system drains energy and hydration each step; starvation deals HP damage
  • Hunting --- animals on walkable tiles can be hunted for meat
  • Fishing --- harbour and coast tiles allow fishing for food

Crafting screen

Sea Travel

Harbour ports (P) appear on coastlines. Walking onto a port tile opens the port compass overlay showing the nearest port in each of the eight compass directions. Select a direction to sail there instantly for a gold fee proportional to the distance.


Controls

World exploration:

  • [Arrow keys] : move one tile in a direction
  • [EXE / Enter] : enter village or castle
  • [I] : toggle inventory / message log panel
  • [18] : quick-use inventory slot
  • [C] : open crafting menu (world map only)
  • [S] : save game (opens file dialog)
  • [Q] : quicksave to last used file
  • [H] : multi-page help screen
  • [ESC] : quit to main menu (with save prompt)

Character creation:

  • [LEFT / RIGHT] : cycle field values
  • [UP / DOWN] : move between fields
  • [EXE] or [SPACE] : confirm and start the game

Combat:

  • [A] : Attack
  • [M] : Cast magic (costs 3 MP)
  • [S] : Use class skill (Berserk / Fireball / Arrow x2 / Backstab)
  • [I] : Use an item from inventory
  • [R] : Attempt to run away

Build & Install

Calculator Build

cd fxcgRPG
fxsdk build-cg -B
# Transfer fxcgrpg.g3a to your calculator

PC Build

# Prerequisites: libfxcgio-pc.a and libfxcgtui-pc.a already built
cd fxcgRPG/pc && mkdir build && cd build
cmake .. && make
./fxcgrpg

TODO List

Short-Term (High Priority)

  • Procedural world generation (250×200 or 600×600 depending on memory)
  • Fog of war (world, caves, and castle interiors)
  • Four character classes with ASCII-art portraits
  • Turn-based combat with ASCII-art enemy portraits
  • Dungeon crawling (procedural BSP layout, two levels deep)
  • Castle interiors (3-floor procedural, locked doors, keys, crypts)
  • Village interiors and NPC interactions
  • Merchant, Tavern, Forgemaster, Elder, King NPCs
  • Herbalist, Bard, Priest, Guard NPCs
  • World map wandering NPCs (Hermit, Trader, Scout, Bard, Refugee)
  • Quest system (main 12-step chain + side: kill/fetch/explore)
  • Inventory (8 slots, 3-line item ASCII art in crafting)
  • Crafting system
  • Survival system (energy, hydration)
  • Hunting and fishing
  • Sea travel via port compass
  • Save / load (SAVE_VERSION 9, language + fog included)
  • PC build
  • Enemy AI: biome confinement + charge/flee behaviour
  • Day/night cycle with timeline bar
  • Bootcamps (safe rest stops, fog pre-revealed)
  • Multi-language support (EN / FR)
  • Player coordinates display
  • World lore: Caldoria history, 6 Archelders, Night of Shattered Stars
  • Enigma system: Prophecy in 3 parts, VORETHAL combat bonus
  • Expanded dungeon content (locked doors, keys, 3-floor castles)
  • Magic spell system (distinct spells per class)
  • Equipment stats visible on character screen
  • Multiple save slots

Long-Term (Possible Future Work)

  • Boss encounters with unique multi-phase combat
  • Merchant price variation between villages
  • More quest types (escort, timed, multi-stage)
  • Factions and reputation system
  • Random world events (storms, festivals, invasions)

Version History

Version 0.1

  • World map generation (biome tiles, villages, castles, harbours)
  • Player movement and collision
  • Basic encounter system
  • Placeholder combat (attack only)
  • Single NPC type (Merchant)

Version 0.2

  • Full turn-based combat (attack, magic, item, run)
  • Dungeon generation and entry / exit
  • Inventory system (20 slots)
  • Tavern and Forgemaster NPCs
  • XP / level-up system

Version 0.3

  • Character creation screen (gender, name, class, difficulty, world type)
  • Quest system (Elder / King quest givers)
  • Crafting system with material tracking
  • Survival system (energy, hydration)
  • Hunting and fishing
  • Save / load system

Version 0.4

  • Sea travel via port compass
  • Castle interiors and King NPC
  • ASCII-art portraits for classes (chargen), enemies (combat), items (crafting)
  • Inventory highlighting with item art in the inventory screen
  • Archipelago world type

Version 0.5

  • Fog of war (world and dungeon, bitfield, radius-7 Euclidean reveal)
  • Custom name entry in character creation
  • Save version bumped to 5 (fog state included in save file)
  • PC build via pc/CMakeLists.txt
  • Screen-dependent layout constants moved to render_init()

Version 0.6

  • Enemy AI: biome confinement (enemies never cross biome boundaries)
  • Enemy AI: charge behaviour (speed-3 enemies always move); flee when HP < 25%
  • Combat: item selection menu (choose which slot to use)
  • Quest log: full-screen scrollable screen (Q key on world map)
  • Village names: procedurally generated from syllable table per world coordinate
  • Village themes: Forest Hamlet, Mining Camp, Trading Post (biome-based colours)
  • Notice board (N tile in villages): 8 rumour lines seeded per village
  • Castle bounty board: King offers bounties after kingdom unification
  • Side quests: fetch quests (collect N items) and explore quests (reach coordinates)
  • Two-level caves: > inside a cave leads to a deeper level with scaled enemies
  • Victory screen: ASCII art crown, hero stats, kingdoms unified
  • Day/night cycle: 400-step period; Dawn 1525%, Day 2575%, Dusk 7585%, Night
  • Day/night timeline bar at top of map viewport (coloured markers at key transitions)

Version 0.7

  • Bootcamps (M, orange): placed in forests and hills; restore energy & hydration on visit; fog of war pre-revealed in radius 7 around each camp
  • Fog of war refinement: villages and non-cave dungeons fully auto-revealed on entry; caves keep active fog (radius 7 PC / radius 5 calculator); world map radius 10 PC / radius 7 calculator
  • Multi-language support: English and French; selectable in Options menu at startup
  • All in-game strings translated (menus, dialogs, combat, quests, NPCs, help pages)
  • Player coordinates displayed centred at the bottom of the map viewport (grey)
  • Screen cleared on exit (no terminal artefacts on PC build)
  • Save version bumped to 9 (language preference, struct changes)
  • Bug fix: phantom STR_LORE_L12 enum entry removed (caused 1-slot shift in all string-table indices from STR_LORE_TAGLINE onward in French mode)

Version 0.8

  • Castle interior overhaul: 3-floor procedural system (80 × 48 tiles per floor)
    • Floor 0 (Entry Level): Guard Barracks, Armory (locked gate + key), Chapel (shrine), Store Room, Great Hall (> stairs); optional second labyrinth spur (50%) and optional secret passages (20%)
    • Floor 1 (Throne Level): Prison Wing (24 variable cells), Treasure Vault (locked + elite guard), Throne Room (ruler NPC + 4 elite guards + 2 chests), optional Library (33%); > stairs lead down
    • Floor 2 (Catacombs): 7 crypts, vertical spine, 2 locked doors, 2 hidden keys, optional secret bypasses (25% each); Sanctum boss room
    • Fog of war now active inside castles (was previously auto-revealed)
    • Dungeon limits raised: DUNG_MAX_ROOMS 32, DUNG_MAX_ENE 40
  • World lore — the Realm of Caldoria
    • Full history: Age of the Compact (Year 0350 AC), Night of Shattered Stars, the six Archelders (Valdris, Selenne, Kharim, Lyren, Oma, Malachar), Thornwall Conflict, Silk Road Wars, Oma's Prophecy
    • Lore integrated into all NPC dialogue: Elders, Kings, Bard, Hermit, Refugee
    • Notice board rumours rewritten with Caldoria history fragments
    • Lore screen (main menu) updated with Compact history
  • Enigma system
    • Each king's boss-slain dialogue reveals their Prophecy fragment
    • All three fragments assembled → VORETHAL (Malachar's binding word) revealed
    • Dark Lord dialogue changes if player has unified all 3 kingdoms ("You know my name!")
    • VORETHAL combat bonus: +25 HP first-attack damage when all kingdoms unified
  • New village NPC types: Herbalist (herb → Herbal Tea brewing), Bard (Night of Stars lore), Priest (HP/MP blessing for gold), Guard (castle patrol dialogue)
  • World map wandering NPCs: Hermit (Dark Lord origin hint), Trader, Scout (reveals fog radius 15), Bard (Malachar lore), Refugee (escaped Ashenfell; name-power hint)
  • New documentation file: docs/lore.md — full Caldoria lore Bible with Archelden bios, history timeline, enigma walkthroughs, and glossary

Documentation

Full documentation is available in the docs/ directory:


Disclaimer

This software is a Work in Progress and is provided "as is", without warranty of any kind. Save files may become incompatible between versions when the save format changes. Always note your current SAVE_VERSION before updating the game.

Please:

  • Back up your save file before installing a new version
  • Report crashes with the exact sequence of actions that triggered them
  • Do not attempt to run the calculator build on unsupported models

The author cannot be held responsible for any lost progress or save file corruption.


Credits

Thanks to Lephenixnoir for gint, fxSDK, and for keeping the Planète Casio SDK ecosystem alive and growing.

Thanks to the Planète Casio community — the game would not exist without years of shared knowledge from that forum.