Game Development Community

Torque 2D for Android Ready

by Michael Perry · in Torque 2D Beginner · 10/28/2013 (11:47 am) · 122 replies

Android port is ready for testing. If you pull latest from the development branch, you can start using it. I don't have the time to write a formal blog yet, so spread the word. Feel free to start posting bug reports based on your own Android testing.
Page «Previous 1 2 3 4 5 6 7 Last »
#1
10/28/2013 (1:00 pm)
Great news, Michael.

I did a clone of this branch originally for my project

git clone https://github.com/GarageGames/Torque2D.git torque2d

how I can pull the development branch ?

I did

git branch development
git checkout development

but it seems that are no changes in the files... I say this because I have a SVN repository in the same path, and SVN detects no changes as source files are concerned

#2
10/28/2013 (1:08 pm)
Have you tried something like this: git checkout origin/development
#3
10/28/2013 (1:45 pm)
That did it

When building with Visual Studio 2010, I get errors about missing files


m:\torque2d\engine\source\persistence\taml\taml.h(43): fatal error C1083: Cannot open include file: 'persistence/taml/tamlVisitor.h': No such file or directory

#4
10/28/2013 (1:46 pm)
Alternatively, if anyone prefers using a web based interface instead of Git commands, go here:

github.com/GarageGames/Torque2D/tree/development

And at the bottom of the right sidebar is a button "Download Zip". That will give you a local copy of the development branch to compile and test with.

Also, we have a guide for Android development. Any feedback on that too would be appreciated.
github.com/GarageGames/Torque2D/wiki/Android-Development-Guide
#5
10/28/2013 (1:47 pm)
Also, a suggestion, if you could rename the files, so that they don't have spaces in it , like

'engine/compilers/VisualStudio 2010/Torque 2D.vcxproj'

this may cause issues on Unix
#6
10/28/2013 (1:49 pm)
Quote:Also, a suggestion, if you could rename the files, so that they don't have spaces in it
Those are the only instances of spaces, but I agree that there should not be any.
#7
10/28/2013 (1:50 pm)
Quote:When building with Visual Studio 2010, I get errors about missing files

Not seeing this on my end. Have you performed a full clean and rebuild?
#8
10/28/2013 (1:56 pm)
ah, sorry for the confusion... let me explain my setup

originally I did a clone of the master. Since I want to modify the source for my own needs, I checked this version into a SVN repo.

Now I did a switch to git branch development but apparently these are new files that must be added to my SVN repo
#9
10/28/2013 (3:10 pm)
I added the new files to SVN, but after an update I still get these missing files

1>m:\torque2d\engine\source\math\mathtypes.cc(34): fatal error C1083: Cannot open include file: 'random_ScriptBinding.h': No such file or directory
1>m:\torque2d\engine\source\sim\simbase.cc(37): fatal error C1083: Cannot open include file: 'SimBase_ScriptBinding.h': No such file or directory
1>m:\torque2d\engine\source\graphics\dgl.cc(36): fatal error C1083: Cannot open include file: 'dglMac_Scriptbinding.h': No such file or directory

#10
10/28/2013 (3:25 pm)
fyi, these files are in the zip obtained in the #4 link above
#11
10/28/2013 (3:45 pm)
I tried running my game script in this new version, I get this error

Namespace:unlinkClass : reference count to parent is less than 0

This is a message box that shows up , Visual Studio does not show a code stack to the source file that triggered the assertion, only this part

void Platform::debugBreak()
{
DebugBreak();
}

this happens with the zip downloaded from the development branch
#12
10/28/2013 (5:05 pm)
the same happens with the default game at

M:\Torque2D-development\main.cs

I tried both running from within Visual Studio 2010, by adding this pathh to
the "Command arguments" entry

and by running the script from within Torsion

here's the stack of code execution

