OpenGothic icon indicating copy to clipboard operation
OpenGothic copied to clipboard

Will it be possible to compile this for android?

Open AdamBilisic opened this issue 4 years ago • 17 comments

So the title is probably self explanatory, but if I understand correctly this re-implantation of the engine which then could mean that with some effort it could be compiled for android?

Thanks for the response!

AdamBilisic avatar Jun 15 '20 07:06 AdamBilisic

Hi, @AdamBilisic !

Right not only windows is fully supported and linux implemented(not tested), so compile and run game on android is not yet possible.

However, it's not too hard to port engine to another platform: it requires only rewriting of event loop and Vulkan-surface initialization.

Try avatar Jun 15 '20 18:06 Try

Hi @Try. Thanks for the response!

I thought it would be possible without too much effort and it seems so.

Maybe it would be good idea to contact team which is working on ReGoth for a long time and they could do this much quicker then implement their own stuff. What do you think ?

AdamBilisic avatar Jun 25 '20 08:06 AdamBilisic

Hm, you suggest to ask ReGoth team to port my engine to android... I don't think they are familiar with engine development, after all they use third party engine at this point, right?

Try avatar Jun 27 '20 21:06 Try

Do you think that experience with engine development would be crucial here? Imho this collaboration would be perfect, since they are developing for android for a long time, they have passion for Gothic and with some of your guidance it could work nicely. Also lets face it. Its much more time consuming to reprogram everything from scratch like they are doing then just reprogram engine on which the game is running on. And I think that over time they already realize that their approach will take years.

AdamBilisic avatar Jun 30 '20 11:06 AdamBilisic

Hi, i just wanted to say i also have great interest in an android port if possible. Maybe the android port of Morrowind could be an inspiration/code source? https://github.com/xyzz/openmw-android

dibade89 avatar Feb 19 '21 09:02 dibade89

Hi @Try could you point me to the direction what files/functionality exactly would need rewriting? I never developed anything android related but I have c++, c#, java, php and js background so maybe if i spend some time on it i will figure it out.

AdamBilisic avatar Mar 11 '21 06:03 AdamBilisic

Thanks for enthusiasm, @AdamBilisic :)

First things first (Android - specific):

There is no C++ applications on android, all android is capable of is java app + C++ library. So you have to create sort of 'java' app, which delegates everything to already existing C++ code.

I use to have android support in previous(opengl-based) version of my engine, you can use it for inspiration: https://github.com/enotio/Tempest/blob/master/android/src/com/tempest/engine/Tempest.java

Apart from that Android doesn't support opengl(and I assume Vulkan as well) graphics in main thread, so you basically have to start another thread right at the begging and then invoke a c++ main from it.

Now engine specific:

There is an OpenGothic\lib\Tempest\Engine\system\api catalog, if you need some extra android-code add it here. Again, for inspiration: https://github.com/enotio/Tempest/blob/master/Tempest/system/androidapi.cpp

Also there is a WSI (window system integration) in VkSurfaceKHR VDevice::createSurface(void* hwnd) - here you have to add an extra case for android. Should just work...

Build system

OpenGothic is cmake-based, afaik android studio has support for cmake out-of-the-box. Should 'just work', but will see.

Disclaimer: this is only to get engine to work, there must be a whole-lot performance and ui-related issues.

Try avatar Mar 11 '21 19:03 Try

I can confirm that it "works" mostly out-of-the-box.

Performance-wise I'm getting 5 FPS in Xardas Tower (mid range device) and vulkan dies with VK_ERROR_DEVICE_LOST on fences.

radwan92 avatar Jan 08 '22 01:01 radwan92

Hey, just wanted to say I made a Steam link configuration for all Gothic and Risen Games. With that it is possible to control Gothic with a touchscreen.

Here is a demo: https://youtu.be/zEkMRMM3X1A

If this topic will ever come further this could maybe serve as inspiration for the controls.

Here and there people show interest in such a port, here for instance: https://www.reddit.com/r/worldofgothic/comments/zg4755/is_piranha_bytes_thinking_of_developing_a/?utm_source=share&utm_medium=android_app&utm_name=androidcss&utm_term=1&utm_content=share_button

dibade89 avatar Dec 09 '22 18:12 dibade89

Any update on this?

Davilarek avatar Mar 16 '23 12:03 Davilarek

any update on this?

jurises99 avatar May 26 '23 18:05 jurises99

nope :)

no pull requests from other people, and on my end not much enthusiasm.

PS: android-Vulkan is reduced in functionality and even what remain is buggy, so development wont be fun :(

Try avatar May 26 '23 20:05 Try

Update: Apparently this is not necessary anymore. There is this new emulator https://winlator.com/ which let's Gothic and Gothic 2 run fine on modern phones. It is even possible to use mods with it (tested it myself)!

dibade89 avatar Sep 03 '23 07:09 dibade89

Emulation is no solution as OpenGothic is quite a bit different. Especially look wise. Claiming that stupid emulation is a solution just says one thing, you don't understand the aim of this project at all yet. AND... Winlator does not work that well at all if you don't have a Snapdragon CPU.

EDIT: And don't post some questionable claim to be official site please. This is the one and ONLY site. https://github.com/brunodev85/winlator

dreimer1986 avatar Sep 03 '23 11:09 dreimer1986

Also, winlator is closed source made by unknown company, which makes it suspicious to me.

Davilarek avatar Sep 03 '23 11:09 Davilarek

My understanding of this issue is there are people out there wanting to play Gothic 2 on their phone. Since nobody expects THQ Nordic to provide an official port, the hopes lie on this project. @Try made a statement above this issue won't be followed, so still no Android port in sight.

I just wanted to give the other commentors here who wanted such a port a working solution for their initial usecase. My assumption is they don't care that much if it is an OpenGothic or regular Gothic, the main point is it should work. If Winlator is shady, there are also alternatives like Box64 or exagear. Next year maybe also Project Cassia.

Edit: After reviewing the website i posted above it looks indeed a bit shady. There are screenshots put there which were initially posted on r/EmulationOnAndroid. There is also no direct link to the GitHub repository and some 4.9 star ratings coming out of nowhere. On the other hand it seems like a little too much effort to scam people looking at all the content on the page.

dibade89 avatar Sep 05 '23 09:09 dibade89