Jump to content
Sign in to follow this  
Guest afeder

Android port

Recommended Posts

well i am not in any way an Android Developer but i will read up on this thread and see what has been said and if i learn to code to Android i'll definitively give it a GO :D

Share this post


Link to post
Share on other sites

Hi everyone,

I thought I'd give the Android build a try once more. Unfortunately the code no longer builds for Android as a lot of rendering code has been added that is not supported by OpenGL-ES. I tried fixing a few errors, but gave up after a while - I don't have any experience with OpenGL. Would there be an effort to clean up the graphics code to make it OpenGL ES compliant?

Is anyone still interested in the Android port? I know that 0AD as such might be unplayable on a phone or a tablet. However if the engine supports Android, it might be an attractive proposition for others who might want to make a pure Android mod (Possibly a heavily scaled down version of the game). That would definitely result in much more interest in 0AD. It will not be possible for the team to spend time on an Android port, but would it be possible to simply maintain compatibility, or would that be too much effort? I'd like someone's thoughts on this.

Thanks

Edited by evanssthomas

Share this post


Link to post
Share on other sites

Most of the errors were about missing constants and functions which I assumed were due to OpenGL/OpenGL ES differences. For example:


../../../source/graphics/LOSTexture.cpp: In member function 'void CLOSTexture::InterpolateLOS()':
../../../source/graphics/LOSTexture.cpp:126: error: 'GL_FRAMEBUFFER_BINDING_EXT' was not declared in this scope
../../../source/graphics/LOSTexture.cpp:150: error: 'GL_VIEWPORT_BIT' was not declared in this scope
../../../source/graphics/LOSTexture.cpp:150: error: 'glPushAttrib' was not declared in this scope
../../../source/graphics/LOSTexture.cpp:153: error: 'GL_QUADS' was not declared in this scope
../../../source/graphics/LOSTexture.cpp:153: error: 'glBegin' was not declared in this scope
../../../source/graphics/LOSTexture.cpp:154: error: 'glColor4f' was not declared in this scope
../../../source/graphics/LOSTexture.cpp:155: error: 'glTexCoord2f' was not declared in this scope
../../../source/graphics/LOSTexture.cpp:155: error: 'glVertex2f' was not declared in this scope
../../../source/graphics/LOSTexture.cpp:159: error: 'glEnd' was not declared in this scope
../../../source/graphics/LOSTexture.cpp:161: error: 'glPopAttrib' was not declared in this scope

When I fix the above, I get other errors.

Share this post


Link to post
Share on other sites

I tried fixing a few errors, but gave up after a while - I don't have any experience with OpenGL. Would there be an effort to clean up the graphics code to make it OpenGL ES compliant?

I doubt there's any such effort, but since it's an experimental port anyway, the usual technique to make it compile has been wrapping the offending code with CONFIG2_GLES macros:


#if CONFIG2_GLES
#warning TODO: implement this for GLES
#else
...
//GL code that won't compile/run here
...
#endif // CONFIG2_GLES

and then hoping it works :D Granted nobody has worked on that since Philip, and that was last year. It's even more fun if you try compiling against GLES on Windows, I don't recommend trying that.

Is anyone still interested in the Android port?

Judging by the activity in this topic, it would appear nobody is both interested in the Android port and willing to spend time making it work. I certainly don't see why effort should be put into maintaining compatibility when nobody tests it anyway (according to Philip, there have been exactly 2 users who succesfully ran the game on Android, and at least one of them was him). I also don't know how wise it would be to try, if myconid is still interested in redesigning the renderer, much of the existing code would change - fixed function would go away, which is relevant.

I did try building for iOS and that required solving all the GLES build errors, so perhaps I'll dig up that patch and see if it still applies. I didn't do anything special though, just commented out a bunch of stuff as described above.

Share this post


Link to post
Share on other sites

I'm certainly not volunteering to do the work that might be needed to bring up a functioning Android port. But I am about to receive the following two devices from KickStarter backing and they both seem like winners.

http://www.kickstarter.com/projects/872297630/gamestick-the-most-portable-tv-games-console-ever

