University of Lethbridge Logo

How the AI Story Idea Generator Works

The AI Story Idea Generator uses a structured, rule-based approach to create unique stories by randomly selecting elements from a predefined set. Each story is built using eight components: character, place, plot, quest, obstacle, companion, motivation, and resolution. These components are stored in a JSON file and are all AI-generated, ensuring a diverse and creative range of possibilities.

Story Components

The generator selects one element from each of the following categories to create a story:

How Stories Are Generated

Each time the generator is run, JavaScript accesses the JSON file containing the story components. It randomly selects one element from each category to construct a story. The selected elements are then combined into a narrative structured into four sentences:

  1. The first sentence introduces the character and place.
  2. The second sentence adds context with the companion and motivation.
  3. The third sentence outlines the action by detailing the quest and obstacle.
  4. The final sentence resolves the story with the resolution.

This setup ensures each story feels complete and engaging while maintaining a consistent structure.

Unique Story IDs

To facilitate easy reference and retrieval, each story is assigned a unique identifier. This ID is generated by concatenating the index of each selected element, formatted as a uniform-length string. For example, if the first element in each category is chosen, the ID will be "01010101010101," ensuring that each story is uniquely identifiable.

Story Generation Cycle

The generator automatically produces a new story every 60 seconds. Given the 126,904,825,484,800 possible combinations, it would take over 403 million years to exhaust all unique stories at this rate. This vast range of potential stories ensures that users rarely encounter duplicates, providing a continually fresh experience.

Conclusion

The AI Story Idea Generator exemplifies how AI can be integrated into educational and creative contexts in a low-cost, sustainable way. By using a rule-based approach and avoiding external API calls, it ensures accessibility and affordability, making it an ideal tool for academic and community engagement.


Back to the AI Story Idea Generator