Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Sudden problem with cloned objects in my game.

Author
Message
Nabz_32x
17
Years of Service
User Offline
Joined: 25th Oct 2008
Location:
Posted: 28th Sep 2013 19:42 Edited at: 28th Sep 2013 20:18
Hello,

I recently discovered, that my cloned objects drain more Performance than before.
For example, in my 0.18 Build of Reggie World, I get only small Performance Drains when many cloned and animated .x objects are on the Screen. However with the new build only one cloned object on the Screen is enough to Change my game timer from 0.27 to 0.39 - 0.42. The next additional object will take my timer up to 0.6 and so on.
I have already started to replace the clones with instances and try to animate them cleverly. This works and my game timers behaviour is back to the way it was before.

The only difference between the two builds is, that I added an effect to my cloned objects, but it is only applied if a certain condition is true and only to one of my cloned objects at the same time.
The other Thing I have changed is including set Alpha mapping on commands, but not on the cloned objects, only to triangles and plains.
Edit: Forgot another Thing: I added set object transparency to some objects also, but again not to the cloned objects.

Could it be that set Alpha mapping or loading an effect could make such a difference for cloned objects? As said above, I am replacing my clones with instances right now which solves the Problem, but I am rather curious what caused the difference in how my cloned objects are handled.
Edit: I also Need to find a solution for enemys that Need to be cloned, because they have certain Animation sequences that are not seemlessly smoothable.

Nabz_32x
17
Years of Service
User Offline
Joined: 25th Oct 2008
Location:
Posted: 28th Sep 2013 23:33
Update to the Problem:

I noticed, that when I don´t calculate the cloned objects ( mostly enemys in my game ) the Frame rate is back to normal, but I also noticed, that the cloned objects show their non animated appearance
( like when the Modell is viewed in object edit mode rather than in Animation mode in the 3d modelling tool I use ).
This makes the Problem even stranger for me, anyone else noticed animated objects displaying their completly unanimated form?

Mobiius
Valued Member
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 28th Sep 2013 23:52
Are you playing the animation after cloning, as it will be static by default?

Nabz_32x
17
Years of Service
User Offline
Joined: 25th Oct 2008
Location:
Posted: 29th Sep 2013 00:12 Edited at: 29th Sep 2013 00:18
Update:
Fixed the Problem, caused by some careless coding on my side.
I figured the cause was that I used SET OBJECT EFFECT id , 0
all the time not even checking if the object existed.

Using SET OBJECT EFFECT in a Frame,
without updating the objects Frame afterwards,
using SET OBJECT FRAME ,
will give you the unanimated .x object for this frame.

I thought back then, that SET OBJECT EFFECT id , 0 wouldn´t require that much power^^ , but it does, if carelessly used like
I did.

Login to post a reply

Server time is: 2026-07-06 10:36:44
Your offset time is: 2026-07-06 10:36:44