Web version?
Hi Cubitect, is there a chance of building wasm version of viewer so it can be packaged and published as a web page? This would be really cool
Not sure how realistic this is. While the cubiomes library should be relatively straighforward to port, almost all of cubiomes-viewer is UI code and would need to be rewritten pretty much from scratch considering it's not even suitably abstracted.
Seems like a lot of needless work, potential danger with people's seed finding sessions and invasive updates, as well as all the hassle of having to host and deploy it. I am not sure what the advantates you were thinking of when you said it would be really cool.
almost all of cubiomes-viewer is UI code and would need to be rewritten pretty much from scratch
It looks like Qt (including QtWidgets) supports WebAssembly. I have also found some Demos. But t looks like it is hard to set up and you need to compile QT from source. I also can't say how well this will work. There may be some patches needed. It may also work not as fast as if running as a normal Application.
Not saying it should be done or that we really need it in the first place, was just curious because that would make a very good alternative to chunkbase if ported to web (even lacking seed searching part).
potential danger with people's seed finding sessions and invasive updates
I am sorry but who is invasive and where? You may be living in different universe perhaps? If app updates it is not like you are forced to update to it nor it will be likely touching existing sessions or what have you because it will just become one of building targets like we have flatpak now.
Can't disagree on needless part but hey, I will go to web based cubiomes viewer any day instead of chunkbase.
Since I am not familiar with Qt I created this issue asking if it is remotely possible with current codebase, as mentioned above Qt generally supports being built for web. Just compiling Qt from sources and expecting minor tweaking does not sound that bad so I will give it a shot in future.
that would make a very good alternative to chunkbase if ported to web (even lacking seed searching part)
If you don't need searching, you can take a look Minecraft Seed Map, which says that it's using cubiomes.
generally supports being built for web
It's supports this but I have never anyone seen compiling a QtWidgets Application to WebAssembly outside a few demos, so expect some problems. I also don't how how this handle multiple Windows.
Cubiomes Viewer writes a configuration file and save the session, which could be a Problem for WebAssembly. You may need to patch this out.
I will give it a shot in future.
Good luck
I have found this blog post from the Qt Developers which ported a existing Application to WebAssembly. The App in the Post uses QtQuick, but they wrote it also works with QtWidgets (which Cubiomes Viewer uses). You can take at the look of this for a general direction, but you will need some experience in Qt.
It should also be noted that Cubiomes Viewer currently uses Qt 5 while Qt 6 is the newest version. Qt 6 might have some fixes that make Apps work better in WebAssembly.
Yes, indeed, so far for me it is very confusing since I only worked with Qt apps when I was hacking inside their binary but if I will figure something up or give up I will write here. There seem to be light at the end of a tunnel tho
I was initially going to dismiss this as unfeasible, but this looks surprisingly doable. It's at least worth investigating.
My main concern is the sketchy support for multi-threading and how it works with Qt's event-loops. Most of the functions in cubiomes viewer are long operations that run in their own thread and communicate with the GUI via Qt signals. It seems that you can enable multithreading, but there are some caveats.
Regarding existing web applications, there is also mcseeder which has some rudimentary search capabilities, but is a little more limited in the map navigation.
My journey ended on failing to build Qt for web from source, likely just skill issue, will revisit it later.