How do I delta-time limit framerate for entire game?

Get help using Construct 2

Post » Sun Dec 06, 2015 8:27 pm

I'd like to recreate the old 90's framerate limit of the early Apogee games, and to an extent, Doom used a framerate limiter, but without the action being slow, just the frame were longer between refreshes while the action continues between frames. Is there a way of having the whole game run at a 15fps or 12fps limit?
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,248

Post » Mon Dec 07, 2015 7:17 am

You can't change the refresh rate of the game with C2. I believe a half framerate (30fps) was attempted before but it didn't perform well with html5, the result wasn't smooth. A search could probably give more info.

That said C2 only redraws if something has changed position. So you possibly could force lower redraw rate by only moving the objects every other tick or something. It wouldn't work if you used any behaviors since they update every tick but with just events it could work. Probably more trouble than it's worth though.
B
89
S
30
G
95
Posts: 5,160
Reputation: 63,456

Post » Mon Dec 07, 2015 12:04 pm

Yeah, but unfortunately that would create the slow motion effect which I'm trying to avoid, in fact it's really just a frame-cap I'm looking for, so the action speed remains the same but the gameplay runs at the same speed. Sometimes it's called Posterize Time.
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,248

Post » Mon Dec 07, 2015 12:18 pm

@R0J0hound

Just asking for fun:
Would it be possible to use the paster or canvas-object for this..
Overlaying the complete viewport/layout and pasting everything in it every 0.03 seconds?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Dec 07, 2015 5:42 pm

@Zebbi
You would have to add up dt for the ticks you don't use.
Here's my idea. It adds dt to mydt every tick. Then every forth tick the "code" group is enabled which moves the objects around using mydt instead of dt. At the end of the group mydt is reset to 0.
https://dl.dropboxusercontent.com/u/542 ... 15fps.capx
This could get very tedious to do. You can't use behaviors or animations with sprites, you'll have to do everything with events to ensure objects are only redrawn on that one frame. On a side note as far as the engine is concerned the fps is still 60 fps but we're only redrawing at 15fps.

@LittleStain
I suppose you could but it wouldn't save on any performance which I assume this would be for.
B
89
S
30
G
95
Posts: 5,160
Reputation: 63,456

Post » Mon Dec 07, 2015 6:33 pm

R0J0hound wrote:@Zebbi

I suppose you could but it wouldn't save on any performance which I assume this would be for.


Actually, the effect would be entirely for aesthetic, similar to shooting movies at 24fps, but naturally I wouldn't want the effect to eat up performance as that would introduce slow-downs, which I'm trying to avoid. Why does so much of the game have to be drawn manually with delta time? Would it be possible if a plugin could be coded that just frame-capped the refresh rate of the game?
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,248

Post » Mon Dec 07, 2015 6:56 pm

A plugin can't be made to do that since it's something fundamental that the engine controls, and would need to be changed in the engine itself.

The purpose of moving stuff with events is in C2 only redraws if something moves or changes viually. If nothing visual changes then the runtime doesn't redraw and just reuses the previous frame's image. By controlling when we move stuff we can control when the screen redraws.
B
89
S
30
G
95
Posts: 5,160
Reputation: 63,456

Post » Tue Dec 08, 2015 6:56 pm

Yeah, but couldn't there be a screen-level shader that can hold the framerate visually for a sub-division of a second, since it's entirely intended as a visual effect rather than anything that affects the gameplay? Can shaders not be made to work on the entire viewport that is drawn?
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,248

Post » Tue Dec 08, 2015 7:12 pm

Shaders can change what is seen on screen, but they have nothing to do with how often it's updated.
B
89
S
30
G
95
Posts: 5,160
Reputation: 63,456

Post » Tue Dec 08, 2015 9:36 pm

Yes, but the game could still update under the shader, the shader could theoretically just mini-pause the action 15x per second, say, to emulate the look?
B
41
S
12
G
14
Posts: 1,117
Reputation: 11,248

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 2 guests