Detect device

Get help using Construct 2

Post » Fri Nov 16, 2012 8:18 am

HI

Can I somehow detect device in order to set other value for actions
MMy probllem is that on a HTC desire this works fine with the impulse value

( Apply Physics impulse 30 toward (Touc.,X, Touch.Y )

BUT on a ipad it run exstrem fast

So is there a way to avoid that

Cheers
flemmig

B
23
S
12
G
10
Posts: 323
Reputation: 7,382

Post » Fri Nov 16, 2012 12:44 pm

You can check the fps rate ... in the expression bar as fps !
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Fri Nov 16, 2012 1:04 pm

Thanks ..

Yes I know .. but thats not what I m looking for

Its a way to set different values in the action
since there is a huge difference in processors



this is nice on a HTC desire
( Apply Physics impulse 30 toward (Touc.,X, Touch.Y )


this is nice on a ipad2
( Apply Physics impulse 8 toward (Touc.,X, Touch.Y )

Regards
B
23
S
12
G
10
Posts: 323
Reputation: 7,382

Post » Fri Nov 16, 2012 4:30 pm

hmm. This is an extremly important question for me as well.. well will be.

The CPU cycles are less important that the effect of deterministic physics. If C2 uses deterministic physics then the CPU should make no difference. Unfortunatly Box2d is not natively built as deterministic.

The current solution is to run the physics step independently of the main gameloop and instead run the step based on timestamps. However, it seems to me that in C2 there isn't a way to turn on or off the physics(I could be wrong I haven't delved into c2 physics that much).

In the mean time you might have to do Whiteclaws suggestion. Get the difference in FPS. Determine a base value for impulse. Then figure the percentage of change based on the FPS difference. I suspect the physics simulation won't be the same. There is consideration for friction, density and mass for the fixture where impulse has different effects :|
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Fri Nov 16, 2012 6:23 pm

@jayderyu THANKS

Yes I guess that I have to sone how figure out some FPS difference
Could you please help me with an sample, rather new to C2

R/flemmig



B
23
S
12
G
10
Posts: 323
Reputation: 7,382

Post » Fri Nov 16, 2012 7:30 pm

The solution is really easy ... I'll give you an example ... imagine that you get 30 fps on the HTC Desire and 40 on Ipad 2

System | Compare two values : fps = 30
Apply Physics impulse 30 toward (Touch.X , Touch.Y )

System | Compare two values : fps = 40
Apply Physics impulse 8 toward (Touch.X , Touch.Y )

No need for an Mathematical Physics Conundrum !

Cheers !

Edit : If you need a .capx , just reply "@Whiteclaws"Whiteclaws2012-11-16 19:32:52
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Fri Nov 16, 2012 10:48 pm

Just great ....

works fine :-)

THANKS !!
B
23
S
12
G
10
Posts: 323
Reputation: 7,382

Post » Sat Nov 17, 2012 1:29 am

No problem , You know who to ask when you have a problem :D
Edit : @Jayderyu , Here is the answer for your important question ...Whiteclaws2012-11-17 01:31:26
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Sun Dec 09, 2012 11:23 am

Hi again

I have some issues ..is there some ease parameters so the sprite dosnt rotate so wild .. maybe so easeing in rotate

Ive posted a simple capx here:

https://dl.dropbox.com/u/22406377/HappyFrog_v01.capx

Regards
Flemming




B
23
S
12
G
10
Posts: 323
Reputation: 7,382

Post » Tue Dec 11, 2012 3:17 am

@flemming - one of the physics options in an event is called 'Stepping Mode'. It is by default on 'Fixed' which will give you the exact same movements every time, but is not framerate independent. However if you switch it to 'Framerate Independent' it will work at the same speed regardless of framerate. It will then, however, give slightly different results (which can be a good or a bad thing depending on the type of game).

So if your game isn't counting on having exactly predictable physics results, just switch the stepping mode and that should fix your problems.
B
27
S
8
G
5
Posts: 429
Reputation: 6,902

Next

Return to How do I....?

Who is online

Users browsing this forum: YoHoho and 18 guests