Custom Font DEMO - now more CPU friendly!

firemaplegamesfiremaplegames Member Posts: 3,211
edited November -1 in Working with GS (Mac)
Hey All,

I just rebuilt my custom score font demo:

http://gamesalad.com/game/play/31065

The other one was hitting the CPU pretty hard. It used to work by having a Constrain Attribute for each digit, as well as 10 Rules per digit to set the image.

I rebuilt it to set the image using concatenation as opposed to having 10 separate Rules. It still needs a Constrain Attribute to work. In the demo I have a 5-digit score, and on my 3GS, the frames rarely drop below 60 - even if I tap like mad.

At the very least, I just eliminated 50 Rules that were getting checked every time.

Your mileage may vary of course, but it seems pretty solid to me.

I haven't changed the other custom font demos yet, so if you're using them, please apply this method to those.

Thanks!
Joe

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    Thanks dude - will hopefully check it out on the weekend.

    The saving of FPS is always welcome!

    Cheers!

    QS :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • rdcuberdcube Member Posts: 361
    Thanks FMG...fps do look/respond better.
  • netdzynrnetdzynr Member Posts: 296
    Hey FMG, forgive the novice question, but how does one download a demo file, as opposed to running the demo in Safari? Thanks in advance.
  • netdzynrnetdzynr Member Posts: 296
    Oh, never mind, I found it under the Shared Projects tab in the GameSalad app. Thanks.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    yeah, the way to download shared projects is a little weird.

    When you download the file, you'll get a .game file.

    You have to change the .game extension to .zip

    Then double-click on the .zip to extract the .gameproj file.

    The way you did it is the way I would do it, just open it right up through gamesalad creator, under the Shared Projects tab.
  • netdzynrnetdzynr Member Posts: 296
    Ah, I just now found the Download Project button on the demo pages. For some reason, the GS folks seem to put controls in places I never find them :-) It took me eons to realize that the magnifying glass at the topright of their Web pages could be used for searching the forums!

    BTW, the score demo looks great, especially for those of us mathematically challenged. :-)

    Thanks again.
  • JamesZeppelinJamesZeppelin Member Posts: 1,927
    Thanks so much. This will be nice

    also I've never done any of that stuff with the whole zip thing

    I just open up gs and hit shard projects as oppsed to rcent or new. type th name or a word from the name in the little seach box.

    Also a great way to browse demos if you hit templates only.

    Opens right up in the editor.
  • JamesZeppelinJamesZeppelin Member Posts: 1,927
    Just added it to my game and it worked perfectly.

    On my iPod and 3gs there was no hit at all

    I mean maybe if you had a read out or something but I certainly couldn't notice anything

    althogh maybe it was your high score formula that was crashing everyones browser..... Jk

    anyways thanks this is very nice and so easy to add in
  • firemaplegamesfiremaplegames Member Posts: 3,211
    Cool!

    Yeah, combining things like that is called concatenation. It's a pretty basic programming technique.

    I've asked (begged?) for them to add that ability everywhere, especially to the Change Scene behavior.

    i.e:

    Change Scene
    "Scene "..(game.currentScene+1)

    or

    Change Scene
    "Scene "..random(1,50)

    It would make my life soooo much easier. And allow me to chop out literally 600 Rules from each of my games.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    We'll see. It also opens the doors for syntax errors, and for accessing things that don't exist.

    The way they currently have it where you need to select everything from drop downs avoids these issues for new programmers...

    But I would rather have possible syntax errors than carpal tunnel syndrome!
  • adadoadado Member Posts: 219
    I second FMG's thoughts on concatenation techniques are necessary.

    Combine them with arrays and you open up all sorts of dynamic content and without the input headache as FMG mentions.

    <hint, hint DEVs>
  • SDMGSDMG Member Posts: 280
    thank you FMG !!! looks great!!
Sign In or Register to comment.