kys-cpp: Recreating the Classic Jin Yong’s Heroes with Modern C++, Supporting Three Innovative Combat Modes!

A 2D game development framework based on SDL2, it is both a classic recreation and an excellent example for learning game development.

After the passing of Mr. Jin Yong, a group of programmers who love martial arts games recreated the classic DOS game “Jin Yong’s Heroes” using modern C++. They built a fully functional 2D game engine called kys-cpp based on this. This project is not only a tribute to the classic but also a valuable resource for learning game development, currently achieving over 2.8k stars on GitHub.

Project Introduction

kys-cpp: Recreating the Classic Jin Yong's Heroes with Modern C++, Supporting Three Innovative Combat Modes!

kys-cpp is a 2D game engine framework implemented based on SDL2, providing a complete port of the DOS game “Jin Yong’s Heroes”. The project was initially developed by scarsty, written in modern C++, following contemporary game engine design principles, but intentionally avoiding callback mechanisms to reduce the difficulty for beginners.

The “kys” in the project name is the pinyin abbreviation for “Jin Yong’s Heroes”, while “cpp” indicates that this is the C++ version. This project not only fully ports the content of the original game but also adds many innovative features, including three different combat modes and a series of modern improvements, giving the classic game new vitality while retaining its original flavor.

The engine is released under the zlib license, but includes two additional clauses: generally, the code can be used freely, but any form of profit-making is strictly prohibited if used for games themed around Jin Yong.

Core Features Highlights

kys-cpp has a comprehensive feature set, including both core game engine functionalities and a complete game implementation:

🎮 Game Engine Architecture:

  • • A 2D graphics rendering system built on SDL2, providing efficient drawing performance.
  • • The RunNode/Element system serves as the basic execution class for the game, containing five important virtual functions: backRun, draw, dealEvent, onEnter, and onExit.
  • • A texture management system specifically handling textures with offset settings.
  • • An audio system supporting BASS or SDL_mixer, capable of playing various formats such as mid, mp3, wav, etc.

⚔️ Three Combat Modes:

  • Classic Turn-Based: Retains the turn-based combat system of the original game.
  • Semi-Real-Time Combat: A semi-real-time combat system with a progress bar.
  • Fully Real-Time Combat: A fully real-time combat mode inspired by “Hades” and “Sekiro”.
  • Switching can be done by modifying the battle_mode in the ini file.

🔧 Development Toolchain:

  • • Supports various resource formats, including modern image formats like PNG and WEBP.
  • • The save system uses sqlite3 database format, supporting persistent data storage.
  • • Integrated support for Lua scripting language, facilitating game functionality expansion.
  • • Built-in simplified and traditional Chinese conversion functionality, using the opencc library for text conversion.

🌐 Cross-Platform Support:

  • Supports Windows and Linux platforms.
  • • Uses CMake build system, making it easy to compile on different platforms.
  • • Visual Studio project files for easy use by Windows developers.

Architectural Design Features

The architectural design of kys-cpp reflects modern game engine thinking, with a greater emphasis on usability and learnability:

Node System: RunNode (or Element) is the basic execution class in the game, where each node can contain multiple child nodes, forming a tree structure. The engine draws each node from bottom to top, creating a complete game scene.

Resource Management: A texture manager is used to uniformly manage game resources, supporting various formats of images and audio files, while also supporting resource loading from ZIP compressed packages.

Event Handling: A blocking event handling mode is adopted, eliminating the need for complex event tagging and callback mechanisms, reducing the difficulty of understanding.

Save System: Uses SQLite database to store game saves, supporting more flexible data structures and larger storage capacity.

Advantages Comparison

Compared to other game engines and recreation projects, kys-cpp has significant advantages:

Feature kys-cpp Other Game Engines Other Recreation Projects
Open Source and Free ⚠️ Some charge fees
Learning Difficulty ⭐⭐ Easy to get started ⭐⭐⭐⭐ Higher difficulty ⭐⭐⭐ Moderate
Feature Completeness ✅ Engine + Complete Game ⚠️ Only engine or only game ⚠️ Usually limited functionality
Cross-Platform Support ✅ Windows/Linux ✅ Generally good ⚠️ Usually limited to Windows
Modern Architecture ✅ Modern C++ design ✅ Generally modern ⚠️ Often uses outdated technology
Documentation and Examples ✅ Complete game examples ⚠️ Usually only basic examples ✅ But usually not open source

Conclusion

kys-cpp is an open-source game engine project with both educational and practical value, which not only perfectly recreates the classic game “Jin Yong’s Heroes” but also provides game development learners with a clear and easy-to-understand modern C++ game engine implementation.

The project’s greatest feature lies in its balance between tradition and modernity: it retains the essence of the classic game’s gameplay while introducing the technical advantages of modern game engines; it provides a complete playable game experience while maintaining code readability and learnability. The three different combat modes further demonstrate the diverse expressions of the same game content under different technical implementations.

For game development learners, kys-cpp is a rare learning resource, from which you can learn core concepts such as game engine architecture design, resource management, and event handling. For nostalgic game enthusiasts, this is a high-quality remake of Jin Yong’s Heroes, allowing you to relive the classic on modern systems.

⚠️ Notes:

  • • The project is based on the zlib license, but profit-making activities are prohibited when used for Jin Yong-themed games.
  • • Some features (such as video playback) require additional configuration and compilation.
  • • It is recommended to have a certain foundation in C++ before attempting to modify the engine code in depth.

Project Address: https://github.com/scarsty/kys-cpp or

https://gitee.com/scarsty/kys-cpp

For more exciting open-source project recommendations, please follow and star ⭐ our public account 【Smart Baby Library】, bringing you the latest and hottest open-source project analyses every day!

If this article has helped you, please give us a thumbs up kys-cpp: Recreating the Classic Jin Yong's Heroes with Modern C++, Supporting Three Innovative Combat Modes!+ kys-cpp: Recreating the Classic Jin Yong's Heroes with Modern C++, Supporting Three Innovative Combat Modes! Thanks!

Leave a Comment