Skip to content

Conversation

@toymak3r
Copy link
Member

@toymak3r toymak3r commented Sep 7, 2025

initial steps

- Renamed from From Abyss Studio to Carnifex Engine
- Updated all branding and version strings
- Modified engine to not require original Quake files
- Added independent game development support
- Preserved all original IronWail credits
- Created comprehensive documentation
- Added build scripts and game template
- Updated README and project structure

Based on IronWail Engine with all original credits preserved.
- Updated CMakeLists.txt to use carnifex-engine as project name
- Changed all target references from ironwail to carnifex-engine
- Updated build script to not rename executable (already correct name)
- Updated .gitignore for new executable name
- Build system now generates carnifex-engine directly

The engine now builds with the correct name from the start.
- Updated all remaining IronWail references to Carnifex
- Changed initialization message to use CARNIFEX_VER_STRING
- Updated version display in host.c to show Carnifex
- Changed engine string in CSQC_Init to 'Carnifex'
- Updated shader error messages to show Carnifex engine
- Removed IronWail reference from console title
- Updated Windows Makefiles to generate carnifex-engine.exe
- Updated config file references to carnifex.cfg

All IronWail references have been completely replaced with Carnifex branding while preserving original credits.
- Reorganize root directory structure:
  * Move documentation files to docs/ directory
  * Move build script to scripts/ directory
  * Create build-artifacts/ for build outputs
  * Update .gitignore to exclude build artifacts

- Implement smart compiler system:
  * Use Clang as primary compiler (18.1.8)
  * Fallback to GCC (14.2.1) if Clang unavailable
  * Enhanced build script with compiler detection
  * Clear messaging for compiler selection

- Update documentation:
  * Fix paths in README.md for new structure
  * Add docs/README.md explaining organization
  * Update build instructions for new paths

- Maintain compatibility:
  * All original functionality preserved
  * Build system works with both compilers
  * Clean separation of source, docs, and build artifacts
- Add signal handlers for SIGSEGV, SIGTERM, SIGINT, and SIGFPE in main_sdl.c
- Implement Sys_SignalHandler() for graceful cleanup on crashes
- Fix segmentation fault in M_CheckCustomGfx() by checking for invalid file handles
- Add safety checks in Sys_FileClose() to prevent crashes from invalid handles
- Enhance WAV file validation in snd_mem.c with comprehensive error checking
- Add bounds checking to GetLittleShort() and GetLittleLong() functions
- Improve error handling for corrupted audio files with clear error messages
- Apply fixes to both Unix and Windows versions

The engine now shuts down gracefully instead of crashing with segmentation faults.
Corrupted WAV files are handled properly with informative error messages.
- Reorganize documentation into docs/user/ and docs/development/
- Move development scripts to tools/scripts/ directory
- Move build scripts to tools/build/ directory
- Create comprehensive README.md with project overview
- Add tools/README.md with development tool documentation
- Remove temporary files and build artifacts
- Clean up CMake build files and object files
- Organize project structure for better maintainability

