Best way to build levels - number of actors limited?
pbb76
Member Posts: 12
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
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
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
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.
Is it like this (top down):
Or more like this: