Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Changelog

All notable changes to Taj's Core Framework will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2026-01-07

### Added
- Initial release of Taj's Core Framework
- Core.Runtime: Module registration and management system
- Core.Logger: Multi-level logging system with file output support
- Core.Settings: Namespaced configuration with version-based migrations
- Core.EventBus: Global event system for module communication
- Core.Keybinds: Input action registration with conflict detection
- Core.Patches: Apply-once code patching system
- Complete API documentation in docs/API.md
- Example module demonstrating all features
- Semantic versioning support

### Core Features
- Module lifecycle management with version tracking
- Conflict-free keybind registration
- Persistent settings with automatic schema migrations
- Event-driven architecture for loose coupling
- One-time patch application with tracking
- Comprehensive logging with configurable levels

[1.0.0]: https://github.com/Taj-s-Mods-Upload-Labs/core/releases/tag/v1.0.0
235 changes: 235 additions & 0 deletions IMPLEMENTATION_SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
# Implementation Summary: Taj's Core Framework v1.0.0

## Overview
Successfully implemented a complete modding framework for Godot 4.x games, providing essential systems for module management, logging, configuration, events, input handling, and code patching.

## Repository Statistics
- **Total Lines of Code**: ~1,831 lines
- **Total Files**: 18 files
- **Core Framework Files**: 7 GDScript files
- **Documentation Files**: 8 Markdown files
- **Version**: 1.0.0 (Semantic Versioning)
- **License**: MIT

## Core Components Implemented

### 1. **core/mod_main.gd** - Main Bootstrap (1,906 bytes)
- Entry point for the framework
- Initializes all subsystems in correct order
- AutoLoad singleton named "Core"
- Prints startup banner
- Provides version information

### 2. **core/runtime.gd** - Module Registration System (2,380 bytes)
- Register/unregister modules
- Track module versions
- Enable/disable modules
- Module lifecycle management
- Module dependency tracking

### 3. **core/logger.gd** - Logging System (2,099 bytes)
- Multiple log levels (DEBUG, INFO, WARN, ERROR, NONE)
- Console and file output
- Timestamped messages
- Configurable log levels
- Append mode for persistent logs

### 4. **core/settings.gd** - Configuration System (3,542 bytes)
- Namespaced settings (avoid conflicts)
- ConfigFile-based persistence
- Version-based migrations
- Automatic schema upgrades
- Deferred save optimization

### 5. **core/event_bus.gd** - Event System (2,666 bytes)
- Built-in signals for framework events
- Custom signal registration
- Decoupled module communication
- Signal parameter documentation
- Connection management

### 6. **core/keybinds.gd** - Input Management (4,603 bytes)
- Input action registration
- Conflict detection
- Multiple events per action
- Action rebinding
- Improved type checking with `is` operator

### 7. **core/patches.gd** - Code Patching (3,299 bytes)
- Apply-once patch registry
- Patch history persistence
- Callable validation
- Error handling for patch execution
- Patch versioning support

## Documentation Suite

### 1. **README.md** - Project Overview
- Features and benefits
- Quick start guide
- Component descriptions
- Project structure
- Links to detailed docs

### 2. **INSTALLATION.md** - Setup Guide
- Step-by-step installation
- AutoLoad configuration
- Verification steps
- Troubleshooting tips
- Platform-specific paths

### 3. **QUICKSTART.md** - 5-Minute Tutorial
- Create first module
- Basic usage examples
- Common patterns
- Module template
- Best practices

### 4. **docs/API.md** - Complete API Reference (11,802 bytes)
- Full API documentation for all components
- Parameter descriptions
- Return values
- Code examples
- Best practices
- Version history

### 5. **CHANGELOG.md** - Version History
- Release notes for v1.0.0
- Features added
- Links to releases
- Semantic versioning info

### 6. **LICENSE** - MIT License
- Open source license
- Copyright information
- Usage permissions

## Example Implementation

### **examples/example_module/** - Working Example
- Complete module implementation
- Demonstrates all features:
- Module registration
- Keybind setup (F1 key)
- Settings management
- Event handling
- Input processing
- Includes README documentation

## Testing Framework

### **tests/test_framework.gd** - Automated Tests
Tests all core components:
1. Framework version verification
2. Logger system (all levels)
3. Settings (get/set with namespaces)
4. Module registration
5. Keybind registration
6. Event bus (custom signals)
7. Patch system (apply-once)

### **tests/README.md** - Test Documentation
- How to run tests
- Expected output
- Test coverage details

## Key Features Implemented

### ✅ Framework Requirements
- [x] Module registration system
- [x] Logging with multiple levels
- [x] Namespaced settings with migrations
- [x] Global event bus
- [x] Keybind management with conflicts
- [x] Apply-once patch registry
- [x] Bootstrap system

### ✅ Code Quality
- [x] Safety checks for initialization order
- [x] Null-safe Core references
- [x] Improved type checking (using `is` operator)
- [x] Error handling for patch execution
- [x] Deferred I/O operations
- [x] Append mode for log files
- [x] Callable validation

### ✅ Documentation
- [x] Comprehensive README
- [x] Installation guide
- [x] Quick start tutorial
- [x] Complete API reference
- [x] Code examples
- [x] Example module
- [x] Test documentation
- [x] Changelog
- [x] MIT License