Torque2D_DEBUG.exe!SimObject::unlinkNamespaces()  Line 1293	C++
 	Torque2D_DEBUG.exe!SimObject::linkNamespaces()  Line 1236	C++
 	Torque2D_DEBUG.exe!SimObject::onAdd()  Line 889	C++
 	Torque2D_DEBUG.exe!SimObject::registerObject()  Line 111 + 0xf bytes	C++
 	Torque2D_DEBUG.exe!Sim::initRoot()  Line 327	C++
 	Torque2D_DEBUG.exe!Sim::init()  Line 412	C++
 	Torque2D_DEBUG.exe!initializeLibraries()  Line 117	C++
 	Torque2D_DEBUG.exe!DefaultGame::mainInitialize(int argc, const char * * argv)  Line 344 + 0x5 bytes	C++
 	Torque2D_DEBUG.exe!run(int argc, const char * * argv)  Line 1567 + 0x1c bytes	C++
 	Torque2D_DEBUG.exe!WinMain(HINSTANCE__ * hInstance, HINSTANCE__ * __formal, char * lpszCmdLine, HINSTANCE__ * __formal)  Line 1677 + 0x17 bytes	C++
#13
10/28/2013 (11:55 pm)
The namespace assert is a result of this fix:
github.com/GarageGames/Torque2D/pull/126/files

As far as I am aware, the assert fix is correct - it has simply uncovered a bug with the linking or unlinking of classes. Any help in supplying a fix to this new issue would be appreciated.

If you build in release mode instead of debug, then this assert does not show up.
#14
10/29/2013 (5:52 am)
I have fixed the unlink class bug this morning that was causing the assert. It is now commited if you want to pull down again.

Also if you want to stay up to date, I would recommend working out of git instead of svn, it will save you a lot of issues and time. you can create your own branch based on development, then update development and have git merge it into your branch. Then instead of having to merge it all yourself, you can only fix conflicts. Bitbucket offers free private repos for 4 users if you dont want to set up a git server yourself. Git is a pain to learn but can be very useful in someways over svn once you learn it.

My workflow is to change my local git repo to point to my private bitbucket while im working, then if I want to update to latest development code in the GG repo, I just set origin to the GG repo, pull down the changes, then reset origin back to bitbucket. Then from there i update my branch by merging in the development branch.


Here are some commands to help out if you want to try it
//create a branch based on development from GG repo
git checkout -b mybranch origin/development

//see where origin is pointing
git remote -v

//change origin
git remote set-url origin http://repolocation
#15
10/29/2013 (10:15 am)
Wow, finally we get to develop for Android, thanks to you all at GG.

I tried to run T2D on an actual Android phone (Galaxy y) it did not work, I get the following error:
[2013-10-29 14:00:20 - Torque2D] ------------------------------
[2013-10-29 14:00:20 - Torque2D] Android Launch!
[2013-10-29 14:00:20 - Torque2D] adb is running normally.
[2013-10-29 14:00:20 - Torque2D] Performing com.garagegames.torque2d.MyNativeActivity activity launch
[2013-10-29 14:00:24 - Torque2D] Uploading Torque2D.apk onto device '0123456789ABCDEF'
[2013-10-29 14:00:27 - Torque2D] Installing Torque2D.apk...
[2013-10-29 14:00:30 - Torque2D] Installation error: INSTALL_FAILED_CPU_ABI_INCOMPATIBLE
[2013-10-29 14:00:30 - Torque2D] Please check logcat output for more details.
[2013-10-29 14:00:30 - Torque2D] Launch canceled!

Maybe it's because the phone's system is android 2.3.5 and I couldn't figure out how to change the minimum deployment target, I don't know, maybe someone can shed a light on this, it's my first time to deal with Android.

Then I tried the emulator, also with no luck, the emulator launches but I don't see my app.

I followed the steps of the Android-Development-Guide in post #4 exactly.

