I posted this on the libGDX forum here, but since it’s a pretty broad question, I haven’t received any replies, so I’m crossposting here.
Long story short: I run a little website that contains tutorials and an uploader for Processing and Java games. I’d like to expand to include html5 projects exported from libGDX.
I have the basics working: exporting from libGDX to html5 using gradle, which creates a dist folder that contains the files to be hosted.
The problem is, these files come in at around 70 MB (just for the default example game that shows an image on a red background). That would be okay if it was just my games being hosted, but we’re talking about multiple users uploading multiple games, so it adds up quickly!
I’m thinking that much of this 70 MB is the same for every game: the libGDX backend and GWT support code. However, I don’t really understand the anatomy of what gets exported, so I’m hoping somebody out there can break it down for me.
I work with GWT, so I understand the basics, but I’m pretty sure the output is obfuscated, so it’s a little difficult to determine exactly what’s going on. I’m trying to compare the output of 2 identical projects, but I’m hoping somebody out there already knows the answers I’m trying to reverse engineer.
Basically, is there a way to host a single shared subset of the output of a libGDX html project, that way any subsequent uploads will be much smaller than the shared codebase? What files do I need to use as the shared codebase? How can I link user uploads to these shared files, especially if the output is different every time thanks to obfuscation?