### ✅ Best Practices
- [x] Semantic versioning
- [x] Consistent code style
- [x] GDScript 4.x syntax
- [x] Documentation comments (##)
- [x] Type hints
- [x] Error handling
- [x] No gameplay changes (framework only)

## File Structure
```
core/
├── CHANGELOG.md # Version history
├── INSTALLATION.md # Setup guide
├── LICENSE # MIT License
├── QUICKSTART.md # 5-min tutorial
├── README.md # Overview
├── VERSION # 1.0.0
├── core/ # Framework code
│ ├── event_bus.gd # Event system
│ ├── keybinds.gd # Input management
│ ├── logger.gd # Logging
│ ├── mod_main.gd # Bootstrap
│ ├── patches.gd # Code patching
│ ├── runtime.gd # Module system
│ └── settings.gd # Configuration
├── docs/ # Documentation
│ └── API.md # API reference
├── examples/ # Examples
│ └── example_module/ # Sample module
│ ├── README.md
│ └── example_module.gd
└── tests/ # Tests
├── README.md
└── test_framework.gd
```

## Integration Steps
1. Copy `core/` directory to Godot project
2. Add `res://core/mod_main.gd` as AutoLoad singleton named "Core"
3. Create modules using the framework
4. Run and test

## Version Information
- **Framework Version**: 1.0.0
- **Godot Compatibility**: 4.0+
- **Release Date**: 2026-01-07
- **License**: MIT
- **Language**: GDScript

## Code Review Results
- Initial review: 5 issues found
- All issues resolved:
- ✅ Fixed type checking in keybinds (using `is` operator)
- ✅ Fixed event emission in example module
- ✅ Added error handling for patch execution
- ✅ Deferred settings save on initialization
- ✅ Changed log file mode to append

## Summary
This implementation provides a production-ready modding framework for Godot games with:
- **Zero gameplay changes** - Pure framework
- **Complete documentation** - Easy to use
- **Robust error handling** - Production ready
- **Extensible design** - Easy to extend
- **Best practices** - Clean, maintainable code
- **No external dependencies** - Works out of the box

The framework is ready for use in mod development projects.
116 changes: 116 additions & 0 deletions INSTALLATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Installation Guide for Taj's Core Framework

This guide will walk you through setting up Taj's Core framework in your Godot 4.x project.

## Prerequisites

- Godot 4.0 or later
- A Godot project (new or existing)

## Installation Steps

### Step 1: Copy the Core Framework

1. Clone or download this repository
2. Copy the entire `core/` directory into your Godot project at `res://core/`

Your project structure should look like:
```
your_project/
├── core/
│ ├── mod_main.gd
│ ├── runtime.gd
│ ├── logger.gd
│ ├── settings.gd
│ ├── event_bus.gd
│ ├── keybinds.gd
│ └── patches.gd
└── ... (your other project files)
```

### Step 2: Add Core as AutoLoad Singleton

1. Open your Godot project
2. Go to **Project → Project Settings**
3. Navigate to the **Autoload** tab
4. Click the folder icon next to **Path**
5. Select `res://core/mod_main.gd`
6. Set **Node Name** to: `Core` (case-sensitive!)
7. Make sure **Enable** is checked
8. Click **Add**

![AutoLoad Setup](https://docs.godotengine.org/en/stable/_images/autoload_example.png)
*(Example from Godot documentation)*

### Step 3: Verify Installation

Create a simple test script to verify the installation:

```gdscript
extends Node

func _ready():
print("Core version: ", Core.get_version())
Core.Logger.info("Core framework is working!")
```

Run your project. You should see:
```
============================================================
Taj's Core Framework v1.0.0
Modding framework for Godot
============================================================
[timestamp] [INFO] Core framework initialized successfully
Core version: 1.0.0
[timestamp] [INFO] Core framework is working!
```

## Optional: Install Example Module

To see a working example:

1. Copy `examples/example_module/` to your project
2. Add `example_module.gd` to your scene tree or as an AutoLoad
3. Run the project and press **F1** to test the keybind

## Next Steps

- Read the [API Documentation](docs/API.md) to learn about all features
- Review the [example module](examples/example_module/) for usage patterns
- Create your first module following the examples

## Troubleshooting

### "Core is not defined" error

- Make sure you added `mod_main.gd` as an AutoLoad singleton
- Verify the Node Name is exactly `Core` (case-sensitive)
- Ensure the path is `res://core/mod_main.gd`

### Settings file errors

- The framework creates settings in `user://tajs_core_settings.cfg`
- On Windows: `%APPDATA%\Godot\app_userdata\[ProjectName]/`
- On Linux: `~/.local/share/godot/app_userdata/[ProjectName]/`
- On macOS: `~/Library/Application Support/Godot/app_userdata/[ProjectName]/`

### Module not registering

- Ensure you're calling `Core.register_module()` after the Core framework is ready
- Call it in your module's `_ready()` function or later
- Check the console for warning messages

## Uninstallation

To remove the framework:

1. Remove the AutoLoad singleton from Project Settings
2. Delete the `res://core/` directory
3. Delete any modules that depend on the framework

## Getting Help

- Check the [API Documentation](docs/API.md)
- Review the [README](README.md)
- Look at the [example module](examples/example_module/)
- Check the [CHANGELOG](CHANGELOG.md) for version-specific information
Loading