Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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

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

AAJUG 京都 2019/11/09

Hidetaka Okamoto

November 09, 2019
Tweet

More Decks by Hidetaka Okamoto

Other Decks in Programming

Transcript

  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. 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. Q u e s t i o n 1 :

    A l e x a Ͱ ήʔϜ εΩϧ Λ ࡞ ͬ ͨ ͜ ͱ ͕ ͋ Δ ํ ʁ #aajug
  4. Q u e s t i o n 2 :

    ͦ ͷ ήʔϜ ʹ ϥ ϯ Ω ϯ ά Λ ͭ ͚ ͨ ͜ ͱ ͕ ͋ Δ ਓ ʁ #aajug
  5. D y n a m o D B Ͱ A

    l e x a εΩϧ ͷ ε ί Ξ ද ͸ ޻ ෉ ͕ ͍ Δ #aajug
  6. 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
  7. D y n a m o D B ʹ Ͱ

    ͖ ͳ ͍ ͜ ͱ • ߲̏໨Ҏ্ͷσʔλͰͷݕࡧʢΫΤϦޙʹFilter͢ΔܗʹͳΔʣ • ORDER۟ʹΑΔιʔτ • ωετͨ͠஋ʹର͢ΔΫΤϦͷ࣮ߦ #aajug
  8. 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
  9. A l e x a Ͱ ή ʔϜ ͷ ε

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

    ʹ ͓ ͢ ͢Ί ͷ ه ࣄ https://aws.amazon.com/jp/blogs/news/amazon-dynamodb-gaming-use-cases-and-design-patterns/
  11. A m a z o n G a m e

    O n https://developer.amazon.com/ja/gameon
  12. A m a z o n G a m e

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

    O n Ͱ Ͱ ͖ Δ ʢ Β ͠ ͍ ʣ ͜ ͱ • ήʔϜ಺৆඼ • ϦʔάɾτʔφϝϯτɾϦʔμʔϘʔυΛੜ੒ • Twitchͱͷ࿈ܞ • ஍Ҭ΍εΩϧϨϕϧͳͲͰͷΤϯτϦʔ৚݅ͷઃఆ • ίϯιʔϧͰͷGUI؅ཧ #aajug
  14. 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
  15. 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
  16. “ Yo u r G a m e O n

    C o n s o l e ” ͔ Β ؅ ཧ ը ໘ https://developer.amazon.com/ja/gameon
  17. A m a z o n G a m e

    O n ͷ ߏ ੒ • Game (ܾࡁ୯Ґ) • Competitionʢτʔφϝϯτʣ • Matchʢରઓʣ #aajug
  18. G a m e ʹ C o m p e

    t i t i o n s Λ ࡞ Δ https://developer.amazon.com/gameon/console/home
  19. ݸ ਓ ϓ Ϩ Π / ν ʔϜ ϓ Ϩ

    Π ͕ બ ΂ Δ https://developer.amazon.com/gameon/console/home
  20. C o m p e t i t i o

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

    ͍ͯ ͸ · ͩ ৮ ͬͯ ͍ ͳ ͍ ͷ Ͱ ৄ ࡉ ෆ ໌ #aajug
  22. 1 G a m e ʹ ෳ ਺ C o

    m p e t i t i o n s ͕ ઃ ఆ Մ ೳ https://developer.amazon.com/ja/gameon
  23. “ S c o re S u b m i

    t t e d ” ͕ ՝ ۚ ର ৅ ύ ϥϝλ ʢ ଟ ෼ ʣ https://developer.amazon.com/ja/gameon
  24. A m a z o n G a m e

    O n & A l e x a #aajug
  25. A l e x a Ͱ G a m e

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

    η ο τΞ οϓ https://developer.amazon.com/ja/blogs/alexa/post/671de3de-0635-4626-9371-e926d7d655d6/skills-gameon-sdk
  29. ϓ Ϩ ΠϠʔ ͷ ௥ Ճ ͱ ର ઓ ΁

    ͷ ࢀ Ճ ొ ࿥ https://developer.amazon.com/ja/blogs/alexa/post/671de3de-0635-4626-9371-e926d7d655d6/skills-gameon-sdk
  30. Ϧ ʔ μʔϘʔ υ ͱ ε ί Ξ ͷ औ

    ಘ https://developer.amazon.com/ja/blogs/alexa/post/671de3de-0635-4626-9371-e926d7d655d6/skills-gameon-sdk
  31. Ϧ ʔ μʔϘʔ υ ͱ ε ί Ξ ͷ औ

    ಘ https://developer.amazon.com/ja/blogs/alexa/post/671de3de-0635-4626-9371-e926d7d655d6/skills-gameon-sdk
  32. Ϧ ʔ μʔϘʔ υ ͸ A P L ʹ ΋

    ର Ԡ ʢ ઐ ༻ ϝ ι ο υ ʣ https://developer.amazon.com/ja/blogs/alexa/post/671de3de-0635-4626-9371-e926d7d655d6/skills-gameon-sdk
  33. εΩϧό ο Ϋ Τ ϯ υ ߏ ੒ • ࣮ߦ؀ڥ:

    AWS Lambda (Node.js 10.x) • ߏ੒؅ཧ / σϓϩΠ: Serverless Framework • ఺਺؅ཧ: Amazon GameOn • Database: Amazon S3 #aajug
  34. ϓ Ϩ Π Ϡ ʔ ৘ ใ ͷ ؅ ཧ

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

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

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

    ͱ ͋ Δ จ ষ ͕ https://developer.amazon.com/ja/blogs/alexa/post/671de3de-0635-4626-9371-e926d7d655d6/skills-gameon-sdk
  38. "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
  39. "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Ͱ࢖͏෼͸ ແྉʹ͓ͯ͘͠Α ʢҙ༁ʣ