Setting to unlimited FPS - massive increase in particle rate

For questions about using Classic.

Post » Sat Jan 31, 2009 2:17 pm

After reading the TimeDelta wiki page, I wanted to make sure my game won't suffer any problems when it comes to computers with varying performances. So what I did is follow the wiki and set the Framerate Mode to unlimited FPS. After doing this, my game ran at ~500 - 1000 FPS and everything ran fine (though I don't have any TimeDelta commands since everything is behaviour based). Everything ran fine except for the fact that the particle rate increased dramatically.



Should I be worried about this and try to limit it? Or it it normal for particle rates to increase when setting to unlimited FPS? The game is going to be V-synced and locked at 60 fps, so it shouldn't be a problem, correct?

Everything in terms of speed runs the same with unlimited FPS, so all is fine?

EDIT: for those wondering, the particles are done like this

Always (every tick) > Bullet: Spawn object 'Bullet_trail' on ...
B
2
S
2
G
3
Posts: 143
Reputation: 1,536

Post » Sat Jan 31, 2009 3:17 pm

The Particles object is fully timedelta-compatible, but you're not using it, you're spawning objects manually. This means you have to do the timedelta stuff yourself.

Always - create/spawn object is not framerate independent. As the name suggests, "Always" runs every tick, and at 5000fps, this is 5000 times per second, and at 60fps, that's 60 times per second. So if you always create an object, at 5000fps you're creating 5000 objects, etc.

You should probably just use the particles object - otherwise you need to use timedelta to work out how many objects to create this tick (timedelta * objects_per_second) and you'll have rounding errors unless you also save the fractional part of that expression and add it to the next tick's count...
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Sun Feb 01, 2009 9:48 am

[quote="Ashley":30b5e8va]Always - create/spawn object is not framerate independent. As the name suggests, "Always" runs every tick, and at 5000fps, this is 5000 times per second, and at 60fps, that's 60 times per second. So if you always create an object, at 5000fps you're creating 5000 objects, etc.[/quote:30b5e8va]
But since the game is capped at 60 FPS and is in V-sync mode, this shouldn't be a problem right?
B
2
S
2
G
3
Posts: 143
Reputation: 1,536

Post » Sun Feb 01, 2009 10:25 am

It is a problem, since the player's are going to run the game with 60Hz, 70Hz or 80Hz... or even higher. If it's just a visual, aestethic thing, it doesn't maybe matter so much but I wouldn't leave anything which affects the gameplay without TimeDelta.
B
3
S
2
G
5
Posts: 263
Reputation: 2,201

Post » Sun Feb 01, 2009 12:51 pm

Well yeah, if it's purely cosmetic you can be a bit lazy. But not everyone V-syncs at 60Hz like the article says, it can be anywhere from 60-120Hz (which is up to double the framerate). Still, more particles isn't the end of the world, so yeah, could just let it go.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Sun Feb 01, 2009 1:48 pm

I guess I should make it so it's consistent on all PCs. This is how I should go about setting it right?

Every "60 * TimeDelta" Ticks > Bullet: Spawn object 'Bullet_trail' on ...

So that'll spawn it 60 times a second? Well anyway, when I do something like that, the game crashes on the layout load... It's either a bug or I'm doing something wrong... or both!

I'll send a bug report tomorrow, since I need to get some sleep. I start school (year 12) tomorrow :(
B
2
S
2
G
3
Posts: 143
Reputation: 1,536

Post » Sun Feb 01, 2009 2:10 pm

You can use milliseconds. That should work just fine.

Also, 60 bullets a second is... crazy. Hell, 20 bullets in a second is a lot.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Feb 02, 2009 5:19 am

[quote="deadeye":6qw1qter]You can use milliseconds. That should work just fine.

Also, 60 bullets a second is... crazy. Hell, 20 bullets in a second is a lot.[/quote:6qw1qter]
It's not actual bullets, but the trail left behind the bullets, like in my original post.

Concerning your suggestion, is this what you mean?

Every 100 * timedelta Milliseconds > Bullet: Spawn object 'Bullet_trail' on ...

Doesn't seem to be making a difference. On unlimited FPS it still spawns an incredible amount of particles.
B
2
S
2
G
3
Posts: 143
Reputation: 1,536

Post » Mon Feb 02, 2009 5:23 am

[quote="Shady":2nm39f91]Concerning your suggestion, is this what you mean?

Every 100 * timedelta Milliseconds > Bullet: Spawn object 'Bullet_trail' on ...[/quote:2nm39f91]

No... you don't need to use TimeDelta if you're using milliseconds. Milliseconds are measured in real time, not the time between ticks. So if you say "Every 100ms" then the event will trigger every tenth of a second, regardless of the framerate.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Feb 02, 2009 6:06 am

[quote="deadeye":k29jjg63][quote="Shady":k29jjg63]Concerning your suggestion, is this what you mean?

Every 100 * timedelta Milliseconds > Bullet: Spawn object 'Bullet_trail' on ...[/quote:k29jjg63]

No... you don't need to use TimeDelta if you're using milliseconds. Milliseconds are measured in real time, not the time between ticks. So if you say "Every 100ms" then the event will trigger every tenth of a second, regardless of the framerate.[/quote:k29jjg63]
Tried both ways with still no luck...



Maybe it's my .cap. I'll try replicating something similar in a new file.

EDIT: Just made a new cap following the same suggestion you gave me and it worked fine. Guess there must be something wrong with the other cap. Well, the fun part now is figuring whats wrong with it!

...
B
2
S
2
G
3
Posts: 143
Reputation: 1,536

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 10 guests