Announcement

Collapse
No announcement yet.

programing methods

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    programing methods

    hi there,
    this is a question about programming methods really. Lets say i have a mod which makes
    randomised sounds for a level. Its made up of two actors, one of them is nothing more than a
    database of available sounds and the other actually plays the sounds. That way i can have lots of the
    'playsound' actors but the mapper only has to enter the sound data once.
    Would it be better to have the 'database' actor deal out the sounds to the play actors before the level
    starts or would it be better to have to playactors just look up which sound to play from the 'database' actor.
    Is there a significant increase in overheads when an actor accesses data from another object ( otherobject.somedata)
    compared to accessing the data from itself ( self.somedata )?
    I just assumed because the data has to travel between 2 actors that are not close to each other that it would take
    longer or be a greater strain on the cpu.
    - Thanks

    #2
    there is a difference, but not it's not significant, unless you do it like 100000 times per tick.

    but I assume that other logic used in the function will take up a greater part of the cpu usage.

    it's simple logic, which of the following do you think takes less time:

    look at something from the room your are currently in.
    or
    look at something from the room next to the room you are currently in.


    x has a smaller path than y.x

    Comment


      #3
      thanks for the quick reply (in a net cafe here,lol).
      Thats excellent news..means im gonna have to rewrite a whole bunch of code but thats cool.

      Comment

      Working...
      X