Light Style© by Fisana

Jump to content


Android port


  • Please log in to reply
271 replies to this topic

#121 Guest_afeder_*

Guest_afeder_*
  • Guests

Posted 15 February 2012 - 01:33 PM

Posted Image Posted Image

Kindly upload that setup somewhere!
  • 0

#122 Ykkrosh

Ykkrosh

    Primus Pilus

  • WFG Programming Team
  • 4,921 posts

Posted 15 February 2012 - 08:43 PM

I think I've committed the right code now. It's not at all elegant or robust, but seems to be enough to start testing and iterating.

Rough usage instructions:

"hg clone http://hg.libsdl.org/SDL" into build/android/sdl-project/jni/ (or clone elsewhere and symlink it there, or whatever). Until this bug is fixed, apply the patch from there.

In build/android/sdl-project/, run "make". That should compile SDL and the .apk file. (Dependency checking is probably broken, so run "make clean" if you need to rebuild after changing stuff.)

In build/android/, run "./setup-libs.sh". The script hardcodes the expected locations of NDK and SDK, so put them there or adjust the script, and it will output to ~/android/toolchain-0ad. That should download and compile loads of stuff.

Build the game like
./update-workspaces.sh --gles --android --without-fam --without-audio --disable-atlas --with-system-mozjs185 --with-system-enet --with-system-nvtt --without-nvtt
and
TOOLCHAIN=${HOME}/android/toolchain-0ad PKG_CONFIG_LIBDIR=${TOOLCHAIN}/sysroot/usr/local/lib/pkgconfig LDFLAGS="-lSDL2 -L=/usr/local/lib -L../../android/sdl-project/libs/armeabi" INCLUDES="--sysroot=${TOOLCHAIN}/sysroot -I${TOOLCHAIN}/arm-linux-androideabi/include/c++/4.4.3/arm-linux-androideabi/armv7-a/ -I../../android/files/SDL/include -isystem=/usr/local/include/boost-1_45" CXX=${TOOLCHAIN}/bin/arm-linux-androideabi-g++ make pyrogenesis -j3 config=debug

Then attach a device, and in build/android/sdl-project/ run "make push-apk" and "make push-so". Run /sdcard/0ad.apk on the device to install. Then you need to build a public.zip containing all the data files, kind of like what source/tools/dist/build.sh does, and preferably unzip+zip it so that it's compressed properly (to save bandwidth and space), and push to /sdcard/0ad/data/mods/public/public.zip, then run the app.

(The .apk is basically just the standard SDL android-project, and it loads /data/local/libpyrogenesis_dbg.so which contains all the engine code. That means you can recompile and then upload the engine code (via "make push-so") on the host PC, and don't have to manually reinstall the app after each change.)
  • 0
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#123 Ykkrosh

Ykkrosh

    Primus Pilus

  • WFG Programming Team
  • 4,921 posts

Posted 15 February 2012 - 10:56 PM

Found a better camera (and fixed text rendering and landscape mode etc):

Posted Image

(You can get to the match setup screen by touching buttons, but the GUI isn't designed for such a low screen resolution so you can't click the button to start the game, which wouldn't work anyway because it's missing shaders and doesn't have the Collada importer.)
  • 0
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#124 WhiteTreePaladin

WhiteTreePaladin

    Primus Pilus

  • WFG Retired
  • 1,663 posts

Posted 16 February 2012 - 12:11 AM

I don't even have an android tablet, but now I'm want one! :)
  • 0

Brian [aka WhiteTreePaladin]

0 A.D. Gameplay and UI Developer


#125 WhiteTreePaladin

WhiteTreePaladin

    Primus Pilus

  • WFG Retired
  • 1,663 posts

Posted 16 February 2012 - 12:15 AM

Hmm, we've lost the ability to edit posts on the mobile site. (Can't fix that typo...)
  • 0

Brian [aka WhiteTreePaladin]

0 A.D. Gameplay and UI Developer


#126 Sonarpulse

Sonarpulse

    Sesquiplicarius

  • Community Members
  • PipPip
  • 166 posts

Posted 16 February 2012 - 01:05 AM

Wow, that is the coolest image I have seen on the internet in a long time.
  • 0
Posted ImagePosted ImagePosted Image

#127 gameboy

gameboy

    Duplicarius

  • Community Members
  • PipPipPip
  • 316 posts

Posted 16 February 2012 - 12:46 PM

oh, this is really a miracle, this game was finally able to run on a mobile platform, it can really play on this phone? I really look forward to, I have a Samsung I9220 mobile phone with a resolution of 1280 * 800it should be able to completely run the game, ha ha!
BTW: If it really be able to play on a mobile platform.:banana: :victory: :drunk: :cheers: :D (y) :P
  • 0

#128 Thorfinn the Shallow Minded

