Game Development Community

Taking too long to compile on iPhone 3G iOS 4

by Scott Wilson-Billing · in iTorque 2D · 09/10/2010 (9:15 pm) · 8 replies

Guys, needs some help here please...

- Getting this message when I try and run IWT on the iPhone 3G:

Application Specific Information:
com.meyume failed to launch in time 
elapsed total CPU time (seconds): 21.750 (user 9.000, system 12.750), 96% CPU 
elapsed application CPU time (seconds): 16.960, 75% CPU

Thread 0:
0   iWT                           	0x002cf554 dyld_stub_strcmp + 4
1   iWT                           	0x00181070 Compiler::CompilerStringTable::add(char const*, bool, bool) (compiler.cc:132)
2   iWT                           	0x00175f28 VarNode::precompile(TypeReq) (astNodes.cc:788)
3   iWT                           	0x00176688 FuncCallExprNode::precompile(TypeReq) (astNodes.cc:1314)
4   iWT                           	0x00175d24 SlotAssignNode::precompile(TypeReq) (astNodes.cc:1511)
5   iWT                           	0x0017411c Compiler::precompileBlock(StmtNode*, unsigned int) (astNodes.cc:44)
6   iWT                           	0x001768e8 FunctionDeclStmtNode::precompileStmt(unsigned int) (astNodes.cc:1775)
7   iWT                           	0x0017411c Compiler::precompileBlock(StmtNode*, unsigned int) (astNodes.cc:44)
8   iWT                           	0x0017af0c CodeBlock::compileExec(char const*, char const*, bool, int) (codeBlock.cc:726)
9   iWT                           	0x00185c98 cexec(SimObject*, int, char const**) (consoleFunctions.cc:1421)
10  iWT                           	0x0017faa8 CodeBlock::exec(unsigned int, char const*, Namespace*, unsigned int, char const**, bool, char const*, int) (compiledEval.cc:4851)
11  iWT                           	0x0017f480 CodeBlock::exec(unsigned int, char const*, Namespace*, unsigned int, char const**, bool, char const*, int) (compiledEval.cc:4758)
12  iWT                           	0x0017f480 CodeBlock::exec(unsigned int, char const*, Namespace*, unsigned int, char const**, bool, char const*, int) (compiledEval.cc:4758)
13  iWT                           	0x0017b010 CodeBlock::compileExec(char const*, char const*, bool, int) (codeBlock.cc:754)
14  iWT                           	0x0018322c Con::evaluate(char const*, bool, char const*) (console.cc:2008)
15  iWT                           	0x00049bb4 runEntryScript(int, char const**) (main.cc:382)
16  iWT                           	0x00049e1c initGame(int, char const**) (main.cc:419)
17  iWT                           	0x00049ff0 DemoGame::mainInit(int, char const**) (main.cc:469)
18  iWT                           	0x001b3ba0 _iPhoneRunTorqueMain(objc_object*, UIView*, UIApplication*) (iPhoneMain.mm:31)
19  iWT                           	0x001bd204 -[TGBAppDelegate applicationDidFinishLaunching:] (TGBAppDelegate.mm:54)
20  UIKit                         	0x0001314c -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1192
21  UIKit                         	0x001c16cc -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 292
22  UIKit                         	0x0007c7b8 -[UIApplication handleEvent:withNewEvent:] + 1784
23  UIKit                         	0x0007beb4 -[UIApplication sendEvent:] + 60
24  UIKit                         	0x0007b7e8 _UIApplicationHandleEvent + 6704
25  GraphicsServices              	0x00004edc PurpleEventCallback + 1024
26  CoreFoundation                	0x000742ac __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 22
27  CoreFoundation                	0x000761d6 __CFRunLoopDoSource1 + 158
28  CoreFoundation                	0x0007718e __CFRunLoopRun + 574
29  CoreFoundation                	0x0001e0bc CFRunLoopRunSpecific + 220
30  CoreFoundation                	0x0001dfca CFRunLoopRunInMode + 54
31  UIKit                         	0x00007b18 -[UIApplication _run] + 524
32  UIKit                         	0x00005fb8 UIApplicationMain + 964
33  iWT                           	0x001b38f8 main (iPhoneMain.mm:215)
34  iWT                           	0x000372b4 start + 44

Problem is that the engine is taking far too long to start and is a result of having to compile the .cs files into DSO, I think.

What can I do to tell iOS that the game hasn't stalled and then carry on compiling this stuff whilst splash loads etc?

It works fine on all other devices, including 1st gen touch, just 3G which is so crap.

Thanks

#1
09/10/2010 (9:21 pm)
Not sure if I read your post correctly. It is trying to compile script files...while running on the device? Or are you thinking DSO files take longer to execute than a .cs file?

#2
09/10/2010 (9:21 pm)
Also, at what point in the loading of a Torque game does it hand back control to the device? Is it when we exit applicationDidFinishLaunching ?

If this is the case then it seems that every cs script it can find is pre-compiled?

Can I defer compilation for certain directories?
#3
09/10/2010 (9:23 pm)
Michael, it is compiling script files on the device - I think, looking at the stack trace. I should add this is iTGB 1.3.1.
#4
09/10/2010 (9:24 pm)
What happens when there are no .cs files in the resources? Just DSOs. I'm wondering if this is an execution problem, not a compilation one.
#5
09/10/2010 (9:25 pm)
I should also add that I don't pre-build the DSO files prior to installing on the device - I always clean and let the cs files get compiled on the device. I got a feeling that this happens every time the game is run because if I run in xCode it does load, but exit xCode and it wont load, so I am assuming that the compiled DSOs are not kept?
#6
09/10/2010 (9:27 pm)
Michael, I don't have any DSOs - I have a separate build for the game which does not have the DSOs compiled by the editor - I just let the device compile them - it seemed to solve all those problems around PUAP_SCRIPT_OPTIMIZE etc.
#7
10/23/2010 (9:03 pm)
Scott, Have you resolved the problem?
#8
10/23/2010 (9:25 pm)
Edoardo, resolved using the code I posted in answer to a problem that Rennie was having ...

www.torquepowered.com/community/forums/viewthread/121007/