Skip to content
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

[WIP] Android port #179

Merged
merged 9 commits into from
Sep 13, 2019
Merged

[WIP] Android port #179

merged 9 commits into from
Sep 13, 2019

Conversation

kkszysiu
Copy link
Contributor

https://www.youtube.com/watch?v=zlmXVI-oUqQ

I will publish build files and cleanup the source a bit more in next phases.

The sources are not yet ready to be merged in any way.

@ghost
Copy link

ghost commented Jul 15, 2019

Hey @kkszysiu I am excited to see to see this ! I have been trying to get this working. Can I see your code?

Everytime I tried to launch the game when it was compiled , it would just crash in the JNI.

@AJenbo
Copy link
Member

AJenbo commented Jul 15, 2019

Nice work, could you also add a script for downloading the dependencies similar to what we have done for the iOS builds:
https://github.com/diasurgical/devilutionX/blob/64700e2a668920e0a7cdb67a2f8f464f78fcdd5c/Xcode-iOS/fetch-dependencies.sh

@ghost
Copy link

ghost commented Jul 15, 2019

How is this actually build? I don't see any links or anything to the NDK or anything like this.

@kkszysiu
Copy link
Contributor Author

@ApertureSecurity , most of NDK stuff, java project and AndroidManifest will be released after I finish brief code cleanup. I'm trying to make it as easy as possible to compile it by basically anyone.
Hopefully you will just import it into Android Studio, then click "Build" and everything will be covered there.

As for now as you can imagine it's pretty rough, including copying data from your PC to Android :)

@AJenbo I hope this will not be necessary. As I've stated - there will be another project that fetch everything and it's compatible with Android Studio (gradle project compiling SDL2 etc.). It is fetching https://github.com/diasurgical/devilutionX (currently pointing on my fork and my android_port branch) as a submodule. So all you do is opening AndroidStudio, clicking "build" and ending up with a code that should work on every platform Android currently supports (arm64, armv7, x86_64 and x86 are being built as for now).

There's also a plan to make additional Java activity before the game will run. Maybe some code that will download a game from GOG automatically for you and set it up or something like that or in case you have installed a game on PC then it will guide you trough the steps to make it work on Android.

@ghost
Copy link

ghost commented Jul 15, 2019

I have a script that will get all the dependencies if they are all just SDL stuff...

Here is what I made for compiling for android and it kind of works... It compiles and runs but I cannot move. I think the unsigned char might have to do with it but I am not 100% sure.

https://github.com/ApertureSecurity/DevilutionM

@kkszysiu
Copy link
Contributor Author

Hey @ApertureSecurity , I will do simple cleanup of my code and you we can join the forces :)

On my port everything works so far, but since the game was never designed to be run on mobile devices playing it is actually quite rough.

My ideas to extend the gameplay was:

  • addign the joystick support, so if you have bluetooth gamepad you can move using it
  • add ability to display virtual d-pads on top of game surface, so in case you do not have gamepad this is actually alternative controller
  • using mouse handling by SDL2, which is currently working but game is not very pleasureable with that setup - I can imagine on tablet it's probably much better.

@AJenbo
Copy link
Member

AJenbo commented Jul 15, 2019

@kkszysiu I'm currently working on bringing over @erfg12 controller code here #181

The virtual gamepad UI would obviously also be attractive for the iOS port #137

Regarding the build process; I would prefer having the build setup be part of the same repo as the code. If Android Studio is picky about the code location then maybe we could use symlinks instead of submodules.

@ghost
Copy link

ghost commented Jul 15, 2019

@kkszysiu Have you played FFVII on android? I like the controls in that.

One thing that annoys me when I play on mobile platform is when I fingers move and I will eventually lose the statically placed joystick. FFVII has a joystick that is created upon fingertouch. All other buttons are static , but the joystick is freely made like this so you never lose the joystick.

Perhaps I can make video on this to demonstrate .

Also I want to ask. Did you get sound to work? I was only able to make sound effects play but that code was separate.

@kkszysiu
Copy link
Contributor Author

@ApertureSecurity , haven't played it sadly.

But yeah, sounds works just fine! :)

@qndel
Copy link
Member

qndel commented Jul 15, 2019

aye I've played games like this and have to say it works ok and doesn't sound hard to code :p

@AJenbo AJenbo mentioned this pull request Sep 3, 2019
12 tasks
Source/diablo.cpp Outdated Show resolved Hide resolved
@AJenbo AJenbo changed the base branch from master to android-wip September 13, 2019 17:41
@AJenbo AJenbo merged commit a9cbe48 into diasurgical:android-wip Sep 13, 2019
AJenbo pushed a commit that referenced this pull request Sep 14, 2019
AJenbo pushed a commit that referenced this pull request Sep 23, 2019
AJenbo pushed a commit that referenced this pull request Sep 23, 2019
AJenbo pushed a commit that referenced this pull request Sep 23, 2019
AJenbo pushed a commit that referenced this pull request Sep 23, 2019
AJenbo pushed a commit that referenced this pull request Nov 24, 2019
AJenbo pushed a commit that referenced this pull request Nov 24, 2019
AJenbo pushed a commit that referenced this pull request Nov 24, 2019
AJenbo pushed a commit that referenced this pull request Nov 25, 2019
AJenbo pushed a commit that referenced this pull request Nov 28, 2019
AJenbo pushed a commit that referenced this pull request Oct 25, 2020
AJenbo pushed a commit that referenced this pull request Oct 25, 2020
AJenbo pushed a commit that referenced this pull request May 27, 2021
AJenbo added a commit that referenced this pull request May 30, 2021
Set the font path for Android

The font is located in the package resources so no path should be

Do not check for FileExists on CharisSILB.ttf for Android (#2087)

FileExists will always fail as it doesn't detect files located in the
APK
AJenbo added a commit that referenced this pull request May 30, 2021
Set the font path for Android

The font is located in the package resources so no path should be

Do not check for FileExists on CharisSILB.ttf for Android (#2087)

FileExists will always fail as it doesn't detect files located in the
APK
AJenbo added a commit that referenced this pull request May 31, 2021
Set the font path for Android

The font is located in the package resources so no path should be

Do not check for FileExists on CharisSILB.ttf for Android (#2087)

FileExists will always fail as it doesn't detect files located in the
APK

asd
AJenbo added a commit that referenced this pull request Jun 7, 2021
Set the font path for Android

The font is located in the package resources so no path should be

Do not check for FileExists on CharisSILB.ttf for Android (#2087)

FileExists will always fail as it doesn't detect files located in the
APK

asd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants