game-time updates instead of constraints?

themagicboxthemagicbox Member, PRO Posts: 82
hi there, i wanted to know if instead of constraining the position of an actor to another...would using a gametime rule be better on the processing...for example when the scene starts set start.game.time to game.clock.milliseconds. i would but a rule to update the position of the actor to be constrained according the actor its "following" about 4 times a second...would this reduce performance issues that constraints could cause?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Possibly, but you'd have to be happy with keeping the position synced only 4 times per second.

    Drag the white square around and you can see the difference:

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • themagicboxthemagicbox Member, PRO Posts: 82
    Wow thanks! Yah I get that it will only be 4 times a second..I might do it 8-10 times...I'm just curious how much less processing is required compared to constraints...because I have many lol
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited May 2013
    I can't answer that but maybe if you explain what you're doing (what type of game you're making) we can think of another way with fewer constraints. I honestly don't think a timer for constrains will work well but it does depend on the type of game (i.e. very slow moving actors may be okay).

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • themagicboxthemagicbox Member, PRO Posts: 82
    Pretty much it's a block match game...imagine a grid of blocks and when matching colors are touching (tip bottom or right left) they get destroyed...I'm using physics and constraints because I don't understand how to do this with tables :S all the blocks have two detector actors on each side that are constrained and there are around 50 blocks....when I changed the constraints to my own constraining code (with self time) the performance did increase but I think it is just barely playable and I feel like once I add very thing else it won't be playable at all....I'm testing adhoc on android because it works fine when I test it in gamesalad

    I've even working on this for a while and I'm in the middle of changing the destroy behaviors to just move off screen hoping that will help...but I'm still worried about some levels that have like 10 or more actors falling at the same time...I REAALLY want to make this game and was so enthusiastic when I started but as soon as I started testing it was like my dreams were crushed hahahah....if the removal of destroy behaviors doesn't help I don't know what else to do....

    I'm NOT opposed to learning how to do this with tables but it's just hard for me to wrap my head around it without a detailed explanation which I have not web able to find anywhere

    There's a template for bejeweled games and I downloaded it...it's what're closest to what I would need but I dont need actors to spawn on top when some are destroyed....I feel like the that may be important to the whole code ad it's not just a behaviour I can delete to not spawn on top....also te matching concept confuses me....I dont undrstand how to track actors positions with the tables as well as check for matching blocks...Also how do the blocks know how far down to go? Are all the possible positions on the grid reference from somewhere?

  • themagicboxthemagicbox Member, PRO Posts: 82
    Oh and the detector actors I mentioned above that are attached to each block left and right...those are to detect what blocks are beside

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I think you really need to switch to tables. It sounds like you need some consulting, which various people on the forums offer.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.