QUESTION:- spawn & destroy VS recycling

PeeCeePeeCee Member Posts: 107
edited November -1 in Working with GS (Mac)
Hi.

I've been reading some info from members and nonmembers on the difference and when to decide to spawn & destroy as apposed to recylce or vice versa. Im finding different answers from different people with different experiences.

can someone shed light on the latest GS methods on what is better. ??
please include what are somethings that can be an indicator when choosing one or the other method aso ????

for example , would you consider raindrops better spawned and destoryed or recycled ?

many thanks

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Easy, If your going to be spawn and destroying a lot. Use Recycle instead. If its going to be just here and there it will likely be easier to spawn and destroy.

    So rain Drops would be a definite recycle.
  • PeeCeePeeCee Member Posts: 107
    Thanks TD.

    I've only seen one video on recycling but its not too clear and deailed. do you have any resources or info , perhaps a link that i can start looking into recycling
  • rlehmrlehm Member Posts: 320
    To recycle, don't ever use "destroy." Instead, simply use Change Attribute self.position.x to -40 (or whatever get's it off your screen)

    Then create a trigger to bring it back on screen.

    or, if it is blown up and you want it to randomly reappear right away, something like:

    rule
    if collide
    change attribute self.position.x to random (20,300)
    change attribute self.position.y to 330

    depending on whether you use landscape etc.. this could make it look as though it was destroyed, but it really just went off screen and will re-enter like it was spawned.

    changed attribute simply makes it vanish and reappear in a new location like it was destroyed and re spawned, but it was not :)

    you could do this for the explosion as well, move it on and off, but then you get into using last location attributes and eh.. I dont want to type all that crap :) but this will get you started

    Just think about it this way...

    if you were to use "destroy" where would you have it re spawn? Just use "change attribute" to pull it of in-place of destroy... welcome to recycling.. it's great for the (game salad) environment.
  • PeeCeePeeCee Member Posts: 107
    Hi Rlehm.

    Thanks for that info. its all starting to sink in now. but just quickly, your emphasizing that i dont destory (which is ok and yes i get that) and i take it that i shouldn't use SPAWN neither right ??? - Just want to make sure your not saying to use SPAWN but not destory ??? or are you ???

    its all x & y coordinates that does it yes ????
  • outasiteoutasite Member Posts: 417
    if you spawn, your performance will go down but only during the spawning, (and really only if your spawning a bunch at once) but if your only using a few actors have them already there on the scene, but off the screen.

    You must also take into consideration that your load times will increase with more actors on the scene.

    Might I also suggest the particle emitter?
  • PeeCeePeeCee Member Posts: 107
    well my aim is to create rain drops from a cloud and the raindrop count could change up and down. ok so i need to have my raindrop actor in a x & y off the screen and then i simply tell it where to appear etc. I get that and thankyou all for helping. however just quickly how can i have the raindrop appear from behind the cloud (which also is always moving) just as the SPAWN behaviour works without using the SPAWN Behaviour when the cloud is moving
  • JPickardJPickard Member Posts: 477
    Bumping because I would like to know an answer to the last question, too. Thanks.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You can track the clouds location to a game attribute and when using your recycling technique have the change attribute setup ti work based off that value.

    Also make sure your rain drops are lower in the layer than the cloud

    Edit: Beat to it
  • JPickardJPickard Member Posts: 477
    You rock, tshirtbooth!
Sign In or Register to comment.