spawining using tables

digitalzerodigitalzero Member, BASIC Posts: 639
edited August 2012 in Working with GS (Mac)
is there any way to spawn an actor using tables to increase performance? it seems as if i have a lot of spawn behaviors in my game and i have not tested out the fps rate because im nervous as hell LOL i already know about the change position method but im in dire need of some spawns

Comments

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    Yep, way better to recycle than to spawn...spawning hurts the performance a lot.
  • digitalzerodigitalzero Member, BASIC Posts: 639
    well honestly... there really is no way :(... its hard to explain but for the attacks (lets just say it is a sword attack) the actor spawns a different image and then reverts back to the original image... the oriiginal actor image allows you to run and jump ect... the attack actor has a rule placed where the character wouldnt be able to use run or jump and thats something that i was having difficulty with... its kinda hard to explain because its SUPER complicated and the code is bananas... but i definitely need something that would allow me to use something that would speed up my performance beacuse i know if i plug it into the viewer the fps is going to be pretty low... and it doesn't help that i have over 70 actors and easily over 100 images... so its a pretty damn huge project lol
  • digitalzerodigitalzero Member, BASIC Posts: 639
    @tshirtbooth i was looking at your videos yesterday till about 5am central time wondering if i was goign to find something that used that because of performance and no luck :( but i did find a decent amount of other things that i can use LOL (like always)... and im fairly, well actually VERY new with tables so im just trying to grasp my head around the concept
  • rhinokeyrhinokey Member Posts: 158
    yeah i use spawning in my current project for my random platfom generation and i was really hoping i could use a table to list the names of actors and have the spawn actor be allowed to access that so i could randomly spawn different actors.

    now i have to have several different actor spawns per actor so it can randomly spawn between them. would really like to have it work with tables.

    other things of the like would be nice to work with tables, like play sound and music, would be nice if i could do a table with 3 or 4 sound names and make the play sound pick from it, so you could have a few jump variations without having to make a different rule for each
  • ORBZORBZ Member Posts: 1,304
    edited August 2012
    @digitalzero

    Couldn't you just change the image of the single actor instead of spawning a separate actor just for swinging a sword?

    If you explain the problem better there may be a way to do what you are doing without spawning, or with minimal spawning and a lot of recycling.
  • digitalzerodigitalzero Member, BASIC Posts: 639
    iwould use the change image but it warps the image because they are not the same size :(
  • digitalzerodigitalzero Member, BASIC Posts: 639
  • imjustmikeimjustmike Member Posts: 450
    yeah i use spawning in my current project for my random platfom generation and i was really hoping i could use a table to list the names of actors and have the spawn actor be allowed to access that so i could randomly spawn different actors.

    now i have to have several different actor spawns per actor so it can randomly spawn between them. would really like to have it work with tables.

    other things of the like would be nice to work with tables, like play sound and music, would be nice if i could do a table with 3 or 4 sound names and make the play sound pick from it, so you could have a few jump variations without having to make a different rule for each
    I use tables as part of spawning logic. I list the actors in the rows, and in the columns next to them add number for info such as spawn rate (frequency), spawn delay (after how many seconds should this spawn - useful for spawning harder actors later in the game) etc.

    That way my spawner actor can pull those numbers into an expression and calculate how often to spawn, the speed of the spawned actors etc.

    After (figure for spawn delay) second, Every (figure for spawn rate) seconds, Spawn actor

    In theory you could replace the spawn actor rule with move a recycled actor rule.

    Have to admit, not sure either is ideal for a performance POV, repeatedly checking the table every x seconds (game is currently quite laggy) but, well, works in principle
Sign In or Register to comment.