Project structure is now clean and well-organized with proper documentation.
- Remove all .wad and .pak files from carnifex/ directory
- These are game data files that should not be in source control
- Update .gitignore to prevent future accidental commits of game data files
- Add patterns for *.wad, *.pak, carnifex/*.wad, carnifex/*.pak

Game data files should be distributed separately or generated during build process.
- Remove all .wad and .pak files from git history
- These files should not be tracked in source control
- Game data files are now properly excluded from the repository
- Update .gitignore to exclude WAD, PAK, BSP, DAT, and LMP files
- Remove all binary game assets from git tracking:
  - Quake/ironwail.pak
  - carnifex/maps/*.bsp (e1m1.bsp, start.bsp)
  - carnifex/progs/progs.dat
  - carnifex/gfx/*.lmp (119 graphics files)
- Keep binary assets in working directory but exclude from version control
- Binary game assets should be generated by build scripts, not versioned

This prevents repository bloat and ensures binary assets are properly generated.
- Add section explaining that WAD, PAK, BSP, DAT, and LMP files are excluded from version control
- Document which file types are automatically ignored
- Explain that binary assets should be generated by build scripts
- Reference development tools for asset generation
- Remove references to deleted LMP library (lib/lmp.c, lib/lmp.h)
- Remove CLI tool build target that depended on missing library
- Main engine doesn't require CLI tool for operation
- Fixes CMake configuration errors after directory cleanup
- Implement complete PAK library (tools/lib/pak.h, tools/lib/pak.c)
  - Support for reading, writing, and manipulating Quake PAK files
  - Proper endianness handling for PAK format
  - File extraction with directory structure preservation
  - Memory management and error handling

- Add LMP library stub (tools/lib/lmp.h, tools/lib/lmp.c)
  - Basic LMP file support for compatibility
  - Conchars (console font) handling

- Enhance CLI tool (tools/carnifex-cli.c) with PAK functionality:
  - -l, --list: List files in PAK archives
  - -e, --extract: Extract files from PAK archives
  - -c, --create: Create new PAK archives
  - -a, --add FILE: Add files to PAK archives (multiple files supported)
  - Auto-detection of PAK files
  - Updated help and usage information

- Tested with real Quake PAK files (pak0.pak, pak1.pak)
- Successfully extracts 339+ files maintaining directory structure
- Supports both LMP and PAK file operations in single tool

This enables full PAK file manipulation for Carnifex Quake engine development.
These placeholder scripts were replaced by the comprehensive PAK and LMP
functionality implemented in the C-based carnifex-cli tool:

- create_basic_progs.py
- create_placeholder_graphics.py
- create_simple_map.py
- fix_bsp.py
- fix_stub_graphics.py

The new carnifex-cli tool provides more robust and integrated functionality
for PAK file manipulation and LMP file handling.
- Implement auto-detection for PAK file endianness (big-endian vs little-endian)
- CLI tool now creates PAK files in standard little-endian format
- CLI tool can read both big-endian and little-endian PAK files
- Replace problematic big-endian pak0.pak with compatible little-endian version
- Engine now loads PAK files successfully without errors

The original pak0.pak was in non-standard big-endian format, which caused
compatibility issues with the engine. The CLI tool now auto-detects
endianness when reading PAK files and creates new PAK files in the
standard little-endian format expected by Quake engines.
- Fixed missing gfx.wad file by creating minimal WAD file structure
- Converted music files to WAV format for engine compatibility
- Engine now starts successfully without WAD file errors
- Music system can load external music files when bgm_extmusic is enabled
- All PAK file compatibility issues resolved
- Enhanced BGM_PlayCDtrack with detailed search and loading messages
- Added logging for music file discovery, format detection, and codec selection
- Improved BGM_Play function with format validation and loading status
- Added logging for BGM_Stop, BGM_Pause, and BGM_Resume operations
- Enhanced BGM_Init to show available codecs and system status
- Added logging for music looping and end-of-track events
- Console output now shows complete music loading sequence and playback status
- All music operations now provide clear feedback about success/failure
- Added support for general LMP file extraction and processing
- Fixed LMP file format: width/height are uint32_t (4 bytes), not uint16_t (2 bytes)
- Implemented auto-detection for LMP files in extraction mode
- Added process_lmp() and extract_lmp() functions
- Updated usage information to include LMP file type
- LMP files are extracted as raw image data with header information
- Auto-detection avoids double-loading files to prevent memory errors
- CLI tool now supports: conchars, pak, lmp file types
- Implemented lmp_to_pcx() function in lib/lmp.c with proper PCX format support
- Added --convert option to CLI tool for format conversion
- PCX files include proper header, RLE compression, and 256-color palette
- Added convert_lmp() function to handle conversion workflow
- Updated usage information and examples to include conversion functionality
- Successfully tested with sp_menu.lmp (232x64) and backtile.lmp (8x8)
- Generated PCX files are valid and recognized by file command
- Conversion preserves image dimensions and pixel data accurately
- Implemented pcx_to_lmp() function for PCX to LMP conversion
- Added PCX header parsing and RLE decoding support
- Updated convert_lmp() to handle both conversion directions:
  - pcx: LMP -> PCX conversion
  - lmp: PCX -> LMP conversion
- Enhanced CLI with bidirectional conversion examples
- Updated usage information to reflect both conversion directions
- Tested with sp_menu.lmp (232x64) and backtile.lmp (8x8)
- Verified perfect round-trip conversion (files identical after LMP->PCX->LMP)
- PCX files properly decoded with RLE compression and palette handling
- Complete bidirectional conversion workflow now available
- Updated lmp_to_pcx() to load actual Quake palette from carnifex/gfx/palette.lmp
- PCX files now display with proper Quake colors in GIMP instead of grayscale
- Added fallback to grayscale palette if Quake palette file not found
- Maintains perfect round-trip conversion compatibility
- PCX files now show correct colors when opened in image editors
- Resolves issue where PCX files appeared black and white in GIMP
- Fix WAV file size validation logic in snd_mem.c to check original data size instead of resampled size
- Make MP3 handler conditional in bgmusic.c to prevent 'Unhandled extension' errors when MP3 libraries unavailable
- Fix CDRIP_TYPES macro definition syntax error in bgmusic.c
- Add converted OGG music files (track02.ogg, track03.ogg) to replace MP3 versions
- Enable OGG Vorbis support with proper library detection

Resolves issues with original Quake WAV files and provides full OGG support for music playback.
- Remove OGG music files from git tracking (binary files shouldn't be versioned)
- Add comprehensive audio file patterns to .gitignore (*.wav, *.mp3, *.ogg, *.flac, *.opus)
- Audio files remain available locally but won't be tracked in future commits

This follows best practices for binary file management in git repositories.
- Remove unnecessary README files and documentation
- Remove old MP3 audio files (replaced with OGG versions)
- Remove placeholder WAV sound files
- Add new audio documentation (AUDIO_FORMATS.md, AUDIO_QUICK_REFERENCE.md)
- Move quake.rc to project root for better organization
- Add audio examples script
- Update tools documentation and CLI

This commit cleans up the project structure and removes placeholder files while adding proper documentation and examples.
The engine looks for quake.rc in the game directory (carnifex/), not the project root.
Moving it back to where the engine expects to find it.

This ensures the configuration file is properly loaded when the game starts.
Project Structure Reorganization:
- Rename Quake/ directory to core/ for engine core files
- Move platform-specific files to platforms/ directory:
  - Windows/ -> platforms/Windows/
  - Linux/ -> platforms/Linux/
  - Misc/ -> platforms/Misc/
- Move game assets to carnifex-game/ directory
- Keep tools/ and docs/ in their current locations

Documentation Updates:
- Update all documentation to reflect new directory structure
- Create comprehensive PROJECT_STRUCTURE.md
- Update build commands and paths in all guides
- Organize documentation into logical categories
- Update README.md with new structure overview

Build System Updates:
- Update CMakeLists.txt to reference new directory paths
- Fix Makefile to not remove core directory during clean
- Update all build paths from Quake/ to core/
- Update platform-specific paths to platforms/

Verification:
- Build system tested and working correctly
- All functionality preserved
- Clean separation between engine core and game assets
- Documentation accurately reflects new structure

This reorganization provides:
- Clear separation of concerns
- Better maintainability
- Logical file organization
- Scalable project structure
- Comprehensive documentation
…ations

Features:
- Music metadata extraction for OGG Vorbis comments and MP3 ID3v1 tags
- Console logging: 'MUSIC: [Title] by [Artist]' or filename fallback
- Colored toaster notifications: title in dark white, artist in light red
- 5-second display duration (configurable via music_info_toaster_duration)
- Menu options to toggle console output and toaster display
- Support for both automatic music loading and console commands
- Fixed opus codec build issues with dummy implementation
- Enhanced user experience with visual feedback

Files modified:
- core/music_metadata.c: Main implementation with metadata extraction and colored display
- core/music_metadata.h: Header with function declarations and structures
- core/bgmusic.c: Integration with music playback system
- core/gl_screen.c: Toaster rendering integration
- core/menu.c: Menu options for configuration
- core/snd_opus.c: Fixed build issues with dummy codec implementation

The system now displays beautiful colored toaster notifications when music plays,
showing the title in dark white and artist in light red, with a 5-second duration.
- Create main README.md with complete project overview
- Document enhanced music metadata system features
- Add detailed music system usage instructions
- Include build instructions and troubleshooting
- Update docs/README.md with music system information
- Create MUSIC_METADATA_SYSTEM.md with technical details
- Document configuration options and file formats
- Add examples for adding music with metadata
- Include troubleshooting and future enhancement ideas

The documentation now provides complete coverage of:
- Project overview and quick start guide
- Music metadata system features and usage
- Build instructions and dependencies
- Configuration options and CVars
- File format support and metadata extraction
- Troubleshooting and development information
- Update all existing workflows for new project structure
- Add comprehensive dependency installation for all platforms
- Update build paths and artifact names for Carnifex
- Add music metadata system testing workflow
- Add code quality checks workflow with static analysis
- Add automated release workflow for all platforms
- Update branch references from master/main to carnifex
- Add smoke tests for engine startup
- Include music metadata system verification
- Add cross-platform build support (Linux, Windows, macOS, MinGW)
- Update artifact packaging and release automation

New workflows:
- music_metadata_test.yml: Tests music metadata extraction and display
- code_quality.yml: Static analysis, formatting checks, and integration verification
- release.yml: Automated release builds for all platforms

Updated workflows:
- linux_ci.yml: Updated for Carnifex structure with comprehensive dependencies
- windows_ci.yml: Updated build paths and artifact names
- macos_ci.yml: Updated dependencies and build process
- mingw_ci.yml: Updated for cross-compilation with new structure

All workflows now properly test the enhanced music metadata system
and verify the complete Carnifex engine functionality.
@toymak3r toymak3r self-assigned this Sep 7, 2025
@toymak3r toymak3r merged commit 5991ada into master Sep 8, 2025
0 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants