-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite launcher for v4 #146
Comments
I found a good architecture for the rewrite, looks promising. It involves more split source files (goodbye to the 2k lines file) and way more static type hinting. |
I'm wondering if it would be a good idea to include the mod loader add-ons into the core. Add-ons will still be a thing but with the rewrite it would be possible to add more source files, and it would simplify installation. If you read this I'm interested in your opinion on this! |
Personally, I think that the most common modloaders should be included into the core. One of the immediate effects of this would be a much simpler installation method, as you already mentioned. More exotic and niche modloaders can be left to be implemented as an addon, along with other "specialized" functionality like #20. |
Thank you for the feedback, can you elaborate on the pain to use CLI. I'm really interested in how to improve it! |
While I do agree a more fancier CLI would be nice (perhaps an addon?), I think it is still important to keep something like the current CLI interface for its simplicity. At the very least, it should still handle running in non-exotic and non-interactive environments. |
CLI refers to portablemc API. It was very confusing to understand. Long ago I was working with your CLI it took me 3 whole days to get it to work because while working on it I ran into too many logical errors that didn't tell me what the problem was so I had to figure it out myself. |
This is one of my top priorities! I'm trying to improve the API, but to be honest I'm far from the API of minecraft-launcher-lib, which seems to me a little bit too simple with single function that do all the work (reminds me of OpenGL vs Vulkan). I'm still trying to improve it in order to also provide this kind of functions, but my goal is also to provides high modularity, which is not really the case in current version, imho. For the GUI, it will be complicated to include this as-is in the core, because one of the thing I want to keep is the zero required dependency. Maybe a minimal interactive interface? Also, I think that the CLI will remain almost the same, except for the login which will defaults to microsoft login. |
Matter of fact if you're worried about manual installation of the dependency, you can include the dependency in your pypi and it will auto install for the user. So there is no harm in just adding a bit more KB to the disk for better experience. I recommend using this text console UI library: Textual. I haven't researched much about it but I guess it should work on non-exotic and non-interactive environments. If you want it on a more non-interactive don't worry about it there no way someone playing Minecraft without mouse... |
For the dependency I know that I can install dependency by I generally don't like dependency management in Python (version conflict, downgrades, ...). For this case it will only be one dependency but I'm afraid we'll get used to it and maybe add more in the future. For the UI itself, it'll require a lot of work in addition to the rewrite. I'm also worried that the launcher would loose its UNIX philosophy about doing one thing well (installing and launcher Minecraft from command line, on most systems as possible, as fast as possible). To be honest I'm not currently convinced by this feature. By the way I'm going to improve this by improving the CLI to allow "machine readable" output, that could be parsed by other programs. |
Best of luck 🍀. Do what u are satisfied with. Hope the new update will give us a big surprise. |
I'll give a lot of updates here, so that we can build a better interface together 🚀 |
Yup let's just add all. UI, no UI or so what ever let just add all 😅 so that the user can pick what they like. |
Because I've time, here's a summary of how the API is going to be... The new architecture will be focused around tasks executed by an installer, with a shared state and watchers (cool new feature!). TasksThe tasks are simple classes implementing an InstallerThe installer is basically defined by a sequence of tasks, the internal shared state and watchers. The installer can be simply executed with an WatcherWatchers are simple class that receives events when new tasks are executed and when these tasks trigger events, this will be used for CLI, to avoid the old problem CLI where I was forced to extend classes to add more precise logging (I hate that). Why?The problem with the current API is how the installation procedure has to be done in the right order by the frontend using the API. For example in the CLI, because I want to log each step (metadata, libraries, assets, ...) in the terminal, the CLI is required to call each of these functions from the The version's installer will remain highly customizable, because it will remains possible to insert task in it (it will be the case for forge versions), but modifying it is no longer required to have a proper logging. The API will provide functions like installer = make_vanilla_installer("release")
installer.execute()
# Game is installed. However I've not yet decided how to start the game, the installer's state should contain enough information to know how to run the game. Maybe a step of the installer could add a NoteDownload will be multi-threaded! |
I think making everything bundled in isInstalled = PMC.check_loader("vanilla", "1.18.2", "./mc_dir")
if not isInstalled:
PMC.installer("vanilla", "1.18.2", "./mc_dir/", callback = {
"setStatus": some_function, # This function is called to set a text
"setProgress" some_function, # This function is called to set the progress.
"setMax": some_function, # This function is called to set to max progress.
})
# Do the same thing like above for checking if Java installed
PMC.args([...])
PMC.auth.Yggdrasil(...)...
# For starting the game
PMC.start(callback->dict)
# At this step I don't even know if it is possible to add call back function for logging |
This will be available in the portablemc package, so it can be imported |
I lied! There was a bug, the real time is 68 seconds! (on 4 cores, reaching up to 110 Mbps!) |
Now that I doubled the number of threads, it takes 36 seconds, reaching 17 Mo/s with 8 threads. It seems that it scales above the core's count because blocking I/O operations can easily be multi-threaded. Edit: 16 threads gives 27.4 Mo/s (peaking at 60 Mo/s) in 22 s |
It's incredible the job that you are doing |
Still working on it, the hard part is the start process but it's looking good for now. The first v4 pre-releases will not support add-ons I think, but forge/fabric/quilt will be integrated. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Version 4.0.0 is almost ready, remaining to-dos:
|
I forgot mod loaders in the previous message, but I'm also working on them, and it's working well for the moment. It's getting complicated on the API side, but this allows high flexibility. Now I'll have to make simpler functions, with less flexibility but easier to use and with less boilerplate. The big remaining part is including LWJGL fix into the API (it was previously done only by the CLI). |
A lot of progress today!
Yes, if I'm correct, this is the only work remaining! Edit: I was missing that all tests are now broken... |
I can't wait to show you how fast and easy forge can be installed |
…e resolving, should be more similar to official launcher now. #146
Huge! 46 sec to install, 1 min 10 sec to run the game. https://youtu.be/xd9QidKgdTM (please share 👍) |
Minecraft and Forge are actually so annoying lmao For Minecraft 1.5.2 to run with forge, the main class has to be put ahead of the global class path. This is so annoying because this is exactly what we tried to fix with #125 Minecraft 1.5.2 also crashes when modern |
@onebyte4 Hi! Do you remember which mod loaders were fixed by this PR #125 ? It's true that Mojang's launcher is placing the path at the end, but the older launcher didn't do that like this, and this doesn't seem to be a problem with all forge versions between 1.5.2 and 1.20.1! Maybe I can check the game's version to choose? Same thing that for legacy fixes. |
I'm updating documentation, and the launcher will be ready for the first pre-release. |
I'm trying another approach for on the API side, without all this sequence/task/state stuff, a lot closer to what currently is the launcher (v3). This is happening in Example: Still on time for pre-release this weekend! |
Ready for pre-release! Everything has been updated, documentation, and the new API that I was reworking this week is much better than my previous idea of sequence/tasks, so I decided to keep it. The new README is available at https://github.com/mindstorm38/portablemc/tree/v4-rc Here is it: https://pypi.org/project/portablemc/4.0.0rc1/ I'd be happy if you review this version (and its documentation!), so I can actually release it! |
Sadly, I can already spot a few problems :/
|
Pre-release 2 available, fixing problems described above: https://pypi.org/project/portablemc/4.0.0rc2/ Install with Now I'll write the changelog. |
The not fun part is writing documents. |
I actually like writing changelogs, it's so satisfying to see all the work done and all the contributions! Here is it by the way: #159 |
Pre-release 3 available now: https://pypi.org/project/portablemc/4.0.0rc3/ I hope this is the last pre-release! We fixed a lot of issues thanks to @rutexd on #133, downloads are now more reliable (on paper). |
I've been testing |
…e resolving, should be more similar to official launcher now. #146
Released! |
Awesome! 😍 |
The launcher really needs to be rewritten, the current architecture, single-file oriented, gets more and more complicated over time and doesn't scale with the new forge add-on. I want to simplify the API architecture for beginners.
The text was updated successfully, but these errors were encountered: