Unrealistic project size

NessusXVINessusXVI Member Posts: 6
edited November -1 in Working with GS (Mac)
So I've been making all kinds of progress on my space-invaders-style shooter. Up until now, I've been working in the prototype for the enemies, and I've made use of another actor to spawn the complete group of 30. That is all that are spawned, you needn't warn me about the dangers of spawning/destroying, these same 30 spawned actors are used over and over through the entire game. Unfortunately, spawning the actors now takes too long; several seconds pass while each one is spawning, during which the game slows to a crawl and is essentially unplayable. I can't expect anyone to wait a full minute to play a shoot 'em up on their phone.

My solution was to place all 30 enemies into the scene (of which there is one, reused over and over) so that they all load with the game. I had hoped this would remove any inherent overhead or inefficiency with spawning such complex actors. Instead, the 10MB project ballooned to 105MB, and it no longer loads. Gamesalad has been chugging on it, trying to open the one and only scene, for fifteen minutes now.

Why would this happen? The enemy actors contain a great deal of code and animation frames, but such things should be reused as needed, not stored/loaded individually for every actor instance... unless I've stumbled on an inherent limitation of Gamesalad. Any insight would be useful. I'm going to try to optimize my images while keeping animations smooth.

Speaking of images, is there anyway to tell Gamesalad not to use any sampling when resizing images? I'm going for a pixelated look, so blurry edges are not my friend. I'm using large but pixelated images at the moment, so I could save a lot of space by using the tiny originals and having Gamesalad resize them.

Comments

  • tvappstvapps Member, PRO Posts: 42
    About your game being 105MB, that seems interesting and I am not sure why that would happen. This could be due to the size of your image. It seem that spawning has been steadily improving with each release of game salad to the point where I find it more convenient to spawn than to keep reusing actors. But I dont know what your game looks like so its hard to tell.

    What size are your images? if you don't want the image to look pixelated you need to follow a few rules: make your image match the size of your actor, or .5 the size if you are making your game retina compatible. So if your actor is 64*64 pixels, you want your image to match that, or 128 * 128 if you are using resolution independence. If you don't the images will be filtered/blurred.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    also all images should be 72dpi, even when divided by 2, and if your using resolution independence they should be even when divided by 4 as well.
  • NessusXVINessusXVI Member Posts: 6
    I appreciate the suggestions. It turns out that editing each actor instance to set the instance's index variable was the cause of the enormous project size. I'm guessing gamesalad was treating each one as a separate actor rather than an instance of the original. I put in another actor which scrolls through the enemy instances, setting their index on each collision, and the filesize dropped from 105MB to 11MB.

    Unfortunately, previewing the app now involves several minutes of loading, which worries me. Do apps on the iphone load more or less quickly than they do when previewed before publishing? Nobody is going to wait around that long to play one of these games, whether the loading time is on my end or gamesalad's end. The problem remains.

    The enemy actor contains about 480 images. There are 30 instances of the enemy actor. The average image is 32 x 32 and about 1KB in size. I'll look into getting the dpi set up correctly.

    "if you don't want the image to look pixelated"

    I actually do want the image to look pixelated. However, gamesalad uses supersampling or some similar technique when displaying a resized image. So if I stretch a 32 x 32 image to 64 x 64, all the pixels are blurred. This is great if you're looking at a photograph or something, but it destroys pixel art's charm.

    EDIT:

    I tracked the source of my loading issues down to the particle engine. In order to create convincing explosions, I call dozens of particle behaviors simultaneously, each responsible for between two and four particles in the explosion. I've found no better way of making particle explosions, and I would humbly suggest that gamesalad needs a particle explosion behavior.

    Is there a way to set the colors of particles programmatically? If I could use variables to set the colors of particle behaviors before calling them, I could cut back on the literally hundreds of particle behavior calls within the enemy actor.
Sign In or Register to comment.