Android Faster Than CPU

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
Soule X
Red Slime
Posts: 84
Joined: Wed Sep 19, 2012 4:18 pm
Location: Indianapolis

Android Faster Than CPU

Post by Soule X »

I know this is a very open question, but what might cause the android version of OHR to run faster than a superior desktop? I have a desktop that runs everything with no problem but when I load my script on both the PC version has obvious problems handling the load whereas when I test it on Android it runs flawlessly. It seems like it should be the opposite, but I can't find the missing link. Is there any experiments with this kind of thing?
Last edited by Soule X on Sat Apr 15, 2017 2:38 am, edited 1 time in total.
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

What does your script do? I can't say much without knowing that.

You're using Windows? Does task manager (or other program) show that game.exe is using 100% cpu?
What framerate do you have the game set at? If you press Ctrl+~ to show the framerate, what does it actually run at?

If you're using a nightly build, you can enable script profiling in the F8 debug menu. That will tell you in which script the slowdown is.
User avatar
Soule X
Red Slime
Posts: 84
Joined: Wed Sep 19, 2012 4:18 pm
Location: Indianapolis

Post by Soule X »

I figured out exactly what was causing it, and now I feel really stupid. It was driving me crazy because it would do it really badly in the beginning, but after a while it would be basically normal again until I closed the game and restarted it.
In trying to solve the issue I was putting a lot of TRACE VALUE's. I went through and deleted them all and bam, runs perfectly now.
I guess maybe android has a lower limit of how much it can print to g-debug.txt?
TMC
Metal King Slime
Posts: 4101
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Ah, that makes sense. You probably have a Windows desktop. Windows is actually often a lot slower than Linux (recall that Android uses the Linux kernel) when it comes to file IO, both inherently, but especially if you have a virus scanner installed with "real time protection" enabled. These typically scan a file every time it is written, which is quite a disaster*.
Finally, your phone has flash storage, while your desktop might have a harddisk, although that shouldn't make a significant difference due to caching

*game.exe opens and closes g_debug.txt every time it writes to it, which probably makes the virus scanner problem much worse. I could do something about that.
User avatar
Soule X
Red Slime
Posts: 84
Joined: Wed Sep 19, 2012 4:18 pm
Location: Indianapolis

Post by Soule X »

I do have a virus scanner running so that makes sense.
At least now I know what causes it. Just glad it wasn't something in my script!
Post Reply