曉郁
    • 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

      This note has no invitees

    • 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
    • Note Insights New
    • 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 Note Insights 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

    This note has no invitees

  • 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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # hana引擎介紹 ## 用途 hana引擎是參考Electron的想法(我沒有查過他的實做,所以不敢說是用一樣的作法)製作的java galgame引擎。 主要目標是想讓不會寫程式但會畫圖跟寫腳本的人可以輕鬆做出galgame,並且讓前端開發者可以用html + css + js做出更複雜的功能甚至是小遊戲,理論上可以套用所有網頁框架甚至是非js,為什麼可以這樣做下面會說明。 另外它採用完全的前後端分離,並且可能會使用graalVm 因此"應該"可以跨多語言(以官方來看可以支援js, node.js, python, ruby, R, LLVM家族) ## 架構 整體架構簡單來說是: javaFx + SpringBoot + MyBatis + H2DB + hana script 所有東西(包含DB)都是執行在jre(jvm)上面,所以這個專案不用處理任何作業系統的問題,可以幾乎跨全平台。 但android 不包含在內。 雖然android有類似jvm的東西,但由於ART那個我很討厭的東西是google高度訂製的類似jvm的東西,所以會有缺一堆lib跟多一堆有的沒的lib所以無法跨平台上,但關於這點有備案可以另外聊(不是這次)。 整個啟動流程滿簡單易懂的,當使用者開啟應用程式的時候會啟動上述 javaFx + SpringBoot + H2DB。 ## 前端 前端是使用JavaFx 上的 Webkit。 簡單來說當使用者開啟的時候就是開啟一個java的網頁瀏覽器。 對於開發者來說就是開發總計三個一頁式網頁並且透過spring boot的API去取得資料或存取檔而已。 同時由於是直接使用 Webkit 所以理論上來說可以跑unity 3d網頁版跟live 2d,但由於沒有測試過所以不確定。 對於沒學過前端的人hana引擎本身會提供基本的網頁讓使用者不用寫網頁也可以得到想要的東西。 所以理論上玩家會看到的東西應該是極高度訂製化的才對。 ## 後端 後端是採用 java 目前最主流的後端框架,基本上所有的類別呼叫都是透過依賴注入(DI)跟控制反轉(IOC)去實現的。 換句話說當hana引擎開發完成後可以提供界面讓非hana引擎維護者的開發人員可以不用看hana引擎的code就可以客製化自己的後端內容甚至修改API,但因為剛開始就考慮這塊會大幅影響開發進度,所以目前不開發這個內容。 ## 持久化 使用MyBatis,因為它可以檔sql注入也可以做動態sql組成,感覺很不錯。 ## DB 資料庫使用H2 DB的嵌入模式,他是純 Java 實現的資料庫。 這個東西滿屌的 * 它雖然是DB但對於玩家來說它不用手動安裝任何東西, * 對於開發者來說它就是一個大約2MB大小的lib而已 真的超簡單的,只需要在spring boot設定幾個參數而已就有DB可以用了,而且有網頁控制台,如果資料只有幾十萬的話效能上完全可以和mysql媲美。 ## 後言 java是我從高二用到現在,一直是我很喜歡的語言,是一個說不出來的喜歡,不過這件事情其實很愚蠢,就有點像是工具箱裡獨愛十字螺絲起子一樣。 同時看著它成長,你知道嗎?他讀取檔案這件事情從 ```java String fileName = "c://lines.txt"; List<String> list = new ArrayList<>(); try (Stream<String> stream = Files.lines(Paths.get(fileName))) { list = stream.collect(Collectors.toList()); } catch (IOException e) { e.printStackTrace(); } ``` 這麼麻煩的寫法變成了: ```java try { var content = Files.readAllLines(Paths.get(fileName)); } catch (Exception e) { e.printStackTrace(); } ``` 很有趣吧,但大部分的人都還停留在那個麻煩的寫法就是了... 雖然說著喜歡,但其實從來沒有用它來完成過任何東西。(第一個完成的是類C語言,第二個是python。) 所以這次算是一個彌補吧。 另外這次的專案目前沒有想要拿來賺錢,完全只是自己想做遊戲所以才做的。 有點回到小時候的感覺,不考慮金錢不考慮大家是否喜歡甚至不在意會不會有一堆BUG,只是單純做有趣好玩的東西。 或許有點向"理想的大人"邁進了吧哈哈。 ## 目前進度 現在進度的話... 前端做了標題畫面,還有遊戲對話的部份跟選擇存檔畫面沒做,阿~~~~好不喜歡前端,好不想做阿~~~~ 後端的部份持久層的sql全部寫好了,剩下service層跟controller層。如果不偷懶的話九月初可以做完吧。但是好多遊戲想玩阿~~~ 主要是讀取hana腳本的邏輯會花比較多時間寫吧。 恩希望明年夏天可以壓幾張去CWT賣~~~

    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