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

【Hi-Con登壇資料】ブロックチェーンゲーム「My Crypto Heroes」で バトルβ...

Shun Ishikawa
November 10, 2018

【Hi-Con登壇資料】ブロックチェーンゲーム「My Crypto Heroes」で バトルβ版をリリースしてみました!〜課題と対処の現場録〜

・システム全体構成
・ethereum-loomのやり取り
・コントラクト全体構成
・複雑なバトルロジックをどうSolidityで捌いたか
・3つの性能改善策
・経験を踏まえたMCHの現実的な解

11/30正式リリースです!

My Crypto Heroes(マイクリプトヒーローズ)/ ブロックチェーンゲーム (@mycryptoheroes): https://twitter.com/mycryptoheroes?s=09

Shun Ishikawa

November 10, 2018
Tweet

More Decks by Shun Ishikawa

Other Decks in Technology

Transcript

  1. 3 0 . 14 3/ 3 2 : . 4

    888 3 0 . 14 3/ 3 ! -
  2. . / 4@  B I / 4 2 2

    // OTDCECE 4 4 2 2 // 2 / CECE @
  3. . .

  4. . / (/ / ) ) 8 I @ :

    1 300 . . /
  5. 0 . 1 X b () I m  X

    op ndlj  U 1 L X ec k   
  6. -

  7. 2 0 : 5 81 )( oNpy OI N m

    b .-/u n El T • e O O d OcNk • t M • O u j
  8. 2 3 2.62 1 5 043 , 7 , bm

    l 9 , 7 I d o % jke n pc !
  9. C1 C 2  8 8 (- - 8 8

    C 8 7 C 27 8 E ( 1 EA CF C A EEE 2 7 A A R 1 2 7 A SR R I I R PRI A .)
  10. .

  11. 1 A 2 7A C 0   2 .

    2 2 2 2 . . 2 2 2 2 . 2 2 2 2 2 .1. . 2 2A A0   2 2 I 2 T P ML RE 2 2 2 2A . 2 Pb H a
  12. . 1 () e j I m 2 l I

    b cj d 9 2 l k
  13. 2 2.72 1 B G 9 Imb R k r

    E tl p u c C C de Ino ph j
  14. 2 3 2. 2 b Td S C B 9

    a cI S nk p S r S 2 b ec l t u u B j o C ykm
  15. 2 2 .       

                         B 6 B I
  16. 2 3 7 1  • Zk kcr v vd

    Pf 1 3 13c M • u pIow s 2 3bd j u t d -3 3 c D 3 – • dr v v a _ 3 l eSjc gma _OUM let HeroAsset = artifacts.require('HeroAsset') let DeckManager = artifacts.require('DeckManager') let address = '0x123456…' module.exports = function (deployer) { deployer.then(async function() { let deckManager = await DeckManager.deployed() let heroAsset = await HeroAsset.deployed() let currentDeck = await deckManager.getDeck(address) let hero1 = await heroAsset.tokenOfOwnerByIndex(address,0) let hero2 = await heroAsset.tokenOfOwnerByIndex(address,1) • 1 b _ i M • ynp d . 3 3 31 7 c Mb _ 3 3 3 . 2 c Mb x p v j Mb j
  17. 7B 5 8 C B JB A6  6BA 6

    8 A 8 6BA 6 82 AE 6 BA 5 J 8 BA 8I 5 J 8 8 5 J 81 6 8A E 6 8 E 6 3A f c x i uknji h c ol e E A 9B 9 A6 BAi 6 8 h c 8 i HE T rtsma T 1. start 3. end 2. battle 8H8A 81 8H8A 8 A7 8H8A 8 6 BA 6 8A b v p ma8H8A y 6 8A b v p ma8H8A y A g A g U Sh M a P f d . H 16 C h
  18. .9 6 7 95 9  • 9 a J

    9 e S S 63 y kohe S e ykoh c plr c • dae c 9 3 1 09 0 39 e 2 S log j s c cJ J c • ne 63 c c c a I b J uint256 digit = 77; uint256 tmp = 0; digit -= 1; tmp += uint256(1) * (10**digit); // 1 digit -= 1; tmp += uint256(unit.position) * (10**digit); // 1 digit -= 9; tmp += uint256(unit.heroId) * (10**digit); // 9 digit -= 9; tmp += uint256(unit.itemId1) * (10**digit); // 9 digit -= 9; tmp += uint256(unit.itemId2) * (10**digit); // 9 eu c 3 c emor a 3 3 1 tib fllv J b J
  19. 0 . 1 :    • d c

    yCC Aae lo E mi I ITB • 1 3 t mi mi y I • kj 31 S 1 3 b Aur S 1 vI M i 1 21 1 3 31 1. start 3. end 2. next 1 1 1 1 1 1 0 1 1 1 3 x n 00 1 3 : 00 1 ig 3 n pEC mi s
  20. . 4 3      4 4

    4 Loom (production) Loom (worker1) 4 Loom (worker2) 4 Loom (worker3-5) E ABC I ABC M 4 . 4 4 4 event#% 1.!(BattleStart) #%   worker Loom Battle$, 2.'(BattleComplete) #%  (" 4 cilent +')  event  1. start 3. end 2. action&*
  21. . 5 (  • 4 g b Bcrd B

    dm bdo a j 3 4 et o g g d I s ye h raL I y jek y e To g u k e raL p L • s y u e_L g ) e s y o eg dL j L pe k a • po n g l e 3 4 iL b a o 3 4 g e pdLS mL o SmL ad m
  22. . L

  23. 3 7 - 3 3 3 3 ) - Loom

    1. start 3. end 2. Battle 2. Battle     3 3 3 3 ) - (. r a B ) V o d i P B r P P B) y I 3wmcpa L B 3y MG G b IB n jkekgIlIaP BV (. c Ga uID P P n G E 3 3ct P
  24. 8 3  • S .33 c w e G

    P cl e G P - l - d i u ng E it ng l e e a P Vng r oEB M ng G o • . .8 8 8 .3 8 8 . 8 I G
  25. . 4 2 ( • r k k i il

    e - 2 a n 2 c g 2 -2 l k DB M • M 4 jab m t 4 n o ) By 4 ) 0 D dciu M V 4 ) 0 kc c o I kc c 4 V e pE Mc k gk M      4
  26. - . 1  • e g d S I

    • bc I 4 1 a n go c d - p - s A i h rp B go u B a
  27. 4 ( 4 4 3)   .3 ) .3

    . ) .3 44 3 4 4 ) .3 7 ( 11 2 ) A ( ) 2 2 R H C C 2 i & dom e • j k b I a nfh • .3 ) .3 . ) .3 lc • P 4 ) .3
  28. 0 A 1  • P a J g b

    r v ty J b r s” hy J r c • fh m J fm v “ fe • y J h -A/A / g Wegb g f P k h J ala w w aSpd i St R j n l suIIL • 0 cy J t h f fe . 0Gt r g A 0 4b /C/-1 Aco r e gb g b
  29. .  1 3 3 3 / 1P v E

    0 0 ( v L 3 3) 2 1 3 3 L 0 3 0 3 2 1 E 0 p U 02  1 3 3 L 2
  30. . %