Tips & Best Practices - Everyone Contribute!

calebdomingo

  • Posts: 7
It's my 2nd day using iStencyl and I must say this is WAY better than any of the 3rd party iOS dev softwares out there.  I have several tips to share and of course questions to ask  :P Feel free to post & contribute your tips & best practices here :)

Tips:
1. Logic Editor - Holding ALT & Dragging a behavior will copy it. Holding Shift & Dragging a behavior  will select that particluar behavior only.

2. For Actors with the same behavior but different graphics (ex. buttons) Just make one actor for all your buttons and import all button images to that actor. Then make a behavior that you can select the Animation Image(Button Image) & Target Scene or link.

3. Again for actors with the same behavior but different graphics - Add the behaviors when these actors are in the SCENE so you can customize them easily.


Questions:


1. Atlases best practice - Is it best if we untick them all and just load them when the scene needs it? and unload them again when we enter a different scene? Or is it better if we load most of them when the game initially starts?

2. Whats the easiest way to load your graphics/sprites in the game? Is there a batch loading of graphics & sprites?

3. Are there any iStencyl game size limitations? Graphic size limitiations? Are there attribute limitations?



« Last Edit: March 13, 2012, 07:54:33 pm by Jon »

Jon

  • *
  • Posts: 17524
Quote
Atlases best practice - Is it best if we untick them all and just load them when the scene needs it? and unload them again when we enter a different scene? Or is it better if we load most of them when the game initially starts?

Only if you run into memory issues or find the initial loading time to be unsatisfactory. We put in this notion of atlases to accomodate larger games that have enough resources that they couldn't all be loaded at the start due to the device's memory limits. Off the top of my head, an older device will accomodate 24 MB of graphics RAM. Since each full atlas (1024x1024x4 channels) will take up 4 MB of RAM, that gives you at most, 6 full atlases to hold at one time.

Dizko

  • *
  • Posts: 451
3. Are there any iStencyl game size limitations? Graphic size limitiations? Are there attribute limitations?

I'm not sure if there is a limit on the iStencyl side.

Apple's limitations are:
  • 2GB maximum app size
  • 20MB is the biggest an app can be to be downloaded over a cell network, otherwise it will require wi-fi

Jon

  • *
  • Posts: 17524
Quote
2. Whats the easiest way to load your graphics/sprites in the game? Is there a batch loading of graphics & sprites?

Drag and drop works, but it depends on what you want to do. If there's a particular loading scheme you have in mind, let us know.

Jon

  • *
  • Posts: 17524
Ctrl + O lets you open a resource by name - use the arrow keys to go up/down the list and enter to pick. Takes partial names and regex.

I no longer use the game center thanks to this.

h1rnz1lla

  • *
  • Posts: 649
Wow, dont know if it belongs here, but this bugged me for 2 hours. Touch coordinates are bound to the screen size.

x of Touch = x on screen
x of Touch NOT != x ( x in game )

 :-[

fanstudio

  • Posts: 201
I'd love to see a complex tutorial on how to spawn an actor based on a rule. What is the best practice without affecting performances keeping in mind that the actors should be spawn every time the rule is true.


Jon

  • *
  • Posts: 17524
The rule of thumb is to avoid getting into a scenario where you accidentally spawn actors every frame. Using a print statement alongside the actor creation block and then peeking at the console will flood it in that case.

With events, that will be harder do (in a good way), though.

emf715

  • Posts: 46
Here's a tip:
If you're having trouble testing your game in the simulator or device, check your game's name. Xcode doesn't like spaces (or possibly numbers). For example, "Ape Crazy 2" wouldn't build, yet "AC2" built just fine.

I'm sure this is documented somewhere, but I couldn't find it.

Jon

  • *
  • Posts: 17524
That's pretty interesting. One of our example games seems to break that rule though - Drop Block comes out as Drop Block, yet that appears to work. Is there more to it than just the spaces?

emf715

  • Posts: 46
You're right: I can't seem to break Drop Block no matter what I name it.

I swear it though: all I did to get Ape Crazy 2 to build was to rename it to AC2. I'll try to recreate the bug (which very well may have nothing to do with Stencyl or Xcode) in a bit.

Raiyumi

  • *
  • Posts: 212
You're right: I can't seem to break Drop Block no matter what I name it.

I swear it though: all I did to get Ape Crazy 2 to build was to rename it to AC2. I'll try to recreate the bug (which very well may have nothing to do with Stencyl or Xcode) in a bit.

You might've had to restart Stencylworks and try building again. I had a similar problem where it wouldn't build, but when I restarted SW it worked.

toml2003

  • Posts: 351
Just a tip for Labels.

If using a Number like a Score, always use [anything as Text] or else the game won't build.

malospam

  • *
  • Posts: 467
For iOS at least, this is a good image from Jon explaining how to detect collisions.
Visit Reddit's Stencyl page and contribute to spread the word about this amazing program!
http://www.reddit.com/r/stencyl

malospam

  • *
  • Posts: 467
Quote
If using a Number like a Score, always use [anything as Text] or else the game won't build.

toml2003, have you confirmed this with Jon? If so I think this should definitely be in the documentation.
Visit Reddit's Stencyl page and contribute to spread the word about this amazing program!
http://www.reddit.com/r/stencyl