Collisions on a Timer & node webkit

Get help using Construct 2

Post » Tue Jun 04, 2013 4:25 am

Hi everyone.

     I'm working on my first "big" project with construct 2. And I have a couple optimization questions. The first one is what is better.

Just using the when this object collides rule, or using a timer to say that every 0.02 seconds if object collides?

I'm making a very, very collision heavy game. And so far my performance has been very good. Getting a sold 60 fps. But I want to know what is more efficient for slower machines?

What are the draw backs to both? I know the collisions are not as accurate if you use a timer, but I don't need them to be. It just seems to me checking for collisions 20 times a second would be less processor heavy than checking every tick. Am I wrong? Missing something maybe

Second question: When I export to Node Webkit, it runs at a solid 60fps as well.. But out of no where, and in random spots it just seems to freeze for a couple of seconds. It doesn't seem related to the action on the screen, because it happens during down times as well. This does not happen in the browser. Any ideas what could be causing this?

Thanks a ton!
Adam
B
36
S
5
Posts: 156
Reputation: 3,310

Post » Tue Jun 04, 2013 12:34 pm

Optimisation: don't waste your time. If your game already runs 60 FPS, it's pretty much just a waste of your time to try and optimise it. C2's collision engine is pretty good, and objects which are not overlapping their bounding boxes can be discarded from collision checks in virtually no time, so trying to reduce that further with a timer will probably just have no effect and unnecessarily complicate your events.

Node-webkit uses the Google Chrome browser engine. So it ought to work identically to Chrome...
Scirra Founder
B
397
S
236
G
88
Posts: 24,423
Reputation: 194,560

Post » Wed Jun 05, 2013 5:05 am

[QUOTE=Ashley] Optimisation: don't waste your time. If your game already runs 60 FPS, it's pretty much just a waste of your time to try and optimise it. C2's collision engine is pretty good, and objects which are not overlapping their bounding boxes can be discarded from collision checks in virtually no time, so trying to reduce that further with a timer will probably just have no effect and unnecessarily complicate your events.

Node-webkit uses the Google Chrome browser engine. So it ought to work identically to Chrome...[/QUOTE]

Cool, thanks for the article. But that is part of the problem, Im checking for tons of collisions constantly. And my computer is a bit powerful, so Im worried on the average computer it might be slow. At any given time I have 100-200 bullets and several "baddies" Like I said, it runs great. But Im wondering what would be smoother. Ill just do some experimenting haha. I was also wondering if there was a way to find the Minimum Specs needed to run? A lot of games give those details, and Im not sure how to go about figuring out how low you can go haha.,

As for Node, thats strange, when I run in chrome its flawless.. But node does the freeze/stuttering thing from time to time. Not sure what the issue would be.
B
36
S
5
Posts: 156
Reputation: 3,310


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 14 guests