Android port (on hold)

Github repo: https://github.com/utunnels/Cataclysm-DDA/tree/android
Compiled binary: https://www.dropbox.com/s/fqy4wf33zppasyd/DDA4droid.7z

Currently I edit all paths to let DDA load from sdcard. So the code isn’t compatible with other platforms.

It is a headache to display the keyboard, because my phone has a 480x800 screen. Though it looks OK in landscape view, there won’t be any place to put the screen keyboard. So I use portrait view and 6x12 bmp font.

I wonder how it looks like on a device that has bigger resolution.

[hr]
*Edit

Update the app to use landscape view. Change font size to 8x16.

Hit back button or the icon at lower botto corner to bring up the keyboard.

You can also edit data/android.keys to add your own quick key list.



This looks awesome, now I can slap zombies with crowbars while literally shitting myself.
Props to you man

So now I have to get the android dev environment installed on my computer…

Wow utunnels, just wow. I can’t wait to check this out.

Awesome! Will this run well on slower/older phones such as my Xperia Play?

Now I want to buy an android. This. Is. Awesome.

Welp, I tried running it on my phone, but when i generate a new world, there’s a bunch of stuff (looks like graphical glitches) covering the screen.

Seems to work fine on my D2G, hard to test because the OSC is ridiculously difficult to use.
If we can streamline the input (not terribly happy about the prospect, but probably with some kind of command menu), this looks like it will actually work.

Particularly for testing, might see if we can get wifi keyboard working with it. Also it crashes if I slide out my keyboard.

Astounding utunnels, simply astounding.

[quote=“utunnels, post:1, topic:1726”]Github repo: GitHub - utunnels/Cataclysm-DDA at android
Compiled binary: Dropbox - DDA4droid.7z - Simplify your life

That’s pretty good, there even seems to be support for audio ready. Did you make all that just for Cataclysm or you used some skeleton of some previous port? Have you tried playing any sounds from the native part of the code, is audio support complete?

Can you name the tools you used and describe compilation process? Are there any files that need to be manually moved between native and Java compilations? Is there anything unusual that needs to be done to get it compiled?

It is a headache to display the keyboard, because my phone has a 480x800 screen. Though it looks OK in landscape view, there won't be any place to put the screen keyboard. So I use portrait view and 6x12 bmp font.

You could enable auto rotation anyway. If you are just moving from place to place all you need is the touch-screen, then when the keyboard is required you simply rotate the phone. Alternatively the right side of the screen with messages, radar and player info could be separated and moved below the main view, something like this:

I wonder how it looks like on a device that has bigger resolution.

It’s pretty small even for 7 inch tablet. The game definitively needs landscape view, with some custom keyboard/controls panel, or vertically split windows like on that screenshot above.

It is based on SDL 2.0 and it seems there's some bug when using both finger touch event and text input event. Otherwise I would have simulated the directional buttons. For now you have to use hjkl or numbers to move your character.

Perhaps for a quick hack you could use screen rotation event to disable one and enable the other, enable touch screen and disable text input when in landscape and the other way around when rotated to portrait.

Yeah, it is just a quick port. Perhaps I can draw DDA keyboard with only required keys on it so I can forget the bug.

So… now we need to make our paths more readily configurable, so that we can merge this into mainline. Yeah?

Goddamnit, I want an IOS version.

Yeah, more need to be planned out if we take the project seriously. It is more like a curious attempt. I had a day off yesterday so I sat and coded the thing. :stuck_out_tongue:

Perhaps DDA has relative bigger side menu so the display area is really tiny. There can be a way to configue the layout but I know it needs lots of work.

Check nethack for example: https://play.google.com/store/apps/details?id=com.nethackff&hl=en

Personally I don’t feel the experience is too good for the reason the screen is really tiny. I can barely read the menus.

Ok so everytime I click open it boots me back to the home screen what did I do wrong.

Probably you are missing the data folder. Copy Cataclysm-DDA folder to your sdcard.

It looks like:

/mnt/sdcard/Cataclysm-DDA

Ok i’ll try it

No its there what do I run it from the debug yhat comes with it.

No idea. Maybe the app used some device specific feature so it doesn’t always work.
By the way, do you install the apk correctly? But the chance is small since android usually doesn’t let you do that if your system doesn’t meet the requirement of the app.

Can you name the tools you used and describe compilation process?

At what stage is audio support, can it play sounds from the native part of the code?

Are you not going to do what I suggested and enable auto rotation and touch screen input for landscape view?

It is hard to start. You need to download and install android sdk/ndk from official site first, follow their instruction. It took me ages to do so before…After that you need only to run build.bat under android folder (from the github repo). The names of the files explain enough.

SDL 2.0 download (source) contains an empty android project. That is what I worked based on.

As for audio, I don’t know. If SDL_mixer can be ported to SDL 2.0, it is possible.

[quote=“utunnels, post:19, topic:1726”]It is hard to start. You need to download and install android sdk/ndk from official site first, follow their instruction. It took me ages to do so before…After that you need only to run build.bat under android folder (from the github repo). The names of the files explain enough.

SDL 2.0 download (source) contains an empty android project. That is what I worked based on.

As for audio, I don’t know. If SDL_mixer can be ported to SDL 2.0, it is possible.[/quote]

I see, some kind of official template, that’s convenient. It’s also the hardest part, initialising and setting it all up. So I searched for similar templates that include SLD_mixer initialisation and all the necessary files. Not official but this seems should do the job:

http://www.midnightfragfest.com/2012/05/04/sdl-2-0-android-project-template/

In “…/jni/SDL_android_main.cpp” there are hooks for native access to touch screen input, key up and key down events they are commented out. Is that what you said you have disabled or does it come like that in the template? Do you know what is supposed to be the purpose of those bindings when input can already be handled from native code via standard SDL_PollEvent?