The idea here is to have an achievements system built into Mini Micro, to encourage new users to explore the demos, libraries, and help. This is kind of a big feature, so let's break it down:
Example Achievements
- used
findFile (or view, etc.)
- won a game of
pigDice (or speedConquest, ticTacToe, textAdventure, etc.)
- turned the Wumpus upside down in the angles demo
- cleared the screen in Asteroids (or Breakout, etc.)
- auto-attract (used self-running mode in
demos)
- scored more than X points in
flappyBat (or mochiBounce, quadris, acey-deucey etc.)
- added numbers in
lcars
- played with
neko (in some particular way)
- found the exit (which we should make work, and harder to reach) in
platformer
- made a sound (?) in
soundLab
- Megawumpus: modified
spriteDemo to double the Wumpus scale
- made the sun orange in
sunset
- found the "secret" help in the help system
- ran all three demos built into
/sys/lib/turtle
- win a game of World Conquest (requires learning about DLC)
- play a 2-player game of Retro Robots
- Hacker: an achievement only achievable by hacking the achievement system
Detection
We'll add a /sys/lib/achievements library... or maybe put it somewhere else, since it's not really meant to be used by user code, and import it using #55. This will give us an achievements.check function, which we call in various places in the built-in demos and libs (and probably some of the functions defined in /sys/startup.ms).
achievements.check will examine the machine state: the current _sourceFile and _source, the display state, the stackTrace, etc., and so will be able to detect each of the achievements above. When a new achievement is detected, it will play a sound (#54), and mark that one as achieved.
Display
Add either a /sys/demo/achievements program, or an achievements command (via startup.ms), or possibly both. This will launch a program that draws all the achievements, like trophies in a case, but any you haven't achieved yet will be just dark silhouettes. Mousing over any of them will pop up the details of what you have to do to get it.
(Sometimes those details will be intentionally vague, and you'll need to go read the comments in the corresponding demo or lib to find the details.)
Storage
Achievement data will be stored as a binary file in /usr/sysinfo/achiev.dat. That means achievements are particular to the disk you have mounted. That's actually a good thing in some cases, for example when two siblings (or a whole classroom) are sharing a Mini Micro installation. Also, using the Disk Info feature (#53), users can choose to disable achievements entirely for a particular disk.
The format of this .dat file will be undocumented, but nothing stops a user from figuring it out by examining the achievements code, using a hex editor, etc. In fact the only way to get the Hacker achievement is to understand this file well enough to modify it accordingly.
Linking to an online account?
A possible extension of this idea, if we ever have online accounts, would be to include some command like linkAchievements that lets you link your local achievements to your account ID. That would sync achievements between your local storage and what's on the web, and then you could easily share your achievements with others by pointing to your online profile.
The idea here is to have an achievements system built into Mini Micro, to encourage new users to explore the demos, libraries, and help. This is kind of a big feature, so let's break it down:
Example Achievements
findFile(orview, etc.)pigDice(orspeedConquest,ticTacToe,textAdventure, etc.)demos)flappyBat(ormochiBounce,quadris,acey-deuceyetc.)lcarsneko(in some particular way)platformersoundLabspriteDemoto double the Wumpus scalesunset/sys/lib/turtleDetection
We'll add a
/sys/lib/achievementslibrary... or maybe put it somewhere else, since it's not really meant to be used by user code, and import it using #55. This will give us anachievements.checkfunction, which we call in various places in the built-in demos and libs (and probably some of the functions defined in /sys/startup.ms).achievements.checkwill examine the machine state: the current_sourceFileand_source, the display state, thestackTrace, etc., and so will be able to detect each of the achievements above. When a new achievement is detected, it will play a sound (#54), and mark that one as achieved.Display
Add either a
/sys/demo/achievementsprogram, or anachievementscommand (via startup.ms), or possibly both. This will launch a program that draws all the achievements, like trophies in a case, but any you haven't achieved yet will be just dark silhouettes. Mousing over any of them will pop up the details of what you have to do to get it.(Sometimes those details will be intentionally vague, and you'll need to go read the comments in the corresponding demo or lib to find the details.)
Storage
Achievement data will be stored as a binary file in
/usr/sysinfo/achiev.dat. That means achievements are particular to the disk you have mounted. That's actually a good thing in some cases, for example when two siblings (or a whole classroom) are sharing a Mini Micro installation. Also, using the Disk Info feature (#53), users can choose to disable achievements entirely for a particular disk.The format of this .dat file will be undocumented, but nothing stops a user from figuring it out by examining the
achievementscode, using a hex editor, etc. In fact the only way to get theHackerachievement is to understand this file well enough to modify it accordingly.Linking to an online account?
A possible extension of this idea, if we ever have online accounts, would be to include some command like
linkAchievementsthat lets you link your local achievements to your account ID. That would sync achievements between your local storage and what's on the web, and then you could easily share your achievements with others by pointing to your online profile.