TimeDelta regardless TimeScale by Profiler object

Post your own tutorials, guides and demos.

Post » Thu Feb 14, 2013 3:16 am

download the .cap file

I needed a way to move something by time when game paused by adjusting timescale to 0, and I found the way to do it, by using profile object.

Questions::
1) Is it a correct way to do it?
2) Are there better ways?
3) What retrieves from 'GetTicks' by Profiler object? I cant' understand it.



Ch_Softblow2013-02-14 03:18:08
B
45
S
9
G
7
Posts: 73
Reputation: 7,518

Post » Fri Feb 15, 2013 9:21 pm

[QUOTE=Ch_Softblow]Questions::
1) Is it a correct way to do it?
2) Are there better ways?
3) What retrieves from 'GetTicks' by Profiler object? I cant' understand it.[/QUOTE] 1) In cases like these there is no correct or wrong way. See it like this: If it works, it's just fine.
But to satisfy your curiosity, the profiler was designed to measure the processor load of events.
2) No. There are other ways, but they aren't better. For example, in "Verve!" I used a custom deltatime calculated from the deltatimes before (while timescale was 1.0). The great disadvantage of such a method is that you don't work with the current, the real, deltatime, but with an average that is not very accurate per tick.
3) As I said in 1), the profiler was designed to measure the processor load of events. This would be a typical use of it:
+
-> Begin profiling
+ For "" from 1 to 10000
-> Add 1 to global('just_some_variable')
+
-> End profiling
-> Set text to Profiler.GetSeconds

The "ticks" should not be confused with Construct's ticks. They are better known as clock cycles per instruction (or the summary of all instructions in this case). You may want to read more about it here
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Thu Feb 21, 2013 10:18 am

er... headache...

@tulamide thank you for kind answer. :D
It was not an tick I thought. ha.. Recently I read some book about cpu, and that includes information about it. I confused absolutely.
B
45
S
9
G
7
Posts: 73
Reputation: 7,518


Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 0 guests