Thorfinn the Shallow Minded

    Triplicarius

  • Community Members
  • PipPipPipPip
  • 486 posts

Posted 16 February 2012 - 12:55 PM

Would it be able to be converted to iOS?
  • 0
To win, we must endeavour to be the stronger of the two at the point of impact. Our only hope of this lies in making our own choice of operations, not in waiting passively for whatever the enemy chooses for us."—Schlieffen

#129 gameboy

gameboy

    Duplicarius

  • Community Members
  • PipPipPip
  • 316 posts

Posted 16 February 2012 - 01:53 PM

The game's default resolution should be set to choose from, for example: 640 * 480 800 * 600 1024 * 768 ....... Thank you!
  • 0

#130 Ykkrosh

Ykkrosh

    Primus Pilus

  • WFG Programming Team
  • 4,921 posts

Posted 16 February 2012 - 02:38 PM

Would it be able to be converted to iOS?

The technologies are pretty similar (C++, OpenGL ES, ARM, etc, with SDL doing most of the platform integration work) so it should be feasible if anyone cared to do it. Porting to Windows for ARM would probably be a bit more technically interesting - I guess you'd have to use ANGLE to translate GLES into DX9, but otherwise it still shouldn't be much different.

The biggest problem is that the current RTS gameplay design seems like an awful fit for phone-sized devices (since it requires presenting too much information to the player, and requires too much precision of input, and requires concentration for long periods), and not much good for tablet-sized devices either, so someone would have to solve that too :)

(To clarify my current interest in this: I don't care about making a proper playable game on Android, and I'm not intending to spend any time trying to achieve that. I'm just personally interested in learning about the technical aspects of the platform, and porting the game engine as a tech demo seems a better approach than spending the time on some throwaway toy project instead, since it encounters more interesting issues and produces a more impressive result, and it also indirectly helps the game on the proper desktop platforms (by cleaning up some of the rendering code (avoiding global GL state), and by adding GLSL support which will simplify new graphical features and may improve performance or driver compatibility, and by dealing with some portability problems, etc).)
  • 0
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#131 historic_bruno

historic_bruno

    Primus Pilus

  • WFG Programming Team
  • 2,465 posts

Posted 16 February 2012 - 09:32 PM

iOS support shouldn't be too hard, Apple has done a decent job of integrating the APIs for OS X and iOS (from what I've seen). Supposedly this will get even better, if we can create a bundle for OSX, it's feasible we can create an app for iOS, but I have serious doubts about whether it would qualify for the App Store. I would say focus on OS X and completing the game generally, then that will attract people with iPhones and iPads and whatever else, who can work on porting it. Although just having the basic Android demo is really exciting :)

The game's default resolution should be set to choose from, for example: 640 * 480 800 * 600 1024 * 768 ....... Thank you!

I agree, this would be a good feature not only for mobile devices but desktops as well. We should be able to detect supported resolutions and offer them as choices. It's easy to do that, but a functioning in-game options system needs to be designed first/concurrently.
  • 0
Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben [at] wildfiregames [dot] com

#132 Pedro Falcão

Pedro Falcão

    Centurio

  • Community Members
  • PipPipPipPipPip
  • 651 posts

Posted 17 February 2012 - 02:24 PM

Can these devices can even support the quantity of processing the game requires? How long can we play before the battery's done? I think that IF the programmers one day think about releasing 0 AD for mobiles, it should be a spin-off title proper to mobiles, much simpler and with a different gameplay, caring more for the device than the game itself, as you will probably like if the game is complex, but when you play it you'll be bored to have to recharge your device again just because you wanted to play while at the bathroom and feel really bored about the battle you lost because you weren't fast enough to touch-screen your army to defend your base.
  • 0
Pedro Falcão
Latin: Petrus Falco; Literally means 'Stone Hawk'.
English equivalent: ' Peter ';


Undergraduate Computer Scientist by UFCG
Shotokan Karate Adept, 3rd Kyu (Green Belt) & Muay Thai initiate

#133 historic_bruno

historic_bruno

    Primus Pilus

  • WFG Programming Team
  • 2,465 posts

Posted 18 February 2012 - 01:16 AM

This patch should help a bit, it adds pre-converted models and animations to the archive (public.zip) so you won't need the converter :)
  • 0
Ben Brian [ aka historic_bruno ]

Wildfire Games Programmer
Contact me: ben [at] wildfiregames [dot] com

#134 gameboy

gameboy

    Duplicarius

  • Community Members
  • PipPipPip
  • 316 posts

Posted 18 February 2012 - 11:43 AM

This game can play on Android? I think we should make this game run on the Android system, which is a great game, we need it to run on the Android system can run on the Samsung I9100 mobile phone has beena great progress, I think our development team should be efforts to make the game better able to run on the Android system, our team can not give up on the Android system support, thank you!:banger: :victory: :flex:
  • 0

