Are 80 attributes too many?

jb15jb15 Member Posts: 602
edited November -1 in Working with GS (Mac)
After finding rather serious bug in Lefty, I've decided to make all levels playable, like in Bubble Ball. (So you don't have to complete level 3 before playing level 33).

Two questions, though:

1) Can I save up to 80 attributes? Or is that to many? Is there a limit?
2) Should I remove my game from the App Store, until it's fixed? Is that possible? Suggestions, please!

Comments

  • jb15jb15 Member Posts: 602
    OK. Thank you very much! I had forgotten I could ask for an expedited review.
  • jb15jb15 Member Posts: 602
    Hmm...one more question: Will it work to have 80 load attribute behaviors in one actor, in the same scene? That seems like a lot of behaviors...
  • EastboundEastbound Member, BASIC Posts: 1,074
    I would imagine that saving and loading attributes is pretty light on memory usage, so I really doubt it would be a problem. I haven't done quite 80 at a time, but 60 had no issues.
  • quantumsheepquantumsheep Member Posts: 8,188
    Gravitrixx had over 300 attributes I think - that worked just fine :D

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

  • MammothMammoth Member Posts: 640
    How much memory does an attribute take up anyway?
  • InLikeFlynnInLikeFlynn Member Posts: 171
    There's a way to store 30 or more Boolean attributes in one integer, and if you take the time to figure it out it can save a lot of effort setting up attribs:

    This would work well if you have multiple profiles and want to store one number in place for all profiles, or if you want to store an entire players inventory (of under 30) in one int.

    If you have a Boolean attribute like 'owns gold sword', you can save all profiles info in one integer by decoding it into boolean numbers. Let's say profiles 1 and 3 own the sword, but profiles 0, 2, 4 and 5 don't. You could encode that information by having the user select a profile number, then adding that number to the power of two on top of the sword integer.

    The integer for profiles 2 and 4 would be: 10

    then you can decode this by breaking the 10 into binary:

    P5) 32 = 0
    P4) 16 = 0
    P3) 8 = 1 <<
    P2) 4 = 0
    P1) 2 = 1 <<
    P0) 1 = 0

    2 + 8 = 10

    If profile 2 obtains the sword, you add 2^Pnum (2 to the power of the player profile integer) to the sword integer, then resave the attrib. In this case, 10 + 4 = 14. 14 in binary means the 2, 3, and 4th digits are 1s, which corresponds to the 2, 3, 4th profiles.

    When you go to decode it's a bit trickier. You have to use (MOD(2^(profileNumber+1)))-(MOD(2^(profileNumber))). If that equation is greater than 0, you know the player has gotten the item.

    I know this sounds like extra work, but it doesn't take long to set up. You can store the equivalent of 30 (possibly more) Boolean attribs in there. So if you have thirty items in your game with 3 profiles, you can load them all in 3 integers instead of 90 booleans, which can be a pain to set up.

    You also dont have to worry much about this slowing down your load time because the info can be decoded when you need it, and it's a simple equation, so it's quick.

    Epic Math loads about 70 separate attribs when it boots up, and has about 210 overall. I think it works ok, but if you want to stagger it you could always load them behind a splash screen.
  • jb15jb15 Member Posts: 602
    Wow, thanks for all the tips guys. I think I'm going to try loading all the attributes seperately, at once. If this is slow, I'll definitely look into your suggestion, GeoffB. I guess one other option is to load 40, then in a different actor (maybe a different scene too) load the other 40. I'll do some experimentation on my end. Thanks again y'all!
  • calvin9403calvin9403 Member Posts: 3,186
    I have 35 atributes in my big project now

    and 80 int is only 40K, so it should not be a problem

    _________________________
    http://www.thatgameforum.com/
    http://gshelper.com/
    http://www.youtube.com/user/GameSaladCookbook#p/
    http://gamesalad.com/wiki/
    http://www.deepblueapps.com/Deep_Blue_Ideas_Ltd./Home.html
    http://www.gamesalad.es/
    http://thatgameforum.com/threads/gs-videos.360/
    my email: calvin9403@hotmail.com
    my skype: calvin9403
  • InLikeFlynnInLikeFlynn Member Posts: 171
    I doubt my method will help your performance much. Maybe a bit if you have a lot because it lowers seek time and only needs to read one or two attribs from flash into RAM, but it's really more to save time with creating and searching though all kinds of attribs. I found it got tedious looking for an attrib out of hundreds of others when I was programming. Does anyone know if there's a quick way to search through them?
  • EastboundEastbound Member, BASIC Posts: 1,074
    Unfortunately, there is not.
Sign In or Register to comment.