Alexa + GameOnでのゲームスキル開発 / alexa-gamon

Alexa + GameOnでのゲームスキル開発 / alexa-gamon

AAJUG 京都 2019/11/09

75486cbfd37125f121cf4a6c5614601c?s=128

Hidetaka Okamoto

November 09, 2019
Tweet

Transcript

  1. 1.

    A m a z o n G a m e

    O n Λ ࢖ ͬ ͨ A l e x a Ͱ ͷ ήʔϜ εΩϧ ߏ ங ๏ A A J U G ؔ ੢ 2 0 1 9 / 1 1 / 0 9 #AAJUG
  2. 2.

    H i d e t a k a O k

    a m o t o • Digitalcube Co. Ltd. • Alexa Campions • AWS Samurai 2017 in Japan • ask sdk(Node.js) Core contributor
  3. 3.
  4. 4.

    Q u e s t i o n 1 :

    A l e x a Ͱ ήʔϜ εΩϧ Λ ࡞ ͬ ͨ ͜ ͱ ͕ ͋ Δ ํ ʁ #aajug
  5. 5.

    Q u e s t i o n 2 :

    ͦ ͷ ήʔϜ ʹ ϥ ϯ Ω ϯ ά Λ ͭ ͚ ͨ ͜ ͱ ͕ ͋ Δ ਓ ʁ #aajug
  6. 6.

    D y n a m o D B Ͱ A

    l e x a εΩϧ ͷ ε ί Ξ ද ͸ ޻ ෉ ͕ ͍ Δ #aajug
  7. 7.

    D y n a m o D B ͔ Β

    S t re a m - > L a m b d a Ͱ ू ܭ https://www.slideshare.net/AmazonWebServicesJapan/aws-black-belt-online-seminar-2018-amazon-dynamodb-advanced-design-pattern
  8. 8.

    D y n a m o D B ʹ Ͱ

    ͖ ͳ ͍ ͜ ͱ • ߲̏໨Ҏ্ͷσʔλͰͷݕࡧʢΫΤϦޙʹFilter͢ΔܗʹͳΔʣ • ORDER۟ʹΑΔιʔτ • ωετͨ͠஋ʹର͢ΔΫΤϦͷ࣮ߦ #aajug
  9. 9.

    a s k - s d k ͷ D y

    n a m o D B ࣮ ૷ ͸ D y n a m o ޲ ͚ Ͱ ͸ ͳ ͍ • ύʔςʔγϣϯΩʔɿUser ID or Device ID • savePersistantAttributesͰอଘ͞Εͨσʔλ: Mapܕ • ID + attributesͷ߲̎໨ͷΈͰอଘ͞ΕΔ • ޙ͔Βผ్ΫΤϦ͢Δʹ͸޲͍͍ͯͳ͍ #aajug
  10. 10.

    A l e x a Ͱ ή ʔϜ ͷ ε

    ί Ξ ද • attributesManagerΛ࢖Θͣʹaws-sdkΛ࢖͏ • ήʔϜܥͷهࣄɾυΩϡϝϯτΛࢀߟʹDynamoDB TableΛઃܭ • ඞཁʹԠͯ͡Stream + LambdaͰόονతʹߋ৽͢ΔॲཧΛ࣮૷ • ूܭظؒʹԠͯ͡ϥϯΩϯάͷϦηοτͳͲ΋ඞཁ #aajug
  11. 12.

    ʮ ΍ ͬͯ ΍ Δ ʯ ͱ ͍ ͏ ਓ

    ʹ ͓ ͢ ͢Ί ͷ ه ࣄ https://aws.amazon.com/jp/blogs/news/amazon-dynamodb-gaming-use-cases-and-design-patterns/
  12. 13.

    A m a z o n G a m e

    O n https://developer.amazon.com/ja/gameon
  13. 14.

    A m a z o n G a m e

    O n ͱ ͸ ʁ • ΫϩεϓϥοτϑΥʔϜͰར༻Ͱ͖ΔରઓήʔϜͷαʔϏε • ϦʔμʔϘʔυʢಘ఺දʣ΍ϦʔάɾϓϨΠϠʔͷੜ੒؅ཧ • AmazonͰར༻Ͱ͖ΔϦϫʔυͷ࡞੒ͱ෇༩ • SDKΛར༻ͯ͠؆୯ʹ૊ΈࠐΈՄೳ #aajug
  14. 15.

    A m a z o n G a m e

    O n Ͱ Ͱ ͖ Δ ʢ Β ͠ ͍ ʣ ͜ ͱ • ήʔϜ಺৆඼ • ϦʔάɾτʔφϝϯτɾϦʔμʔϘʔυΛੜ੒ • Twitchͱͷ࿈ܞ • ஍Ҭ΍εΩϧϨϕϧͳͲͰͷΤϯτϦʔ৚݅ͷઃఆ • ίϯιʔϧͰͷGUI؅ཧ #aajug
  15. 16.

    A m a z o n G a m e

    O n ͷ ྉ ۚ • είΞͷه࿥1ճ = 1Play • 35,000ϓϨΠ / ݄ͷແྉ࿮ + 6ϲ݄ͷແྉظؒ • ௒ա෼͸ 1Play 0.002 USDͷैྔ՝ۚ • https://developer.amazon.com/ja/gameon/pricing • AWSͷར༻ྉۚͱҰॹʹܾࡁ͞ΕΔʢͳͷͰཁAWSΞΧ΢ϯτʣ #aajug
  16. 17.

    G e t t i n g s t a

    r t e d A m a z o n G a m e O n #aajug
  17. 18.

    “ Yo u r G a m e O n

    C o n s o l e ” ͔ Β ؅ ཧ ը ໘ https://developer.amazon.com/ja/gameon
  18. 19.

    A m a z o n G a m e

    O n ͷ ߏ ੒ • Game (ܾࡁ୯Ґ) • Competitionʢτʔφϝϯτʣ • Matchʢରઓʣ #aajug
  19. 22.

    G a m e ʹ C o m p e

    t i t i o n s Λ ࡞ Δ https://developer.amazon.com/gameon/console/home
  20. 23.

    ݸ ਓ ϓ Ϩ Π / ν ʔϜ ϓ Ϩ

    Π ͕ બ ΂ Δ https://developer.amazon.com/gameon/console/home
  21. 24.
  22. 25.

    C o m p e t i t i o

    n s Ͱ ܾ Ί Δ ͜ ͱ • ໊લɹɹɿ100จࣈҎ಺ • ظؒɹɹɿ༗ݶɺͨͩ͠2100೥ऴྃͱ͔ʹͰ͖Δ • είΞɹɿϋΠείΞ / ߹ܭ఺ • উഊ൑ఆɿείΞ͕ଟ͍ํ / গͳ͍ํ͕উऀ • ৆඼ɹɹɿΞΠςϜɾϥϯΫɾ഑෍ํ๏etc.. • ͳͲͳͲ #aajug
  23. 26.

    ৆ ඼ ΍ ࡉ ͔ ͍ ઃ ఆ ʹ ͭ

    ͍ͯ ͸ · ͩ ৮ ͬͯ ͍ ͳ ͍ ͷ Ͱ ৄ ࡉ ෆ ໌ #aajug
  24. 27.

    1 G a m e ʹ ෳ ਺ C o

    m p e t i t i o n s ͕ ઃ ఆ Մ ೳ https://developer.amazon.com/ja/gameon
  25. 28.

    “ S c o re S u b m i

    t t e d ” ͕ ՝ ۚ ର ৅ ύ ϥϝλ ʢ ଟ ෼ ʣ https://developer.amazon.com/ja/gameon
  26. 29.

    A m a z o n G a m e

    O n & A l e x a #aajug
  27. 30.

    A l e x a Ͱ G a m e

    O n Λ ࢖ ͏ • ϦʔμʔϘʔυ͕؆୯ʹ࡞ΕΔ • ಘ఺ͷܭࢉɾϥϯΩϯάࢉग़ॲཧΛ࣮૷͠ͳͯ͘ࡁΉ • ݄͝ͱͷΠϕϯτ + ߃ৗϥϯΩϯάͳͲͷෳ਺ͷରઓཁૉ • ϥϯΩϯάɾಘ఺ཁૉ͕͋ΔεΩϧͱ૬ੑ͕ྑ͍ #aajug
  28. 31.

    A l e x a Ͱ G a m e

    O n Λ ࢖ ͏ ͨ Ί ʹ ඞ ཁ ͳ ෺ • Node.js • ASK SDK ( npm i -S ask-sdk ) • GameOn SDK for Alexa ( npm i -S @alexa-games/skills-gameon-sdk ) • GameOn API Key (GameOn Dashboard͔Βऔಘ) • Game ID / Tournament ID / Match IDʢಉ্ʣ #aajug
  29. 32.

    A l e x a B l o g ʹ

    ղ આ ه ࣄ ͕ ͋ Δ https://developer.amazon.com/ja/blogs/alexa/post/671de3de-0635-4626-9371-e926d7d655d6/skills-gameon-sdk
  30. 33.

    A P I Ϋ ϥ Π Ξ ϯ τ ͷ

    η ο τΞ οϓ https://developer.amazon.com/ja/blogs/alexa/post/671de3de-0635-4626-9371-e926d7d655d6/skills-gameon-sdk
  31. 34.

    ϓ Ϩ ΠϠʔ ͷ ௥ Ճ ͱ ର ઓ ΁

    ͷ ࢀ Ճ ొ ࿥ https://developer.amazon.com/ja/blogs/alexa/post/671de3de-0635-4626-9371-e926d7d655d6/skills-gameon-sdk
  32. 36.

    Ϧ ʔ μʔϘʔ υ ͱ ε ί Ξ ͷ औ

    ಘ https://developer.amazon.com/ja/blogs/alexa/post/671de3de-0635-4626-9371-e926d7d655d6/skills-gameon-sdk
  33. 37.

    Ϧ ʔ μʔϘʔ υ ͱ ε ί Ξ ͷ औ

    ಘ https://developer.amazon.com/ja/blogs/alexa/post/671de3de-0635-4626-9371-e926d7d655d6/skills-gameon-sdk
  34. 38.

    Ϧ ʔ μʔϘʔ υ ͸ A P L ʹ ΋

    ର Ԡ ʢ ઐ ༻ ϝ ι ο υ ʣ https://developer.amazon.com/ja/blogs/alexa/post/671de3de-0635-4626-9371-e926d7d655d6/skills-gameon-sdk
  35. 41.

    εΩϧό ο Ϋ Τ ϯ υ ߏ ੒ • ࣮ߦ؀ڥ:

    AWS Lambda (Node.js 10.x) • ߏ੒؅ཧ / σϓϩΠ: Serverless Framework • ఺਺؅ཧ: Amazon GameOn • Database: Amazon S3 #aajug
  36. 43.
  37. 45.

    ϓ Ϩ Π Ϡ ʔ ৘ ใ ͷ ؅ ཧ

    • GameOnͷσʔλ͸AlexaͷϢʔβʔσʔλͱඥ͔ͮͳ͍ • AttributesManagerͰDynamoDB or S3ʹϓϨΠϠʔ৘ใΛอଘ͢Δ • DBʹσʔλ͕ͳ͍ͳΒϓϨΠϠʔ৽ن࡞੒ • DBʹσʔλ͕͋Ε͹ɺϦϑϨογϡͯ͠ϓϨΠϠʔͷ৘ใΛߋ৽ • εΩϧଆͰ؅ཧ͢΂͖ͳͷ͸͜Ε͚ͩ #aajug
  38. 46.

    ࡞ ͬͯΈ ͯ ͷ ײ ૝ • ϓϨΠϠʔ৘ใҎ֎؅ཧ͢Δඞཁ͕ͳ͍ͷͰָ • είΞ΋submitScore

    APIʹՃ఺ɾݮ఺͍ͨ͠஋Λ౤͛Δ͚ͩ • SDKΛ·ͱΊͨΫϥεΛ༻ҙ͓ͯ͘͠ͱɺίʔυྔ͕ݮΒͤΔ • ࣗ෼ͷલޙXҐͷ఺਺ͳͲ΋औಘͰ͖ɺ͔ͳΓߴػೳ • ࠓ೔ʹؒʹ߹ΘͤΔͨΊAPL͸Ұ୴ఘΊͨ #aajug
  39. 47.

    ೔ ຊ Ͱ ࢖ ͏ ৔ ߹ ͷ ஫ ҙ

    ఺ • ϓϨΠϠʔ໊͕σϑΥϧτͰ͸ӳޠ • PlayerProfileGeneratorͰઃఆΛม͑ΕΔ༷ࢠ • ͸͡Ί͸είΞͱॱҐද؅ཧ͚ͩʹ࢖͏ͷ͕ແ೉͔΋ • υΩϡϝϯτ͸ӳޠͳͷͰɺTSͷิ׬ͱGoogle຋༁࢖͓͏ #aajug
  40. 50.

    ঺ հ ϒϩ ά ͷ Լ ͷ ํ ʹ ɺ

    ͱ ͋ Δ จ ষ ͕ https://developer.amazon.com/ja/blogs/alexa/post/671de3de-0635-4626-9371-e926d7d655d6/skills-gameon-sdk
  41. 51.

    "QQMZ/PXUP6TF(BNF0OGPS'SFFGPS:PVS4LJMMT To apply for the special offer, submit this application,

    and we will whitelist your skill within 3 business days until the end of public beta. Please note that you need to provide your skill ID, and GameOn Game ID to apply. You can either use the Skills GameOn SDK in Node.js for easier integration for skills written in Node.js or integrate Amazon GameOn directly for skills written in other languages including Java. To learn more, check out the Skills GameOn SDK GitHub repository, and read the documentation. https://developer.amazon.com/ja/blogs/alexa/post/671de3de-0635-4626-9371-e926d7d655d6/skills-gameon-sdk
  42. 52.

    "QQMZ/PXUP6TF(BNF0OGPS'SFFGPS:PVS4LJMMT To apply for the special offer, submit this application,

    and we will whitelist your skill within 3 business days until the end of public beta. Please note that you need to provide your skill ID, and GameOn Game ID to apply. You can either use the Skills GameOn SDK in Node.js for easier integration for skills written in Node.js or integrate Amazon GameOn directly for skills written in other languages including Java. To learn more, check out the Skills GameOn SDK GitHub repository, and read the documentation. https://developer.amazon.com/ja/blogs/alexa/post/671de3de-0635-4626-9371-e926d7d655d6/skills-gameon-sdk PBظؒऴΘΔ·Ͱʹ ਃ੥ͯ͘͠ΕͨΒɺ AlexaͰ࢖͏෼͸ ແྉʹ͓ͯ͘͠Α ʢҙ༁ʣ