Sure! Hereβs the README translated into English:
This project is an open-source medieval fantasy city generator based on the original Medieval Fantasy City Generator (also available here). This version has been updated to be compatible with the latest versions of the Lime and OpenFL libraries.
This is the very old version 8 years old fixed and improved.
To install and run this medieval city generator, you will need:
-
Haxe (version 4.2.0 or higher)
- Download Haxe from the official website
- Make sure it is added to your PATH after installation
-
Haxelib (comes with Haxe)
-
Git (optional, for cloning the repository)
# Using Git
git clone https://github.com/kroryan/TownGeneratorOS.git
cd TownGeneratorOS
# Or download the ZIP manually and extract itOpen a terminal (PowerShell or Command Prompt on Windows) and run:
# Install Lime
haxelib install lime 8.0.0
haxelib run lime setup
# Install OpenFL
haxelib install openfl 9.2.0
haxelib run openfl setup
# Install msignal
haxelib install msignal 1.2.5To check that everything is correctly installed:
haxelib listYou should see the installed libraries with their versions:
- lime: [8.0.0]
- openfl: [9.2.0]
- msignal: [1.2.5]
For HTML5 (web browser)(This way you can use it with azgaar i have an azgaar repository with a branch call TOTALOCAL you can use that one, it is ready):
haxelib run openfl test html5This will compile the project and open it in your default browser, usually at http://localhost:3000.
haxelib run openfl test nekohaxelib run openfl test windowsThe following changes were implemented to solve compatibility problems with the current versions of Lime and OpenFL:
Library versions in project.xml were updated:
- Lime updated to version 8.0.0 (previously 7.8.0)
- OpenFL updated to version 9.2.0 (previously 9.0.2)
Main errors fixed were related to data type incompatibilities:
lime.utils.Float32Array,lime.utils.Int32Array, andlime.utils.UInt32Arrayshould now belime.utils.DataPointerin certain contextsopenfl.utils.ByteArrayshould belime.utils.Bytesorlime.utils.BytePointerdepending on context- Deprecated references to
lime.math.ColorMatrixandlime.math.Matrix4now uselime.utils.ArrayBufferView
Most warnings (that did not prevent compilation) were related to obsolete syntax:
@:enum abstractis deprecated and should be replaced withenum abstract@:externis deprecated and should be replaced withextern
Although these warnings appear in library code, not project code, they do not affect functionality.
Types in the WebGL/OpenGL APIs were fixed to be compatible with new versions:
- Adjustments in
WebGL2RenderContextandNativeOpenGLRenderContextto use correct types in function arguments
-
Main Interface: When running the application, you will see an interface where you can select parameters for your city.
-
City Generation:
- Select the city size
- Click generate to create a new random city
-
Exploration:
- Zoom using the mouse wheel
- Drag to move around the map
- The interface includes buttons to generate new cities or modify parameters
If you encounter errors during Lime or OpenFL installation, try:
haxelib run lime setup -y
haxelib run openfl setup -yIf you encounter type-related errors, verify you are using the correct versions of Lime (8.0.0) and OpenFL (9.2.0) as specified in this README.
If the app compiles but crashes when running, it may be due to:
- Missing resources in the
Assetsfolder - Browser incompatibility (try Chrome if using HTML5)
- WebGL configuration issues on your system
In addition to the web version, this project now includes a complete desktop application built with Electron that serves as both a standalone desktop app and a local web server.
- Standalone Desktop App: Native window with proper menus and icons
- Local Web Server: Automatically starts a web server on port 3000
- Beautiful Loading Screen: Medieval-themed loading interface with progress indicators
- Auto-reload System: Intelligent reloading at 5s and 12s to ensure proper initialization
- Cross-Platform: Available for Windows and Linux
- No Internet Required: Works completely offline
-
Node.js (version 16 or higher)
- Download Node.js
- Verify installation:
node --version
-
NPM (comes with Node.js)
- Verify installation:
npm --version
- Verify installation:
# Navigate to the electron app directory
cd electron-app
# Install dependencies
npm install
# Build the web application
npm run build-web
# Run in development mode
npm run dev
# OR run in production mode
npm startThe desktop application includes an automated web build system that compiles the Haxe/OpenFL project and copies it to the electron app directory.
From the electron-app directory:
cd electron-app
# Build web application (recommended method)
npm run build-web
# OR run the script directly
node build-web.jsFrom the project root directory:
# Build web application from root
cd electron-app && npm run build-web && cd ..
# OR combine with Haxe build
haxelib run openfl build html5 && cd electron-app && npm run build-web && cd ..- Compiles Haxe Project: Runs
haxelib run openfl build html5 - Locates Build Output: Finds the compiled files in
Export/html5/bin/ - Copies Files: Copies all web files to
electron-app/web-build/ - Verifies Build: Ensures
index.htmlandTownGenerator.jsare present - Reports Status: Shows success/failure with file paths
If you prefer to build manually:
# 1. Build the Haxe project first
haxelib run openfl build html5
# 2. Copy files manually
cd electron-app
Remove-Item -Path "web-build" -Recurse -Force -ErrorAction SilentlyContinue
Copy-Item -Path "..\Export\html5\bin" -Destination "web-build" -Recurse
# 3. Verify the build
if (Test-Path "web-build\index.html") {
Write-Host "Web build completed successfully"
} else {
Write-Host "Web build failed"
}Common Issues:
# If build fails, clean and retry
cd electron-app
Remove-Item -Path "web-build" -Recurse -Force -ErrorAction SilentlyContinue
cd ..
haxelib run openfl clean html5
haxelib run openfl build html5
cd electron-app
npm run build-webBuild Script Errors:
- Ensure you're in the correct directory (
electron-app/) - Verify the parent directory contains the OpenFL project
- Check that
Export/html5/bin/exists after Haxe compilation - Make sure Node.js has file system permissions
cd electron-app
# Build web application first
npm run build-web
# Compile for Windows (creates installer and portable versions)
npm run build-winThis creates:
- NSIS Installer:
dist/Medieval-Fantasy-City-Generator Setup 1.0.0.exe - Portable Version:
dist/Medieval-City-Generator-Portable-1.0.0.exe
cd electron-app
# Build web application first
npm run build-web
# Compile for Linux
npm run build-linuxThis creates:
- AppImage:
dist/Medieval-Fantasy-City-Generator-1.0.0.AppImage - DEB Package:
dist/medieval-fantasy-city-generator_1.0.0_amd64.deb
cd electron-app
# Build web application first
npm run build-web
# Compile for all platforms
npm run build-allcd electron-app
npm run dev- Opens with developer tools enabled
- Automatic console logging
- Hot reload capabilities
cd electron-app
npm start- Optimized performance
- No developer tools
- Clean user interface
After compilation, you can run the generated executables:
Windows:
- Double-click the
.exeinstaller to install the application - Or run the portable version directly without installation
Linux:
- Make the AppImage executable:
chmod +x Medieval-Fantasy-City-Generator-1.0.0.AppImage - Run it:
./Medieval-Fantasy-City-Generator-1.0.0.AppImage - Or install the DEB package:
sudo dpkg -i medieval-fantasy-city-generator_1.0.0_amd64.deb
The desktop app features a beautiful loading screen with:
- Medieval-themed design with castle icon π°
- Progressive loading bar (15-second animation)
- Status messages that update every 2.5 seconds
- Automatic reloads at 5s and 12s for optimal initialization
- Smooth transitions and fade effects
-
File Menu:
- Open in Browser (Ctrl+B) - Opens the web version in your default browser
- Exit (Ctrl+Q) - Close the application
-
View Menu:
- Reload (Ctrl+R) - Refresh the application
- Force Reload (Ctrl+Shift+R) - Hard refresh ignoring cache
- Developer Tools (Ctrl+Shift+I) - Open debugging tools
- Zoom controls and fullscreen toggle
-
Help Menu:
- About - Application information
- Server Information - Details about the local web server
-
Generation menu: in the right at botton to avoid the menu in the half of the city image in azgaar

