Page 1 of 1

performance bettering?

Posted: Wed Oct 06, 2010 9:35 pm
by random
well...

in (as short as possible)...

iam up to make a game (space -> skybox - starcraft fight -> goal multiplayer also pvp)...

current situation

customClass (shipObject)

what does it do?

it dreates a
shipNode (IMesh with octree für collisiondetection)
add´s weapon turrets 24pcs (2 meshes rotating turret and weapon itself for angle per each)
add´s a lightNode a Billboard Node and a BeamNode per each turret

the class rotates each turret, and the weapon in the direction to the target, updates the position checks if the turret would fire the own ship if yes sets the laserbeam and the billboard to invisible...
so i got 48 rotating nodes 24 laserbeams and lightnodes 24 billboards + 1 for an explosion animation which will be updates position 1 shipmesh

it also adds a particle system as propulsion

i think i missed something but thats what i got currently

with 2 ships i get an performance of somehow 60fps with 8 ships where each is firing i got a perforance of somehow 20fps.

... is there any way to see where i can better the performance where my bottleneck is what lines of code costs the most time?

Re: performance bettering?

Posted: Thu Oct 07, 2010 12:27 am
by Luben
random wrote: ... is there any way to see where i can better the performance/where my bottleneck is/what lines of code costs the most time?
Sure there is. What you need(want) is a profiler[1]. Depending on what IDE you'r using, you might have one close at hand. The expensive versions of visual studio seem to have nice profilers, and i have memories of having used a profiler with c::b a few years ago.

[1] http://en.wikipedia.org/wiki/Profiler_% ... science%29

Posted: Thu Oct 07, 2010 8:35 pm
by CuteAlien
A new open-source profiler for Windows which I found recently: http://www.codersnotes.com/sleepy