how bad is spawn actors for performance
howdy, i'm working on a endless runner and its going great except for some performance problems i'm getting in gs viewer on my ipad3
the core of my system is a self randomizing platform system, basically i have 4 actors, Left Middle and Right, then one cale lane change all of these are set to constrain attribute to a table value, for lin.x so they are moving towards the left
the only one that starts in my seen is "left", when the game start it moves left a bit, when it gets to a certain spot it spawns the middle piece following it, when this piece gets to a certain spot (all slightly off the right hand side of the screen, it has a 75% chance of spawning another middle piece , and a 25% chance of spawning the right end cap, this way you can get short platforms or really long ones depending on that percentage. the lane change spawns in right after, and determines a random size gap before the next left plat form spawns, also it chooses another height for the following platforms.
each of these platforms, when they spawn, spawn an art actor over them, the art is what you see of the platforms playing game
whats going wrong .. is that even tho the viewer says its getting 65 fps the platforms , at least the art, seem jittery, its weird cause some plays it will be smooth, then when i play again it will be jerky
its not because of all the spawned actors building up, almost as soon as they leave the left side i have a actor there named "gandalf" and any actors that touch it despawn "you shall not pass!"
i was going to try an adhoc, but the dev site is down for maintenance![:( :(](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/frown.png)
so any thoughts, are spawn actor extremely hard on the system? i hope not cause i still need to spawn obstacles and mobs
the core of my system is a self randomizing platform system, basically i have 4 actors, Left Middle and Right, then one cale lane change all of these are set to constrain attribute to a table value, for lin.x so they are moving towards the left
the only one that starts in my seen is "left", when the game start it moves left a bit, when it gets to a certain spot it spawns the middle piece following it, when this piece gets to a certain spot (all slightly off the right hand side of the screen, it has a 75% chance of spawning another middle piece , and a 25% chance of spawning the right end cap, this way you can get short platforms or really long ones depending on that percentage. the lane change spawns in right after, and determines a random size gap before the next left plat form spawns, also it chooses another height for the following platforms.
each of these platforms, when they spawn, spawn an art actor over them, the art is what you see of the platforms playing game
whats going wrong .. is that even tho the viewer says its getting 65 fps the platforms , at least the art, seem jittery, its weird cause some plays it will be smooth, then when i play again it will be jerky
its not because of all the spawned actors building up, almost as soon as they leave the left side i have a actor there named "gandalf" and any actors that touch it despawn "you shall not pass!"
i was going to try an adhoc, but the dev site is down for maintenance
![:( :(](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/frown.png)
so any thoughts, are spawn actor extremely hard on the system? i hope not cause i still need to spawn obstacles and mobs
Best Answers
-
3itg Posts: 382
I am making a game, it spawns 18 things, each loads about 60 attributes based on their randomly selected type.
Each of these actors have 2-6 guns. Missles and turrets. But I rarely see the game slow down.
If I try to go into combat with all 18 at once, it's not until they are all on screen shooting at me that I see a slowdown.
At that point, there would be well over 100 spawned actors.
You said endless runner. So I'm guessing the scene is always moving and changing.
Try slowing down the speed that the actor is moving right, and add a scrolling effect to the background, so it moves to the left. You can balance these 2 movements pretty easily, and it adds a nice optical illusion of a very fast speed, as well as a little depth.
Cutting your background up into more actors, and setting different speeds to each is also a great way to add perspective or depth.
-
The_Gamesalad_Guru Posts: 9,922
Have you sized your art properly for non retina is should be divisible by 2 for retina divisible by 4. Spawning actors is fine I do it all the time just make sure at some point when they go off screen you destroy them or they will build up and still be active and slow down the game.
Answers
3tig, my character does not move at all he stays constrained in one spot as all the platforms and backgrounds scroll past him in the opposite dir, i want this game to be able to go on for a long time and don't know of a way to do that with the character moving, besides making the scene a billion miles wide, which i don't want to do
i tried doing a screen wrap but it seems the camera does not wrap smoothly, it stops following the char near the edge, i was hoping it would let me smoothly loop my character in a smaller scene.
my scene right now is 2048 and my play surface is in the middle, that gives 512 of space on either side, the platforms and such spawn in on the right 512, and moves left into the scene, when it leaves out of the left side it gets destroyed in that 512 gap on the left.
i am getting confusing results, with my gs viewer test on my iPad also, seems when i send a project over and its connected to the mac (so i can see fps on mac) i get a lot of graphical glitches, these glitches slowly get better as i play the game. it also seems if i disconnect the iPad from game salad and play the game thru the recent games menu on iPad it runs a lot smoother
is this normal?
its also showing 60fps which seems like it should be good