ACTORS, RULES & MEMORY USAGE, THIS IS THE ONE OF THE MORE EXCITING THREADS!

olster1olster1 Member Posts: 396
edited November -1 in Working with GS (Mac)
Hey guys, long time no see. I've been working and sorting out stuff for Uni, fun fun fun.

Anywhoo, I have been messing about with an idea for a platformer for a while I have done some proof of concepts and have finally sketched out all the 'final' plans and ideas. The next stage is going to be the coding. Before I start I would like to know the answers to several related questions.

Each scene is going to be large, 5000px by 3000px as a ball park figure. Because of this it's going to have a lot of actors on screen, some of which are moving. So here are the questions.

1. It is better for memory/loading/fps to have many actor prototypes and have each one on the scene or is it better to have one actor prototype (just a blank actor) and just edit each one individually on the scene. (I know it would increase the workload and confusion if not done correctly but if it cuts down on memory/loading it's worth it)

2. Some of the actors will have quite a few rules relating to the main character and for movements ect. Now I can spread the rules over both the object and the main character actor. For some rules there would be an opportunity to chose where to put it (depending on how you code it), so would it be better to put most of the rules in the one main character actor or should I keep them in each of the objects.

3. Is it better to use scene or game attributes when possible or does that make a significant difference.

4. Any other advice in terms memory usage for actor prototypes/the ones on the scene (I think they're called instances, correct me if I'm wrong) and rules.

I know these are some heavy questions but any help would be much appreciated and would set me off in the right direction.

Cheers.

Oli

_______________________________________________________________________
http://itunes.apple.com/gb/app/his-adventure/id448738557?mt=8

FOLLOW PEZZINI GAMES ON TWITTER
LIKE US ON FACEBOOK
www.pezzinigames.com

`Edit - Please do not use images in your signature - tenrdrmer`

Comments

  • LiquidGameworksLiquidGameworks Anchorage, AKMember, Sous Chef Posts: 956
    I seem to recall FMP talking about the use of instance/prototype actors. I'm not sure if there's a significant difference in memory use, but I'm fairly certain of one thing. If there is a difference, its that the game uses instance actors, not prototypes. This does not mean you have to BUILD all of your actors in the instance. You can use prototype actors to arrange the scene, and if it bogs down, open up your actors in scene, and delete the prototypes.

    One thing to keep in mind on a huge scene is that most of it is not seen at any given moment (well yeah, that's a duh moment). Now, we know animation eats up memory and movement can eat up memory. I haven't tried it, so I may be talking out of my ass, but maybe try a global rule for all of your animated/moving characters to only activate when within a certain proximity of your "hero" (or whatever is controlling the camera).

    I doubt there's any difference in scene/game attributes, memory wise.

    I'd like to know if rules placement matters as well. I always stack my rules in as few of actors as I can to ease debugging, and I haven't noticed any issues... yet.

    I have a couple of big games (scenes over 5K dimensions) in the works, so I'll be seeing if any of these issues arise as well.
  • olster1olster1 Member Posts: 396
    Cheers LiquidGameworks, a lot of useful stuff there :D I hadn't thought of animating actors when they are within proximity. Genius
  • mynameisacemynameisace Hull, UKMember Posts: 2,484
    The trick of using one actor and using the change image trick is largely irrelevant now because we have the preload image attribute to do that for us and multiple actors isn't going to bog down your project half as much as it did before. In my current game I have all my important characters and stuff as separate actors and then an actor called instances which I use for everything else smaller.

    Definitely fire your rules and animations for the baddies when you are within a magnitude of whatever amount. You can also recycle the baddies dependant on your location. You could have a baddie that is used 5 times in your scene but change the x value depending on your location and direction and also reset his attributes if he was killed, etc.

    Ace
Sign In or Register to comment.