using the current FPS in an equation.

For questions about using Classic.

Post » Thu Aug 13, 2009 6:16 am

Hm, perhaps a system expression would be nice, but since it is easily recreated with events, I guess the devs haven't gotten around to it yet.

Then there are plugins - Construct is awesome for the fact that one can make plugins to make game development more convenient. Good luck finding someone to make a FPS plugin, though. ;)
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Thu Aug 13, 2009 6:17 am

If you think that TimeDelta is inaccurate, you should post a CAP file demonstrating this.

The difference in accuracy between multiplying by TimeDelta and multiplying by (1 / FPS) is incredibly small.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Thu Aug 13, 2009 6:19 am

linkman: timedelta varies highly, I just did a test - just an every 1000ms event showing round(1/timedelta), it shows between 13 and 80 frames, depending on overhead. That's 60 vsynced. The frame count is more accurate, since we're averaging FPS over a second.

Edit: Oh snap, 666 posts! :twisted:
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Thu Aug 13, 2009 6:20 am

I didn't say it was inaccurate. I said it was weird. or some synonym of that. or broken. It should be predictable enough to return something that corresponds with the FPS the game returns when I'm messing with it. not necessarily close but... it just doesn't seem like it can be used for this purpose.
B
2
G
4
Posts: 29
Reputation: 1,108

Post » Thu Aug 13, 2009 6:23 am

It may look like it's returning values all over the place, but when used to move stuff it works just as well as using the FPS average.

Example CAP

NOTE: If your refresh rate isn't 60, just change the value in the second action to whatever your refresh rate is. I didn't feel like making an FPS counter thingy. :P

EDIT: Of course, if you plan on doing something other than consistent movement with this, feel free to ignore me. :P
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Thu Aug 13, 2009 6:33 am

like you said, "when used to move stuff it works just as well as using the FPS average"

well... I'm not using it to move stuff. GASP

So anyway blah blah blah, lack of forethought, pain in the ass, workaround still not too useful, etc.

and i'm only trying to mess around here. I'm not even making some big project out of this but it still gives me a hard time.
B
2
G
4
Posts: 29
Reputation: 1,108

Post » Thu Aug 13, 2009 6:37 am

Perhaps if you clarified what do you need the FPS for, we could have helped more. I just assumed that you wanted FPS to display or whatever. FPS is Frames Per Second, which is an average. However, if you use fixed numbers like that for your equations, you might notice disrespectancies when your FPS drops or rises.

Timedelta expression is ideal, because it scales with current FPS. When your game gets slowed down due to all those projectiles on the screen, timedelta rises, keeping the game flow uniform. Stuff that uses timedelta runs equally fast on 30 FPS, 60 FPS and 500 FPS.

So, the question is - what do you need the FPS for? What is that you are trying to do?
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Thu Aug 13, 2009 6:40 am

Wait is the profiler object usable for this?
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Thu Aug 13, 2009 6:44 am

Profiler? As far as I know, it only has two actions and two expressions... Start, end, get seconds, get ticks.

I suppose you could use the profiler to start and end as soon as it hits one second, then get ticks it ran - that'd be the ammount of frames, I'm guessing. However, that is not exactly one click. :P
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Thu Aug 13, 2009 7:38 am

I'm impressed by the forum regulars, you guys are extremely friendly and helpful even when replying to less respectable members.
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests