Oh wow, what an amazing idea!
It really got me feeling super nostalgic, such a throwback to like more than a decade ago when I was a kid and just spammed poor Akinator with most random characters to see his limits :D
I never thought about it since I went into programming, so it got me thinking about the way it was executed. I'd be very interested to hear about your experience and design that went into this. It's interesting to think about because it literally seemed magical when I was a kid, but now thinking about it I can almost guess the way it deduces and doesn't seem that magical anymore :D
Small complaint: Very frequently, it was repeating the same questions. And some questions seem a bit odd. I gave it multiple attempts and I wasn't able to make him guess that my color is orange. But very easily he guessed my girlfriend's color which was dark blue if I remember correctly!
Regardless, this was super fun to try out and it's a WONDERFUL idea which hit a strange place in my memory. I'm super grateful for it, great job! <3
Viewing post in Colorator 2000: The color picker jam comments
Glad you liked it!
Actually, I used a completely different approach from Akinator. Akinator works by assigning attributes to each character and then asking questions until it finds a match. That approach doesn't work very well for colors because you can't easily give colors attributes like "Is it tall?" or "Does it wear glasses?". It would also require a lot of training data before it could guess correctly, plus I'd need to set up a server so players could continuously train it.
Instead, I asked an AI to generate around 100 questions. For each question, every color is assigned a score based on how strongly it relates to that question.
For example, for the question: "Is it like the sun?"
The scores might be: Yellow = 1.00, Orange = 0.90, Red = 0.80, White = 0.45
When the player answers "Yes", those scores are added to each color's total. In this example, Yellow would gain 1 point, Orange 0.9 points, Red 0.8 points, and so on.
The next question is then chosen from questions that are associated with the current leading color (Yellow in this case).
If the player answers "No", each color loses one quarter of the score associated with that question, and a random question is selected instead.
If the player answers "I don't know", the question is simply skipped.
This process continues until the difference between the highest-scoring color and the second-highest-scoring color exceeds 3 points. At that point, the genie makes its guess. The genie's emotion sprite is also based on this confidence difference.
However, as you noticed, there are still some issues.
Because colors like red, blue, and green are very common, many questions ended up being associated with them. That's probably why blue was easy to guess while orange was much harder.
Another problem appeared during development. Originally, every question that was asked was marked as "used" and could not be asked again. Since I only have about 100 questions, whenever I tried to find an unusual color, after answering "Yes" to just 3 or 4 questions, the genie would sometimes get stuck because it couldn't find another suitable question.
My first solution was to make the game automatically pick a random question whenever it got stuck. Unfortunately, that created a new problem: unusual colors became almost impossible to guess because too many unrelated random questions were being asked.
To fix that, I removed the "used" marker entirely. Questions can now be asked multiple times if necessary, which gives the system enough information to identify less common colors.
At the moment, the game can theoretically guess the following colors:
white;black;red;blue;yellow;green;orange;purple;pink;brown;gray;cyan;magenta;beige;turquoise
(That's literally the entire color database)