The desktop application automatically starts a local web server that:
- Runs on
http://localhost:3000(or next available port) - Serves the complete web application
- Can be accessed from any browser on the same computer
- Provides API endpoint at
/api/infofor status checking
You can use the desktop application as a local web server:
- Start the desktop application
- Access from any browser at
http://localhost:3000 - Share with others on the same network (if firewall allows)
This is perfect for:
- Running the generator on a local network
- Integration with other web applications
- Development and testing purposes
- Using with Azgaar's Fantasy Map Generator (TOTALOCAL branch)
Permission Errors (Windows):
# Run PowerShell as Administrator if you get permission errors
# Or disable Windows Defender temporarily during compilationMissing Dependencies:
# Reinstall dependencies
cd electron-app
Remove-Item -Path "node_modules" -Recurse -Force
npm installBuild Failures:
# Clean build directory
cd electron-app
Remove-Item -Path "dist" -Recurse -Force
npm run build-web
npm run build-winWeb Build Issues:
# Ensure OpenFL project is properly built first
cd ..
haxelib run openfl build html5
cd electron-app
npm run build-web- Windows: Requires Windows 7 or higher for building Windows targets
- Linux: Can build Linux targets on any platform with Node.js
- Disk Space: Allow at least 500MB for dependencies and build outputs
- Internet: Required for initial dependency download only
electron-app/
βββ main.js # Main Electron process
βββ package.json # Dependencies and build configuration
βββ build-web.js # Web build automation script
βββ assets/ # Application icons and resources
βββ web-build/ # Compiled web application (auto-generated)
βββ dist/ # Compiled executables (auto-generated)
- main.js: Main Electron application with Express server
- package.json: Build configuration for electron-builder
- build-web.js: Automated script to compile Haxe/OpenFL project
- assets/: Icons in multiple formats (SVG, PNG, ICO)
- Web Build: Compiles Haxe/OpenFL project to HTML5
- Copy: Copies web build to
electron-app/web-build/ - Package: electron-builder packages the app with web content
- Distribute: Creates installers and portable versions
-
Errors like
lime.utils.X should be lime.utils.DataPointerrelate to Lime API changes where specific typed arrays must now be treated as generic data pointers. -
Warnings about
@:enum abstractand@:externare syntax changes in Haxe that do not affect functionality but indicate libraries use deprecated syntax. -
The default port for HTML5 mode is 3000 but may change if that port is busy.
- License: See LICENSE file
- Version: 1.0.0
- Original Author: Oleg Dolya (Watabou)
- Compatibility Update: May 19, 2025
- Desktop Application: June 6, 2025
- Platforms: Web (HTML5), Desktop (Windows, Linux), Neko, Windows Native
This city generator works perfectly with Azgaar's Fantasy Map Generator. You can:
- Generate a region map in Azgaar's tool
- Mark city locations on your map
- Use this generator to create detailed city layouts for each marked location
- Export both for use in tabletop RPGs or world-building projects
For the best integration experience, use the TOTALOCAL branch of Azgaar's tool which includes enhanced local connectivity features.
Perfect for:
- D&D Campaign Preparation: Generate cities for your adventures
- Pathfinder: Create detailed urban environments
- World Building: Design consistent medieval fantasy settings
- Virtual Tabletops: Export city images for Roll20, Foundry VTT, etc.