Ancurio / mkxp

Free Software implementation of the Ruby Game Scripting System (RGSS)
GNU General Public License v2.0
516 stars 133 forks source link

MKXP build for Android #56

Closed moocow1452 closed 9 years ago

moocow1452 commented 9 years ago

More of an issue tracker than anything else. I'll see if I can get a compile going, and report back on where I can get the code running and broken, and how I can otherwise put off actually getting things done. Anyone who cares to join me, get something running, or take credit for stuff already done can do so here.

pulsejet commented 9 years ago

How do you handle the overlay? Because the overlay also disappears when the screen goes black. This leads me to think about SDL.

Ancurio commented 9 years ago

Did you see the verbose log? There are a few libegl lines between two imgsrv errors. Can the problem have something to do with SDL?

Yes, there are libEGL lines because you turned on libEGL logging. All GL calls are simply being dumped to the log, but that's not very useful.

How do you handle the overlay? Because the overlay also disappears when the screen goes black. This leads me to think about SDL.

That is expected, as the overlay is just a textured quad drawn over the internal main offscreen buffer which is ultimately blitted to the screen. Since glDrawElements is discarded by the driver, the blit simply doesn't happen.

Ancurio commented 9 years ago

@radialapps You said this issue was occurring on a "MTK6589", but it seems that is only the name of the CPU. Could you write down a full description of the phone you're using?

pulsejet commented 9 years ago

It's an Intex Aqua HD. 1GB ram, 1.2 GHz mtk procesor armv7l, powervr sgx544mp, hotplug cpu, opengl 2.0, jellybean etc. Here is the full description but it is not very technical: http://m.gadgets.ndtv.com/intex-aqua-hd-1025

Tell me if you need anything else, I'll look it up in cpu-z.

pulsejet commented 9 years ago

@Ancurio, I think I am missing something here. Why is it that these problems are occurring only for mkxp and not for the other rpgxp simulators for android. I tried out a few and I got these: 1) Neko RPGXP player: Korean, looks like this one works off zh99998's openrgss. Works fine on ALL GPUs I tried, but has its set of bugs. Also windows api is partially implemented. 2) rmxp4droid: The first and oldest. Uses Jruby. Works very slow, but again works on all GPUs. Lacks lots of functionality. Chinese. 3) RMRunner: Works well, but slow and crashes in slightly big maps. I have tested on only two GPUs, but works as it should on both. Again Chinese. My guess is that it uses cocos2dx.

Mkxp performs tons better than any of these, except the winapi. But why (your opinion) is the GPU specific problem occurring only for mkxp?

EDIT: How about using cocos2d for mkxp too? They have already solved a majority of these problems. It will also give iOS hopes! It works on iOS, Android, Windows Phone, OS X, Windows and Linux.

Ancurio commented 9 years ago

@radialapps Every application is different; one might have a specific GL call pattern that triggers bugs in the graphics driver while another doesn't, and yet another might not care about performance at all and just use some sort of software rendering.

I have no idea how the internals of those other programs you listed look like because they are all closed-source. The fact that they all somehow play RPG Maker games is completely besides the point, you're still comparing Oranges to Apples, it's akin to asking "why does mkxp have these problems if Angry Birds and Temple Run play just fine".

Edit: Also FYI I asked for help here, it seems like the devs there are pretty responsive to questions.

pulsejet commented 9 years ago

Ok, carry on.

pulsejet commented 9 years ago

@Ancurio, just leave out PowerVR for now, it'd be much better if it ran well on adreno. My brother has a completely different Chinese GPU (I can't exactly remember the name). Can you give me instructions with some amount of detail about how to debug with a PC? I'll try to ask him to try it out.

pulsejet commented 9 years ago

@Ancurio, this is very interesting and weird. When I play TML, it works fine. So does Knight Blade. But now when I copy scripts.rxdata from TML to knight blade, maps are broken, scrolling hangs and it is also slower. Also, the effect is eerily similar to the video that @moocow1452 uploaded a while back on YouTube with his Moto G. This is surely a custom script issue.

Ancurio commented 9 years ago

