Timebug or missunderstanding

Discussion and feedback on Construct 2

Post » Sat Apr 02, 2016 11:18 am

If a correct time is realy importand then "for every x seconds" will not be trustable. This is true.

Its no bug, it is intended to be able to pauze the game. That is why time has a dt factor by default. If i have to choose, i choose for 'able to pauze'.

On the other hand, there are workarrounds.

1/ Or you use wallclock to code your own time.
2/ Or you can use the timer behaviour to trigger, and timesscale only the object with that behaviour attached.
3/ You can also try to convince R0J0hound, because this dude has the skills to make u a wallclock based time plugin.

The comment about 'teleporting objects' i have to figure out myself, later today.
B
33
S
18
G
27
Posts: 2,441
Reputation: 20,346

Post » Sat Apr 02, 2016 11:43 am

@R0J0hound and @99Instances2Go
THX for clearing things up for me

I don't know if this is a bug or a feature and I'm new in C2 so I just was surprised
And I don't know which elements are affected (but I think all of them like timer, wait, ...)

A small example:
Let's build an Astroids clone where an object appears every second and if you have shot 99 astroids your game ends and shows the time it took.
The obj_Astroid - thanks to eg. behaviour bullet which uses dt - will always move the same speed. Doesn't matter which hardware.

But time... (kinda worst case)
Now the classic way of doing it would look something like
every 1 sec | create obj_Astroid
if g_counter >= 99 | set text to wallclock

So if I run on a fast computer I can finish the game in 100seconds
On a slow one the objects appear only every 2 sec in RealWorldTime so I can only finish in 200sec (easy to paly but bad time)

now I change set text to time
The slow computer still gets an obj_Astroid every 2 sec but the finished time shows 100 even if RWT is 200 (almost like cheating)

build custom x seconds
maybe solved - but only time will tell ;-)


I still think I will use every x second in future, but now I know that I can't use CS2 the easy way for e.g. Speedrun Games and think about "timed levels" a little bit longer

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Post » Sat Apr 02, 2016 6:41 pm

There is no way to keep fast objects on track in heavy ticks. Lets translate 'heavy ticks' to 'low dedection rates'.
Remarkable is that the system that calculates angles gives up before the collission dedections give up.

So, anyway, the objects will indeed fly all over the place in heavy ticks. WITH the current calculation of dt. A correct calculated dt will not change that, but at least 'time' and its expression will be the right 'time'.
B
33
S
18
G
27
Posts: 2,441
Reputation: 20,346

Post » Sat Apr 02, 2016 6:41 pm

double, sorry
B
33
S
18
G
27
Posts: 2,441
Reputation: 20,346

Post » Mon Apr 18, 2016 9:20 pm

@fm4fanAT
Late reply, but I've found a solution to this in another topic. The is the system action: "set minimum framerate". By default it is 30 which means dt will be limited to 1/30. You can set this to 0 if you so desire and dt won't be limited. It's a trade off though. When dt isn't limited you can have issue of fast moving objects passing right past obstacles without hitting them.
B
91
S
31
G
103
Posts: 5,234
Reputation: 67,754

Post » Mon Apr 18, 2016 11:20 pm

@R0J0hound - saw the other topic THX
But your post inspired me to test my capx again (now with a loop).

So here are the results:
0 = perfect with the flaw that I maybe get into some other troubles
15 = near perfect - here time is pretty close to WallClock

  • System > On start of layout | system > load game from slot "brain"
  • System > On load failed | system > scroll to obj_Forum
B
17
S
8
G
5
Posts: 340
Reputation: 4,707

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: jefftrier and 3 guests