Deactivate Bone Behavior

New releases and general discussions.

Post » Tue Jul 21, 2009 2:33 am

I was thinking earlier -- given that the bone behavior is probably the most CPU intensive of any of the behaviors -- that it would be great if you could deactivate/activate the bone behavior of an object at runtime. This could help in increasing performance by allowing you to deactivate the bone behavior when the object is off-screen, thereby freeing up more CPU time for other things.

I know that most CPUs from the last 4 or so years should be able to handle quite a few of these before slowing things down noticeably, but I want my games to be playable on as many computers as possible.

Any chance we could get this?
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Tue Jul 21, 2009 7:39 pm

The bone behavior doesn't do anything CPU intensive at all, as far as I know. It just does a bunch of interpolation functions which are really really cheap for a CPU to do. Have you got some framerate figures that demonstrate slowdowns are caused by the bone behavior and not by other things like effects on the sprites the bone is controlling?

As I said in another thread, the key to optimisation is to measure! What are the framerates? How much is bone slowing things down?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Jul 21, 2009 9:09 pm

On my 2.8GHz Athlon 64, 20 eight-limbed figures brings the framerate down to 400 from 2200 with one. I know that's not exactly a problem by itself, but once you throw in the rest of the game code, including other CPU intensive things like AI, the framerate could eventually fall below the refresh rate.

Then you have to consider different CPUs. There are still plenty of people with 2GHz P4s, which are approximately half as powerful as what I have(I'm talking about real world performance, not clockspeed).

Maybe I'm just being paranoid about this, but I still think it could effect older computers tremendously. Besides, a deactivate feature should probably be added just for consistency with the rest of the behaviors. :P

File I used to test speed - .99.4
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Tue Jul 21, 2009 9:51 pm

I'm not sure it's the bone behavior, because if I remove it, the framerate hardly changes :P If you want to compare performance, remove only the thing you want to test - if you get rid of the sprites you're actually testing the performance impact of removing sprites :P
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Jul 21, 2009 10:10 pm

By removing the bone behavior I doubled the framerate, despite all the sprites being there, so I'm pretty sure it's the behavior.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Tue Jul 21, 2009 10:37 pm

I can't reproduce that... stays about the same as I said - anyone else got results?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Wed Jul 22, 2009 2:55 am

I tested it on my laptop which is really underpowered. 220 with bone behavior, 360 without.

1.7 GHz, integrated graphics card, 896 MB RAM
B
77
S
49
G
25
Posts: 346
Reputation: 17,409

Post » Wed Jul 22, 2009 6:23 am

I Tried the cap file too..

With the behavior: ~770 fps
Without the behavior: ~2500 fps

Only clicked remove behavior, nothing else was changed.

Edit: This was on 0.99.4
B
3
G
3
Posts: 12
Reputation: 899

Post » Wed Jul 22, 2009 7:15 pm

With behavior - 600
Without behavior - 1640
B
2
S
1
G
4
Posts: 71
Reputation: 1,342

Post » Wed Jul 22, 2009 8:02 pm

With Behavior - 400
Without Behavior - 600
B
2
G
3
Posts: 27
Reputation: 904

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests