help me with my time deltas (please)

For questions about using Classic.

Post » Sun Oct 05, 2008 11:47 pm

[quote="Arcticus":33qk2a2f]I could be way off, i don't really make pixel precision games, but then again, i've never seen much pixel inconsistancy in my games anyways and i use timedelta all the time[/quote:33qk2a2f]

In one of my very early experiments with platforming (way, way back in the day), the character could easily make a specific jump if the game was full-screen, but missed it by a mile if the game was windowed (or was it the other way around?). I realize now the only difference was the fps had changed.

The timedelta override would have fixed it. A better graphics card would have fixed it to, but yeah...
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Oct 06, 2008 12:24 am

I have to say - I personally would much rather code a game to allow for the small variations TimeDelta produces than override or avoid using TimeDelta at all. Not using TimeDelta will cause you problems, period. And possibly problems worse than the one you're trying to fix.

Deadeye: I cannot imagine how varying framerates and timedelta would cause large variations (ie. a "mile"). That can't be right. Can you reproduce an example where the variation is that significant?

If your game is a pixel retro platformer consisting of a player who can jump exactly 32 pixels high, running around a level of blocks exactly 32 pixels high, of course timedelta will cause variations. Sometimes you'll make it, sometimes you wont. The correct solution here is to make the blocks 25 pixels high or so, so you have a chance to clear them! If you turn TimeDelta off or override it, you either end up with V-Sync off and horribly torn up display (and highly dubious gameplay speed on low end systems), or have your game run twice as fast on one computer as another (ridiculously unfair on players).

Design your game to take in to account variations. Not using Timedelta has its own serious problems.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Mon Oct 06, 2008 12:30 am

Wouldn't it be just as easy/better to have TimeDelta enabled by default in the way the events work? I am yet to figure out how to add it and get it to work... one time I tried, Construct gave me some sort of runtime error when I tried to test my game out, so I removed the timeDelta(s) and it worked fine after that.

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Mon Oct 06, 2008 12:34 am

[quote="SoldjahBoy":1jxbj8rr]Wouldn't it be just as easy/better to have TimeDelta enabled by default in the way the events work?[/quote:1jxbj8rr]
No, this is not possible. Consider this, to make a sprite rotate 360 degrees every second:

+ Always
-> Rotate sprite 360 * Timedelta degrees clockwise

Why not make the 'Rotate clockwise' action automatically multiply its parameter by TimeDelta? Because if you call it one-off, this messes everything else up:

+ Upon pressing spacebar
-> Rotate sprite 90 degrees clockwise

Here, if you hit spacebar four times, the sprite makes a complete rotation. If you automatically tried to apply timedelta as above, it would only rotate a few degrees... that's not what you'd expect to happen!

[quote:1jxbj8rr]one time I tried, Construct gave me some sort of runtime error when I tried to test my game out[/quote:1jxbj8rr]
Did you report this bug?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Mon Oct 06, 2008 12:39 am

[quote="Ashley":9zd68fpm]Deadeye: I cannot imagine how varying framerates and timedelta would cause large variations (ie. a "mile"). That can't be right. Can you reproduce an example where the variation is that significant?[/quote:9zd68fpm]

Well, maybe I was exaggerating a little... :P

But yeah, it did miss the jump on one and made it on the other, so the difference was pretty noticeable. It's just something you have to watch for when making a game I guess.

I'm not sure I could recreate the exact scenario in which it happened, because I have a better graphics card now, but if I run across the problem again in the future I'll let you know.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Oct 06, 2008 12:43 am

Well.... crap....

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Mon Oct 06, 2008 4:09 am

i'm making a 2d vertically scrolling shooter. A modern style one with a gajillion bullets.

the collision box on the player is extremely tiny, and the gaps between the bullets can be easily in single pixel figures.

I'd rather the game slow down gracefully than become jerky, this is what these games do in the arcade.

http://jp.youtube.com/watch?v=Ji88FmxemAs

All I want it to do is play at 60fps max if the PC can handle it, and slow down after that.
B
4
S
2
G
5
Posts: 149
Reputation: 2,025

Post » Mon Oct 06, 2008 11:07 am

OH MY SWEET HOLY F%#K, bullets... everywhere... thousands...
How in the world anyone can enjoy that? Its simply Avoiding => Waiting => Shootin, repeat untill boss is dead.
B
4
S
2
G
4
Posts: 719
Reputation: 2,938

Post » Mon Oct 06, 2008 12:04 pm

hmm, well, I guess that's like some who likes britney spears listening to some death metal and asking how anyone can listen to that, it's preference.
B
4
S
2
G
5
Posts: 149
Reputation: 2,025

Post » Mon Oct 06, 2008 12:22 pm

[quote="Doppel":jsvfijri]OH MY SWEET HOLY F%#K, bullets... everywhere... thousands...
How in the world anyone can enjoy that? Its simply Avoiding => Waiting => Shootin, repeat untill boss is dead.[/quote:jsvfijri]

It's what's known as a "Bullet Hell" shooter. They're pretty common, especially in the Japanese shmup scene.

Part of the allure is making pretty patterns of bullets with math. Some of them are quite intricate.

Personally, I can't stand them :P But then again, I'm not a big fan of shmups in general. But there's a whole lotta people out there who make and play these so they've got their own little hardcore niche.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

PreviousNext

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest