[suggestion] option to let dt get larger than 0.1

Discussion and feedback on Construct 2

Post » Fri Sep 14, 2012 2:29 am

Hey

As the title says, would be good if there was an option in project properties that you could allow C2 to let dt get larger than 0.1 (below 10FPS)

This is important to games that you don't want to ppl cheat by lowering their overall FPS and make the game run slow for a specific purpose, in my case my game have player turns, so let's say the turn have 30 seconds and someone with a very low fps like 5 is playing, their turn will have more than 30 seconds, would be unfair.

Again, my suggestion is only to add the option, if the developer want to activate it then he may have the choice.
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Fri Sep 14, 2012 2:49 am

30 seconds is 30 seconds, how lowering FPS would impact on that ?
Instead your player would just have less effective time (frames) to perform its actions.

That's the interest of dt, to make up for the difference of FPS between computers.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Fri Sep 14, 2012 3:05 am

[QUOTE=Kyatric] 30 seconds is 30 seconds, how lowering FPS would impact on that ?
Instead your player would just have less effective time (frames) to perform its actions.

That's the interest of dt, to make up for the difference of FPS between computers.
[/QUOTE]

http://www.scirra.com/tutorials/67/delta-time-and-framerate-independence/page-1


read the part of 'Minimum framerate' ;)

you can also test for yourself, if you have a mobile that isn't powerful enough you can preview your game on the mobile and if it runs below 10fps then the time will take longer to complete a 'real' 30 seconds.
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Fri Sep 14, 2012 12:38 pm

[QUOTE=Guif0DA] [QUOTE=Kyatric] 30 seconds is 30 seconds, how lowering FPS would impact on that ?
Instead your player would just have less effective time (frames) to perform its actions.

That's the interest of dt, to make up for the difference of FPS between computers.
[/QUOTE]

http://www.scirra.com/tutorials/67/delta-time-and-framerate-independence/page-1


read the part of 'Minimum framerate' ;)

you can also test for yourself, if you have a mobile that isn't powerful enough you can preview your game on the mobile and if it runs below 10fps then the time will take longer to complete a 'real' 30 seconds.[/QUOTE]
Wow, you are absolutely correct!
We do in fact need a way to unlock dt so it can be bigger than 0.1!
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

Post » Fri Sep 14, 2012 1:47 pm

I don't have a mobile to test this.
But wouldn't the use of the condition "every X seconds" still work in that case ?
If you want your turn to be 30 seconds long, use a "Every 30 seconds" event.

At worst try "Every 1 second" to add 1 to a global variable. When its value is equal 30, you have your 30 seconds. (or whatever time you want/need)
Once again I can't test this by myself to see if a "bloated" mobile acts as I would expect or as you described.

You could also use your own manual dt, testing the FPS value each tick, and "creating" your own dt variable to add to the timer.
There are some workarounds possible I hope.

@Ashley, your thoughts ?
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,791

Post » Fri Sep 14, 2012 4:31 pm

[QUOTE=Kyatric] I don't have a mobile to test this.
But wouldn't the use of the condition "every X seconds" still work in that case ?
If you want your turn to be 30 seconds long, use a "Every 30 seconds" event.

At worst try "Every 1 second" to add 1 to a global variable. When its value is equal 30, you have your 30 seconds. (or whatever time you want/need)
Once again I can't test this by myself to see if a "bloated" mobile acts as I would expect or as you described.

You could also use your own manual dt, testing the FPS value each tick, and "creating" your own dt variable to add to the timer.
There are some workarounds possible I hope.

@Ashley, your thoughts ?
[/QUOTE]
Nope it wont work because the game will run in 'slow motion' below 10FPS, so if you use an action like every 10 seconds, it will trigger after more than 10 seconds because the dt can't get bigger than 0.1(10FPS)

Please take a look at the link I sent above that explains the minimum framerate and you will understand ;)

You also suggested to use every 1 second to add 1 value to a global variable. Also that won't work because it wont trigger at 1 second the action, because the game is running in slowmotion the action will trigger after more than 1 second and then the global variable wont increase every second.

Hope you understand ;)
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Fri Sep 14, 2012 4:56 pm

Games with values of dt above 0.1 tend to become unstable. Everything is stepping so far often collisions are missed and the player can effectively teleport around.

So how does it help prevent cheating to allow this? It seems like it will make cheating worse. Set your FPS to 1 while running towards a wall and you can teleport through it. However with the current design, you would probably still bump in to it.

A better way to handle this would be to require a minimum FPS of 15 or something, and don't allow scores to be registered for them. Or keep separate scoreboards for slow devices and fast devices based on average FPS - you don't want to annoy or blame users who just legitimately have very slow systems.
Scirra Founder
B
359
S
214
G
72
Posts: 22,948
Reputation: 178,532

Post » Fri Sep 14, 2012 5:11 pm

Hmm.. you gave a good idea, check if the player runs above 10FPS, if not, the game is closed, or something like that.
might try that.

Still, I think it is a nice idea to add the option, so it's the developer choice if he want to allow DT to become higher than 0.1 or not. For games that doesn't involve movements and are time-based with static sprites that would be very welcome.

I don't know if it would be hard to you to add that option, if it's an easy thing to implement, then why not?

thanks ;)
B
30
S
6
G
5
Posts: 433
Reputation: 6,061

Post » Fri Sep 14, 2012 5:23 pm

You can use the wallclocktime expression to measure the time passed. It's unaffected by the fps.

global number end_time

start of layout:
-set end_time to wallclocktime+30

end_time <= wallclocktime
- do stuff
B
79
S
24
G
53
Posts: 4,728
Reputation: 40,219

Post » Fri Sep 14, 2012 5:32 pm

I don't think there's a convincing use case for allowing dt to go above 0.1. Most games become unstable and unplayable. Why would it be welcome in certain games?
Scirra Founder
B
359
S
214
G
72
Posts: 22,948
Reputation: 178,532

Next

Return to Construct 2 General

Who is online

Users browsing this forum: supreme676, TRMG, zenox98 and 16 guests