GS loads every image from any referenced actor. How to prevent?
![Fodder76](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hey there,
I brought up this issue in another thread, but I though I'd try a new one since that thread is a couple of pages long now. This, for me, is a huge issue, and I'm desperately hoping there is a way around it.
In my game I have a situation where I'm loading one of a set of nine images. Basically, I have one of 9 characters you can choose from, each has a bunch of animations associated with it.
When the level starts, based on which choice the player made, it will spawn the actor of one of the 9 characters. Well what I realized, is that GS is actually loading ALL of the images of all of the actors, regardless of whether they are spawned or not!
Its adding about 5 seconds to my load time, which is unacceptable. The only way I can think of to get around this is to have 9 separate scenes, each one loading its own character. But that SHOULD be entirely unnecessary.
Does anyone have any advice?
I have another situation that's similar, but I'll wait on that until I see if there are any suggestions to fix this issue.
Thank you very much!
I brought up this issue in another thread, but I though I'd try a new one since that thread is a couple of pages long now. This, for me, is a huge issue, and I'm desperately hoping there is a way around it.
In my game I have a situation where I'm loading one of a set of nine images. Basically, I have one of 9 characters you can choose from, each has a bunch of animations associated with it.
When the level starts, based on which choice the player made, it will spawn the actor of one of the 9 characters. Well what I realized, is that GS is actually loading ALL of the images of all of the actors, regardless of whether they are spawned or not!
Its adding about 5 seconds to my load time, which is unacceptable. The only way I can think of to get around this is to have 9 separate scenes, each one loading its own character. But that SHOULD be entirely unnecessary.
Does anyone have any advice?
I have another situation that's similar, but I'll wait on that until I see if there are any suggestions to fix this issue.
Thank you very much!
Comments
I do have separate actors for each character. When the scene starts, I have one actor that essentially says 'if CharacterNumber = X, then spawn X actor'
The animate properties are only in the separate characters actors, (not in the primary actor) which shouldn't even be loaded at all, but, I believe, because the other characters are simply referenced in the 'master' actor, all of them seem to load.
When I delete this actor and no character spawns at all, it knocks 5 seconds off of my load time.
But that will load the image in the game (Instead of the beginning) and will make you have some lag when you load the image.
Cheers-
If you really believe the load tie is affected by the unspawned actors go into your spawner rule and turn all of the rules for spawning a character off except 1 and see if that improves things. if it does you may have found a bug and need to report it.
I have a feeling though you are just spawning a ton of images in one actor and they may even be oversized. You can also try optimizing your images based on powers of 2. Let me know what the image dimensions you are using and I can tell you real fast if its close enough to a size for less memory usage.
I haven't actually tested what you suggest: removing the references to the other 8 characters. I will when I get home today. But I'd be very surprised if loading 17 128x128 images is adding 5 seconds to the loading.
Thanks again!
Another thing that may or may not work is moving the controller that is spawning to the top of the highest layer. From what I understand The scene loads and reads all of the actors from the bottom of the layer list to the top. so if its in the bottom all of those spawn rules right off the bat it may be jamming things up while its try to load other actors. I dont know if any of that would help but those are things I would try.
So first thing. I'm home now and I did my test. I deleted all of the extra parameters that point to other characters, except for my default primary character. And sure enough, it cut my load time down from 8 seconds or so to a little less than 4. No doubt about it in my mind, GS is loading lots of images that it doesn't need to.
I'm not sure how much of the forums the GS devs look at, but I'd like to officially submit this. To me, and for the game I'm making, this is a major problem.
I'll try the delayed spawn now. Thanks for the suggestion.
So basically, while a scene loads, GS looks at any actors that will, or even MIGHT spawn, and loads all of their information including any images associated with them.
Ohh boy what I'm I gonna do.
Thanks for everyone's help in this thread!
Definitely submit that as a bug report. they have bugs(at)gamesalad.com that you can send your project file to them showing the issue.
___________________________________________________________________________________
TEMPLATES AND PROJECT HELP BY TENRDRMER. CLICK HERE!!!
AppSolute Entertainment on Facebook
AppSolute Entertainment on iTunes
I did submit it as a bug. We'll see if I hear anything back.
Thanks again for all your help! Promo code coming your way in a few weeks.