C2 games and 120hz monitors (*dt problem?)

Discussion and feedback on Construct 2

Post » Sat Jan 24, 2015 4:52 pm

@aphrodite

yea i rephrased it, you quoted a post i edited a few seconds later realizing what i said sounded off from my exerience :P
B
79
S
13
G
8
Posts: 1,977
Reputation: 9,947

Post » Sat Jan 24, 2015 5:09 pm

I'd start with:
Don't use dt in conditions. Use it in actions.
Then only use dt if you can imagine a scenario where you might want to timescale the output.
And all behaviors should have dt built in.
Image ImageImage
B
171
S
50
G
180
Posts: 8,394
Reputation: 113,982

Post » Sat Jan 24, 2015 5:14 pm

@newt Thank you! That I can understand, super helpful : )))

(Sorry if I sound like a dumb 8 years boy. It must be super irritating for you guys, really sorry. But picture someone who never did any math at school due to a cursus only focused on arts. I'm wayyyyy behind you all.)
Last edited by Aurel on Sat Jan 24, 2015 5:19 pm, edited 2 times in total.
Image | @AurelRegard on twitter
B
19
S
6
G
1
Posts: 307
Reputation: 2,500

Post » Sat Jan 24, 2015 5:14 pm

@Aurel yeah, that is the issue, it is considered so basic that it is hard to explain for those who understand it, but when you do not understand it it is hard to get into (kind of like "why 1+1 =2", hard to explain, and if you do not know it, it won't come like that).

try to think "if the game ran twice as fast the event sheet, would the action be affected?", every x seconds will not, since it will run every x seconds (it Ill be checked twice as much, but still will only be true every x seconds), not every x frames. triggers won't also (as the manual states they do not run in the normal loop logic checked every tick).

but changing the position of something every tick by hand to make it move fluently will (the events runs twice as much in the same duration).

behaviors are mostly defined with "by seconds" so it is time dependant and not framerate dependant.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
53
S
22
G
18
Posts: 2,122
Reputation: 17,123

Post » Sat Jan 24, 2015 5:21 pm

Let me just add that you should assume you might want to use timescale in all projects.
Image ImageImage
B
171
S
50
G
180
Posts: 8,394
Reputation: 113,982

Post » Sat Jan 24, 2015 5:33 pm

@Aphrodite @newt Allright, pretty clear in my head now. Thanks again, guys. And also to everyone else who patiently tried to explain : )

Let's get rid of these useless *dt in some events, and add it where it could be missing or done wrong.

(I'm editing the 1st post to write the answer in plain text: I was making things wrong.)
Image | @AurelRegard on twitter
B
19
S
6
G
1
Posts: 307
Reputation: 2,500

Post » Sat Jan 24, 2015 6:08 pm

Oh, and thanks @Ashley for the timescale test.
The game is using timescale a lot BUT on the 2 events which make the game crazy.

I'm using your idea to be sure the fix will work, thanks again.
Image | @AurelRegard on twitter
B
19
S
6
G
1
Posts: 307
Reputation: 2,500

Post » Sat Jan 24, 2015 6:36 pm

@Aprhodite - I agree with your calcs when using large lerp values. For the case A = lerp (A, B, X), the lerp equates to A = A + X * (B - A).

So, the lerp won't work correctly if the value that is added to A (which is X * (B - A)) is greater than the difference between B and A ( which is simply B - A).

So, X * (B - A) must not be greater than B - A

So, at the max value for X the equation becomes:

X * (B - A) = B - A

So max X = (B - A) / (B - A)

max X = 1

I think it's a good lesson (for me, at least!) that care should be used when putting dt inside a lerp in this way, because an inadvertent value greater than 1 will cause unexpected behavior.
A big fan of JavaScript.
B
76
S
20
G
74
Posts: 2,255
Reputation: 46,484

Post » Sat Jan 24, 2015 6:51 pm

@newt I love your posts on the forum, always so short and to the point. makes me laugh
Image
B
33
S
11
G
2
Posts: 564
Reputation: 5,163

Post » Sat Jan 24, 2015 7:07 pm

To end this story, I just made the timescale check everywhere I could in the game: 2 events had a dangerous use of *dt.
(Too bad you could see their effect in the very first level of the game *cough*)

Thanks again for your help, much appreciated.
Image | @AurelRegard on twitter
B
19
S
6
G
1
Posts: 307
Reputation: 2,500

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 13 guests