Android and IOS ports

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
mammoth5000
Posts: 11
Joined: Sun Oct 07, 2012 3:56 pm

Post by mammoth5000 »

Interesting

what would be the correct flag for this?


./configure --enable_opengles ??
make


which file to I have to modify for the resolution?
Gillou68310
Posts: 14
Joined: Mon Oct 08, 2012 1:35 pm

Post by Gillou68310 »

I didn't update the configure script so the easiest way is to edit the config.mk inside the build_android folder and change the ndk and sdk path to fit yours, then "make".
The resolution can be changed in the run function in grim.cpp
mammoth5000
Posts: 11
Joined: Sun Oct 07, 2012 3:56 pm

Post by mammoth5000 »

Hmmmmm,, well I had a go at trying to compile but I had no luck.. probably because I'm not trying to build for Android I am interested in opengles code for the Pandora..

I am very interested in getting Myst III working on it.

Probably wait a while longer this bugs are fixed and hopefully your code might be added to the main residualvm code..
Gillou68310
Posts: 14
Joined: Mon Oct 08, 2012 1:35 pm

Post by Gillou68310 »

If you have already setup your environnement for pandora, just copy the following files to your folder:
-gfx_opengl.cpp
-gfx_opengl.h
-grim.cpp

Add the USE_GLES=1 and USE_OPENGL=1 flag to your config.mk
And don't forget to define USE_GLES and USE_OPENGL in config.h
hennymcc
Posts: 16
Joined: Sun Apr 01, 2012 10:23 pm

Post by hennymcc »

Hi,

Yes, residualvm already has a preliminary port for android. The port that I have worked on some time ago and that has already been mentioned here (github.com/tobigun/residualvm.git) is completely merged into residualvm.

Normally you do not have to use an additional virtual gamepad as a virtual gamepad is already built in (although not with visual buttons). The corners are used as arrow-keys (double tap to run). The center is used for actions (single tap: perform action, double tap: look at, long press: inventory).

For me and my Samsung Galaxy S plus it works really well with software rendering and the game is playable without noticeable stuttering.

There also already is a port for pelya's android sdl port (used for scummvm for example) that I started before I worked on the native residualvm port:
https://github.com/tobigun/commandergen ... residualvm

And there also is an OpenGLES 1.0 port of residualvm here:
https://github.com/tobigun/residualvm/tree/android_gles

The GLES port only works partly as not all features required by residualvm are provided by GLES 1.0 (as you already have noticed with your ports too).
The best way is to use GLES 2.0 instead.

Maybe the code in repositories will help you to finally get residualvm working in full speed on android devices.

I also wanted to work a bit more on the virtual gamepad for residualvm but did not have the time so far.
hennymcc
Posts: 16
Joined: Sun Apr 01, 2012 10:23 pm

Post by hennymcc »

Something I forgot to mention:
At least my OpenGLES 1.0 port (although not even providing all features needed for grim fandango) was much slower than the Software Rendering port. IIRC with OpenGLES 10 fps was the highest framerate I got. This is probably related to bad GLES 1.0 drivers for my SGS plus graphics card. GLES 2.0 should be much better.

BTW, pass "android-v7a" instead of just "android" to ./configure. This boosted the framerate from 15 fps to 30 fps for my Samsung SGS plus in software rendering mode. But note that the binary will only work with devices with an ARM CPU based on the ARM v7 (or above) architecture. Most nowadays smartphones should be based on such a CPU.

And an additonal note for the controls of the virtual gamepad build into the native residualvm android port:
A wipe gesture on the center area aborts the current sentence (like '.').
Gillou68310
Posts: 14
Joined: Mon Oct 08, 2012 1:35 pm

Post by Gillou68310 »

Dude I feel really stupid right now, I didn't know you've already began to port the opengl plugin to gles!! Why is your work not in the last repo?

I saw that there was already a built in virtual pad when setting the fullscreen option, but I found it difficult to use that's why I'm using the gamekeyboard app instead.

Thank you for the android-v7a trick I will check the performance difference on my phone.
hennymcc
Posts: 16
Joined: Sun Apr 01, 2012 10:23 pm

Post by hennymcc »

You don't have to feel stupid, how should you know that the branch exists. :)
It has not been merged into residualvm as the GLES 1.0 version was slower than software rendering and some features needed by residualvm like drawing to the z-buffer are probably not possible with GLES 1.0. And as a GLES 2.0 implementation will probably be totally different, the decision was to wait until someone does a 2.0 implementation.

