Does using “My Behavior” increase efficiency?

SilencingMachineSilencingMachine PRO Posts: 16
edited November -1 in Working with GS (Mac)
What’s up guys, I have a question that I’m sort of hoping that someone else may have already run into.

I’ve done a number of searches and turned up limited info on the topic.

I have a number of actors that are essentially the same for the majority of their behaviors, with only slight variations on what sound that play when destroyed or what size they are scaled to, etc.

If I were to put the main attributes for their movements, collision, etc into a main behavior via “my behaviors”; would that save on memory and increase performance?

Currently they were simply duplicated, and had their individual variables changes as needed.

In terms of programming; I guess I’m wondering if the “my behavior” actions are created as a subroutine in the final compiled executable; and if so whether or not there is an appreciable amount of performance savings as a result.

Comments

  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    Yeah, if you're using the behaviours a few times, might as well drag it into my behaviours and reuse it :)

    Ace
  • mithraweptmithrawept Member, PRO Posts: 167
    I had wondered what the My Behaviours thingy was for. Thanks both!
  • At this point for me it’s less about practicality and more about the amount of time it will take to complete. That and how many times I’ll likely have to close and reopen GameSalad (lol?)

    The behaviors are created, and work perfectly as is, but if my time spent optimizing is better spent elsewhere... then that would be where I’d generally prefer to allocate it.

    In terms of investments I’m wondering what the ROI (return on investment) is lol… That’s the best way I can equate it.
  • SlickZeroSlickZero Houston, TexasMember, Sous Chef Posts: 2,870
    If you are using the same one several times, absolutely make a custom behavior like ace said. But it doesn't help on performance by doing that. Whatever behavior you make, and then use again still has to be written in the background by GameSalad. The custom behavior is just a way to save yourself some time by not having to drag and drop the same things over and over again. If you could see the code, it would be written the same way on every actor you apply that behavior to as if you did it by hand one by one.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    It will only make your game development more efficient. But it will do nothing for Game Performance.

    Also be sure to name the behavior before dragging it over there. otherwise you will have several custom behaviors name Rule
  • MotherHooseMotherHoose Member Posts: 2,456
    last time I looked...myBehavior isn't included in the build... and doesn't need to be as you will already have dragged them to the actors...

    that said, for development myBehaviors sure speeds things up... I even put the constrainAttributes in there...
    and much longer rules even if they do need minor tweaks for individual instances...
    and I drag some notes... with position type of info...

    and listen to @tenrdrmer... name before dragging!

    MH
  • Ahhh well cool, and thanks guys.

    If that’s the case then I’ll probably make use of it for my next version iteration, and stick to attenuating spawn rates (and whatnot) to try and save on resources for now.

    I started this project (and started using gamesalad) like last week, so much of this game was made with an element of experimentation. I’ve been going back and changing “move-to” behaviors to “interpolate” after my actors missed their mark and flew on by (i.e. off the screen hahaha) among other minor inconveniences.

    I’ve already peeled off all of the custom numeric fonts I had put in place; and just about every other constraint dependency that I could think of to improve performance in an attempt to support older devices… I’m kind of just looking for anything else to improve upon that wouldn't necessarily effect gameplay.

    Thanks again for all the quick replies guys. :)
Sign In or Register to comment.