[edit] during compile process there were over 48 warnings.
#16
10/29/2013 (10:30 am)
Tim did all the work. Thanks to him for all the coding effort. Now it's up to everyone in the community to test it.
#17
10/29/2013 (2:27 pm)
Android emulators are terrible and I do not think they work with NDK. Well they are terrible in general compared to the iOS simulator. As for your device issue, 2.3.5 is near the lowest version of android supported. API8 I think is bare minimum but API9 might be (I have 9 set in the manifest I believe) Your CPU is an older one is why you get the ABI error.

The project is setup for armeabi-v7a ABI only. you can change it in Application.mk file by removing the -v7a off the line that defines the ABI but the openalsoft and freetype libs will need to be recompiled for armeabi as well. I'll check and see if I included the source for openal soft (incase anyone wants to venture into MIPS or X86 later), I know I did for freetype. Ill compile armeabi version of the libs for you though when I get a chance and upload them. Using armeabi will add support for older devices like yours, I set it up for armeabi-v7a so it would be optimized for newer devices which most people will have now.
#18
10/30/2013 (6:55 am)
Thanks Tim for the effort.

I removed the -v7a, now the app works and loads the splash screen and that's it .. nothing happens despite the fact that my code just creates a sceneWindow and then it creates a scene and clears it then I create an image sprite like so:
function Game::create( %this )
{
	// Load scripts.
	exec("^game/scripts/guiProfiles.cs");
	exec("^game/scripts/scenewindow.cs");
	exec("^game/scripts/scene.cs");
	
	// create scene window
	createSceneWindow();
	// create scene
	createScene();
	mySceneWindow.setScene(myScene);
	setRandomSeed(getRealTime());
	
	myScene.clear();
	// enable mouse touch and mouse clicks
	mySceneWindow.setUseWindowInputEvents(true);
	mySceneWindow.setUseObjectInputEvents(true);
	
	%clone = new sprite();
	%clone.setImage("game:arrowBox");
	%clone.setSize(5,5);
	%clone.setPosition(0,0);
	myScene.add(%clone);
}
#19
10/30/2013 (6:56 am)
Here is the log from eclipse LogCat

