[Project] New Launcher (Official)

Discussion in 'Code' started by Dan_Prime, Nov 12, 2017.

  1. New Launcher Project

    Hello everyone, a new launcher for WesterosCraft is currently in development. This launcher will replace the current one, which is unfortunately prone to bugs and may be difficult for users to use. Here are just a few enchancements that the new launcher will have.

    • Better memory efficiency.
    • Completely redesigned UI aimed to be more user friendly and simpler to use.
    • Structured asset system similar to the structure of the modern vanilla launcher. The current launcher uses a more out-dated system.
    • Completely rewritten backend.
    • Will not require Java (planned).
    These are just several things that the new launcher will have. A full feature list will be created down the line.

    Technical Information

    Development History

    Before I discuss the internals of the current launcher, I will briefly go over the history of the project. If you want to get to the important information, skip this section. The current launcher is a modified version of MCUpdater, written using Java's swing API. This library was released quite a while ago, and is outdated in several regards. As a result, the original plan for the new launcher was to rewrite it using Oracle's JavaFX GUI library. This library is intended to replace swing and contains more modern features for desktop applications. As such, work began on the project using JavaFX. You may view the repository for that here.

    A few months into the development, problems were noticed with the Java implementation of the launcher. A major issue was the memory usage. Typical desktop applications have relatively low RAM usage, usually below 100MB. The relatively simple design we created using JavaFX was using an astounding 800MB of RAM. This was simply unacceptable. Comparisons were made to the old launcher, which itself uses 400-500MB of RAM. The root cause of this is simply that Java desktop applications are not efficient. So long as we used Java, this problem would not be solved. As a result, work on the JavaFX launcher was suspended as we looked for an alternative.

    Some research led us to look into Electron. Electron is a node.js GUI framework that powers many high-profile applications, such as Discord and Visual Studio Code. Tests were run using this software, and it proved to be infinitely better than Java. Hence, the new launcher is being written in Javascript using the Electron Framework.

    Current Development Information
    The new launcher is being written in Javascript on the Node.js Runtime Environment. The GUI framework used is Electron. Electron is an amazing framework which allows you to write applications using HTML, CSS, and Javascript. This makes creating GUIs infinitely easier. Electron is essentially a glorified chrome tab, as it is powered by Chromium. Electron is very well integrated with Windows, macOS, and Linux, making it very possible to create an app using native OS features. This is something that Java's GUI librarys severely lacked. The memory efficiency is insanely better, as the new launcher only requires about 20 MB of RAM instead of 800 MB. That's a 4000% increase in efficiency.

    The source code for this project can be found on our Gitlab.


    Why is this Project Taking So Long?
    The people currently involved in the project are only able to work on things during their free-time. I myself am currently a full time university student, so my attention is rarely focused on this project during the semester. Others who work on this have jobs and real life situations which have higher priority. Unfortunately this is the reality, and the launcher will take some time to complete.

    Can I Help?
    Yes! We are constantly looking for extra hands on this, especially in the working on the designs. If you are a designer, we would love to see what you can provide to the project. New coders are also welcome, however only those who have a working knowledge of Node.js and ES6 Javascript. Taking on coders who aren't familiar with the software can lead to producing bad code which would delay the project further.

    Links

    Screenshots
    You can find all the concept art on Trello, however I will attach some screenshots here to make you guys happy :). These concepts are subject to change as the designs are not final.

    [​IMG]
    [​IMG]


    Feedback and Suggestions are welcome! Comment them below.
     
    Pigxle, Twist, EStoop and 18 others like this.
  2. Hey all, I'm currently on thanksgiving break so I'm hoping to put a decent amount of work into this. I will post updates as they develop.

    Edit: Put in several hours of work in order to write up a proper module for launching the game process. With this, I am able to properly launch the game using FML's modlist format, which I mentioned several months ago. Last spring the launcher reached the point where I could log into the test client successfully, however that capability was broken as we shifted to a more organized mod storage and loading structure. Tonight that capability was restored and the new methods have been partially implemented. This is a huge step forward, as I was able to successfully connect to the production client.

    TL;DR - New mod loading system implemented and I was able to log into the production server using the new launcher.
     
    Last edited: Nov 19, 2017
  3. I've added some more updates to this tonight. The download progress is now shown on the landing page of the launcher. When you hit play, the progress bar and detail pane will be shown. First, it will validate the assets. If any assets are incorrect, they will be added to a queue and downloaded. That download will reset the progress bar and it will load again. Once the download is done, the game will be launched.

    Screenshots:

    First screenshot shows the files being validated and the begining of the download process.
    [​IMG]

    After some time the download is complete. Launcher prepares to launch and launches the game. My gif software doesnt let me take very long gifs but I can assure you that after about 10 seconds the minecraft window opened up.

    [​IMG]


    If you have any design/aesthetic suggestions PLEASE let me know :). If you don't have any suggestions - feedback is welcome.

    A possible suggestion is to make the whole progress bar and text much bigger and dock it at the bottom of the launcher, like so:

    [​IMG] [​IMG]
     
  4. I implemented a new design for the progress bar. I like this MUCH more.

    [​IMG]

    Error is only present at the end of the following screenshot because I havent logged in. This will not be a possible error on the completed launcher.

    [​IMG]

    Let me know how you like this one.
     
  5. Nuggets

    Nuggets Builder

    That looks better then the UIs of AAA games!
     
  6. Gorgeous!
     
  7. I am super excited for this!! So sleek!
     
  8. Wazgamer

    Wazgamer Lord Paramount of The Riverlands Maester

    :DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
     
    SseriousBusiness and Dan_Prime like this.
  9. Looks great! Can't wait :3
     
  10. amazing! very pleased with the aesthetic direction this project is taking!
     
    Dan_Prime and Thamus_Knoward like this.
  11. Tobyey

    Tobyey Nobuild

    Ohh boyy, hyped, i hope this'll resolve the issues :D
    Any ideas on when this will be aviable?
    Anyway looking great :eek:
     
    Wazgamer likes this.
  12. geeberry

    geeberry Kingthlayer Admin

    Soon™
     
    Dartman, CashBanks, Dan_Prime and 4 others like this.
  13. Tobyey

    Tobyey Nobuild

    That sounds great :D
    Keep the good work on booyyys <3
     
    Wazgamer likes this.
  14. Love it.

    Going to be working on an unnecessary but fun feature: discord rich presence. When you run the game through the launcher it will sync with discord and display some bits of information. I have not finalized what this will be, but it will likely include the server name (ex. Production or Test), server icon, and time elapsed. I will be providing screenshots once implemented.
     
  15. A lot of work is being completed on this, however much of that is backend stuff so I wont elaborate too much. What I would like to display currently is an early version of Discord Rich Presence support. The values/images you see can be customized in any way, so let me know your thoughts.

    Current plan: Change "WesterosCraft Launcher" to "WesterosCraft". The large image is supposed to be the 'server icon', the small image is the westeroscraft logo, the top line is undecided (help), middle line is time elapsed in game, and finally the bottom line is the server you're on. I might swap the bottom and top line. Let me know your ideas and I can see about changing things up with this (different images, text, etc).

    [​IMG]

    [​IMG]
     
  16. Amazing stuff!! I'm just curious the "exploring the wall" text adapts to the location the player is in? for example "exploring king's landing" exploring southern reach" etc or is it just a slogan or some filler text?
     
    Wazgamer likes this.
  17. lemonbear

    lemonbear Builder

    I'm trying to understand what you mean by "Discord Rich Presence". Does it mean that we will automatically be logged in to Discord/join the Westeroscraft Discord server when we login on the launcher?
     
    Thamus_Knoward and Wazgamer like this.
  18. If you're on the launcher and discord is detected, it will add the rich presence. If you're not on discord it won't, because it can't. As for the "Exploring beyond the wall", that is currently filler text. Something like that could be possible but it would require a client side mod or something equivalent to log some information that the launcher could easily read.
     
    GrayJedi and lemonbear like this.
  19. Rich presence visualized for those of you who may be confused. And yes, it is this simple. Just have discord open and the launcher will do the rest.

    [​IMG]

    After a few seconds minecraft opens, gif software cant take long gifs.

    [​IMG]

    Something I could do for now is have the rich presence show your status in place of the filler text. For example, "Waiting for client", "Loading Game", "Idling?" "Singleplayer", "Exploring the realm" (which means you're in game on the server. The exploring the realm could be configurable per server, so maybe on the test server "Experimenting with Wildfire". We could even have a random list of these status messages for fun!
     
    Last edited: Dec 4, 2017
  20. I thought I'd post an update.

    Launcher development is going slowly but surely. Unfortunately everyone on the team has commitments in our daily lives, so this project is really only worked on during leisure time. With that being said, I'll try to recap the progress made since the last update and what we're currently working on.

    • Perhaps the most impressive update is the finalization of the download process. There were plans to optimize this code a bit since Javascript is a single threaded language, and the file validation process tended to lag the application for 1-5 seconds. This sounds like nothing, but it's pretty noticable everytime you would click "Play". I was exploring ways to make this process asynchronous, although nothing very obvious came up. One night I was doing some research and found that I could fork a separate Node.js process to act as a worker, and deliver "messages" back to the parent process. This sounded like a great way to make the downloads and validations completely asynchronous. I worked on this for a few days and ran into a bunch of weird issues. Luckily, I was able to really crack down on the forked process method and implement it seamlessly.
      TL;DR: The validation and download processes are now implemented in a fully asynchronous manor, elminating all client lag related to it.
    • Another UI element was added, along with full responsiveness. This is the social media button dock on the landing page. Modifications may be made to how this looks before the initial release.

    So what are we working on right now?
    • A login UI is being worked on and finalized. This is an essential part of the launcher, therefore it is important that it is implemented correctly and cleanly. We do not want this to be a point of confusion at all on the new launcher, and special care is being taken to ensure this is the case. Once the UI is completely finalized, the backend authentication manager will be bound to the components.
    • A welcome view is also being actively worked on. When a user boots up the launcher for the first time, they may not immediately know what to do. To resolve this, we are adding a welcome view which will be displayed the first time the application is launched. The user will go through around three instructional UI views to setup the essentials. Currently, this will start with a welcome screen. From there the user will be directed to login to an account. After that, the launcher will process the system information to ensure everything is correct to launch the game without issue. The most important validation which will take place is validating the Java installation, since this the #1 cause for issues on the current launcher. If an invalid version is detected, the user will be given a very convenient option to have the launcher "Fix it" for you. This option will download the correct Java runtime and place it into the westerosraft folder, using it for game launches. These systems are slated for development once authentication and the login UI are complete.
    • A new packaging tool is being experimented with to build executables of the launcher in anticipation for closed alpha tests among select members of the community. I had anticipated that the size of the launcher would be around 150MB, since both the runtime and framework are bundled with it. I am pleased to confirm that this will not be the case, as the files are nicely compressed into a file roughly 40MB in size. This size may fluctuate a bit as more features and assets are added, but this will be roughly the final size. Automating builds and distributions is also a focus with this, however this will be completed down the line.
    I've mentioned private alpha tests in the above updates notes, however I do not expect this to happen soon. Maybe soon™.

    I'm not going to attach any screenshots, as what we're working on is subject to change. If you would like to keep up with day to day development you can checkout #launcherdev on Discord. There are images there ;)

    Thank you for reading and, as always, suggestions and comments are welcome.