http://www.kickstarter.com/projects/ouya/ouya-a-new-kind-of-video-game-console

It could be a brave new world for console games and it would be great to have 0AD there. Lets remember Android really isn't just about mobile gaming anymore...

Share this post


Link to post
Share on other sites

Another note, the Gamestick people are offering free GameSticks and dev kits to anyone who has a game to port. So anyone willing to try to port 0ad could at least get some free hardware for the effort...

  • Like 1

Share this post


Link to post
Share on other sites

Another note, the Gamestick people are offering free GameSticks and dev kits to anyone who has a game to port. So anyone willing to try to port 0ad could at least get some free hardware for the effort...

Now that sounds like some incentive ;) I doubt they'd give one to just anybody, it would probably have to be one person associated with 0 A.D. who was trusted to actually produce something. That said, I think it's a much better deal for them than it would be for us.

Share this post


Link to post
Share on other sites

After much struggle, I got the game to run on my Galaxy S2. It was with code from Feb of last year, though. The game runs slowly and still gives some run time errors related to shaders. One of the other problems is the resolution - S2's resolution is 800x480. I'm going to try it on a Galaxy Note 2 (resolution 1280x720).

By the way, does libpyrogenesis_dbg.so have to be in /data/local? Can't it be run from some other location to which I can copy it to without needing root access?

post-9426-0-43897400-1359040778_thumb.jp

post-9426-0-73857800-1359040828_thumb.pn

Share this post


Link to post
Share on other sites

By the way, does libpyrogenesis_dbg.so have to be in /data/local? Can't it be run from some other location to which I can copy it to without needing root access?

I don't know, but you can make a symbolic link from /data/local to something you can edit I guess: http://www.freebsd.org/cgi/man.cgi?query=ln&apropos=0&sektion=0&manpath=FreeBSD+3.2-RELEASE&format=html

Share this post


Link to post
Share on other sites
I don't know, but you can make a symbolic link from /data/local to something you can edit I guess: http://www.freebsd.o...ASE&format=html

In any case I would need to write to /data/local and that requires root permissions.

The game is surprisingly playable on an S3. Long press instead of right click, pinch to zoom in & out. With some decent effort put it, it could definitely be playable enough for most people.

post-9426-0-88446800-1359090994_thumb.jp

post-9426-0-47324600-1359091054_thumb.jp

post-9426-0-37381300-1359091103_thumb.jp

  • Like 1

Share this post


Link to post
Share on other sites

Now that sounds like some incentive ;) I doubt they'd give one to just anybody, it would probably have to be one person associated with 0 A.D. who was trusted to actually produce something. That said, I think it's a much better deal for them than it would be for us.

I reread the deal more closely, and they are also giving 100% of the revenue for the firs 3 months on purchases if you enter the program, also which doesn't do us much good ;-). I figured this wouldn't get someone to jump in and start developing (the unit only costs $75-$100 anyway) just a nice incentive to someone already working on it. But they do want you to commit to a ship date so it may not be appropriate for us after all...

Share this post


Link to post
Share on other sites

The game is surprisingly playable on an S3. Long press instead of right click, pinch to zoom in & out. With some decent effort put it, it could definitely be playable enough for most people.

Heh, that's pretty cool, did you enable user feedback reporting for both of them? It might be nice to have data from these rarely used devices :)

Share this post


Link to post
Share on other sites

I wouldn't say it's as good as playing on a PC, but it's not as terrible as indicated by earlier posts in this thread. I'd say this is decent considering that the game's UI or controls are not optimized in any way for touch screen input. If there was some effort put in, it'll make it much more playable.

I didn't make a note of frame rates, but it's quite smooth on a release build. I disabled shadows because I was getting some errors related to shaders. I also didn't try out a water map so I'm not if sure water renders properly.

(The S3 is my friend's so I'll be able to test only when he comes over)

Share this post


Link to post
Share on other sites

After much struggle, I got the game to run on my Galaxy S2. It was with code from Feb of last year, though.

Could you provide a link to the code you used from Feb.?

I'd like to try and build the GLES version on a Chromebook running Ubuntu.

Thanks,

James.

Share this post


Link to post
Share on other sites

graphics/ShaderProgram.cpp

renderer/WaterManager.cpp

renderer/ShadowMap.cpp

renderer/SkyManager.cpp

renderer/TerrainRenderer.cpp

all contains undeclared GL variable of GL types in their scope

beacuse GLES dont support FBO

I followed the instructions http://trac.wildfire...iki/AndroidPort and i finally come to the install apk

but i can't install it since it's missing some certification stuff

,My phone is Sony Xperia J ST26i,which has a cortext-a5 Qualcomm MSM7227A processor

it works now time to modify .glsl files

Edited by dajayalol

Share this post


Link to post
Share on other sites

sorry i cant upload my apk and libpyrogenesis_dbg.so to the forum

so i zipped it

how to install 0ad for android by using my apk

1. besure that your drive is rooted

2.move and install 0ad.apk to your phone

3.download and move libpyrogenesis_dbg.so to /data/local of your phone

4.download public.zip of 0ad inside /binaries/data/mods/public/ ,then move to

/(your sdcard path )/0ad/data/mods/public

of your phone

5.extract shaders.zip to /(your sdcard path )/0ad/data/mods/public/shaders

6.done ,if your phone got small screen like mine (480 x 854 pixels, 4.0 inches (~245 ppi pixel density))

you got to modify /gui/gamesetup/gamesetup.xml

mine Build version is svn 13242

0ad for android.tar.7z

Edited by dajayalol

Share this post


Link to post
Share on other sites

OK, thread resurrected! My Ouya has just shipped, I should be getting it in the next week -> month lol. At that point I'm going to try and build this.

http://www.ouya.tv/

This may also be a good chance to upgrade to SDL2.0 which is still a WIP but their timeline seems to roughly jive with the amount of time the port will take. Anyone with some Android expertise / interest who wants to stay in the loop on this let me know. OF course I'll post here when I am successful. Defeat is not an option!

Share this post


Link to post
Share on other sites

This may also be a good chance to upgrade to SDL2.0 which is still a WIP but their timeline seems to roughly jive with the amount of time the port will take

We already have decent SDL 2.0 support, though I've only tested on Windows and OS X (briefly) so far. I have a patch for using SDL 2.0's color cursors, that fixes a conflict between SDL and our hardware cursor implementation on Windows, I will try to post that soon. Progress has been tracked somewhat on #935.

Share this post


Link to post
Share on other sites

We already have decent SDL 2.0 support, though I've only tested on Windows and OS X (briefly) so far. I have a patch for using SDL 2.0's color cursors, that fixes a conflict between SDL and our hardware cursor implementation on Windows, I will try to post that soon. Progress has been tracked somewhat on #935.

So the invisible cursor on Windows 7 issue I brought up has been resolved?

Share this post


Link to post
Share on other sites

We already have decent SDL 2.0 support, though I've only tested on Windows and OS X (briefly) so far. I have a patch for using SDL 2.0's color cursors, that fixes a conflict between SDL and our hardware cursor implementation on Windows, I will try to post that soon. Progress has been tracked somewhat on #935.

So by support you are saying that switching over to SDL 2.0 may not be that hard? In that case maybe I will look at it (if you don't mind) as part of the Android move. Who knows how many odd issues it may clear up...

Share this post


Link to post
Share on other sites

So the invisible cursor on Windows 7 issue I brought up has been resolved?

If you mean the issue with an SVN or release version of the game, it may be fixed indirectly by moving to SDL 2.0 on Windows. But I was actually referring to a bug specific to using official SDL instead of our emulation in Windows - which nobody does, so it shouldn't apply to you :)

So by support you are saying that switching over to SDL 2.0 may not be that hard? In that case maybe I will look at it (if you don't mind) as part of the Android move. Who knows how many odd issues it may clear up...

I mean you should be able to compile against SDL 2.0 right now with no problems, just set up premake to find the correct libraries :) Any bugs you find should be fixed, because eventually everyone will have SDL 2.0, but obviously we still support 1.2 in the meantime (there are a bunch of preprocessor macros in the engine to handle the different APIs).

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...