一个面向游戏机黑客的火车模拟器游戏
A train simulator game for console hackers

原始链接: https://github.com/antoniovazquezaraujo/LeTrain

LeTrain 是一个程序化火车模拟器,结合经典 ASCII 美学与现代 LibGDX 驱动的 3D 引擎。玩家在无限的 Perlin 生成世界中建造并管理铁路网络,在生产者与消费者之间运输货物,并从零资本起步。2026 更新增加了 3D 探索、语义站点颜色、动态山脉透明度,并保留经典 2D 终端。编辑工具包括录制模式、撤销/重做、以 .ltr 文本导入/导出场景、内置编辑器、实验快照和无头验证器。经济系统具有基于距离的定价、建设成本和可通过 letrain.cfg 配置的游戏玩法。使用 Java 17 和 Maven 构建,输出 3D、2D 和验证器启动器。开发由人类主导,AI 辅助编码,欢迎贡献。Snap 构建在 WSL2 或远程桌面上可能有音频或图形问题,建议使用源码构建或原生启动器。

``` Hacker News 新 | 过去 | 评论 | 提问 | 展示 | 工作 | 提交 登录 一个为控制台黑客设计的火车模拟器游戏 ( github.com/antoniovazquezaraujo ) 4 分 由 avaraujo 1小时前 | 隐藏 | 过去 | 收藏 | 讨论 帮助 考虑申请 YC 的 Winter 2027 批次! 申请 开放至 11 月 2 日. 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索: ```
相关文章

原文

🌐 English | Español

