How many constraints

EmrysEmrys Member Posts: 38
edited November -1 in Working with GS (Mac)
The advise is often given that constraints use lots of processor power and you should use as few as possible.

Is there a target number one should keep in mind?
I know it probably is not possible to give an actual number. But how about a guide line estimate?

:)

Comments

  • RattleheadRattlehead Member Posts: 485
    As you already pointed out to yourself, there really isn't a way to come up with a definitive number as it also depends as to what also is going on in your current scene.

    I have one project where it has about 5 constrains going on at all times and it doesn't seem to be bad but you really do need to get a scene to where you like it, add your constrains and then deploy it to the device. Then look for ways to optimize; such as changing constrains to a Change Attribute using a timer where possible. So if an attribute only needs updated every 'x' number of seconds, use that method rather than a constrain which fires every cycle.
  • EmrysEmrys Member Posts: 38
    I just find that as I get deeper into the game features the answer to various issues seems to often be "you make a constraint ... " and that is often followed up with, "too many constraints is bad".

    I currently have several actors constrained to one invisible actor that carries most of the behaviors, motion limitations, and collisions. So I was getting a little worried about how many is too many. :)
  • RattleheadRattlehead Member Posts: 485
    Yeah, I know what you mean, but unfortunately when you are doing any form of mobile development you will run into limitations. It's been that way for as long as I remember. Even when I was coding for the DAP and Husky handhelds back in the 90's there were memory considerations and these types of memory and processing limitations are still in the newer mobile devices.

    Anyways, definitely look to optimize once you get a good representation of your 'level' by getting it on the handheld and play around with it. There is never a better way to see what works and what doesn't. Look at all of your objects that have constrains and look to see if you can't change them up using a different method and definitely look to see if you can limit the constrains to one or two objects and then do periodic references to those objects for updates; either through the use of a timer or a rule (for example, on collision).

    Good luck! :)
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    I have an app im working on with 30+ constraints running nonstop. It's pretty hard on the 2nd gen devices but iphone 4 still holds around 60fps maybe as things imporove in the iOS device worlds this will be lees of an issue
Sign In or Register to comment.