Skip to content

Conversation

@alanops
Copy link
Owner

@alanops alanops commented Aug 16, 2025

Summary

  • Added 5-second GIF recording feature (F12 hotkey or 'gif' console command)
  • Integrated Imgur API for instant web sharing
  • Share dialog with online/local save options
  • Rate limiting and upload tracking

Features

Recording

  • Press F12 to capture 5 seconds of gameplay
  • 15 FPS capture rate for smooth GIFs
  • Non-blocking frame capture during gameplay
  • Recording indicator with countdown

Web Sharing

  • Direct upload to Imgur (anonymous)
  • Share link copied to clipboard
  • 50 daily upload limit tracking
  • Upload progress notifications

Local Save

  • Original functionality preserved
  • FFmpeg conversion scripts generated
  • Frame-by-frame PNG export

Setup Required

  1. Get Imgur Client ID from https://api.imgur.com/oauth2/addclient
  2. Update IMGUR_CLIENT_ID in scripts/GifSharer.gd

Test Plan

  • Test F12 recording during gameplay
  • Verify share dialog appears after recording
  • Test Imgur upload with valid Client ID
  • Verify clipboard copy of share link
  • Test rate limit enforcement
  • Test local save fallback option
  • Verify all notifications display correctly

Future Enhancements

  • Proper GIF encoding (currently single frame PNG)
  • OAuth2 for user accounts
  • Social media integration
  • Watermark/branding options

Documentation

  • README_GIF_RECORDING.md - Recording feature guide
  • README_IMGUR_SETUP.md - API setup instructions

- Press F12 or use 'gif' console command to start recording
- Records 5 seconds of gameplay at 15 FPS
- Saves frames as PNG files in user://gifs/ directory
- Includes FFmpeg conversion scripts for Windows/Linux/Mac
- Shows recording indicator with countdown timer
- Integrated with dev console help system
- Added comprehensive documentation in README_GIF_RECORDING.md

Technical features:
- Viewport texture capture for frame recording
- Automatic directory creation for organized output
- Cross-platform conversion script generation
- Non-blocking frame capture during gameplay
- Timestamped filenames for multiple recordings
- Integrated Imgur API for direct GIF uploads from game
- Share dialog appears after recording with online/local options
- Anonymous uploads with 50 daily limit per IP
- Automatic clipboard copy of share link
- Upload progress notifications and error handling
- Rate limiting with local tracking
- Comprehensive documentation for API setup

Technical implementation:
- GifSharer singleton handles Imgur API communication
- ShareDialog UI for user choice (share online vs save locally)
- Non-blocking HTTP uploads with status callbacks
- Base64 encoding for image data transfer
- Client-side rate limit enforcement
- Currently uploads single frame as proof of concept

UI/UX features:
- Share dialog with remaining upload count
- Upload progress indicator
- Success notification with clickable link
- Error messages for failed uploads
- Maintains original local save functionality
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