What started out as a fun idea (much like Mycroft itself) will soon be in development to ship along with Mycroft! The idea is a game you interact with through speech, Mycroft will read a scenario to you, and then give you options, you will respond with the option you like the best and before you know it you are off on an adventure with your custom audiobook. We are looking into doing voices and sound effects to compliment the story, but are still in the early stages of this fun function that I am excited to share! Do you have any ideas on games we could add to Mycroft?I look forward to hearing from all of you!
UPDATE: This feature will no longer ship with Mycroft
What about allowing users to create their own and upload them to a server with a collection of them? So for instance:
-âMycroft, help me make an audio gameâ
âDescribe your surroundingsâ
-âYou are in a dark room with items scattered on the floor.â
âWhat can you do?â
-âYou can turn on the light switch, or clear a path and then walk to the light switch.â
âWhat happens if you walk to the light switch?â
-âYou trip and fall and the game is overâ
âWhat happens if you clear a path and then walk to the light switch?â
-âYou clear a path, walk to the switch, and turn on the lights. You win the game.â
Iâm sure there will be an interest of people wanting to play some of the old âtext adventureâ games in audio form. Iâm sure it wouldnât be very hard to port them to Mycroft either. Just have to make sure youâre not breaching copyright by doing it.
Itâd be quite easy to port old MUDD time games and the like to Mycroft methinks. I find this line of thinking fascinating, because of the many possibilities.
Trivia games would also be quite good candidates for the platform.
Having a Mycroft skill which plays interactive fiction from the IF archive would indeed be doable and rather fun, I think; use the frotz basic text mode, and done, roughly.
Yup, testing this with Frotzâs âdumb modeâ, which outputs direct to stdout with no curses module etc, and piping the output into flite, itâs possible. A better IF interface, designed for Mycroft, would likely be an improvement of course!
git clone https://github.com/DavidGriffith/frotz
cd frotz
make dumb
cat control.py
#!/usr/bin/env python
# the world's most stupid broken TTS IF player
from subprocess import Popen, PIPE, call
from fcntl import fcntl, F_GETFL, F_SETFL
from os import O_NONBLOCK, read
import time
p = Popen(["./dfrotz", "../Cloak.z5"], shell=False, stdin=PIPE, stdout=PIPE)
# set the O_NONBLOCK flag of p.stdout file descriptor:
flags = fcntl(p.stdout, F_GETFL) # get current p.stdout flags
fcntl(p.stdout, F_SETFL, flags | O_NONBLOCK)
while True:
try:
output = read(p.stdout.fileno(), 1024)
print output
call(["flite", "-voice", "slt", "-t", output])
except OSError:
# the os throws an exception if there is no data
time.sleep(0.5)
continue
if output and output.endswith(">"):
p.stdin.write(raw_input("Text:") + "\n")