Testing ZGE speed on PC VS Android

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
User avatar
Ats
Posts: 933
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Testing ZGE speed on PC VS Android

Post by Ats »

Hello,
I'm preparing the release of the next version of Omeganaut, and I’ve run into another issue.

It’s been bothering me for a while, but I wasn’t sure at first: the game seems to run faster on the phone than on PC.
Everything in the code is tied to App.Time or App.DeltaTime, so it should run at the same speed regardless of the platform.

However, playing Omeganaut on the phone really feels faster. Since this might just be a tunnel-vision effect caused by the smaller screen, I was wondering if there’s a reliable way to compare the speed on PC vs. Android and determine whether the game is actually running at the same speed.

Maybe a simple brute force loop of some sort with a timer?
User avatar
VilleK
Site Admin
Posts: 2416
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: Testing ZGE speed on PC VS Android

Post by VilleK »

How about display the current FPS on screen to see if the PC and Android version is running at the same FPS?
User avatar
Ats
Posts: 933
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: Testing ZGE speed on PC VS Android

Post by Ats »

164 FPS on the computer
60 FPS on the phone

On the computer, I have time to look outside the screen, kill every enemy whenever I want, and navigate around obstacles.
On the phone, I can't finish the first level without losing 90% of my HP, as I'm constantly overwhelmed by enemies and having a near-death experience with every obstacle I encounter.

That makes no sense…
I don't know. It might really be due to the screen size.

So I ran the game in debug mode on both devices and spawned different enemies and obstacles at the exact same time.
The game is effectively running at the exact same speed on both. I think I'm good for the ophthalmologist :|
User avatar
Kjell
Posts: 1985
Joined: Sat Feb 23, 2008 11:15 pm

Re: Testing ZGE speed on PC VS Android

Post by Kjell »

Hi Ats,

Try limiting the PC build to 60fps ( and switching your monitor to 60Hz ) to see if there's still a difference in "difficulty". At 164fps input lag will probably be significantly lower than on your phone.

K
User avatar
Ats
Posts: 933
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: Testing ZGE speed on PC VS Android

Post by Ats »

It *maybe* is harder on PC at 60 FPS.

I have two possible causes that I'm going to look into:

First, I'm going to create a fake level that spawns the exact same objects at the exact same positions and verify whether the enemy/obstacle spawn rate is affected by the FPS.

Second, and I don't like this possibility, it might come from zgeBullet: lasers could pass through enemies without hitting them at lower fps...

Here's how I handle the zbtSetpSimulation.There are a bunch of comments I added during development… :?

Code: Select all

float t = App.DeltaTime;

// Fixed time step for each substep
//zbtStepSimulation(t, 0, 0); // don't work on low framerate

zbtStepSimulation(t, 2, t);

/*
// The follow up doesn't work on android
// Define a fixed time step for substeps (1/60th of a second)
float fixedTimeStep = 1.0 / 60.0;  // 60Hz

// Calculate the number of substeps needed
int maxSubSteps = (t / fixedTimeStep) + 1;

// Limit maxSubSteps to a reasonable number to avoid performance issues
if (maxSubSteps > 10) maxSubSteps = 10;

// Update the physics simulation
zbtStepSimulation(t, maxSubSteps, fixedTimeStep);
*/
I already tried a few things regarding zbtStepSimulation:
https://www.emix8.org/forum/viewtopic.p ... ion#p10900
User avatar
Ats
Posts: 933
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: Testing ZGE speed on PC VS Android

Post by Ats »

I recorded a full level with the exact same object spawned through its length.
It's the exact same game at 60 and 164 fps.

omeganaut_60_VS_164.gif
omeganaut_60_VS_164.gif (280.59 KiB) Viewed 2608 times

Now, to the zgeBullet framerate...
Post Reply