Anuken / Mindustry

The automation tower defense RTS
https://mindustrygame.github.io
GNU General Public License v3.0
22.67k stars 2.97k forks source link

Full ChromeOS Support #802

Closed Anuken closed 4 years ago

Anuken commented 5 years ago

Implement good ChromeOS support.

I only have access to one chromebook, and the game seems to work fine on that. Is anyone interested in working on this?

InValidFire commented 5 years ago

I can have my younger brother test it out on his Chromebook, anything I should look for in particular? Controls should work based on Desktop controls and prompt asking for Touch, correct?

Anuken commented 5 years ago

It should just launch without crashing. The points above are just future plans, if anyone is interested in implementing them.

CA6 commented 5 years ago

i am actively posting this from my chrome book it a ASUS model c202s

CA6 commented 5 years ago

anuke it refusees to open

Anuken commented 5 years ago

What's the crash log?

CA6 commented 5 years ago

didnt give one just didnt open porperly ill try to find it

Anuken commented 5 years ago

Android apps don't tell you the crash log directly, you'll have to look it up.

CA6 commented 5 years ago

i searched down in files i didnt know exist however couldnt find it i think my chrome book cant handle the awesomeness thats mindustry

LionelBergen commented 5 years ago

@Anuken Any reason you suspect ChromebookOs to not work? JVM should work the same on all devices. I could test using ChromiumOS (not ChromeOS), just wondering what to look for / test doing

Anuken commented 5 years ago

@LionelBergen It's probably related to the device architecture. Native libraries are needed to run the game, and I don't know if all the architectures upon which ChromeOS is run are supported properly.

CA6 commented 5 years ago

or the software on it becuse older versions of the game / os worked together but it was vary difcult to play

CA6 commented 5 years ago

gonna go back to the main os channal on my crhomebook

CA6 commented 5 years ago

dev channel on the chrome os hates the game thats all

CA6 commented 5 years ago

can confirm that the rebide does not change the zoom function

Arkanic commented 5 years ago

@Anuken I use an Asus c213 flip, so I can do some testing. I find the main problem I have at the moment is that the multiplayer chat box, when clicked, comes up with a native Android textbox to type your message into, rather than being able to type into the mindustry chat text box.

Violet-Scarelli commented 5 years ago

Using some kind of HP unit and I can assure you it works perfectly because it's using the android build. Chat needs some polish, though (as Arkanic said)

skybldev commented 5 years ago

Same thing as violet.

My experience with Mindustry on my Chromebook does not include touchscreen as the touchscreen on my kevin (samsung chromebook plus) broke a long time ago and only works with a stylus.

Therefore I would like to see a switchable touchscreen or classic control scheme on CrOS, Android, iOS, and Windows, as they all have the capability to run touchscreen or with a portable Bluetooth keyboard or mouse. There are many people who own Windows 2-in-1s and Chromebooks that may prefer to play in tablet mode on-the-go, and on the other hand many iPad and tablet users who do not have a laptop and use their tablets/iPads as one (especially iPads).

Arkanic commented 5 years ago

@Luxray5474 I agree, and another thing that could be implemented is full keyboard control for CrOS

CA6 commented 5 years ago

i second this as i do want to test my mod on my chrome book full keybord would be vundubar

Arkanic commented 4 years ago

i wonder if there is a way to just directly port the desktop version with an android wrapper without causing any ARM issues

any thoughts?

Anuken commented 4 years ago

The desktop version uses a desktop backend, which isn't for Chromebooks. It has to either be a web app (hah) or an Android app.

Fixing the keyboard on Chromebooks wouldn't be too hard, but I would need 2 things:

Arkanic commented 4 years ago

ok

deltanedas commented 4 years ago

anuke cant you cross compile the libraries then tell chromebook users to get specific architectures for each model or something sure itd be annoying and shit up daycare, but its better than nothing

Anuken commented 4 years ago

(tapped the wrong button on mobile again)

Anuken commented 4 years ago

anuke cant you cross compile the libraries

Which libraries and why?

deltanedas commented 4 years ago

Native libraries are needed to run the game, and I don't know if all the architectures upon which ChromeOS is run are supported properly.

these ones??? so you can ship them like with the java runtime eddit: spacing

sybenx commented 4 years ago

Why not just add keyboard and mouse support to the android version, ignoring whether or not it's a chromebook?

Anuken commented 4 years ago

The Android version already has keyboard/mouse support.

Violet-Scarelli commented 4 years ago

So I'd like to add my updated two bits, since I've been playing on a chromebook for quite a while now:

  1. I can run both the java version and the android version. However, the android version either relies on mouse/keyboard controls, which are only partially useful on a touchscreen laptop with no right click, or touchscreen controls, which are very strange for a full laptop, and are still missing the full chat support.
  2. The java version requires installing the chromebook's linux terminal, and then java. From there, I can run mindustry from the terminal, but I get some minor (non-crashing) errors, usually something to do with zlib. It works just fine, but does not have swipe control (naturally, as it's on a 'desktop' platform).

My suggestions are: https://bit.ly/2ZgRsct compacted link to a stackoverflow question about how to detect platform. This could be integrated into either the android app or both platforms to detect what the game is running on, and from there could be used to either implement full touch or hybrid touch/keyboard, a system I'll describe below.

Hybrid touch/keyboard works as follows: How the ship/mech is controlled is dynamically assigned, with arrows/WASD being default. Whenever a swipe gesture is detected, the control is switched to touch movement, updating the camera's tracking style accordingly. As soon as the ship gets to within a certain range of the crosshairs, it switches back to arrrow/WASD control. I (and possibly other chromebook users) would find this system extremely useful, as I use the keyboard for precise control, and often end up switching over to swipe movement to cover large distances, before switching back to maneuver around bases, due to swipe movement's auto-boost for ships (which I find annoying when I clearly have the option to drop behind a block but my mech's hitbox is overlapping the nearby block so I fly instead. Yes, it's mostly cosmetic, but there are times, such as when you need cover from enemy fire, that you'd rather be behind a block than on top of it). If swipe movement and keyboard movement could coexist for chromebooks, it would make things much easier.

Second, aimed at the concept of hybrid touch/keyboard systems in general, we shouldn't lose all keybinds when switching to touch controls while having a keyboard. I've remapped delete/cancel to V on my java copy of mindustry, since I have no mouse on my chromebook. I would think being able to remap delete/cancel, select/save schematic, the schematic menu key, and any other non-movement related actions would be a logical step. Alternatively, it could work by the game detecting the presence of a keyboard on the android version. https://bit.ly/2QfOS26 another compacted link to a stackoverflow question answering how to detect kind and presence of a keyboard on android.

Finally, I think it would be a good idea (not necessary, just good) for a player to be alerted that they're in hybrid mode. Any current chromebook players would be possibly jarred by the sudden change in controls, so perhaps make it a third control mode ("Chromebook" or "Touchscreen Laptop" mode) that isn't default, but the game alerts the player it's there if it detects an attached keyboard?

Thanks for listening, if you got this far. I know this isn't the suggestions page, but I just thought I'd throw my hat into the ring because I've got some real feedback, not just concepts.

Arkanic commented 4 years ago

I've gotten all of the env variables and System.GetProperties() onto a single file and ran it on my chromebook to see if there were any chromebook env variables, and this is the result:

(the only definite indicator seems to be wether or not the device has org.chromium.arc.device_management installed, mindustry could check this before it runs to figure out wether or not it should use keyboard controls, but then again what about android users with bluetooth keyboards...?)

violet-scarelli's link is really helpful --> https://stackoverflow.com/questions/39784415/how-to-detect-programmatically-if-android-app-is-running-in-chrome-book-or-in

---- System.getProperties(); ----
-- listing properties --
http.agent=Dalvik/2.1.0 (Linux; U; Android 9; In...
java.runtime.name=Android Runtime
android.icu.impl.ICUBinary.dataPath=/data/misc/zoneinfo/current/icu:/syst...
java.vm.version=2.1.0
android.icu.cldr.version=32.0.1
java.vm.vendor=The Android Project
java.vendor.url=http://www.android.com/
path.separator=:
java.vm.name=Dalvik
java.vm.vendor.url=http://www.android.com/
java.vm.specification.name=Dalvik Virtual Machine Specification
user.dir=/
java.runtime.version=0.9
os.arch=i686
java.io.tmpdir=/data/user/0/com.duy.compiler.javanid...
line.separator=

android.icu.library.version=60.2
java.vm.specification.vendor=The Android Project
https.proxyHost=localhost
user.variant=
os.name=Linux
android.zlib.version=1.2.11
http.proxyPort=-1
java.library.path=/system/lib:/vendor/lib
java.net.preferIPv6Addresses=false
java.specification.name=Dalvik Core Library
java.class.version=50.0
user.locale=en-US
os.version=4.4.190-16770-gb3c36ab5af98
http.nonProxyHosts=
android.openssl.version=OpenSSL 1.1.0 (compatible; BoringSSL)
user.home=
file.encoding=UTF-8
java.specification.version=0.9
user.name=root
java.class.path=.
java.vm.specification.version=0.9
java.home=/system
user.language=en
java.specification.vendor=The Android Project
java.version=0
java.ext.dirs=
http.proxyHost=localhost
java.boot.class.path=/system/framework/core-oj.jar:/system...
https.nonProxyHosts=
java.vendor=The Android Project
file.separator=/
java.compiler=
https.proxyPort=-1
android.icu.unicode.version=10.0
user.region=US

---- Environment Variables
SYSTEMSERVERCLASSPATH : /system/framework/services.jar:/system/framework/ethernet-service.jar:/system/framework/wifi-service.jar:/system/framework/com.android.location.provider.jar:/system/framework/org.chromium.arc.jar:/system/framework/org.chromium.arc.bridge.jar:/system/framework/org.chromium.arc.mojom.jar:/system/framework/arc-clipboard.jar:/system/framework/arc-services.jar:/system/framework/arcvold-binder.jar
ANDROID_STORAGE : /storage
PATH : /sbin:/system/sbin:/system/bin:/system/xbin:/odm/bin:/vendor/bin:/vendor/xbin
ANDROID_SOCKET_zygote : 12
ANDROID_DATA : /data
ANDROID_ROOT : /system
ASEC_MOUNTPOINT : /mnt/asec
DOWNLOAD_CACHE : /data/cache
EXTERNAL_STORAGE : /sdcard
ANDROID_BOOTLOGO : 1
BOOTCLASSPATH : /system/framework/core-oj.jar:/system/framework/core-libart.jar:/system/framework/conscrypt.jar:/system/framework/okhttp.jar:/system/framework/bouncycastle.jar:/system/framework/apache-xml.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/telephony-common.jar:/system/framework/voip-common.jar:/system/framework/ims-common.jar:/system/framework/android.hidl.base-V1.0-java.jar:/system/framework/android.hidl.manager-V1.0-java.jar:/system/framework/framework-oahl-backward-compatibility.jar:/system/framework/android.test.base.jar
ANDROID_ASSETS : /system/app
Arkanic commented 4 years ago

@Violet-Scarelli wouldn't hybrid touch-keyboard assume that all chromebooks have inbuilt touch displays?

(most of them do, but some of the cheaper models don't. Personally I play on an asus c213 flip, which does have a touchscreen.)

Violet-Scarelli commented 4 years ago

@Arkanic It's a safe bet to assume a chromebook does have a touchscreen, as most do. It is true that cheaper models don't, but to mitigate that the default android mouse/keyboard controls could be altered so the camera doesn't slide around like it does as of now. I've got an HP model of some kind and it definitely has a touchscreen.

Arkanic commented 4 years ago

agreed, most of them do

CA6 commented 4 years ago

i mean there is a mod that like emulates it but chough it is fucking trash chough

denniskempin commented 4 years ago

I used to work on Android input for Chromebooks. For the android version, I would recommend not specifically checking if you are running on a Chromebook (Those methods in stackoverflow are not reliable and have broken already or may break in the future).

The intention is to have developers check for hardware capability and adjust to that (i.e. in this case, to check for the presence of a mouse or keyboard via InputDevice.getDeviceIds()). This would not be limited to chromebooks, but also support other platforms (e.g. Samsung Dex, or whatever there is going to be in the future)

I would strongly recommend setting this flag though: https://developer.android.com/topic/arc/input-compatibility#use_androidhardwaretypepc

Otherwise there may be a lot of emulation happening (e.g. mouse may emulate a touchscreen etc) to stay compatible with older apps.

Please do let me know if you have any questions, I would love to help.

ZSXT123 commented 4 years ago

Is ChromeOS unable to connect to the Android LAN?

Anuken commented 4 years ago

I don't think there much left to discuss here. I may try implementing the hardware checks mentioned here in a later update, or someone else can try their hand at it.

maxwolf76 commented 2 years ago

hey im wondering if i could test it out on my choremebook

skybldev commented 2 years ago

you can try it, but there are no plans on supporting chromeOS, and the best thing you can do is run the android app or use crouton or install Linux to play it. those methods are the exact reasons why.

Anuken commented 2 years ago

I tried running it on a chromebook as an app about a year ago, and most things seemed to work fine with keyboard controls enabled. Unless something got broken, I don't think there's any more support necessary.

Arkanic commented 2 years ago

The app works fine on chromebook (as do keyboard controls) the only real issue is around mouse hovering e.g. when placing a schematic the schematic onionskin or whatever doesn't follow the mouse, and only responds when the app is clicked

Example: https://user-images.githubusercontent.com/50847107/144689691-4cba1fc8-d9d6-4d08-8815-c0c616f9a96b.mp4 (sorry for the crappy fps, chromebook screen recorder is pretty bad)

It just seems to be an issue with how mouse input works with apps on chromeos

Anuken commented 2 years ago

I'm pretty sure the Android backend already listens for "mouse move" events, so I'm not sure if that's even fixable.

Arkanic commented 2 years ago

I can't really comment, as I don't have much experience in this sort of area