An AI-powered fantasy world event generator that creates dynamic, evolving stories using Google's Gemini AI and optional Telegram integration.
- Procedural Fantasy Events: Generate events in diverse categories like political, magical, social, economic, conflict, mystery, and more
- Dynamic World State: World state evolves with each event, including seasons, weather, character relationships, and faction dynamics
- AI-Enhanced Storytelling: Integration with Google's Gemini AI to add rich details, consequences, plot hooks, connections between events
- Event Images: Generate fantasy illustrations for events (requires Google Gemini API key)
- Telegram Integration: Broadcast events (with images) to Telegram chats with special admin-only details
- Persistent Worlds: Save and reload your fantasy worlds with persistent state
- SQLite Database: All world data, events, and relationships are stored in SQLite databases, making it easy to access and reuse the data in other projects
The Fantasy World Generator uses SQLite to store all world information, including:
- Generated events with full details and relationships
- Character information and their evolving relationships
- Faction dynamics and territorial changes
- Historical event chains and consequences
- World state including weather, seasons, and political climate
This database approach allows you to:
- Access your fantasy world data from external applications
- Create custom analytics or visualization tools
- Develop complementary applications that build on your world's history
- Export data for use in other game systems or storytelling platforms
The Fantasy World Generator includes full Telegram bot integration that allows you to:
- Receive event notifications directly to your Telegram account
- View images associated with events
- Access hidden GM/DM information through interactive buttons
- Explore connections to previous events
- Discover adventure hooks and possible consequences
Each event sent to Telegram includes interactive buttons that provide additional GM/DM information:
- 🔍 Behind the Scenes: Hidden details about the event
- 🔗 Connections: How this event relates to previous events
- ⚔️ Adventure Hooks: Potential adventure hooks related to this event
- 🔮 Consequences: Possible outcomes of this event
Each event maintains its own private data, ensuring that buttons from previous events will always display the correct information associated with that specific event.
- Python 3.8+
- Required packages: see
requirements.txt - Optional: Google Gemini API key for AI-enhanced features
- Optional: Telegram Bot Token for messaging integration
-
Clone this repository:
git clone https://github.com/armysarge/FantasyWorld.git cd FantasyWorld -
Install dependencies:
pip install -r requirements.txt -
Run the generator:
python Fantasy.py
When you start the program, you'll be prompted to:
- Enter your fantasy world name
- Optionally provide a Google Gemini API key for AI-enhanced features
- Optionally provide a Telegram Bot Token and Chat Id for sending events to Telegram
Events will automatically be generated at random intervals (10-120 minutes by default), and you'll see them appear in the console with detailed information and story elements.
You can customize the generator by:
- Editing
fantasy_events_data.pyto modify the event templates, characters, locations, etc. - Adjusting the event frequency in
Fantasy.py - Adding your own event categories and templates
Fantasy.py- Main script and event generation engineai_functions.py- AI integration using Google's Gemini APItelegram_functions.py- Telegram integration for broadcasting eventsfantasy_events_data.py- Event templates and world datarequirements.txt- Required Python dependencies
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini API for providing the AI capabilities
- Telegram Bot API for messaging features


