About Store Forum Documentation Contact



Post Reply 
Ineisis on Android - Steps to get working
Author Message
Ozmodian Offline
Member

Post: #1
Ineisis on Android - Steps to get working
Hi There,

So I have been trying to get the Ineisis game working on my Android Tablet (Nexus 7), and have found some steps required I have not seen clearly written anywhere else.

With Esenthel's help, i was able to get the client running on my Tablet and connected to my local server. Here are the steps:

1) Download the Ineisis source code. Follow all steps to get it working along with your Android SDK and NDK (again following the instructions on the website).

2) On the Client Main.es file, make the following changes
a) Change the config to const CONFIG Config=TEST_TO_SERVER;
b) add the following lines to InitPre
Paks.add("engine.pak");
Paks.add("Data.pak");
CurDir(SystemPath(SP_APP_DATA));
c) Remove the data path

// data
//if(Config==FINAL)Paks.add("data.pak", &ClientDataPakSecure);else DataPath("../../../Game/Data");

3) Under Constants.es set the const Str ServerIP= to the server IP
4) Open the Converter Tool and drag and drop the Game\Data folder into the tool.
5) Drag and Drop the resulting .PAK into the Client application in the code editor.
6) Set the Configuration to Android APK
7) Build and Enjoy!
(This post was last modified: 01-22-2013 01:56 AM by Ozmodian.)
01-19-2013 06:03 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Ineisis on Android - Steps to get working
Hi,

Yeah, there are more steps when building for Mobile devices, because originally I was developing the game only for desktops smile With Esenthel 2.0 I'm heavily improving workflow for game development (thanks to auto publishing and auto packaging most steps won't need to be taken in that version).

Now coming back to your next issue. I think it's because of writing permissions.
Temporary created data (like world, check "Game.es" file, "bool InitGame()", code "Game.World.NewTry") is created relative to current path EE::CurDir, which is by default path of the application, this works on desktop, but on Mobile you can't write to that path, you can only read from it.
On Mobile you can write only to SystemPath(SP_APP_DATA);
Please try doing this:

inside InitPre():

Code:
Str cur_dir=CurDir(); cur_dir.tailSlash(true);
   Paks.add(cur_dir+"engine.pak"); // access resources by full path
   Paks.add(cur_dir+"Data.pak"); // access resources by full path
   CurDir(SystemPath(SP_APP_DATA)); // change path to the place where we can write temporary data
01-20-2013 10:49 PM
Find all posts by this user Quote this message in a reply
Ozmodian Offline
Member

Post: #3
RE: Ineisis on Android - Steps to get working
Thanks for the info, that is good to know. I did what you said but now I get an error on start-up again.

Time(16:26:43), App(Esenthel): Can't load pak "/data/app\engine.pak"

I thought it might be the \ so i tried putting tailSlash to false and hardcoding the / but that did not work either.

Time(16:38:01), App(Esenthel): Can't load pak "/data/app/engine.pak"

here is my InitPre(). Thanks as always for your continued help.

Code:
void InitPre()
{
   if(GamePath)CurDir(GamePath);

   App.name("Ineisis Online");
   App.flag=APP_MINIMIZABLE|APP_MAXIMIZABLE|APP_RESIZABLE|APP_FULL_TOGGLE|APP_KB_EX​CLUSIVE|APP_WORK_IN_BACKGROUND|APP_NO_PAUSE_ON_WINDOW_MOVE_SIZE|APP_AUTO_FREE_OP​EN_GL_ES_DATA;
#ifdef DEBUG
   App.flag|=APP_MEM_LEAKS|APP_BREAKPOINT_ON_ERROR;
#endif
   App.x=0;
   App.y=0;
   D.screen_changed=ScreenChanged;
   D.shadow_step=ShadowStep;
   D.reset=Reset;
  
   // default settings
   D.mode(1024,768).sync(true);
   D.shadowSoft(1).shadowJitter(true);
   D.ambientMode(AMBIENT_LOW);
   D.motionMode(MOTION_HIGH);
   D.edgeSoftenMode(EDGE_SOFTEN_MLAA);



   // load settings
   ConfigLoad();

   D.viewRange(ViewRange);
  
   Str cur_dir=CurDir(); cur_dir.tailSlash(true);
   Paks.add(cur_dir+"engine.pak"); // access resources by full path
   Paks.add(cur_dir+"Data.pak"); // access resources by full path
   CurDir(SystemPath(SP_APP_DATA)); // change path to the place where we can write temporary data

   // data
   //if(Config==FINAL)Paks.add("data.pak", &ClientDataPakSecure);else DataPath("../../../Game/Data");
    //DataPath("../../../Game/Data");

}
01-21-2013 01:40 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Ineisis on Android - Steps to get working
Thanks, I forgot that on android, assets (engine and data paks) are accessed using just their names instead of full paths.

Please try this:
Paks.add("engine.pak");
Paks.add("Data.pak");
CurDir(SystemPath(SP_APP_DATA)); // change path to the place where we can write temporary data
the same thing as before except adding cur_dir to the pak paths
01-21-2013 01:01 PM
Find all posts by this user Quote this message in a reply
Ozmodian Offline
Member

Post: #5
RE: Ineisis on Android - Steps to get working
Bravo sir. Mission accomplished! I have updated the description with the necessary steps. Thanks for all your continued work on the engine and on support.
01-22-2013 01:57 AM
Find all posts by this user Quote this message in a reply
Post Reply