help on standalone game

A project to port LÖVE to Android handhelds
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: help on standalone game

Post by T-Bone »

If you want to do anything serious with it, you probably want to compile it yourself, if only to be able to tweak the Android Manifest to fit you game by for example forcing the orientation you want for your game (probably landscape).
utunnels
Citizen
Posts: 75
Joined: Fri Jan 06, 2012 5:20 pm

Re: help on standalone game

Post by utunnels »

Yeah, it seems the android port supports dynamic orientation change. Though I need to configure my phone to enable that.
And perhaps you also need to disable screen lock otherwise it turns black every few seconds if you don't touch a thing.
dudeabot
Prole
Posts: 17
Joined: Tue Nov 13, 2012 2:28 am

Re: help on standalone game

Post by dudeabot »

here are the configs i have been using for my games:

Code: Select all

		getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
		requestWindowFeature(Window.FEATURE_NO_TITLE);  
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,   
				WindowManager.LayoutParams.FLAG_FULLSCREEN);  
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
since i dont want screen rotation is fine for me.
User avatar
Petunien
Party member
Posts: 191
Joined: Fri Feb 03, 2012 8:02 pm
Location: South Tyrol (Italy)

Re: help on standalone game

Post by Petunien »

Here are the steps I've done:

1) Import love-native-android-master into Eclipse Juno.
2) Fix the "Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead."-error.
3) Inserted my game, modified LoveNative.java and AndroidManifest.xml.
4) Now, on building, I get only "Errors during build", no more information.

Did I forget something, what was wrong?
"Docendo discimus" - Lucius Annaeus Seneca
dudeabot
Prole
Posts: 17
Joined: Tue Nov 13, 2012 2:28 am

Re: help on standalone game

Post by dudeabot »

well i got a lot of errors trying to compile , but most of them is because eclipse was just being plain dumb..

first you might want to get ride of the ndk-builder(if you already have the native libs thats it, inside libs folder), right click on the project then go to the builders option, and remove ndk-build.

delete folders bin and gen - these are dynamically created, then choose Prokect->clean then, "refresh" the project [right->click refresh]

if the error still persists, close and open the project.

yuo might want check what android ndk version you have, i only had the newer so i changed local.properties file (root directory) to android=15. If you download full sdk you wont have any problems..

If there are still errors, check problems tab, and copy paste them here.

[]'s
Moe
Party member
Posts: 115
Joined: Thu Dec 22, 2011 10:20 pm

Re: help on standalone game

Post by Moe »

dudeabot wrote:meanwhile i found this hack that doenst require messing with NDK code, only java:

http://stackoverflow.com/questions/4447 ... -to-sdcard

the idea is to copy the .love game to assets folder then use that code to copy to sdcard and pass its location to JNI. the obvious fallback is that requires sdcard, also duplicates the game in memory..
Cool!
We had the same idea, but we did not like of doubling the love file. You can also copy it to the internal application memory. But this is more a hack than the way we want to go. Maybe we should skip the love file and put the data to a subfolder called love within the apk... I need to try this one.

The main problem is that PhysFS does not support recursive data like love within apk....
User avatar
hagish
Citizen
Posts: 85
Joined: Thu May 01, 2008 12:51 pm
Contact:

Re: help on standalone game

Post by hagish »

I found a way to start an apk bundled game without extra copies. Putting an extracted love file into the assets/ folder, a modified startup code and a small hack in the filesystem modul did the job (branch filesystem).
I only need to cleanup and extend love so that it is possible to set a root path within a love file. I'm planning to finnish this tomorrow.
dudeabot
Prole
Posts: 17
Joined: Tue Nov 13, 2012 2:28 am

Re: help on standalone game

Post by dudeabot »

cool i did some hacks on the file system, where PHYSfs coUld find the love file but the system would not kick in, i think i lacked some knowledge of love internals :P

gla y ou got it working!
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: help on standalone game

Post by T-Bone »

hagish wrote:I found a way to start an apk bundled game without extra copies. Putting an extracted love file into the assets/ folder, a modified startup code and a small hack in the filesystem modul did the job (branch filesystem).
I only need to cleanup and extend love so that it is possible to set a root path within a love file. I'm planning to finnish this tomorrow.
This is awesomesauce. If only I had some more time on my hands, I'd release a LÖVE game on Play just to show that it can be done :neko:
User avatar
hagish
Citizen
Posts: 85
Joined: Thu May 01, 2008 12:51 pm
Contact:

Re: help on standalone game

Post by hagish »

I'm still working on this. But the good solution turned out to be more complicated than expected ;)

I ended up adding a new archive to physfs (apk files that are chrooted into the assets/ folder) because all other solutions where incredibly ugly. Code is done but does not work %). So next step is debugging.
Locked

Who is online

Users browsing this forum: No registered users and 24 guests