Best way to build levels - number of actors limited?

I'm working on a hex-based board game and the board has 20 x 40 hexes, and I'm using an actor for each hex (so 800 actors just for the board).

Will this be ok? The hexes on the board can each be different, so I am dynamically loading in attributes from a table for each cell (which is working well). So I have a few questions;

1) Is there a reasonable limit on actors

2) To save dragging 800 hexagons onto the scene and positioning them, I want to loop through the table and position and set attributes using cell data using just 1 initial actor. I'm guessing using Spawn Actor? I think it will work, its just I cant see a way of looping in GS (like in PHP/JS)

3) The board is bigger than the area of the iPad screen, so I can I place hexagons 'off screen' then have an action to move the camera around them? I'm guessing yes from what I've seen of GS, but havent tried it yet.

Any better suggestions!?

Thanks, Paul

Comments

  • MantoManto Member Posts: 796
    It will not run well.

    Yesterday I tried to fill iPad screen with 32x32 actors. 32x24 grid, total 768 actors. The spawning took 16.4 seconds and after spawning all actors the fps went down to 40. The actors that were spawned did not have any images or rules.

    I just added a 4 frame 10 fps animation to all the actors. Now it runs at 23 fps.

    1) Usually once there are hundreds of actors it starts getting really laggy.
    2) You can make a loop in GameSalad using the timer behavior and setting it to every 0 seconds. There are also other ways to do a loop see this thread http://forums.gamesalad.com/discussion/44707/timers-are-for-chumps-gs-optimization-tips/p1
    3) Yes it is possible
  • pbb76pbb76 Member Posts: 12
    Thanks manto. So I guess the alternative is just a big image and the grid types defined in a table still?

    But then (unlike square grid) I can't see how I could accurately get the coordinates of each hex piece due to the shape of them?

    Appreciate your reply though, thanks again.
  • MantoManto Member Posts: 796
    Can you send a picture of your grid?

    Is it like this (top down):

    image

    Or more like this:

    image

  • VolontaArtsVolontaArts Member Posts: 510
    this sucks, because i was building a tetris like game which also required a lot of actors! guess mines wont work either
  • pbb76pbb76 Member Posts: 12
    Can you send a picture of your grid?

    Is it like this (top down):

    image

    Or more like this:

    image

    The first one, just top down. Loving the 3d effect though! :)
Sign In or Register to comment.