GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

What's better? Tables or attributes

I have a pretty big game that I'm about to start coding once the art is finished. There is going to be a lot of data in the game and I want to have it using the most efficient way. So far:

tables:
I have no clue how to use them.

Attributes:
I know how to use them.
It seems like my code would start getting messy with so many.
Easy.

Which should I use? Can someone give me some knowledge of table? Thanks

Comments

  • Braydon_SFXBraydon_SFX Posts: 8,964Member, Sous Chef, PRO, Bowlboy Sidekick GameSalad Employee

    Tables. Easy. Tables are essentially attributes listed in row/column format. With tables you can dynamically write or call to a specific cell, search for a specific term or variable, and much more. It's much more efficient too. There are dozens of videos on tables on YouTube. I'd recommend searching up GameSalad Table Tutorials and several should pop up.

  • jamie_cjamie_c ImagineLabs.rocks Posts: 5,548Member

    Tables are very easy to use once you get the hang of them. I have a tutorial below for creating checkpoints using tables. It's not a table tutorial specifically but its a pretty simple introduction to tables if you're interested.

  • Braydon_SFXBraydon_SFX Posts: 8,964Member, Sous Chef, PRO, Bowlboy Sidekick GameSalad Employee

    @Armelline .....you little rebel. :P

    But I agree.

  • YeezyHypeBeastYeezyHypeBeast Posts: 60Member
  • KevinCrossKevinCross London, UKPosts: 1,893Member
    edited June 2016

    Just keep in mind that writing TableCellValue(game.table name, 1, 2) or TableCellValue(game.table name, 3, TableColNumber(game.table name, "health")) throughout your code can get tedious

  • YeezyHypeBeastYeezyHypeBeast Posts: 60Member

    @KevinCross okay thanks for the tip

  • colandercolander Posts: 1,610Member

    Generally I use attributes which store information which is only needed in the current session of play. Any information which is required next time the game is played I store in a table, things like high scores, etc.

  • AdrenalineAdrenaline Posts: 523Member

    @colander said:
    Generally I use attributes which store information which is only needed in the current session of play. Any information which is required next time the game is played I store in a table, things like high scores, etc.

    Nice, I like that guideline. Simple and helpful.

Sign In or Register to comment.