10-30 15:25:25.414: D/dalvikvm(5353): GC_EXPLICIT freed 24K, 49% free 2768K/5379K, external 708K/1070K, paused 43ms
10-30 15:25:43.594: D/dalvikvm(5430): Trying to load lib /data/data/com.garagegames.torque2d/lib/libopenal.so 0x40516428
10-30 15:25:43.602: D/dalvikvm(5430): Added shared lib /data/data/com.garagegames.torque2d/lib/libopenal.so 0x40516428
10-30 15:25:43.602: I/ApplicationPackageManager(5430): cscCountry is not German : 
10-30 15:25:43.766: W/dalvikvm(5430): dvmFindClassByName rejecting 'com/garagegames/torque2d/FontManager'
10-30 15:25:44.305: D/libEGL(5430): loaded /system/lib/egl/libGLES_hgl.so
10-30 15:25:44.344: D/BRCM_EGL(5430): eglCreateWindowSurface() surface: 0x1c5a38, VC surface: 1, Thread: 5449
10-30 15:25:44.344: D/BRCM_EGL(5430): eglCreateContext() context: 0x1d1300, VC context 1, Thread 5449
10-30 15:25:44.344: D/BRCM_EGL(5430): eglMakeCurrent(0x1d1300, 0x1c5a38, 0x1c5a38) Thread: 5449
10-30 15:25:44.352: W/dalvikvm(5430): dvmFindClassByName rejecting 'com/garagegames/torque2d/SplashScreen'
10-30 15:25:44.485: D/dalvikvm(5430): GC_EXTERNAL_ALLOC freed 182K, 49% free 2762K/5379K, external 408K/517K, paused 121ms
10-30 15:25:44.555: I/Torque2D(5430): [2013/10/30 15:25:44] Input Init:
#20
10/30/2013 (6:58 am)
10-30 15:25:44.571: I/Torque2D(5430): [2013/10/30 15:25:44] []Input::enable.
10-30 15:25:44.571: I/Torque2D(5430): [2013/10/30 15:25:44] 
10-30 15:25:44.578: I/Torque2D(5430): [2013/10/30 15:25:44] Video Init:
10-30 15:25:44.578: I/Torque2D(5430): [2013/10/30 15:25:44] --------------------------------------------------------------------------------
10-30 15:25:44.578: I/Torque2D(5430): [2013/10/30 15:25:44] Video initialization:
10-30 15:25:44.578: I/Torque2D(5430): [2013/10/30 15:25:44]    Accelerated OpenGL display device detected.
10-30 15:25:44.578: I/Torque2D(5430): [2013/10/30 15:25:44] 
10-30 15:25:44.578: W/dalvikvm(5430): dvmFindClassByName rejecting 'com/garagegames/torque2d/FileWalker'
10-30 15:25:44.899: I/torque2d(5430): time in java: 316.0
10-30 15:25:44.899: I/Torque2D(5430): [2013/10/30 15:25:44] Console trace is off.
10-30 15:25:44.907: I/torque2d(5430): time in dir java: 2.0
10-30 15:25:44.922: I/Torque2D(5430): [2013/10/30 15:25:44] Default BPP Chosen , $pref::Android::ScreenDepth was not found.
10-30 15:25:44.922: I/Torque2D(5430): [2013/10/30 15:25:44] Activating the OpenGL display device...
10-30 15:25:44.922: I/Torque2D(5430): [2013/10/30 15:25:44]  OpenGLDevice activating...
10-30 15:25:44.922: I/Torque2D(5430): [2013/10/30 15:25:44] OpenGL driver information:
10-30 15:25:44.922: I/Torque2D(5430): [2013/10/30 15:25:44]   Vendor: Broadcom
10-30 15:25:44.922: I/Torque2D(5430): [2013/10/30 15:25:44]   Renderer: VideoCore IV HW
10-30 15:25:44.922: I/Torque2D(5430): [2013/10/30 15:25:44]   Version: OpenGL ES-CM 1.1
10-30 15:25:44.922: I/Torque2D(5430): [2013/10/30 15:25:44] OpenGL Init: Enabled Extensions
10-30 15:25:44.922: I/Torque2D(5430): [2013/10/30 15:25:44]   Vertical Sync
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44]   ATI_FSAA
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44] OpenGL Init: Disabled Extensions
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44]   ARB_multitexture
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44]   EXT_blend_color
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44]   EXT_blend_minmax
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44]   EXT_paletted_texture
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44]   EXT_compiled_vertex_array
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44]   NV_vertex_array_range
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44]   EXT_texture_env_combine
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44]   EXT_packed_pixels
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44]   EXT_fog_coord
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44]   ARB_texture_compression
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44]   EXT_texture_compression_s3tc
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44]   3DFX_texture_compression_FXT1
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44]   (ARB|EXT)_texture_env_add
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44]   EXT_texture_filter_anisotropic
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44] 
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44]  set screen mode 320 x 240 x 32, fullscreen, force it, dont repaint
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44] Cleaning up the display device...
10-30 15:25:44.930: I/Torque2D(5430): [2013/10/30 15:25:44] >> Attempting to change display settings to fullscreen 320x240x32...
10-30 15:25:44.938: I/Torque2D(5430): [2013/10/30 15:25:44] Resurrecting the texture manager...
10-30 15:25:44.938: I/Torque2D(5430): [2013/10/30 15:25:44] Max Texture Size reported as: 2048
10-30 15:25:44.938: I/Torque2D(5430): [2013/10/30 15:25:44]  set screen mode 320 x 240 x 32, windowed, dont force it, repaint
10-30 15:25:44.938: I/Torque2D(5430): [2013/10/30 15:25:44] Cleaning up the display device...
10-30 15:25:44.938: I/Torque2D(5430): [2013/10/30 15:25:44] >> Attempting to change display settings to windowed 320x240x32...
10-30 15:25:44.938: I/Torque2D(5430): [2013/10/30 15:25:44] Resurrecting the texture manager...
Page «Previous 1 2 3 4 5 6 7 Last »