Build Status GitHub release License Java 17+

      __       ______           _
     / /   ___/_  __/________ _(_)___
    / /   / _ \/ / / ___/ __ `/ / __ \
   / /___/  __/ / / /  / /_/ / / / / /
  /_____/\___/_/ /_/   \__,_/_/_/ /_/
       The Letter Train Simulator           
   (C) 2006-2026 Antonio Vazquez Araujo 

Download Latest Release Available on Itch.io Get it on Snap Store

Read the Manifesto Read the Documentation

The LeTrain cover screen

LeTrain is a procedural train simulator that blends classic ASCII aesthetics with a modern 3D engine. Build vast rail networks across an infinite world, manage a complex economy, and master the art of logistical efficiency.

📜 Read the LeTrain Manifesto & Philosophy (Leer en Español)
"A game for engineer-children and child-engineers: no toys that play by themselves, honest trains, and pure keyboard flow."


🌟 New in 2026: The 3D Evolution

LeTrain has evolved! While maintaining its terminal roots, it now features a high-performance 3D engine powered by LibGDX:

  • Modern Perspective: Explore your rail empire in full 3D with smooth orbiting cameras.
  • Classic Soul: Industrial zones and trains retain their iconic character-based charm, now rendered as physical 3D objects.
  • Visual Polish: Dynamic transparency for mountains, semantic color-coded stations, and high-resolution typography.

The same world in the classic 2D terminal The 3D world by day: a letter train spelling 'letrainisverycool' The 3D world at night, lit by locomotive headlights

Classic 2D terminal · 3D by day · 3D by night

🎬 Record, Undo & Scenarios

The editing workflow is now first-class — in both the 2D and 3D clients:

  • Record/edit mode (R): freeze the world, build instantly, and journal every edit.
  • Undo / redo: u and Ctrl+R (or undo; / redo;), for construction and state changes (forks, semaphores, signals).
  • Scenarios (.ltr): export your whole network as a small text recipe and import anyone else's. The same seed rebuilds the same world, so a scenario travels as plain text. Validate one headlessly with the bundled letrain-check.
  • Built-in editor (p): a tabbed Scenario / Programming / Config editor with a per-tab quick reference and error navigation.
  • Experiment mode (X): snapshot the live world, try anything, then restore it.

The LeTrain editor with the Programming tab selected

💰 Deep Economy & Industry

The game now features a fully integrated financial system:

  • Capital Management: Start with $0 (Zero-to-Hero challenge) and grow your wealth.
  • Logistics Engine: Transport specialized cargo (GOLD, COAL, RUBY) from Producers to Consumers.
  • Smart Pricing: Revenue scales with travel distance. Every meter counts!
  • Construction Costs: Balancing infrastructure expansion vs. operational fuel costs.
  • Configurable Gameplay: Fine-tune the entire game via the letrain.cfg file (it ships next to the launchers).

🌍 Infinite Procedural World

  • Entropy Booster: Every new game starts at a unique, randomized coordinate (±10k to ±100k units) to ensure fresh exploration every time.
  • Procedural Landscapes: Navigate through lakes, forests, and towering mountains generated by custom Perlin noise.
  • Frustum Culling: Optimized rendering engine handles massive maps by only processing what you see.

The Settings dialog, Terrain tab: seed, water and mountain sliders with a map preview


  • Java JDK 17 or higher.
  • Maven.

The build system is fully automated. Simply run:

mvn clean package -DskipTests

This generates three standalone distributions in output/:

  • output/LeTrain — the modern 3D experience.
  • output/LeTrain2D — the classic, high-speed ASCII terminal view.
  • output/letrain-check — the headless scenario (.ltr) validator.

A default letrain.cfg ships next to each launcher, so you can tweak the game without touching the code.

  • LeTrain (or .exe / .sh): Launches directly into 3D mode.
  • LeTrain2D (or .exe / .sh): For those who prefer the classic terminal view.
  • letrain-check <file.ltr>: Validates a scenario file and prints file:line:col diagnostics.

  • Core: Java 17
  • 3D Engine: LibGDX (OpenGL)
  • Terminal UI: Lanterna
  • Scripting: Custom ANTLR4-based rail automation language.
  • Audio: Granular synthesis engine for realistic locomotive sounds.

🧑‍💻 How LeTrain is built

LeTrain has been designed by Antonio Vázquez Araújo since 2006, when generative AI did not exist — first as a C++ ASCII experiment, later as Java. Every design decision, mechanic and direction is his, and until March 2026 he wrote every line of the code himself.

Since then, the project is developed with a team of AI agents (OpenCode) working under his direction: he designs, decides and reviews; the agents write, test and refactor at his instruction — the same way a compiler or a linter helps to think at a higher level. This is human-authored, AI-assisted software, not AI-generated: the goals, the architecture and the judgement are human, and every change goes through the full test suite and CI and is validated by the maintainer before merge.

The team's definitions and working rules live in the repository (AGENTS.md, .opencode/agents/), and the whole development is public in issues and pull requests.

Contributions are welcome! Bug reports, feature ideas, docs and code are all appreciated.

  • 📜 Start by reading our Design Philosophy & Manifesto to understand the core soul, the 2D/3D symmetry, and the non-negotiables of LeTrain.
  • Read CONTRIBUTING.md for the build/test and PR workflow.
  • Open an issue for a bug or a feature request.
  • For code, branch from develop (feature/... / fix/...), keep the PR focused, and make sure mvn clean test passes.

Created by Antonio Vazquez Araujo.
Twitter/X - @avaraujo | GitHub

Snap Package Limitations (WSL2 & Remote Desktop)

Because the Snap package uses strict sandboxing and bundles its own graphics/audio libraries, it may not function correctly in virtualized or remote environments:

  • Windows Subsystem for Linux (WSL2 / WSLg): The Snap version will run without audio. This is due to a known AppArmor sandbox restriction that prevents the Snap from accessing Microsoft's non-standard PulseAudio socket (/mnt/wslg/PulseServer).
  • Remote Desktop (XRDP / VNC):
    • The 3D version will crash on startup with OpenGL errors (Failed to create context: BadValue, swrast fallback failures). Snap's bundled Mesa graphics drivers conflict with the virtual X11 display created by XRDP.
    • The 2D version will not stream audio over the network. ALSA directly accesses the host's physical sound card instead of routing through XRDP's virtual PulseAudio sinks.

Solution: If you are playing over a Remote Desktop connection on Linux, compile the game from source or use the .sh launcher from the Linux .zip release, which perfectly adapts to the host's XRDP drivers. If you are playing on Windows, download the native LeTrain-Windows.zip from the Releases page for perfect 3D acceleration and sound.

联系我们 contact @ memedata.com