Navigation

    CreatiCode Scratch Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode
    1. Home
    2. info-creaticode
    3. Posts
    • Profile
    • Following 0
    • Followers 15
    • Topics 430
    • Posts 1121
    • Best 394
    • Groups 6

    Posts made by info-creaticode

    • RE: the ai does not work. i need help. please

      Can you please post a screenshot? We have just tested it and this is what you should get:

      aadaef11-1c59-4d67-9fdf-e9eeb8a355cf-image.png

      posted in Help
      info-creaticode
      CreatiCode
    • RE: Is this the right topic?

      @rubiired

      We have communicated with that user and he/she agreed to remove inappropriate projects. If there is evidence that he/she is sharing new inappropriate projects again, we will take further actions.

      posted in Feedback
      info-creaticode
      CreatiCode
    • RE: Is this the right topic?

      @rubiired

      Thank you. We will remove inappropriate projects from that user.

      posted in Feedback
      info-creaticode
      CreatiCode
    • RE: the ai does not work. i need help. please

      Hi, you mean the XO chatbot, right? It sometimes get behind a long queue of requests and may time out.

      Can you please try again now? You can reset the chat by clicking the red button, then ask your question again.

      posted in Help
      info-creaticode
      CreatiCode
    • RE: how slow point lock

      OK. You can control the angular speed of the camera using the “configure camera” block’s last input, which is a percentage. For example, when you set it to 100, it is the default speed, but if it is 10, then it will be 10% of the default speed.

      See this project for example:

      play.creaticode.com/projects/68345dcdcf69bbdc83e9472e

      posted in Help
      info-creaticode
      CreatiCode
    • RE: how slow point lock

      Do you mean you want to make the camera rotate less when you move the mouse?

      posted in Help
      info-creaticode
      CreatiCode
    • RE: drop down menu

      You can use the “when widget changes” block.

      Here is a simple example:

      play.creaticode.com/projects/6831f4e759dd9cb676181c93

      posted in Help
      info-creaticode
      CreatiCode
    • RE: [Community Project] Let's Build a CreatiCode Project Packager!

      @jeffreyrb03-gmail

      There are already packagers like Turbowarp, which works well for generic Scratch projects. And since most of the new CreatiCode blocks don’t work offline, most likely this new packager won’t do much more compared to a Turbowarp packager, right?

      So the question is whether it will be justified to dedicate manpower on this feature (as opposed to others) if it is not going to add much additional value.

      posted in Test
      info-creaticode
      CreatiCode
    • RE: fix creaticodg

      @khour_thedeveloper-cc5393d8

      Hi, sorry about that issue.

      You should be able to create many clones with an issue. If you have this problem again, can you please share the project?

      posted in Feedback
      info-creaticode
      CreatiCode
    • RE: Cannot save game?

      @notjaldolfyt

      The service has been restored.

      posted in Help
      info-creaticode
      CreatiCode
    • RE: Cannot save game?

      @notjaldolfyt

      Yes, there is an issue saving and loading projects. It will be restored shortly.

      posted in Help
      info-creaticode
      CreatiCode
    • RE: Limit FPS on projects?

      @notjaldolfyt

      Thank you for the suggestion. We will look into how to add this.

      posted in Feedback
      info-creaticode
      CreatiCode
    • RE: queshtion

      @jeffreyrb03-gmail

      No. That question was on the button on top, not the text to speech block.

      posted in General Discussion
      info-creaticode
      CreatiCode
    • RE: Yellow boxes around projects?

      This issue has been resolved.

      posted in Help
      info-creaticode
      CreatiCode
    • AI Tool Use - A Calender Assistant (Difficulty: 4)

      Introduction

       

      Welcome to this tutorial on building an AI-powered calendar assistant! This project is a great example of how AI tools can be extended with new abilities — allowing them to solve more complex, real-world problems.


      🧠 What’s This All About?

       
      Large language models (LLMs), cannot remember information across different sessions — they can only “remember” the messages within the current chat session. That’s a big limitation because most apps need to store and recall information over time. Think about a calendar app: it needs to store all your events so you can see them later!

      To work around this limitation, we’ll use Google Sheets to store data. Then we’ll teach the AI how to interact with that data to manage a user’s calendar.

      By the end of this project, your app will look like this:

      calendar.gif

       

      This tutorial is divided into two main parts:

      • Part 1: Set up a basic AI chat app
      • Part 2: Teach the AI how to manage the user’s calendar using Google Sheets

       
       
       
       
       

      🧩 Part 1 - Setting up the chat app

       

       
       

      Step 1 - Remix the Starter Project

       

      Start by remixing this template, which gives you a basic chat app to build on. We’ll add new logic to it step by step.

      play.creaticode.com/projects/682dad154dba4796824af2a6

       
       

      Step 2 - Prepare the Google Sheet

       

      We’ll use a Google Sheet to store all calendar events. This approach is free, easy to use, and simple to review.

      Here’s what you need to do (or ask your teacher/guardian to help):

      1. Create a new Google Sheet
      2. Set its sharing settings so that “anyone with the link” can edit
      3. Copy the sheet’s link

      6fe532c8-c01a-4dbd-ba03-b15462392d8a-image.png

      If you can’t create your own Google Sheet, you can use this pre-made one:
      https://docs.google.com/spreadsheets/d/1tH9J09laZNl94Qb1smO5LSmDwD_yzungb9d4lmkobxE/edit?usp=sharing

       
      Then, in your app, store the sheet URL in a variable called Sheet URL. You’ll use this later to tell the AI where the calendar lives.

      eae1657b-7a9d-4cf2-a745-4b3637f32d2e-image.png

       
       

      Step 3 - Update the System Prompt

       

      Next, we’ll give the AI a new role by updating its System Instruction.

      This tells the AI what it’s supposed to do. For now, keep it simple and clear:

      197c4ae4-ba5d-4133-9953-3b190e6ec10a-image.png

       
       

      Step 4 - Customize the Welcome Message

       

      Let’s make the welcome message match the AI’s new job.

      667f26d2-e8a1-4297-bed5-0db881b29b55-image.png

       
      📌 Tip: You could make the AI generate a different welcome message every time, but that would slow things down.

       
       

      Step 5 - Add a Tab for Each User

       

      Because different users might use this app, we need a way to keep their data separate.

      The solution: whenever a new user joins, we’ll create a new tab in the Google Sheet just for them. The tab name will be the user’s unique ID.

      ae212509-2bdf-48aa-b854-bd4d886f5597-image.png

       
      📝 If the tab already exists, this block will do nothing — which is exactly what we want.

       
       

      Step 6 - Get the Current Day of the Week

       

      Here’s an important thing to remember: AI models do not know the current date or time on their own. You can test that like this:

      35c1e1ac-c623-4b17-90ee-932e5b1eabfa-image.png

       
      That’s a problem when managing calendars! We’ll fix this by manually sending the current date and time to the AI.

      Let’s start with the day of the week:

      • First, create a new list “weekdays”:
        6298781c-e323-43ba-afd8-21448f235fbe-image.png

      • Then, use the current [day of week] block to get today’s number, and use it to pick the correct item from your list:
        82c8a6e9-d0d6-402e-9fa9-925f23ce4cbe-image.png

       
      📅 For example, if today is Wednesday, the “current day of the week” block will return 4, and item 4 in your list will be "Wednesday".

       
       

      Step 7 - Get the Full Date and Time

       

      We can also get the full date and time using the current block and combine them into a single string:

      6dfcfd51-db40-401c-a5d2-ad253e5d4d66-image.png

       
       

      Step 8 - Send Time Info with Every User Message

       

      Now we’ll attach the time information to each message we send to the AI model.

      bd8c0581-61a3-4da0-bc40-1d5eae91b171-image.png

       
      For example, if the user says “hi”, then what we actually send to the AI will be:

      hi
      (current time: Wednesday 05/21/2025 13:23:43 )
      

      That way, the AI will know exactly when the message was sent!

      You can now test it to make sure the AI sees the correct time:

      392697d0-3618-40dd-a401-0d1d5c871753-image.png

       
       
       
       
       
       
       

      🧩 Part 2 - Managing the Calendar with Google Sheets

       

       
       

      Step 1 -  Plan the Workflow for Adding a New Event

       

      Our entire calendar lives in Google Sheets, yet the AI can’t touch that Sheet directly — it needs help from our helper code. Here’s a sample back‑and‑forth among the user, the AI, and the helper:

      1. User -> AI: I will have a haircut tomorrow at 4pm
      2. AI -> Helper: add a new event for [date] [time]
      3. Helper adds it to the Google Sheet
      4. Helper -> AI: event added successfully
      5. AI -> User: I have added the haircut to your calendar.

       
      From the user’s perspective, the Sheet and helper code are invisible—the AI simply “gets it done.”

      Another way to think about it: the user speaks natural language, the helper speaks code, so the AI acts as the translator between them.

       
       

      Step 2 - Define the “addEvent” Command

       

      To teach the AI to use our helper, we need to define a new command “addEvent” in the system instruction:

      You are an AI assistant that helps manage the user's calendar.
      
      ## Commands
      
      You can use the following tools to manage events through an external service:
      
      * To add a new event to the calendar, you can return this command, which will return its eventID:
      addEvent | [date] | [time] | [event description]
      
      ## Instructions
      
      * If you are using a command, then only return the one line of command and nothing else.
      
      

      Notes:

      • We separated Commands and Instructions with ## headers so the AI can “see” the sections clearly.

      • The addEvent syntax uses pipes (|) — easy for us to split into pieces later.

      • The instruction forces the AI to output only the command line when needed — no extra chit‑chat.

      Testing now shows the AI emitting addEvent lines automatically:

      324814be-e4dd-4867-9c6b-9b5b5925ad71-image.png

       
       

      Step 3 - Standardize Date and Time Formats

       

      The AI currently formats dates like 05/01/2025, which sorts poorly—05/01/2025 appears “larger” than 02/01/2026. Times such as “3 p.m.” sort badly, too.

      Add two lines to the Instructions section to enforce sortable formats:

      You are an AI assistant that helps manage the user's calendar.
      
      ## Commands
      
      You can use the following tools to manage events through an external service:
      
      * To add a new event to the calendar, you can return this command, which will return its eventID:
      addEvent | [date] | [time] | [event description]
      
      ## Instructions
      
      * If you are using a command, then only return the one line of command and nothing else.
      * Use yyyy.mm.dd date format, such as "2025.02.21"
      * Use hh:mm time format, such as "13:30"
      
      

      Re‑run the app and confirm:

      d1eb5487-12ab-4d69-a973-1cfc3adb3217-image.png

       
       

      Step 4 - Intercept the “addEvent” command

       

      Whenever we receive AI output, we’ll check if it begins with "addEvent " (note the trailing space). If so, we execute helper code in “handle add event”.

      ee6922cd-072a-4a8b-a75b-38d00263f53b-image.png

       
       

      Step 5 - Extract the Parameters

       

      The addEvent line has four parts separated by three pipes. Use the “part of” block to pick them apart and trim whitespace:

      b904221b-f61a-44b0-a897-5ae7264f3e73-image.png

       
       

      Step 6 - Read Data from Google Sheets

       

      Our add‑event logic is:

      1. Read the user’s tab into a table called events.
      2. Add the new event.
      3. Write the entire table back.

      To start, we will read the sheet using a “read data” block:

      c9234755-1b23-4d7b-ab29-747080b966df-image.png

       
      In this block, we will use the “read from Google Sheet” block to read the first 10000 rows from this user’s tab, assuming there are less than 10000 events on the calendar:

      333550a9-d29b-4284-8fcc-67a38af3aa7f-image.png

       
      Run this block and remove all the widgets (or save and reload the project), you will find the “events” table looks like this:

      5ed62169-3cac-423a-a4dd-977a5e16ce8a-image.png

       
      That’s because the new tab is still empty, so the column headers are missing. To fix that, we can define the columns whenever there are 0 rows in the table:

      61dffcd1-e3d2-4361-8535-533288186d35-image.png

       
      The first column “id” will be used to store the unique eventID.

       
       

      Step 7 - Add the New Event

       

      Generate a unique ID using row count + 1 (always unique) and prefix it with “E”. Then append a row:

      d3c9015d-d19e-450b-9775-22dfd1a66eca-image.png

       
       

      Step 8 - Sort the Table

       

      Since all the events have date and time, we should keep them sorted in the calendar. We will sort the rows by “time” first, then by “date”. This will ensure all events are sorted by date and then time:

      4d864702-2d7b-4f65-8a59-bab1e3025a9e-image.png

       
       

      Step 9 - Write Back to the Sheet

       

      Overwrite the user’s tab with the updated table:

      05a6e9d1-f1d6-46fe-a66a-7ca12687e8e2-image.png

       
       

      Step 10 - Report Success to the AI

       

      Let the AI know the command succeeded and pass along the new eventID:

      64a7f312-336b-4591-a3ac-840599769b41-image.png

       
      We clarify that this message is from addEvent, so the AI won’t mistake it for user input.

      Test by adding events:

      c49731ea-472d-498f-a385-ae98eb299472-image.png

       
      …and confirm they appear in the Sheet:

      48824007-a8a5-4e7a-9d2a-1ee82f9eb9d8-image.png

       
       

      Step 11 - Define the “removeEvent” Command

       

      Next, let’s work on removing an evnet. We will still start with defining the command in the system instruction:

      You are an AI assistant that helps manage the user's calendar.
      
      ## Commands
      
      You can use the following tools to manage events through an external service:
      
      * To add a new event to the calendar, you can return this command, which will return its eventID:
      addEvent | [date] | [time] | [event description]
      
      * To remove an existing event, after you have found its eventID, you can use this command:
      removeEvent | [eventID]
      
      ## Instructions
      
      * If you are using a command, then only return the one line of command and nothing else.
      * Use yyyy.mm.dd date format, such as "2025.02.21"
      * Use hh:mm time format, such as "13:30"
      

      removeEvent takes just one parameter — the event’s unique ID. If the AI doesn’t already know the ID, it must retrieve it using other commands first (those are defined later).

       
       

      Step 12 - Intercept the “removeEvent” Command

       

      Detect and handle it with a new block:

      fba93dd8-a0af-4516-9c8d-5316582db7f5-image.png

       
       

      Step 13 - Extract the eventID

       

      Pull the ID from the command string:

      0180e05f-19f3-44cf-b351-6589c557a27f-image.png

       
       

      Step 14 - Find and Remove the Event

       

      1. Read the Sheet into events again.
      2. Find the index of the row with the matching eventID.
      3. Delete that row.

      8637a6a4-4f4d-4cba-b236-d265a9214ae6-image.png

       
       

      Step 15 - Clear and Rewrite the Sheet

       

      Before we write the table back, we need to first clear the tab. The reason is that the table has one less row compared to the data in that tab, so if we simply write the table into that tab, there will be an extra duplicate row at the bottom.

      bdd2d179-e0a3-428f-b7cf-ccece0807ecd-image.png

       
       

      Step 16 - Report Removal to the AI

       

      Notify the AI so it can reply to the user:

      7d7a062a-078f-4733-9579-baf1cdda4d44-image.png

      Restart your program, add an event, then remove it. Double‑check the Sheet each time:

      f31330ff-bb58-4ed5-bd82-bb6c399c64cb-image.png

       
       

      Step 17 - Define the “searchEvents” Command

       

      Earlier, the AI already knew the eventID for the dentist appointment, so removing it was easy. But when an eventID is not in the chat context, the AI must search for the event first.

      To keep things simple, we’ll let the AI specify one keyword. Our helper will search that word in the description column and return every matching event (with its eventID).

      Updated system instruction:

      You are an AI assistant that helps manage the user's calendar.
      
      ## Commands
      
      You can use the following tools to manage events through an external service:
      
      * To add a new event to the calendar, you can return this command, which will return its eventID:
      addEvent | [date] | [time] | [event description]
      
      * To remove an existing event, after you have found its eventID, you can use this command:
      removeEvent | [eventID]
      
      * To search for existing events by a **single word**, use this command, which will return all events at that time with their eventIDs (use a generic word to get more likely matches):
      searchEvents | [keyword]
      
      
      ## Instructions
      
      * If you are using a command, then only return the one line of command and nothing else.
      * Use yyyy.mm.dd date format, such as "2025.02.21"
      * Use hh:mm time format, such as "13:30"
      
      

      We instruct the AI to choose one broad word (e.g., “lunch” or “Jon”) so we’re more likely to find the right event—even if we return a few extras, the AI can sort them out.

      Test it:

      cb3181c5-3870-40b9-90d3-8ded030b3ec9-image.png

       
      The AI should pick “lunch” or “Jon” as the word to search for.

       
       

      Step 18 - Intercept the “searchEvents” Command

       

      We will handle this new command using the block “handl search command”:

      a189acb7-0a5b-4cd4-8aa6-cfc1a1109172-image.png

       
       

      Step 19 - Extract the Search Word and Read the Data

       

      Store the keyword in a variable called search word:

      d470f68e-fb62-488c-ae99-73dbb6dfd306-image.png

       
       

      Step 20 - Iterate Through All Rows

       

      Use a for‑loop to walk through each row in events, pulling out the description:

      b1fbb7ed-c0e0-4ffc-af72-d85b4a194889-image.png

       
       

      Step 21 - Build the Search Result

       

      Create a variable called search result. Start it empty, and append every row whose description contains the keyword:

      dd7b8d9b-2dd3-46c0-bc4a-f9d10745b8e6-image.png

       
       

      Step 22 - Send the Search Result to the AI

       

      After the for-loop finishes, the “search result” will either be empty or filled with events. Either way, we will let the AI know the result, so it can generate the response to the user:

      29c74dc2-4960-40b3-883c-56ef07fd5d6d-image.png

       
      To test it, first add another lunch event to the Google Sheet with another person:

      7b4d3776-859e-4f85-9e28-083e63d91b66-image.png

      Then, restart the app, and ask about the “lunch with Jon”:

      9a7d452e-0fa5-4c22-b2e6-224b66743812-image.png

       
       

      Step 23 - Define the “findEvents” Command

       

      Our final command, findEvents, grabs every event between two time points. Perfect for “Am I free next Wednesday morning?” or “What’s on my calendar this weekend?”

      Here is the updated system instruction with the “findEvents” command:

      You are an AI assistant that helps manage the user's calendar.
      
      ## Commands
      
      You can use the following tools to manage events through an external service:
      
      * To add a new event to the calendar, you can return this command, which will return its eventID:
      addEvent | [date] | [time] | [event description]
      
      * To remove an existing event, after you have found its eventID, you can use this command:
      removeEvent | [eventID]
      
      * To search for existing events by a **single word**, use this command, which will return all events at that time with their eventIDs (use a generic word to get more likely matches):
      searchEvents | [keyword]
      
      * To find existing events inbetween 2 time points (they can be the same date or time), you can use this command, which will return all events within the given time interval:
      findEvents | [start date] | [start time] | [end date] | [end time]
      
      ## Instructions
      
      * If you are using a command, then only return the one line of command and nothing else.
      * Use yyyy.mm.dd date format, such as "2025.02.21"
      * Use hh:mm time format, such as "13:30"
      

       
       

      Step 24 - Intercept the “findEvents” Command

       

      We will handle this command using a new block called “handle find events”:

      779b348f-b6c7-4853-9f3c-83d3cf946c74-image.png

       
      The “handle find events” block should be very similar to the “handle search events” block. Can you try to implement it before looking at the steps below?

       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       

      Step 25 - Extract Parameters

       

      We will first extract the 4 parameters:

      e2561586-799a-4b27-954b-592d8e8b08d8-image.png

       
       

      Step 26 - Reading Events in a For-Loop

       

      We will still use a for-loop, but this time, we will extract the eventDate and eventTime from each row:

      974f08b8-7ec7-40ea-b506-955b752045b8-image.png

       
       

      Step 27 - Skip Events Before the Start Date/Time

       

      As we check out each row, if we find its date is earlier than the start date, or its time is earlier than the start time, then we will continue to the next row:

      fbb2c495-08cf-43ce-b613-c6b890d109f1-image.png

       
       

      Step 28 - Stop After the End Date/Time

       

      Because events are already sorted, once we reach a row after the end date/time, we can break the loop. Until then, add each valid row to search result:

      413abb89-a679-4f75-9fa0-dbde4e7d29d4-image.png

       
       

      Step 29 - Send these events to the AI

       

      After the for-loop completes, we will give the result list to the AI:

      db5cbeff-0384-4655-991e-88892902fd8c-image.png

       
      Now let’s test it. Suppose this is the calender:

      b6fb265d-d965-4b4e-be6a-b6b90d7ac4d9-image.png

       
      The AI will be able to find all events for next week:

      32bd8a87-72ba-4769-9ba0-48126f9b0a10-image.png

       
       

      Step 30 - Refine the output

       

      The reply above feels a little robotic. Let’s tweak the system prompt so the AI talks more like a human:

      ## Instructions
      
      * If you are responding to the user, then talk like a human
      * If you are sending a command, then only return the **single line** of command and nothing else.
      * Use yyyy.mm.dd date format in commands, such as "2025.02.21"
      * Use hh:mm time format in commands, such as "13:30"
      

       
      Unfortunately, this sometimes makes the AI mix user responses with commands:

      1d59cee0-244b-44b9-9f4c-9283717ac8a7-image.png

       
      Fix: Apply the T.I.R.E. prompting method by adding an explicit Example to the end of the system instruction:

      
      ## Example
      
      [User]: I need to go to Jon's birthday party this Saturday
      [You]: What time is the party?
      [User]: I think it is 2pm
      [You]: addEvent | 2025.05.31 | 14:00 | Jon's birthday party at 2 PM
      [Helper]: addEvent result: successfully added event with ID: E123
      [You]: I have added Jon's birthday party to the calendar for May 30 at 2pm.
      [User]: So what's my schedule next week?
      [You]: findEvents | 2025.05.26 | 00:00 | 2025.06.01 | 23:59
      [Helper]: findEvents result: 
      E99|2025.05.28|18:00|gym class with friend at 6 PM
      E123|2025.05.31|14:00|Jon's birthday party at 2 PM
      [You]: Looks like you have a light schedule next week. You will be meeting with your friend for a gym class next Wednesday at 6, and you will also attend Jon's birthday party on Sunday at 2 o'clock.
      
      

       

      Another problem that might appear in testing is that the AI sometimes think of “next week” as the “next 7 days”, rather than the next calendar week. This can be fixed by adding a new line in the “## Instructions” section:

      * When the user refers to the next week, assume they mean the next calendar week, not the next 7 days.
      

       

      Finally, we are getting a much more human-like response:
       
      be331e0c-680c-49ad-b023-822c792fa45e-image.png

       
       
      Here is a final demo:
       
      calendar.gif

       
       

      Important Note:

       
      When you release your app for other users, you should publish the project instead of sharing it. That is because if you share the project, any user can look inside it to acquire the URL of the Google Sheet, then they will be able to look at other users’ calendars.

       
       
       
       
       

      Additional Challenges

       

      For practice, here are some improvements you can make to this app:

      1. Multiple Commands:
        • Users may combine requests (“My lunch with Jon is cancelled and schedule a dentist at 4 p.m. today”).
        • Rescheduling should trigger a removeEvent followed by an addEvent.

       

      1. Multiple Search Keywords:
        • Allow two or three keywords for searchEvents.
        • “Lunch with Jon” could search for “Jon” and “lunch.”

       

      1. Remove Past Events:
        • When the app starts, delete events more than one month old to keep the Sheet tidy.

       

      1. Recurring Events (advanced):

        • Extend addEvent with a fifth parameter, interval (e.g., “weekly,” “daily”).
        • Add an interval column to the Sheet.
        • When interval is present, auto‑add the event for the next six months.
        • On startup, scan for recurring events and extend them six months into the future.
      posted in Tutorials
      info-creaticode
      CreatiCode
    • RE: Bug?

      @notjaldolfyt

      We just tried, and it seems these comments are not blocked?

      a1f10b9f-8a1a-4179-a12e-aa463cf7954a-image.png

      posted in Help
      info-creaticode
      CreatiCode
    • AI-based Game: Guardian of History (Difficulty 4)

      Introduction

       

      Large Language Models (LLMs) such as ChatGPT can do far more than simply chat or perform text‑processing tricks.

      In this tutorial you will build an artificial‑intelligence‑powered game called “Guardian of History.”

      The AI will act as the Game Master, controlling all interactions with the player. Because the AI responds to the player’s unique choices, every play‑through feels fresh and completely personalized.

      This game is an entirely new game designed by the CreatiCode team. Here are some high-level explanations on how this game works:

      1. Background — A villain has stolen a time‑travel machine and journeyed into the past to tamper with human history. They secretly “hijack” the mind of a historical figure, force that person to act differently, and thereby disrupt a major historical event.

      2. Goal of the Game — The player is a “Guardian of the True Timeline.” To win, they must figure out who was hijacked and what action that person took under mind control. Once identified, the timeline can be repaired.

      3. Helper Tool — The player has access to a time‑travel console named TESSA. TESSA can answer any question about the true or altered timeline — but it does not know the identity of the hijacked person either. That detective work is up to the player.

       
      Here is a preview of the game play:

      Peek 2025-05-19 19-48.gif

       
      Besides being fun, this game strengthens historical knowledge, logical reasoning, and debugging skills as the player searches for clues in the altered past.

       
       

      Tutorial Structure

       

      This project leans heavily on widget blocks to build the game’s user interface (UI). Because coding the complete UI step‑by‑step would be extremely long, and our focus is really on the AI portion, you will start from a template project that already contains all non‑AI code.

      The tutorial is split into two large parts:

      • Part 1   A rapid walkthrough of the provided UI code. You will see how every sprite and block fits together so you can customize the visuals later if you wish.
      • Part 2   A detailed, step‑by‑step guide for adding the AI logic. Here you will write and fine‑tune the complex prompts that power the game.

       
       

      Part 1 - Starting Project Explained

       

      This part will help you understand the code given in the starting project, so you can easily change it or extend it, and also you will understand how the AI related code fit into the flow.

       
       

      1 - Remix the project template

       

      You can find the project at this link:

      play.creaticode.com/projects/682bc7628baa30c98a62551a

      Please remix it into your own.

       
       

      2 - The Stage and 3 Sprites

       

      There are 4 components in this project:

      1. Stage: A static backdrop for the game.
      2. “Initial Screen” Sprite: Displays the initial screen when the game starts.
      3. “Game Screen” Sprite: Manages the in‑game chat window and buttons used during play.
      4. “AI” Sprite: Holds all the code that uses AI to run the game. This will be the focus of part 2.

       
       

      3 - The Stage Backdrop

       

      The stage only has one backdrop, which is composed of 3 layers:

      • Background image — You can generate one with any AI image tool. After importing, convert it to vector mode.
      • Title — A bold heading at the top reading “Guardian of History.”
      • Semi‑transparent dialogue area — A see‑through rectangle in the middle where text will appear.

       
      53f6d403-c44d-4f84-b8c9-7b863dcd0c0c-image.png

       
       

      4 - Initial Screen Sprite - Show 3 Main Buttons

       

      Now let’s look at the “Initial Screen” sprite. When the green flag is clicked, this sprite:

      • Loads any saved game so the player may replay a previous mission.
      • Shows an “Instructions” button that explains the rules.
      • Shows a “New Game” button that asks the AI to create a brand‑new plot.
      • Displays a “Replay Game” button only if a prior game was loaded successfully.

       
      ae11ccbb-1997-4ddd-b6c9-534127141913-image.png

       
       

      5 - Initial Screen Sprite - Handle the “Instructions” Button

       

      When Instructions is clicked:

      1. A read‑only rich‑text box appears as an overlay.
      2. Its text is pulled from the variable instructions, which is easy to fill with multi‑line content.
      3. A Back button is added under the text.
      4. Clicking Back removes both the overlay and the button.

       

      0a88cd65-97f1-4e15-b6f8-e65f60ee5584-image.png

       
       

      6 - Initial Screen Sprite - Handle the “New Game” Button

       

      When New Game is pressed:

      • The player sees a label and a text box asking for an interesting historical event. This lets them tailor the adventure to any topic — maybe the French Revolution or the Space Race.
      • For example, we might enter Invention of the Spinning Jenny (UK) in 1764.
      • A “Generate New Game” button then appears. Clicking it instructs the AI to craft a unique plot using the chosen event.

       

      956adf49-c6de-41a4-8886-bcba810e0f47-image.png

       
       

      7 - Initial Screen Sprite - Handle the “Generate New Game” Button

       

      When the player clicks “Generate New Game”:

      1. Saves the typed event in event input.

      2. Clears every widget on screen and shows a single label that says “Creating game …”.

      3. Broadcasts “generate new game” to the AI sprite and waits. The AI will eventually populate 3 key variables:

        • true history – contains the list of people involved in the given event in history.
        • altered history – contains a list of events that lead to a different outcome in the altered history.
        • game intro – a welcome paragraph that sets up the mission.
           
      4. Stores true history, altered history, game intro, and event input so the game can be replayed later.

      5. Removes all widgets because we are switching to the main game screen.

      6. Broadcasts “start game” to let the “Game Screen” sprite take over.

       
      f481e2b7-19eb-41f6-8bbf-c3578ed6a286-image.png

       
       

      8 - Initial Screen Sprite - Load the Saved Game Info

       

      The “load saved game” block (run at project start) works like this:

      1. Retrieves event input, true history, altered history and game intro from local storage.
      2. Extract the first line of altered history into the variable hijacked person. This will be used as the final answer for checking against the player’s guess.

      A real AI‑generated example of altered history looks like this, with the hijacked person’s action in the first line, followed by a series of chain reactions that lead to the disruption of the historical event:

      
      1.  Thomas Highs, instead of employing Hargreaves, decided to focus on improving his own weaving business and invested heavily in new loom technology.
      2.  Without Highs's support or workshop, James Hargreaves lacked the resources and collaborative environment to develop the spinning jenny efficiently.
      3.  Robert Kay's flying shuttle still increased yarn demand, but without the spinning jenny, the pressure fell on existing spinning methods, leading to yarn shortages and price increases.
      4.  John Wyatt and Lewis Paul's earlier spinning machine designs remained largely unexploited, as no other inventor stepped forward to significantly improve upon them.
      5.  Daniel Defoe's advocacy for textile innovation went unheeded, as the focus shifted to optimizing existing hand-spinning techniques rather than pursuing radical mechanization.
      6.  The textile industry experienced slower growth, with weaving outpacing spinning. This imbalance led to economic inefficiencies and delayed the onset of the Industrial Revolution in textile production.
      7.  Ultimately, the invention of the spinning jenny was significantly delayed, potentially allowing other countries or inventors to develop alternative solutions for increasing yarn production first.
      
      

       
       

      9 - Initial Screen Sprite - Handle the “Replay Game” Button

       

      Because the variables were already loaded, pressing Replay Game simply removes the current widgets and broadcasts “start game.” No AI call is necessary.

       
       

      10 - Game Screen Sprite - Responding to “start game”

       

      Now let’s switch to the “Game Screen” sprite. When it receives the “start game” message:

      • Clear the “messages” list, which keeps a running log of player/AI chat.
      • Run the “add chat” block to add a chat window.
      • Run the “add command buttons” block to insert three action buttons below the chat.
      • Run the “add input box” block to prepare a hidden overlay for player text entry.

       
      The finished game screen initially looks like this:

      294a55cc-9bb0-46ae-819d-c223b468c627-image.png

       
       

      11 - Game Screen Sprite - “add chat”

       

      Within add chat the sprite:

      1. Adds the chat window.
      2. Covers the chat’s own input area with a blank label. (We supply our own input dialogue later, which is more reliable than asking the AI to guess each message’s purpose.)
      3. Inserts game intro as TESSA’s very first message.
      4. Saves that same message in the messages list.

       
      If you run only add chat, the screen would appear like this:

      087d25c1-c241-4c9d-a91e-d82d26a62b7a-image.png

       
       

      12 - Game Screen Sprite - “add command buttons”

       

      This block simply drops three buttons onto the bottom edge:

      9f830627-21da-404c-80b4-4be5fe5a82bf-image.png

       
       

      13 - Game Screen Sprite - “add input box”

       

      This custom block creates—but immediately hides—a reusable overlay dialogue. It contains:

      • A purple label that darkens the background.
      • A read‑only textbox that shows a short instruction.
      • A second textbox where the player will type their command.
      • Two buttons: Cancel and Send.

       

      If you displayed them without hiding, they would look like this:

      f1ee0fc7-3611-4fcf-92f9-c9bd20f10498-image.png

       
       

      14 - Game Screen Sprite - “show command input”

       

      This helper toggles the visibility of the overlay input box:

      • If visible = 1, every widget is shown and the input textbox is cleared.
      • If visible = 0, the five widgets are hidden.

       
       

      15 - Game Screen Sprite - Handling the “True History” Button

       

      Clicking True History (factbutton) does three things:

      1. Sets a variable current mode to “check true history.”
      2. Changes the instruction text so the player knows they should ask about the original timeline.
      3. Calls show command input (1) to reveal the overlay.

       
      It would look like this:

      951ca70b-8b5c-4604-a62e-a4d6318abcaf-image.png

       
       

      16 - Game Screen Sprite - Handling the “Altered History” Button

       

      Clicking Altered History (querybutton) follows the same logic, but the instruction now asks about the altered timeline:

      b6dae638-b30c-4f3d-b43e-7da279a84cf8-image.png

       
       

      17 - Game Screen Sprite - Handling the “Guess” Button

       

      Pressing Guess changes the instruction to tell the player they must name the hijacked person and the altered action:

      0da0d319-8997-4365-91f6-390e4d480152-image.png

       
       

      18 - Game Screen Sprite - Handling the “Cancel” Button

       

      If a player opens the overlay but clicks Cancel, show command input (0) hides the dialogue box. Nothing else happens.

       
       

      19 - Game Screen Sprite - Handling the “Send” Button

       

      When Send is clicked the sprite:

      1. Calls show command input (0) to hide the overlay.
      2. If the input box is blank, it exits — identical to pressing Cancel.
      3. Otherwise it appends the player’s message to the chat.
      4. Inserts a placeholder response “…” from TESSA so the user knows the AI is thinking.
      5. Broadcasts “handle command” to the AI sprite and waits.
      6. Replaces “…” with whatever text the AI stores in the variable command result.
      7. If command result reads “You won”, then the player guessed correctly. The three command buttons are hidden so the conversation ends.
      8. If the player has not won, both the player’s message and TESSA’s answer are appended to the messages list.
      9. If the “messages” list becomes too long (more than 31 messages logged), then trim it by removing the 2 oldest messages at the beginning.

       
       

      20 - AI Sprite - Placeholders for Now

       

      Finally, let’s peek at the AI sprite. It currently reacts to only two broadcasts:

      1. “generate new game” – It must invent a full storyline (hijacked person, true history, altered timeline) based on the historical event the player typed. It also needs to compose the introductory game intro.

      2. “handle command” – Depending on current mode, the sprite will run exactly one of three blocks:

        • query true history – Answer a question about the original timeline.
        • check altered history – Answer a question about the sabotaged timeline.
        • submit a guess – Judge whether the player’s guess is correct.

      We will build these blocks — complete with robust prompts — in Part 2.

       
       
       
       
       
       

      Part 2 - Step‑by‑Step Guide for Adding the AI Logic

       

      Now that you have a solid grasp of the player experience and the template code, it is time to fill in the missing AI pieces.

      Throughout this section, we will iteratively craft long, detailed prompts and apply best‑practice techniques (including the T.I.R.E. prompting method) so the AI consistently produces correct and interesting replies.

       
       

      Step 1 - Generating the “true history”

       

      When the AI sprite receives the broadcast “generate new game,” it must invent an entirely new plot.

      The only input available is the player’s event input, for example — “Invention of the Spinning Jenny (UK) in 1764” or “The Declaration of Independence.”

      From that single line, the AI must output 2 items: what happened in the true history and how that’s disrupted in the altered timeline.

      Let’s focus on the true history first. It is simply a list of key historical figures closely related to the event specified by the player. For some events, these people might be well documented. However, if the player has specified a less well-known event, the AI might have to “invent” some people to create a complete story.

       
      For a simple start, we can try this:

      a87d10ec-0b47-4876-82f1-418db216e06c-image.png

       
      Note: Use the LLM reporter rather than ChatGPT — the LLM block is more suitable for complex tasks.

      And here is a likely output in the console panel:

      Okay, here are some people whose actions were important leading up to the invention of the Spinning Jenny in 1764:
      
      *   **John Kay:** His invention of the flying shuttle in 1733 significantly sped up the weaving process. This created a demand for more yarn, which, in turn, spurred innovation in spinning technology.
      
      *   **Lewis Paul and John Wyatt:** They patented a roller spinning machine in 1738 and 1748. Although their inventions weren't commercially successful, they demonstrated the potential for mechanized spinning and inspired later inventors.
      
      *   **James Hargreaves:** As the inventor of the Spinning Jenny, he is the person most directly responsible for its creation. His personal experience as a weaver likely informed his understanding of the need for a better spinning solution.
      

      Before continuing to the next step, try running these blocks a few times to observe any issues. You should try different “event input” as well.

       
       

      Step 2 - Adding Some Instructions

       

      Here are some issues with the blocks added above:

      1. There are often unnecessary sentences before or after the list, such as “OKay, here are …” or “If you need anything else, let me know …”. These are often called “pleasantries.” They are meant to make a chat message more natural, but since we are not in a chat, they become unnecessary.

      2. The output list often only contains 3 to 4 people. We need more people to create a rich story.

       
      Now, can you try to refine this prompt by adding some instructions for the output?

      For a hint, you can build a longer prompt by joining 2 or 3 variables like this:

      27b28366-f8e2-4380-ad22-06d3739f6eb5-image.png

       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
      Here is an example of a refined prompt in 3 parts:

      • Part 1:
      ## Task
      
      Generate a list of 6 most important people in history whose actions directly led to this event:
      
      

       

      • Part 2: The variable event input (note that you need to run the game at least once to populate this variable with an event)

       

      • Part 3:
      
      ## Instructions
      
      * If historical records are incomplete, invent plausible figures to fill gaps in the story.
      * Briefly explain each's role in the event.
      * You must assign a name in English for each person.
      * Avoid all pleasantries. Only return the list and say nothing else.
      
      

       
      Here are the blocks:

      f2e02411-dfb7-421c-ba36-98b06e101495-image.png

       
      Important observations:

      • We are asking the AI to list exactly 6 people to ensure the true history is not too short or too long.

      • We encourage the AI to “invent” some people if the event is not well-documented.

      • The ## headings make it easy for the AI to locate relevant instructions.

      • The event input is a dynamic component that will be provided by the player, which makes the game highly customizable. For this tutorial, please keep using the default value of “Invention of the Spinning Jenny (UK) in 1764” as an example.

      • We require the AI to “avoid all pleasantries” and only output the list. If you did not include this, most likely you will get unnecessary sentences before or after the list.

       
      When you test run this script, the output in the console may look like this:
       

      *   **James Hargreaves:** Inventor of the Spinning Jenny.
      *   **Thomas Highs:** Possible early inventor of a similar spinning machine.
      *   **Robert Kay:** Inventor of the flying shuttle, which increased demand for yarn.
      *   **John Kay (of Bury):** Improved upon the carding process, preparing cotton fibers for spinning.
      *   **Daniel Defoe:** Writer whose observations highlighted the existing domestic system of textile production and the need for efficiency.
      *   **Lydia Bancroft:** A skilled weaver whose efficiency highlighted the disparity between yarn production and weaving capacity.
      

       
      Try to run this new stack a few times, and observe how the list changes. You will find that people on top of the list usually don’t change much, but the remaining people may change between runs.

       
       

      Step 3 - Generating the “altered history”

       

      Next, we need to generate an altered history based on the true history above. The idea is to randomly pick a person from the list as the person to be “hijacked”, and ask the AI to change that person’s action to disrupt the historical event. We will need a list of chain reactions that lead to the disruption of the historical event.

      Now try to add code to generate this altered history. You can use the LLM block to “continue” the conversation above, so you don’t have to repeat the event or true history again.

       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       

       
      Here is an example implementation:

      c0cffd47-4055-4caf-abf7-b0101f772e2f-image.png

       
      We start by asking the AI to “imagine person X from the list was hijacked by a time traveler to disrupt the event”, and X can be a random number between 2 and 6. We did not include the first person, since that’s almost always the main character of the event, and it would be too easy to guess.

      Next, we specify the task and instructions. The complete text for prompt2 is:

       from the list was hijacked by a time traveler to disrupt the event.
      
      ## Instructions
      
      * Only output a list of chain reactions, starting with that person's action and continuing with how other people may react and how the event was disrupted.
      * The first line must be what the hijacked person did
      * Never mention what happened in the original history. Describe the updated events as if they actually happened in history.
      * Avoid any pleasantries and say nothing else except the list of chain events
      
      ## Output Format Example
      
      1. Isaac Newton walked away from the apple tree, so he ignored apples falling from trees.
      2. ...
      
      

       
      A few important details:

      • The text starts with a SPACE before “from the list”, so that there is a space after the random number when they are joined.

      • We emphasize that the first line must be about the hijacked person since we are extracting that into the variable hijacked person, which will be the game’s final answer.

      • We also include an example output to further make sure the output starts with the action of the hijacked person. This is the “E” part in the T.I.R.E. method.

       
      Here is an example output:

      1. John Kay sabotaged the carding machines in his region and spread misinformation about their reliability.
      2. Textile producers became wary of using carding machines, preferring manual methods of preparing cotton fibers.
      3. James Hargreaves struggled to find a reliable supply of prepared cotton for his Spinning Jenny prototype.
      4. Robert Kay's flying shuttle was not as effective due to the uneven quality of hand-carded yarn.
      5. Daniel Defoe documented the continued inefficiency of textile production, blaming the unreliable fiber preparation methods.
      6. Lydia Bancroft's weaving speed was limited by the inconsistent quality of yarn, reducing overall output.
      7. The Spinning Jenny's adoption was slowed by the lack of efficiently prepared cotton, hindering its impact on textile production.
      

       
      Again, run this part of the code a few times, and notice when different people are chosen as the hijacked person, the timeline varies quite a lot.

       
       

      Step 4 - Generating the Opening Message (“game intro”)

       

      TESSA’s first message should greet the player, summarize the danger, and invite questions—no more than ~80 words. We again build a three‑part prompt:

      • Part 1 — fixed text introducing TESSA and the disrupted event (see below).
      • Part 2 — the dynamic event input.
      • Part 3 — instructions demanding a concise, markdown‑formatted greeting.

      For example:

      • Part 1:
      You are TESSA, a robot in a time-travel detective game. A rogue time traveler has gone back to the past to secretly take over a real person. This person was not famous, but they did something different, changing history in a big way.
      
      The player is a guardian protecting the actual history. With your help, the player will discover which person was taken under control and what they did.
      
      Through you, the player can ask about what happened in the original and altered history, so that the player can discover the rogue traveler.
      
      So far, you know the rogue agent aims to sabotage this event:
      ---
      
      • Part 2: the “event input” variable

      • Part 3:

      ---
      
      Now, please generate a short greeting message within 80 words to the player explaining the situation and ask the player to ask questions to catch the rogue traveler.
      
      Use a markdown format to emphasize key information.
      
      

      Note that we are asking the AI to use the markdown format, which usually makes the output easier to read. This is important, since this game is mostly presented by chat messages, it will be exhausting if the player has to read big chunks of text.

      Below is the code for composing this 3-part prompt and send it to AI:

      4e2a809b-03e0-4c6d-b333-eb87d2bad196-image.png

       
      Note that we are using a “new chat” session type. Since all the information is included in the current prompt, the AI does not need any previous messages to generate the new message.

      After this step, when the player generates a new game, they will be greeted with a new message like this:

      2cb75199-b8b3-44d6-80e4-49595eff8c3a-image.png

       
       

      Step 5 - Handling Query on the True Timeline

       

      Next, let’s address the player’s question about what actually happened. This will be a complex prompt that we can develop in a few steps.

      For an initial version of the prompt, let’s keep it relatively simple:

      • Explain how the game works and the key event
      • Tell the AI that its task is to answer the player’s question

      Please add code to “query true history” to compose the prompt above and query the AI. You can test with this question: “Who invented the Jenny?”

       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       

      Based on the discussion above, this prompt will contain 5 parts:

      • Part 1:
      You are TESSA, an AI time machine in a time-travel detective game: a bad time traveler has gone back to the past, secretly taken over a real person to alter their action. The player's job is to guess which person was hijacked and what change in action was made.
      
      Specifically, the current game plot is about protecting the truth of this event:
      
      
      • Part 2: the variable “event input”

      • Part 3:

      
      ## Task
      
      Your current task is to answer a question about the true history from the player:
      
      • Part 4: the variable “player input”, which contains the question.

       
      Below is the code to compose these 4 parts into the prompt and query the AI:

      8365d52f-8187-4487-871d-6243d88a61ff-image.png

       
      Here is an example response we get:

      0ad2951f-91b6-4ab4-9186-7fcac3b00d6d-image.png

       
       

      Step 6 - Adding Recent Messages for Context

       

      When answering player questions, we are doing something very different: we always choose the “new chat” session type instead of “continue”.

      Here is why. When we use the “continue” type, the CreatiCode server will help save all the messages between the user and the AI, and automatically attach them to the next request, so the AI model understands the context.

      However, for this project, there may be hundreds of messages between the player and the AI, so soon there will be too many messages in the context, and the AI model won’t be able to handle them anymore.

      Therefore, we are going to use the “new chat” type and provide the most recent messages ourselves in each request. The benefit is that the player can keep chatting forever if they want to. However, since only the most recent conversation is saved, the AI model will not “remember” earlier messages, though the player can still check them in the chat window themselves.

      To insert the recent messages into the prompt, we can insert another section into our prompt:

      40ba36bb-d4e4-455c-b60e-c4261cc2cc1c-image.png

       
      Note that when we use “messages” as a reporter, it will join all the items in that list as one text.

      The value of “prompt2” above is the following:

      
      ## Recent Messages
      
      For context, here is the most recent conversation between you and the player:
      
      

      We can test it by asking 2 questions one by one:

      1. “Who invented the Jenny?”
      2. “How old was he in 1764?”

      Because we are inserting the messages into the prompt, the AI model can infer “he” refers to “James” in the second question:

      0fb06357-4cdf-486b-83d7-beb39edcd729-image.png

       
       

      Step 7 - Adding the True History as Refrence

       

      Although we can simply make the AI answer these questions based on its existing knowledge of the actual history, it is better to “ground” it with the “true history” we have generated earlier. This way, it will generate consistent answers, and it will automatically include these key people in its answers, which can serve as clues for the player.

      To do that, we can insert these blocks when composing the prompt for the true history:

      64ad405c-6862-467b-ab1f-2590ec045b7c-image.png

       
      The content of the “prompt2” is the following:

      
      
      ## Reference
      
      Some additional details related to the event that you can use as reference:
      
      

       
       

      Step 8 - Output Instructions

       

      Although our code works for basic questions, there are a few issues that need to be addressed:

      • It may include unnecessary pleasantries.
      • It might be “too eager to help” and leak the secret identity of the hijacked person.

      Therefore, we need to add a new section “Output Instructions” to improve the output. This prompt can be refined over time, but here is a good starting point:

      
      
      ## Output Instructions
      
      Now return the answer as if you are talking to the player directly.
      
      * Always assume the player is asking about the true history.
      * Try to include other people from history in your answer besides the reference to make it harder to guess who are important.
      * Be concise. No need for pleasantries. Just answer directly.
      * If the player's question is not clear, you can ask a clarifying question instead. 
      * Use markdown format to organize your answer to make it concise and easy to understand.
      * For any questions on the rogue traveler, say they have no impact on the true history.
      * For questions on who was hijacked or what was changed, say you have no information.
      * Reject inappropriate inputs.
      

       
      This section can be inserted like this:

      e528a2b1-60dd-48d1-b468-731f49257d8b-image.png

       
       

      Step 9 - Handling Questions about the Altered History

       

      The logic for answering questions about the altered history is actually very similar to that for the true history.

      Can you give it a try first? Duplicate the blocks from the “query true history” block into the “query altered history” block, then make all necessary changes.

       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
      Here are the blocks you need:

      a3b71374-6562-4ed3-9159-c68337d50a53-image.png

       
      The changes are:

      • For “Task”, it needs to be updated like this:
      ## Task
      
      Your current task is to answer a question about the altered history from the player:
      
      
      • For “Altered History”:
      
      ## Altered History
      
      The following events happened in the altered history. You should base your answers on these events instead of the actual history:
      
      
      
      • For “Output Instructions”, you need to specify that the answers should be about the altered history:
      
      
      
      ## Output Instructions
      
      Now return the answer as if you are talking to the player directly.
      
      * Always assume the player is asking about the altered history.
      * Use the reference to help you answer, and fill in more details and bridge any gaps to make your answer logical and consistent as if they really happened. You can add additional people in the explanations, so long as they make sense.
      * Be concise. No need for pleasantries. Just answer directly.
      * If the player's question is not clear, you can ask a clarifying question instead. 
      * Use markdown format to organize your answer to make it concise and easy to understand.
      * For questions on the rogue traveler, who was hijacked or what was changed, say you have no information.
      * Reject inappropriate inputs.
      
      

       

      Try a few questions on the altered history. Do you see any issues?

       
       

      Step 10 - Enhancing the Output Instructions

       

      One obvious and serious issue is that the AI is “too eager to share”. For example:

      54a2c2d4-59a9-41b8-be2c-8519713d1ae6-image.png

       

      This is a critical issue. If the AI keeps spilling out clues like this, the game will be boringly easy to play.

      To make the game more challenging, we need to force the AI to say less. Here are some new instructions we can add:

      
      
      ## Output Instructions
      
      Now return the answer as if you are talking to the player directly.
      
      * Always assume the player is asking about the altered history.
      * * Use the reference to help you answer, and fill in more details and bridge any gaps to make your answer logical and consistent as if they really happened. You can add additional people in the explanations, so long as they make sense.
      * Be concise. No need for pleasantries. Just answer directly.
      * If some event did not occur in the altered history, say it did not happen without explaining why.
      * Avoid explaining why some event happend and avoid offering extra facts unless you have to. 
      * Be secretive and respond with the **minimum info**. Make it hard for the player to guess the hijacked person.
      * If the player's question is not clear, you can ask a clarifying question instead. 
      * Use markdown format to organize your answer to make it concise and easy to understand.
      * For questions on the rogue traveler, who was hijacked or what was changed, say you have no information.
      * Reject inappropriate inputs.
      

      After this change, the answer is less helpful (which is good):

      b5134a91-f61a-4f5c-8c74-232235ffc3d6-image.png

       
      Of course, this prompt can still be improved over time as you test with more events and questions.

       
       

      Step 11 - Evaluating Player’s Guess

       

      For the last part, we need to check if the player’s guess is correct. To do that, we need to explain the game to the AI, and ask the AI to compare the player’s guess against the secret information on the hijacked person. To avoid leaking any information by accident, we will simply make the AI respond with one word: “correct”, “partial” or “wrong”.

      You can start by duplicating the blocks from “handle altered history”, and then updating the blocks/variables:

       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       

      Here is an example solution:

      2ee9f2b3-17f9-414d-912e-327dc0c04df1-image.png

       
      The changes:

      • The Task is different:
      ## Task
      
      Your current task is to check if the player has guessed correctly who the hijacked person is and what they did to sabotage the event above. Here is the player's input:
      
      
      • Some information on the hijacked person is inserted

      • The output instructions emphasize that only one word should be returned:

      
      
      ## Output Instructions
      
      Return a single word "correct", "partial" or "wrong" by comparing the player's input and the secret information below.
      
      * Return "correct" if the player guessed the hijacked person's name, and is pretty close on what that person did to sabotage the key event.
      * Return "partial" if the name was guessed correctly, but the action description is missing or far off.
      * Return "wrong" if the name was not guessed correctly.
      
      

       
       

      Step 12 - Converting the One‑Word Verdict into Friendly Feedback

       

      Players deserve a human‑readable reply. In the Game Screen sprite, intercept the raw AI verdict and swap it for a nicer message:

      75aa67cd-be5d-430b-8239-026fa0970f86-image.png

       
       

      Demo

       

      That’s all the steps needed to complete a basic version of the game. Here is what it looks like in action:

      Peek 2025-05-19 19-48.gif

       
       

      Additional Challenges

       

      Below are some creative extensions you can try to make the game more advanced, interesting, or accessible. These tasks are optional but highly recommended as practice to deepen your understanding of AI behavior and game design.

      • Refine the Prompts: Thoroughly test the game and look for bugs, inconsistencies, or loopholes. Then refine the AI prompts to fix those issues. For instance, if the player can easily trick the AI into revealing the correct answer, that would ruin the challenge, so make sure the prompts explicitly tell the AI not to leak any secret information unless asked directly.

      • Add Difficulty Levels: Let players choose a difficulty level when starting a new game. You can increase the challenge by having the AI generate more people involved in the event, so instead of 6 possible suspects, you might have 10 or even more. This adds complexity and makes guessing correctly much harder.

      • Add a Hint Button: For players who are younger or not familiar with history, the game may be too difficult. To help them out without spoiling the answer, you can add a fourth button labeled “Hint” on the game screen. When clicked, the AI can provide a small clue—such as a general time range, region, or a short list of suspicious individuals—that nudges the player in the right direction while still preserving the mystery.

      • Enable Conversations with Historical Characters: Currently, the player can only talk to TESSA to ask questions about the timeline. A major upgrade would be to allow the player to “mentally travel” into the timeline and speak directly with people from that era. You can implement this by asking the AI to role-play historical figures based on the time period and context. This will make the investigation more immersive, like interviewing eyewitnesses in a mystery story.

      posted in Tutorials
      info-creaticode
      CreatiCode
    • RE: Really sad about this

      @notjaldolfyt

      This issue is fixed now.

      posted in Help
      info-creaticode
      CreatiCode
    • RE: [Community Project] Let's Build a CreatiCode Project Packager!

      @tyller_ @Neurotex000-ed114c41

      Thank you for bringing this up.

      We have considered this before. The main issue is that the new extensions, like 3D and AI, all rely on our server to work, so an “offline” version won’t do much.

      If the goal is to generate a package to run a project online, such as embedding it in a webpage, then the “share link” tool already makes this possible.

      We would like to hear more about whether this new packager would be really useful for CreatiCode. If there is a strong use case, we are open to working on it ourselves or with the community.

      posted in Test
      info-creaticode
      CreatiCode
    • RE: First person camera w/ mouse controls

      @remi-1286167-510cee35

      If you use the pointer lock, the v-angle will be automatically changed. But you said you want to limit the v-angle?

      If you want it to move freely but within a range, you can still use the same block to set the v-angle whenever it is outside the range.

      posted in Help
      info-creaticode
      CreatiCode
    • RE: First person camera w/ mouse controls

      @remi-1286167-510cee35

      This seems very similar to the Minecraft demo, where you use “lock pointer” to control the camera view using the mouse pointer:

      play.creaticode.com/projects/660aa865b57a3da838c387bc

       
      To lock the vertical angle, a simple trick is to repeatedly set the camera’s v-angle to 90 degrees whenever it is not:

      5e72b248-fd89-46ad-9d2b-d350b5927689-image.png

      posted in Help
      info-creaticode
      CreatiCode
    • RE: Fog end

      @coder0145 said in Fog end:

      The box is just to demonstrate the fog works on objects, right?

      That’s correct.

      posted in Help
      info-creaticode
      CreatiCode
    • RE: Fog end

      @coder0145

      OK. We can adjust that skybox to disable the fog. Would this be what you are looking for? We can release this over the weekend.

      f2c37ee8-e2f2-44ff-95f6-040d9891ab9e-image.png

      posted in Help
      info-creaticode
      CreatiCode
    • RE: Fog end

      @coder0145

      Got it. Which scene are you using? We might be able to give you a way to disable fogging effect for the skybox you are using.

      posted in Help
      info-creaticode
      CreatiCode
    • RE: chatgpt error

      @greeniwastakenyt

      Do you still have this issue? Most likely it was a temporary outage from ChatGPT’s service (OpenAI).

      In addition, whenever you have such outage issues, you can replace the ChatGPT block with the LLM block, which works the same way but connects to a different AI service.

      e41c309b-40cc-4840-ac44-5a95c2c1154c-image.png

      posted in Help
      info-creaticode
      CreatiCode
    • RE: Fog end

      @coder0145

      The fog is added in front of the camera, so no matter which direction you look at through the camera, there is fog. Is there any reason why there wouldn’t be fog above the player’s head?

      posted in Help
      info-creaticode
      CreatiCode
    • RE: Really sad about this

      @ljvb_4

      This issue will be fixed soon.

      posted in Help
      info-creaticode
      CreatiCode
    • RE: Can I import anyone elses project?

      @ljvb_4

      Yes, so long as credit is given. Thank you.

      posted in Help
      info-creaticode
      CreatiCode
    • RE: Not seeing my project on my user page

      @ljvb_4

      You mean this page? https://play.creaticode.com/users/670f245ae86d0c82b3b3c060

      We will look into it.

      posted in Help
      info-creaticode
      CreatiCode
    • RE: None is the only option

      @coder0145

      That dropdown is automatically populated using the list of sprites in the project.

      According to the tutorial, you need to create another sprite named “Maze”, which will be used to create the walls of the maze. After you do that, then this dropdown will contain the “Maze” option.

      posted in Help
      info-creaticode
      CreatiCode
    • RE: Yellow boxes around projects?

      @notjaldolfyt

      Thank you. We will look into this.

      posted in Help
      info-creaticode
      CreatiCode
    • RE: Yellow boxes around projects?

      @the_true_odst said in Yellow boxes around projects?:

      It is a bit buggy though, it doesn’t always show.

      Can you let us know where the block count does not show? We are not aware of this issue. Thank you.

      posted in Help
      info-creaticode
      CreatiCode
    • RE: Yellow boxes around projects?

      @notjaldolfyt

      Those orange borders mean those projects are not shared with you. Most likely, they are published (you can play with it) but not shared (you can’t look inside).

      posted in Help
      info-creaticode
      CreatiCode
    • RE: Creaticode AI v4 help

      @greeniwastakenyt said in Creaticode AI v4 help:

      what does socratic mode do?

      Hi, you can actually ask XO this question:

      bded187a-4b01-4d96-ad41-545a116a2199-image.png

      posted in Help
      info-creaticode
      CreatiCode
    • RE: BUG: Strange Bug with Palette Previewing

      @alexanderstevens-62d46173

      This issue has been fixed.

      posted in Help
      info-creaticode
      CreatiCode
    • RE: Simple Question

      @attractive-milk

      Our current focus is on AI-related learning and coding tools. We will continue to make XO (the AI assistant) smarter and add more AI blocks.

      Other than that, we work on a list of features requested by users (many from this forum), such as addons/extensions, new 3D models, UX optimizations, etc.

      Feel free to make new suggestions!

      posted in Feedback
      info-creaticode
      CreatiCode
    • RE: Generating AI sprites and backdrops will not work

      @sirbots

      Please share the prompt and screenshot. It should be working fine, but there may be a longer waiting time when there are many image generation requests queued.

      posted in Help
      info-creaticode
      CreatiCode
    • RE: BUG: Strange Bug with Palette Previewing

      @alexanderstevens-62d46173

      You are right. Currently there is an issue if you click the block directly in the palette. It will be fixed in a day or two. For now, please drag the block into the editor to run it.

      Thank you

      posted in Help
      info-creaticode
      CreatiCode
    • RE: queshtion

      @mclark3388-stu-hcpsnc

      That feature is originally meant for users with disabilities. But it has been abused by some students, which distracts these students from learning instead of helping.

      So we have taken it down for now. We will restore it when we have added additional safeguards against abusing users.

      posted in General Discussion
      info-creaticode
      CreatiCode
    • RE: Clone won't appear :(

      @the_true_odst

      I looked at your “Sprite1”, but there is no “create clone of myself as [polkadot]” block in that sprite. Can you double-check on that?

      posted in Help
      info-creaticode
      CreatiCode
    • RE: Clone won't appear :(

      @the_true_odst

      Maybe it is a good opportunity to learn how to debug? Here are 2 tutorials that should be helpful:

      • https://www.forum.creaticode.com/topic/1568/how-to-debug
      • https://www.forum.creaticode.com/topic/1102/creaticode-xo-ai-assistant-debugging
      posted in Help
      info-creaticode
      CreatiCode
    • RE: My published projects not showing up in search

      @blackguy-27c5da45

      Yes, it usually takes 24 hours for the index to be fully updated.

      posted in Help
      info-creaticode
      CreatiCode
    • RE: Forever loop won't work for 2 clones in a single sprite:

      @the_true_odst

      Looking at your code, 2 questions come up:

      1. Are you sure those clones with clone ID of “CB1” and “CB2” are both created?

      2. Since the code under “when I start as a clone” is all the same except the clone ID, why not use an “or” block to check both conditions?

      posted in Help
      info-creaticode
      CreatiCode
    • RE: chat windows copy/paste bug

      @jeffreyrb03-gmail

      Thanks. We will look into this.

      posted in Feedback
      info-creaticode
      CreatiCode
    • RE: new block -- "layer"

      @the_true_odst

      That’s true. It can be hard to use when there are many different layers.

      How about 2 new blocks?

      1. go to layer [LAYER]: LAYER can be any number between 0 and 100

      2. my layer: a reporter block for current layer

      posted in Feedback
      info-creaticode
      CreatiCode
    • RE: new block -- "layer"

      @the_true_odst

      Keep in mind that the layers are relative, and there is no concept of “layer 0”, “layer 1”. What do you expect the value of this new block to be?

      posted in Feedback
      info-creaticode
      CreatiCode
    • RE: "delete all clones" block

      @the_true_odst

      The code should work. Can you provide a project link where it doesn’t work for you? And what do you mean by “doesn’t work”?

      posted in Feedback
      info-creaticode
      CreatiCode
    • RE: "delete all clones" block

      @The_True_Odst

      Here is a complete example:

      ac42cbee-a7b7-4e1e-9345-8341d1a0be8c-image.png

      posted in Feedback
      info-creaticode
      CreatiCode
    • RE: Measuring decimal places

      @the_true_odst

      You can ask XO about it. Here is an example prompt:

      write a program to find out the third digit after the decimal point for a number

      posted in Help
      info-creaticode
      CreatiCode
    • RE: Measuring decimal places

      @the_true_odst

      Can you explain the question with an example? It’s not clear what you are trying to measure.

      posted in Help
      info-creaticode
      CreatiCode