If you want to do work on GLES 2.0 for residualvm that would be totally awesome I think. I do not think that someone is working on that atm. Somaen should know more about this.
Gillou68310
Posts: 14
Joined: Mon Oct 08, 2012 1:35 pm

Post by Gillou68310 »

hennymcc wrote:You don't have to feel stupid, how should you know that the branch exists. :)
It has not been merged into residualvm as the GLES 1.0 version was slower than software rendering and some features needed by residualvm like drawing to the z-buffer are probably not possible with GLES 1.0. And as a GLES 2.0 implementation will probably be totally different, the decision was to wait until someone does a 2.0 implementation.

If you want to do work on GLES 2.0 for residualvm that would be totally awesome I think. I do not think that someone is working on that atm. Somaen should know more about this.
Oh ok I understand now, I feel a little bit less stupid then! 8)

Unfortunately I have no experiences in GLES2.0 and I don't even have an idea of the work that it will need!
Gillou68310
Posts: 14
Joined: Mon Oct 08, 2012 1:35 pm

Post by Gillou68310 »

Thank you for the android-v7a trick I will check the performance difference on my phone.
Ok this makes the game running a lot smoother, I'm getting 40fps in average, but there's still some framerate drops in some place, for example I'm getting 15fps in the casino in year 2!

It seems that this is due to the number of 3D models drawn in the current scene. Just check the "drawModelFace" function occurence!!!

So I was wondering if we can somehow mix the software and opengl plugin to avoid the above issue!

I'll explain:

- Using GLES make the game running fullspeed as 3d models are rendered by the gpu, but background are not rendered correctly due to the depth issue.

- Using Software make the game running slower mainly because of the 3D models rendering which is really ressource hungry, but the background rendering is perfect.

What might be a good idea would be to render everything that is 2D (background, video, etc...) via software and everything that is 3D (models, etc...) via GLES.

I'll really apreciate the dev point of view on this.
trev186
Posts: 32
Joined: Mon Oct 11, 2010 4:41 pm

Post by trev186 »

Gillou68310 wrote:
Thank you for the android-v7a trick I will check the performance difference on my phone.
Ok this makes the game running a lot smoother, I'm getting 40fps in average, but there's still some framerate drops in some place, for example I'm getting 15fps in the casino in year 2!

It seems that this is due to the number of 3D models drawn in the current scene. Just check the "drawModelFace" function occurence!!!

So I was wondering if we can somehow mix the software and opengl plugin to avoid the above issue!

I'll explain:

- Using GLES make the game running fullspeed as 3d models are rendered by the gpu, but background are not rendered correctly due to the depth issue.

- Using Software make the game running slower mainly because of the 3D models rendering which is really ressource hungry, but the background rendering is perfect.

What might be a good idea would be to render everything that is 2D (background, video, etc...) via software and everything that is 3D (models, etc...) via GLES.

I'll really apreciate the dev point of view on this.
Do u have a link to the .apk that gets 40 FPS ?
Gillou68310
Posts: 14
Joined: Mon Oct 08, 2012 1:35 pm

Post by Gillou68310 »

Do u have a link to the .apk that gets 40 FPS ?
http://dl.dropbox.com/u/27654797/Residualvm_apk.zip
trev186
Posts: 32
Joined: Mon Oct 11, 2010 4:41 pm

Post by trev186 »

Gillou68310 wrote:
Do u have a link to the .apk that gets 40 FPS ?
http://dl.dropbox.com/u/27654797/Residualvm_apk.zip
Do I just put my games in the ResidualVm folder ?
Gillou68310
Posts: 14
Joined: Mon Oct 08, 2012 1:35 pm

Post by Gillou68310 »

You can put your data files wherever want, the residualvm folder is just used to store savegame.

For example I put my data files in sdcard/MyGames/grim.

See the following link for a complete list of data files:

http://wiki.residualvm.org/index.php/Datafiles

Don't forget to put the Grim Fandango 1.01 patch file inside your game folder!
trev186
Posts: 32
Joined: Mon Oct 11, 2010 4:41 pm

Post by trev186 »

Gillou68310 wrote:You can put your data files wherever want, the residualvm folder is just used to store savegame.

For example I put my data files in sdcard/MyGames/grim.

See the following link for a complete list of data files:

http://wiki.residualvm.org/index.php/Datafiles

Don't forget to put the Grim Fandango 1.01 patch file inside your game folder!
Whenever I open the app it shows a loading screen and the everything is just black
Post Reply