Go to file
John McCardle c1e02070f4 feat(tcod): complete Dijkstra pathfinding implementation with critical PyArg fix
- Add complete Dijkstra pathfinding to UIGrid class
  - compute_dijkstra(), get_dijkstra_distance(), get_dijkstra_path()
  - Full TCODMap and TCODDijkstra integration
  - Proper memory management in constructors/destructors

- Create mcrfpy.libtcod submodule with Python bindings
  - dijkstra_compute(), dijkstra_get_distance(), dijkstra_get_path()
  - line() function for drawing corridors
  - Foundation for future FOV and pathfinding algorithms

- Fix critical PyArg bug in UIGridPoint color setter
  - PyObject_to_sfColor() now handles both Color objects and tuples
  - Prevents "SystemError: new style getargs format but argument is not a tuple"
  - Proper error handling and exception propagation

- Add comprehensive test suite
  - test_dijkstra_simple.py validates all pathfinding operations
  - dijkstra_test.py for headless testing with screenshots
  - dijkstra_interactive.py for full user interaction demos

- Consolidate and clean up test files
  - Removed 6 duplicate/broken demo attempts
  - Two clean versions: headless test + interactive demo

Part of TCOD integration sprint for RoguelikeDev Tutorial Event.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-09 12:10:48 -04:00
.archive feat(Grid): add customizable background_color property (#50) 2025-07-06 15:58:17 -04:00
assets Whoops, never commited the UI icons spritesheet 2025-03-08 20:33:55 -05:00
deps/platform Windows build 2024-02-25 15:38:38 -05:00
docs feat(docs): complete API documentation with zero missing methods 2025-07-08 11:55:19 -04:00
modules Refactor: Python 3.12, build libtcod & SFML from source. Cmake build. Directory cleanup 2024-02-24 22:48:39 -05:00
roguelike_tutorial/rogueliketutorials.com feat(docs): complete API documentation with zero missing methods 2025-07-08 11:55:19 -04:00
src docs: add comprehensive parameter documentation to all API methods (#86) 2025-07-08 09:51:51 -04:00
stubs feat: generate comprehensive .pyi type stubs for IDE support (#108) 2025-07-08 09:59:19 -04:00
tests feat(tcod): complete Dijkstra pathfinding implementation with critical PyArg fix 2025-07-09 12:10:48 -04:00
.gitignore feat(tcod): complete Dijkstra pathfinding implementation with critical PyArg fix 2025-07-09 12:10:48 -04:00
.gitmodules Refactor: Python 3.12, build libtcod & SFML from source. Cmake build. Directory cleanup 2024-02-24 22:48:39 -05:00
ALPHA_STREAMLINE_WORKLOG.md feat(rendering): implement RenderTexture base infrastructure and UIFrame clipping (#6) 2025-07-06 16:13:12 -04:00
CMakeLists.txt Iterators, other Python C API improvements 2025-05-31 09:11:51 -04:00
GNUmakefile Squashed commit of the following: [interpreter_mode] 2025-07-05 17:23:09 -04:00
LICENSE.md Refactor: Python 3.12, build libtcod & SFML from source. Cmake build. Directory cleanup 2024-02-24 22:48:39 -05:00
PHASE_1_2_3_COMPLETION_SUMMARY.md docs: add Phase 1-3 completion summary 2025-07-06 08:53:30 -04:00
README.md Squashed commit of the following: [interpreter_mode] 2025-07-05 17:23:09 -04:00
RENDERTEXTURE_DESIGN.md docs: create RenderTexture overhaul design document 2025-07-06 16:00:11 -04:00
ROADMAP.md Roguelike Tutorial Planning + Prep 2025-07-09 08:36:11 -04:00
SFML_3_MIGRATION_RESEARCH.md research: SFML 3.0 migration analysis 2025-07-06 13:08:52 -04:00
SFML_EXPOSURE_RESEARCH.md research: SFML exposure options analysis (#14) 2025-07-06 12:49:11 -04:00
STRATEGIC_VISION.md docs: comprehensive alpha_streamline_2 plan and strategic vision 2025-07-05 22:16:52 -04:00
_test.py feat(Grid): flexible at() method arguments 2025-07-05 20:35:33 -04:00
automation_example.py feat(Grid): flexible at() method arguments 2025-07-05 20:35:33 -04:00
automation_exec_examples.py feat(Grid): flexible at() method arguments 2025-07-05 20:35:33 -04:00
base_position_uicaption_test.png refactor: move position property to UIDrawable base class (UICaption) 2025-07-07 17:45:53 -04:00
base_position_uiframe_test.png refactor: move position property to UIDrawable base class (UIFrame) 2025-07-07 17:38:11 -04:00
base_position_uisprite_test.png refactor: move position property to UIDrawable base class (UISprite) 2025-07-07 17:54:47 -04:00
build.sh Squashed commit of the following: [alpha_streamline_1] 2025-07-05 18:56:02 -04:00
caption_invisible.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
caption_moved.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
caption_opacity_0.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
caption_opacity_25.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
caption_opacity_50.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
caption_visible.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
clean.sh feat(Grid): flexible at() method arguments 2025-07-05 20:35:33 -04:00
compare_html_docs.py feat(docs): create professional HTML API documentation 2025-07-08 11:19:09 -04:00
compile_commands.json Squashed commit of the following: [interpreter_mode] 2025-07-05 17:23:09 -04:00
css_colors.txt Squashed commit of the following: [standardize_color_handling] 2024-03-30 21:20:40 -04:00
example_automation.py feat(Grid): flexible at() method arguments 2025-07-05 20:35:33 -04:00
example_config.py feat(Grid): flexible at() method arguments 2025-07-05 20:35:33 -04:00
example_monitoring.py feat(Grid): flexible at() method arguments 2025-07-05 20:35:33 -04:00
exec_flag_implementation.cpp feat(Grid): flexible at() method arguments 2025-07-05 20:35:33 -04:00
frame_clipping_animated.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
frame_clipping_nested.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
frame_clipping_resized.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
frame_clipping_test.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
generate_api_docs.py feat: complete API reference generator and finish Phase 7 documentation 2025-07-08 10:15:37 -04:00
generate_api_docs_html.py feat(docs): complete API documentation with zero missing methods 2025-07-08 11:55:19 -04:00
generate_api_docs_simple.py feat: complete API reference generator and finish Phase 7 documentation 2025-07-08 10:15:37 -04:00
generate_color_table.py Squashed commit of the following: [standardize_color_handling] 2024-03-30 21:20:40 -04:00
generate_complete_api_docs.py feat(docs): complete API documentation with zero missing methods 2025-07-08 11:55:19 -04:00
generate_complete_markdown_docs.py feat(docs): complete markdown API documentation export 2025-07-08 12:16:56 -04:00
generate_stubs.py feat: generate comprehensive .pyi type stubs for IDE support (#108) 2025-07-08 09:59:19 -04:00
generate_stubs_v2.py feat: generate comprehensive .pyi type stubs for IDE support (#108) 2025-07-08 09:59:19 -04:00
gitea_issues.py feat(Grid): flexible at() method arguments 2025-07-05 20:35:33 -04:00
ui_methods_documentation.py feat(docs): complete API documentation with zero missing methods 2025-07-08 11:55:19 -04:00
viewport_center_mode.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
viewport_fit_mode.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
viewport_fit_tall.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
viewport_fit_wide.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
viewport_stretch_mode.png feat: add PyArgHelpers infrastructure for standardized argument parsing 2025-07-07 17:21:27 -04:00
wikicrayons_colors.txt Squashed commit of the following: [standardize_color_handling] 2024-03-30 21:20:40 -04:00
xkcd_colors.txt Squashed commit of the following: [standardize_color_handling] 2024-03-30 21:20:40 -04:00

README.md

McRogueFace

Blame my wife for the name

A Python-powered 2D game engine for creating roguelike games, built with C++ and SFML.

Pre-Alpha Release Demo: my 7DRL 2025 entry "Crypt of Sokoban" - a prototype with buttons, boulders, enemies, and items.

Tenets

  • Python & C++ Hand-in-Hand: Create your game without ever recompiling. Your Python commands create C++ objects, and animations can occur without calling Python at all.
  • Simple Yet Flexible UI System: Sprites, Grids, Frames, and Captions with full animation support
  • Entity-Component Architecture: Implement your game objects with Python integration
  • Built-in Roguelike Support: Dungeon generation, pathfinding, and field-of-view via libtcod (demos still under construction)
  • Automation API: PyAutoGUI-inspired event generation framework. All McRogueFace interactions can be performed headlessly via script: for software testing or AI integration
  • Interactive Development: Python REPL integration for live game debugging. Use mcrogueface like a Python interpreter

Quick Start

# Clone and build
git clone <wherever you found this repo>
cd McRogueFace
make

# Run the example game
cd build
./mcrogueface

Example: Creating a Simple Scene

import mcrfpy

# Create a new scene
mcrfpy.createScene("intro")

# Add a text caption
caption = mcrfpy.Caption((50, 50), "Welcome to McRogueFace!")
caption.size = 48 
caption.fill_color = (255, 255, 255)

# Add to scene
mcrfpy.sceneUI("intro").append(caption)

# Switch to the scene
mcrfpy.setScene("intro")

Documentation

For comprehensive documentation, tutorials, and API reference, visit: https://mcrogueface.github.io

Requirements

  • C++17 compiler (GCC 7+ or Clang 5+)
  • CMake 3.14+
  • Python 3.12+
  • SFML 2.5+
  • Linux or Windows (macOS untested)

Project Structure

McRogueFace/
├── src/           # C++ engine source
├── scripts/       # Python game scripts
├── assets/        # Sprites, fonts, audio
├── build/         # Build output directory
└── tests/         # Automated test suite

Contributing

PRs will be considered! Please include explicit mention that your contribution is your own work and released under the MIT license in the pull request.

The project has a private roadmap and issue list. Reach out via email or social media if you have bugs or feature requests.

License

This project is licensed under the MIT License - see LICENSE file for details.

Acknowledgments

  • Developed for 7-Day Roguelike 2023, 2024, 2025 - here's to many more
  • Built with SFML, libtcod, and Python
  • Inspired by David Churchill's COMP4300 game engine lectures