bckobayashimaru.de

Bridge Commander Kobayashi Maru Project
It is currently Tue Jun 25, 2019 3:28 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sat Aug 05, 2006 4:55 pm 
Offline
Chief Engineer
Chief Engineer
User avatar

Joined: Fri May 06, 2005 10:41 am
Posts: 2449
Location: Hamburg, Germany
Again here because BCU is with one leg down:

Most of you scripters probably noticed, that if you do many AddName()/RemoveName() calls to the friendly or enemy group, the game starts to lag.
Well I found the problem.
Well after searching 90 minutes - my poor afternoon :( - I finally, yes, I finally found the problem.

Best of it, is the comment, that the Author made:
Code:
# Hopefully this won't be too painfully slow:

- I really like this comment (I would like to kill the Author for that)

Anyway the file is ConditionInSet.py
Code:
   def GroupChanged(self, pEvent):
      #debug("GroupChanged for %s" % self)
      # An object has been added to or removed from our self.pObjects group.
      # We'll need to update the proximity sphere for the changed group.
      # Hopefully this won't be too painfully slow:
      #apply(self.SetObjects, (self.sObject1, self.pObjects))

      # by Defiant: and why don't we just call the Proximity function instead of getting the game to lag?
      self.SetupProximitySphere()


and

Code:
   def SetTarget(self, sTarget):
      #debug("SetTarget for " + str(self))
      # Change self.sObject1.
      if self.sObject1 != sTarget:
         #debug("Changing target from %s to %s" % (self.sObject1, sTarget))
         #apply(self.SetObjects, (sTarget, self.pObjects))
         self.pSingleObjectGroup.RemoveName(self.sObject1)
         self.sObject1 = sTarget
         self.pSingleObjectGroup.AddName(self.sObject1)
         # Setup the proximity sphere.
         self.SetupProximitySphere()


Now whats happenning?
Well its pretty easy: For every Group change, the GroupChanged method is called more and more times.

Why this?
To be honest, I'm not sure right now. There seems to be no reason.
I'ld say it would be much easier to just modify the existing ObjectGroup.

What does the rest of you think?

_________________
Shuttle Launching Framework carrier file creator

--
Whenever you find that you are on the side of the majority, it is time to reform.
-- Mark Twain


Last edited by Defiant on Wed Aug 09, 2006 12:40 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Aug 09, 2006 12:39 pm 
Offline
Cadet 2nd Year
Cadet 2nd Year
User avatar

Joined: Tue Jun 14, 2005 12:13 am
Posts: 35
Location: Novi Sad, Serbia and Montenegro
Anything that gets game lag down is greeted in my book :wink:

_________________
"What CAN go wrong, WILL go wrong!"
"Walking Point = Sniper Bait"
"If your attack is going well, you're running into an ambush!"
>>Murphy
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group