#135 Almin

Almin

    Sesquiplicarius

  • Community Members
  • PipPip
  • 177 posts

Posted 18 February 2012 - 07:12 PM

Please, stay judicious. Focus on developing the game in the right direction. I didn't thought that it would be ported so fast and as it is (partly) done now I think it's cool to see, especially the stuff that Ykkrosh told, but it doesn't really improve the game. However, my respect for everyone included porting the game.

Edited by Almin, 18 February 2012 - 07:13 PM.

  • 0
sry for my english

#136 Sonarpulse

Sonarpulse

    Sesquiplicarius

  • Community Members
  • PipPip
  • 166 posts

Posted 18 February 2012 - 07:57 PM

To clarify my current interest in this: I don't care about making a proper playable game on Android, and I'm not intending to spend any time trying to achieve that. I'm just personally interested in learning about the technical aspects of the platform, and porting the game engine as a tech demo seems a better approach than spending the time on some throwaway toy project instead, since it encounters more interesting issues and produces a more impressive result, and it also indirectly helps the game on the proper desktop platforms (by cleaning up some of the rendering code (avoiding global GL state), and by adding GLSL support which will simplify new graphical features and may improve performance or driver compatibility, and by dealing with some portability problems, etc).


Read this again guys. The porting that is going on right now is NOT about making a playable spinoff game, or anything about that. it is about cleaning up the Code. These days, as standardization is better than before, porting doesn't necessitate having to separate code trees, or quick hacks. If one does it right, (which these guys are), it means one's code will "play by the rules" better than ever, be "properly modular" (all the somewhat unsystematic #ifdef's are just an intermediary step).

Then you guys might say, "well if the point is just cleaning up the code, isn't this an inefficient, roundabout way to that? Well if one could consistently visualize every issue that would arise porting a program, then one's code wouldn't need to be cleaned up in the first place.
  • 0
Posted ImagePosted ImagePosted Image

#137 gameboy

gameboy

    Duplicarius

  • Community Members
  • PipPipPip
  • 316 posts

Posted 19 February 2012 - 01:18 AM

Read this again guys. The porting that is going on right now is NOT about making a playable spinoff game, or anything about that. it is about cleaning up the Code. These days, as standardization is better than before, porting doesn't necessitate having to separate code trees, or quick hacks. If one does it right, (which these guys are), it means one's code will "play by the rules" better than ever, be "properly modular" (all the somewhat unsystematic #ifdef's are just an intermediary step).

Then you guys might say, "well if the point is just cleaning up the code, isn't this an inefficient, roundabout way to that? Well if one could consistently visualize every issue that would arise porting a program, then one's code wouldn't need to be cleaned up in the first place.




I agree with you, we should continue to develop it, our development team should work for it, our team can not give up the mobile platform, the lack of good games like this, we need this game to run on a mobile platform, please do notgive up, thank you! :flex: B)
BTW: the game should be the development of multiple platforms, thank you!:D

Edited by gameboy, 19 February 2012 - 01:22 AM.

  • 0

#138 Sonarpulse

Sonarpulse

    Sesquiplicarius

  • Community Members
  • PipPip
  • 166 posts

Posted 19 February 2012 - 01:24 AM

I know I much have a working port that is multiplayer compatible, even if the interface is painful. *looks at mobile Minecraft*
  • 0
Posted ImagePosted ImagePosted Image

#139 Ykkrosh

Ykkrosh

    Primus Pilus

  • WFG Programming Team
  • 4,921 posts

Posted 19 February 2012 - 01:32 AM

This patch should help a bit, it adds pre-converted models and animations to the archive (public.zip) so you won't need the converter :)

Thanks, it did :)

Posted Image
  • 0
Philip Taylor [aka Ykkrosh]

Wildfire Games Programmer
Contact me: philip@wildfiregames.com

#140 gameboy

gameboy

    Duplicarius

  • Community Members
  • PipPipPip
  • 316 posts

Posted 19 February 2012 - 01:35 AM

Nice Work, Team!:banana: :victory: :banana: :crazy: (y) :D :P
This is great, I saw, I want to know, the game lens can zoom, the camera can zoom in?:banana: :victory:
BTW: But our team, they will continue to develop down you, I mean: they will continue to develop the Android version? I'm looking forward to the mobile version of the game, Android is a good operating system, an ad should run in Android system, thank you!:banana:
BTW: If I compile a version of Android (How do I compile the Android version of the game, on the patch colladacache + archivebuild_fixes-02172012.patch), can run on the Samsung I9220 mobile phone or tablet this game.
: "Note: it skips over broken DAEs, these would the trigger errors if used in the game anyway, so there's no advantage. In archiving them
Is it true that the game does not read games archive? Or can not be archived game?

Edited by gameboy, 19 February 2012 - 02:06 AM.

  • 0