Kevin Cyu
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee
  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # 2017 C++ 課程 project ###### tags: `PD2` ## Time (Game loop) - 1/100 ~ 1/10 - Ping 50 ## 打架 - 用 Log 檔做紀錄(對戰還原),限制時間內完成回應 - 同一組隊戰組合不重複 ## Debug 方式 - (offline) 一個接收的 test server,接收後看使用者回復時間 - (online) GUI (for grading) ### Judge message at execution time * Via stderr * Choose 8 card * Success: `Card choose success` * Fail: `Card choose fail` * Interact with server * Success: `Interact success` * Fail: `Interact fail` * Finish normally * P1 process halted: `Player 1 fault` * P2 process halted: `Player 2 fault` * Normally finish will not produce message * Result * P1 Win: `Player 1 win` * P2 Win: `Player 2 win` * Tie: `Tie` ### Judge System execute command ./forever start app.js -o out.log -e error.log ### Contact with Render server - Battle Command - Request (http) - start: 由yee那邊的玩家選擇battle後重新導向至`http://<pathname>:<port>/game_start?p1=<player1>&p2=<player2>` - 而 battle command 內容採用的是 json 格式做傳輸,並且分為幾項: - 目前設定 pathname : `localhost` , port : `3001` - 進行中: `http://<pathname>:<port>/game_cmd?p1=<player1>&p2=<player2>&cmd=<content>` - 結束: `http://<pathname>:<port>/game_end?p1=<player1>&p2=<player2>` => 作為錄影結束 - (最新): 改採用 post method 做 command delivery - 以下是內容的部分 - (2/28) 更新 - 加入 buildings (Json Array) - (3/7) - 需要額外加入結束時,雙方資訊;( render server 保存 ) - 額外再 battle cmd 時,加入雙方目前現有的排組( 4 張 ) - (3/19) - 結束時,使用 post method 傳送 - 包含要顯示的資料 (winner),詳細補在下面欄位 - (3/20 補充) 額外加上雙方塔數 - (3/20) - 更新 cmd prototype,加入 **現在有哪四張卡** (current_hand_player) - (考慮在前端實作紀錄哪八張卡,就不必多一個手續傳送) ```javascript=json // content var cmd_prototype = { 'cmd': 'battle', 'current_minion' : [ { 'belong': 'p1/p2' 'name': 'orge1', 'type': 'orge', 'status': '50', 'move': '2', 'loc_x': '20', 'loc_y': '10' } ] , 'new_minion': [ { 'belong': 'p1/p2' 'name': 'orge1', 'type': 'orge', 'move': '1', 'loc_x': '30', 'loc_y': '10' } ] , 'buildings': [ { 'name': '誰的塔_塔的類型', 'status': '加減損的量(一樣以百分比為單位)' } ] , 'current_hand_p1':[ { 'name': "<force>_<minion>" }, ... (共四張) ] , 'current_hand_p2':[ { 'name': "<force>_<minion>" }, ... (共四張) ] , 'current_time': 180, 'current_mana_p1: 8, 'current_mana_p2: 7 } // End package (3/19) var end_package = { 'p1': p1name, 'p2': p2name, 'winner': winner_player, 'p1_destroy': p1_destroy_tower_number, 'p2_destroy': p2_destroy_tower_number } ``` - cmd: (字串)指令,目前暫時都是 battle - current_minion: (Json Object Array),儲存目前在戰場上的手下及其狀態 - belong: 用來標記物件所屬玩家 - name: 用來標記物件 - type: 小兵的種類 - status: 血量減少或是增加(有正有負),為百分比 - move: 該物件目前行進的方向 - 0: left - 1: right - 2: top - 3: down - 4: left+top - 5: left+down - 6: right+top - 7: right+down - 8: attack (left) - 9 (更正): attack (right) - 10(更正): stop (face right) - 11(更正): stop (face left) - loc_x , loc_y : x,y座標 - x: 介於 0~50 - y: 介於 0~20 - 我這邊會做圖片上面的速度比例調整,直接給位置即可 - 在 current 內部的位置資訊是用來做回復用的 - new_minion: (Json Object Array),為這次 tick 中新增進來的物件 - 和 current minion 中屬性相同,status 去除 - buildings : (3/8 更新) - p1_top : p1 的上塔 - p1_down : p1 的下塔 - p1_main : p1 的中塔 - p2_top : p2 的上塔 - p2_down : p2 的下塔 - p2_main : p2 的中塔 ### 地圖 - 比例地圖: ![](https://i.imgur.com/EeTi17a.png) - 水平方向為 x - 垂直方向為 y - 修正大小 - 橋的 height 長度由 4 增長到 7 - 位置由 - Top: (22,3) -> (22,2) - Down: (22,13) -> (22,11) - 增加和諧感 ### 角色 (考慮到牌組自由搭配,所以覺得不需要每個種族都依照坦補打的規格) - 人類 - 坦 : 人類騎士,形象為重裝騎兵,偏好以歐洲的盔甲騎兵的形象為主(主流的正義形象+衝鋒陷陣的不屈之姿) - Decode : 1 - Range : 3 - ![](https://i.imgur.com/yC5JDeC.png) - ![](https://i.imgur.com/v4VkXjw.gif) - 補 : 牧師、祭司的形象 (原本想採用和尚,但看起來有點像武僧) (已完成!) - Decode : 2 - Range : 5 - ![](https://i.imgur.com/Z1FzA43.jpg) - Q版 - ![](https://i.imgur.com/7AyGYRM.jpg) - ![](https://i.imgur.com/a9EaGyp.gif) - 打 : 人類火槍兵,採用明朝神機營的形象;抑或是女忍的遠(手裡劍)/近(武士刀)距離攻擊 (目前正在 working - 女槍手) - ![](https://i.imgur.com/C0LSVsl.png) - ![](https://i.imgur.com/pTC2X6N.jpg) - 盜賊 (已完工) - Decode : 3 - Range : 3 - ![](https://i.imgur.com/T7lz95C.png) - ![](https://i.imgur.com/P0hkPDR.gif) - 精靈 - 坦 : 石巨人的形象 - Decode : 4 - Range : 2 - ![](https://i.imgur.com/npFyW2a.png) - ![](https://i.imgur.com/Trao6aw.gif) - 補 : 以幽光的型態出現,為周圍的單位提供治療 - Range : 4 - ![](https://i.imgur.com/jkouisD.png) - ![](https://i.imgur.com/4l5yEzR.gif) - 打 (弓手)簡單來說就是一般精靈女弓手 - Range : 5 - 已完成 - ![](https://i.imgur.com/4gx26ux.jpg) - ![](https://i.imgur.com/ePkJt3Z.gif) - 矮人 - 坦 : 主要以矮人王的形象,重武裝+石錘的硬漢 - ![](https://i.imgur.com/CIzRaYk.png) - 補 : 矮人這邊沒有補,改以攻城器代替 - Range : 2x - ![](https://i.imgur.com/AJ0DWCF.png) - 打 : 採用迫擊砲班的形象,強調矮人的工藝 - ![](https://i.imgur.com/vOW8tRu.png) - 不死族 - 坦 : 骷髏巨人 - 補 : 死亡法師,看是不是也沒有補師,成為AOE的法師 - ![](https://i.imgur.com/4ywELST.png) - 打 : 死亡騎士,生命少於人類的騎士,但攻擊力高於人類騎士 - ![](https://i.imgur.com/1rlzCfS.png) ### 建築物 ![](https://i.imgur.com/08u8n3s.gif) ![](https://i.imgur.com/nbv3fZz.gif)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully