General discussion about CrossCode.
no avatar
User

ubergeek77

Posts

2

Joined

Mon Sep 24, 2018 2:23 am

Let's get this masterpeice running on Android

by ubergeek77 » Mon Sep 24, 2018 2:43 am

Original Post:SHOW
I just picked up the game on GOG (after seeing what an amazing game it was on Twitch), and I haven't been able to put it down since.

The music is amazing, the story is well written, the characters are memorable, the gameplay is fantastic; I could go on and on.

The thing that impresses me most about this game? It's (basically) all HTML5! As a developer, I can appreciate what a truly amazing accomplishment this is. And since it's an HTML5 game, and inherently can run in a browser, I want to take it a step further. I'd like to run this on my Android phone.

Don't get me wrong, the Desktop experience is fantastic, but I'm not always near my PC, and lately I've been enjoying playing stuff on-the-go with my favorite controller and a smartphone grip.

The good news is, the game does run on Android! After applying a very simple fix to the game, I started a webserver on my PC, served the "assets" directory in the game files, and loaded a webpage with my PC's IP and port on Chrome on my Android phone. And it works! Best of all, the game fully works with a Bluetooth DINPUT controller without any fiddling whatsoever. Even the triggers and analog sticks get mapped correctly. Awesome!

Unfortunately, the game runs pretty slow, which is to be expected, since (I believe) Google has been implementing some rather drastic performance bottlenecks into Chrome to combat rogue websites. Not to mention there's a lot less raw power to work with when compared to a full-blown desktop. Turning off all of the effects from the in-game settings does help somewhat, but combat still comes to a crawl in some instances. I also tried Firefox for Android, and it was significantly worse than in Chrome. At least in Chrome, the menus, intro sequence, and basically everything before the first dialog boxes runs pretty okay, but Firefox makes things come to an absolute crawl. Aside from Chrome and Firefox, I've not yet tested any other browsers.

What I would really, really like to do is get this game running on my phone at as close to desktop speed as possible. The fact that I got to see it running makes the concept of playing it on my phone all the more alluring. It just feels like it needs that extra performance push to make it happen (and no, I'm not asking for the devs to go and make the game more optimized, you've done enough hard work over the last half decade!!!)

Still, I have a pretty beefy phone, so if I could somehow get it running without any performance restrictions imposed by the basic Chrome app, I have a feeling it will work pretty well. I just need something that loads the game with raw performance in mind, and not for typical browsing like Chrome is obviously designed for. I believe the Desktop version does this when loading the game, as the game is much more responsive and loads much faster when launched the "correct" way, as opposed to serving up the game files on a webserver and loading it in a Desktop browser.

My knowledge of web-based technologies and other such things is pretty short, so I'm not sure about the best way to go about this. I'm thinking an APK with some kind of web wrapper/launcher would be a start (easier said than done, of course), but WebView would almost certainly want to be avoided, since it wouldn't be any better than Chrome; probably worse. Depending on how hard of a performance hit the game takes from load times, you might be able to get away with hosting the game on your local network and just telling the APK to load it from there instead, thus saving ~300MB+ of space on the phone. Again, all easier said than done.

So this is where I come to the community, and the highly skilled game devs: does anyone have any ideas about this? I'm willing to help as much as I can, but I'm not entirely sure where to start. I'm pretty comfortable with Android Studio at this point, so if I need to build something to try and get this working, I will. My phone is also rooted, should that prove to have any benefits.

Fingers crossed we can get this spectacular game running in a portable fashion. Thanks for reading!

-----------------------------------
UPDATE:
-----------------------------------
I've been hard at work trying to get this working, but I haven't had much luck so far.

I was able to package the game using CrossWalk, but the game is just so slow. Even slower than regular Chrome is. The initial boot takes about 4 full minutes. Changing the pixel size to 1 actually helps a lot for performance, but it's still way too slow to play.

I also tried Cordova, which was slightly better, but the difference was negligible. The load time was still ridiculously slow. Between Cordova and CrossWalk, unless there are some disabled performance-related build settings that I'm not aware of, these aren't going to work.

My DINPUT controller technically works with these two methods, but in both, it's not configured correctly like it is in Chrome. It seems like the triggers, d-pad, and potentially bumpers (LB/RB) don't work at all.

All that's left to try is PhoneGap and Cocoon. I don't see much point in using those, though, since I expect the performance would be about the same. Another problem is that Cocoon isn't free, and while they offer a "free tier," you are limited to app sizes of no greater than 50MB. I would need at least 400MB, so unless I run the game off a webserver (which defeats the purpose of portability), that's a non-starter.

My gut is telling me there is a solution to be found, I just don't know what it is yet.

After all this hassle, I'd be better off just playing on Chrome and dealing with the lag, but this game deserves more than that. One of my friends suggested I take a look at chrome://flags on my phone, and see if I can enable/disable some performance-related settings, so there's still that to try, but I'm feeling pretty disheartened, after spending a significant amount of time on this with no progress.

Is there a more efficient way to be doing this?

Edit:

I've come to the conclusion that simply packing this into a WebView is going to cause too much overhead, hence the performance issues I've run in to so far. I don't know how exactly the devs packed the game up for release, but there are definitely some serious optimizations going on.

The only other option I can see at this point is Nativescript, given that the game is basically written entirely in JavaScript. This is where things get really hacky, though, since Nativescript isn't really designed to run code that's written like CrossCode is in its current state. For one, it draws everything to an HTML5 canvas, which I'm not entirely sure Nativescript can use. You can use a canvas if you do something similar to loading an iframe, but I don't know if the JavaScript code benefits from this. Another issue is that I can't seem to get JQuery to work, which is important, since the game relies on it.

Basically, I don't think this is something I'll be able to do without a full, unobfuscated source for the game. I can see the game's "code," but it's all been "uglified," which basically means it's had all readability taken out of it, so functions no longer have names, there are no spaces, and other things that make it next to impossible to do anything with.

I'm convinced at this point that it's absolutely possible for Radical Fish Games to port CrossCode to Android (and pretty much any platform they want for that matter), if properly motivated.

This is very sad, because they've stated already that there are no plans to do this, citing the complex controls, and that, supposedly, not enough people have controllers they use on their phones.

I'd still very much like to see this brought to Android though. I was dying to play it today when I wasn't home, but I couldn't :(

Oh well, it was worth a try...
no avatar
User

duke

Posts

1

Joined

Mon Oct 01, 2018 12:25 pm

Re: Let's get this masterpeice running on Android

by duke » Mon Oct 01, 2018 12:30 pm

Hey, kudos for your efforts so far!

I think an Android/iOS port would be manageable, but I'd say make it exclusive to tablets/phablets and require an external gamepad. I don't see the controls to work well at all with touch inputs.

Maybe I'll also have a look into it, there may be some things that could potentially make it work... but can't promise anything.
no avatar
User

ubergeek77

Posts

2

Joined

Mon Sep 24, 2018 2:23 am

Re: Let's get this masterpeice running on Android

by ubergeek77 » Fri Oct 19, 2018 6:55 am

Thanks a lot! I appreciate the response, I was beginning to think this post would fade into obscurity...

Also, while a touch-control setup is certainly not ideal for this type of game, a video on YouTube showing it being played via Steam Link demonstrates that it still does work a lot better than I would have thought. Of course, I would agree that it severely degrades the experience, but while I'm not interested in playing without a controller, I would understand the people who would want touch controls.

Anyway, I appreciate the interest in this! Let me know if I can help with anything.


Last bumped by ubergeek77 on Fri Oct 19, 2018 6:55 am.

Who is online

Users browsing this forum: Google [Bot] and 1 guest

Powered by phpBB ® | phpBB3 Style by KomiDesign
cron