Skip to content

Specification V1

Jinghan Wang edited this page Oct 8, 2016 · 26 revisions

Mi Data

  1. Data model - Attributes [Date Scale: A-B-C-D-E-F-Today]

    • Age
      • Number of days
    • HP:
      • computed from other property in the past one week.
      • When health goes to zero, Mi go die.
      • This attribute also represents the max health in battle.
      • Need an upper limit which correlates to level
      • HP is initialised to 100 on first use
      • HP = MIN(HP_YEST * 0.95 + (1 - 0.95) * HP_YEST * HP_TODAY_FACTOR, LEVEL_LIMIT)
      • HP_TODAY_FACTOR = f((today_steps / today_steps_goal) * (today_distance / today_distance_goal) * (today_flights / today_flights_goal))
    • Strength:
      • computed from human.steps (Goal is calculated from the average step counts of past 7 days.
      • If data is not there (e.g. new iPhone), use the default value of 5000.)
      • Speed should decrease based on time
      • Strength = (A + B + C + D) * 4 / 1000 steps + E * 6 / 1000 steps + F * 8 / 1000 steps + Today * 10 / 1000 steps
    • Stamina:
      • computed from distance (Goal is calculated from the average walking+running distance of past 7 days.
      • If data is not there (e.g. new iPhone), use the default value of 2500m)
      • Stamina = (A + B + C + D) * 4 / 1000 meters + E * 6 / 1000 meters + F * 8 / 1000 meters + Today * 10 / 1000 meters
    • Agility:
      • computed from flights climbed (Goal is calculated from the average flight climbed of past 7 days.
      • If data is not there (e.g. new iPhone), use the default value of 5)
      • Agility should decrease based on time
      • Agility = (A + B + C + D) * 2 / 1 floor + E * 3 / 1 floor + F * 4 / 1 floor + Today * 5 / 1 floor
    • Mood:
      • Min 50 to Max 100
      • computed from interaction
      • Each petting interaction contributes to 10 points, only 2 petting interaction is allowed every hour
      • Mood will decrease automatically every hour
    • Goals (where X, Y, Z are user defined variables)
      • First use of the app: average of last week or overall depends on HealthKit api
      • If data from HealthKit is not available, set a default one
      • Steps goal = Floor(overall steps average) (Default: 4000 steps)
      • Distance goal = Floor(overall distance average) (Default: 4000 steps)
      • Flights goal = Floor(overall flights average) (Default: 4000 steps)
    • XP
      • You receive 2 XP for each steps you are active the exercise
      • You will receive a bonus 250 XP reward upon finishing 1 goal
    • Level
      • 1 ---- 1500 ---- HP: 200
      • 2 ---- 3000 ---- HP: 250
      • 3 ---- 4500 ---- HP: 300
      • 4 ---- 6000 ---- HP: 350
      • 5 ---- 7500 ---- HP: 400
      • 6 ---- 8500 ---- HP: 450
      • 7 ---- 9500 ---- HP: 500
      • 8 ---- 10500 ---- HP: 550
      • 9 ---- 11500 ---- HP: 600
      • 10 ---- 12500 ---- HP: 650
      • 11 ---- 13500 ---- HP: 700
      • 12 ---- 14500 ---- HP: 750
      • 13 ---- 15500 ---- HP: 800
      • 14 ---- 16500 ---- HP: 850
      • 15 ---- 17500 ---- HP: 900
      • 16 ---- 18500 ---- HP: 950
      • 17 ---- 19000 ---- HP: 1000
      • 18 ---- 19500 ---- HP: 1050
      • 19 ---- 20000 ---- HP: 1100
      • 20 ---- 20500 ---- HP: 1150
      • 21 ---- 21000 ---- HP: 1200
      • 22 ---- 21500 ---- HP: 1250
      • 23+ ---- 22000 ---- HP: 1300
  2. How to store and what to store?

    • Realm for iOS local database
    • Exercise start time, end time, current mood
  3. Computed properties' formula?

Mi Name

  1. Name generation
  2. User input names

Basic Sprite(Mi) Actions

  1. Running
  2. Playing
  3. Staring Roof

Status Snapshot

  1. Timestamp
  2. Mi data
    • Mood

Exercise

  1. What to display in exercise view

    • Human Calories
    • Steps
    • Distance
    • Sports Mode
    • Flights
    • Mi reactions (you run I run)
    • Changes in attribute bars
  2. How to handle offline exercise data and its update

    • Store a status snapshot when app goes to background.
    • When use comes back, take the snapshot, calculate base on the time ecllapsed
      • Calculation of mood
      • Process data between last and current checkins
        • data is calculated in the interval of 1 day
        • update HP based on the data for each day
        • calculation for offline data doesn't consider the mood of component in version 1

Statistic Page (Mi Only, Human refer to Health.app)

  1. Show latest data for today in a separate section
  2. Show the recent 7 days in charts (only organised by summary of the day for now)
  3. Older data are shown in tables (similar to Health.app)
  4. Exercise records

Future work

  • Achievements
  • Battle
  • Mi Items
Clone this wiki locally