@radialapps What exactly do you mean by debugging? If you're not familiar with OpenGL ES there is no point in it. I'll keep you updated on the PowerVR side.

Also exchanging Script.rxdata from different games is not a good idea and bound to cause troubles.

Closing this issue for now.

Xenovo commented 8 years ago

This looks interesting... Does it have any future?

Ancurio commented 8 years ago

@Xenovo If someone who owns a sample device of each common GPU generation of each mobile vendor comes around, willing to invest their time to debug and document every last driver bug and non-conforming behavior as it applies to mkxp's usage of GLES2, then it might have one.

I am in no position to make such a financial/time investment.

xperia64 commented 8 years ago

@Ancurio Could you share your Makefiles/build method for Android mkxp and the basic java project?

Ancurio commented 8 years ago

@xperia64 build.sh sources.def android project files

Of course, that's missing the NDK and the compiled dependencies. These are my notes I wrote down when compiling the dependencies.

xperia64 commented 8 years ago

So I got a standalone arm toolcahin setup, and while most of the libraries on your list above SDL compile fine, I'm having some issues with the SDL libs. SDL_image errors with "libpng12.so: incompatible target" and it can't find libjpeg.

This is the script I've been using for most of the libraries, appending the additionally arguments appropriately:

./configure --prefix=$HOME/Documents/android/armbuild --host=arm-linux-androideabi $@

But for SDL2 I had to use this (with the proper paths pointing to my standalone toolchain): https://gist.github.com/nddrylliog/4688209

To verify: did you use your dependency kit, or the other libs? I'm using stable for everything except pixman, SDL_*, openal-soft-android, and android-cmake. And I have libpng12 and 16, and jpeg-9a. It's almost tempting to just go through and write proper Android.mk files for everything.

moocow1452 commented 8 years ago

If you can do it right, and you have the time, go for it. I know that MKXP is rather specific about the versions of the dependencies it uses, specifically for SDL and all it's friends. Maybe this will point you in the right direction? http://wiki.libsdl.org/Android

On Mon, Aug 10, 2015 at 4:46 PM xperia64 notifications@github.com wrote:

So I got a standalone arm toolcahin setup, and while most of the libraries on your list above SDL compile fine, I'm having some issues with the SDL libs. SDL_image errors with "libpng12.so: incompatible target" and it can't find libjpeg.

This is the script I've been using for most of the libraries, appending the additionally arguments appropriately:

./configure --prefix=$HOME/Documents/android/armbuild --host=arm-linux-androideabi $@

But for SDL2 I had to use this (with the proper paths pointing to my standalone toolchain): https://gist.github.com/nddrylliog/4688209

To verify: did you use your dependency kit, or the other libs? I'm using stable for everything except pixman, SDL_*, openal-soft-android, and android-cmake. And I have libpng12 and 16, and jpeg-9a. It's almost tempting to just go through and write proper Android.mk files for everything.

— Reply to this email directly or view it on GitHub https://github.com/Ancurio/mkxp/issues/56#issuecomment-129601814.

xperia64 commented 8 years ago

I've dealt with SDL a lot in more traditional Android build environments using ndk-build, but the standalone toolchain is completely different.

Ancurio commented 8 years ago

@xperia64 It's been half a year since I last fiddled with this, so I don't really know what's wrong. You can check config.log to see what configure is doing that's going wrong.

xperia64 commented 8 years ago

Ah ok. I think I'll try to go the ndk-build route at some point.

moocow1452 commented 8 years ago

Quick note for anyone who wants to poke around, Android updated their play store apps to 100MB without expandable files for APKs, so that might be enough room for MKXP plus a built in game. Granted, doesn't solve the GPU issues, but still, nice to have that ironed out.

xperia64 commented 8 years ago

I'm starting my pure ndk-build attempt. Going OK so far with everything except ruby and mkxp itself compiled with ndk-build for armv7 only. I will have to modify pixman's Android.mk to support non-arm architectures.

Ancurio commented 8 years ago

@xperia64 Hi, this issue already has over 100 comments so I think it's best to leave it for now. Just open a new one titled "ndk-build attempt" or something, and we can discuss there. Thanks!