Change table value or change attribute?
stefdelec
Member, PRO Posts: 146
Hi,
(sorry I am asking several question at the time, but they are not related)
Change table value or change attribute, what is the best to optimize processing?
Comments
It depends on what you're doing - You can only use the Change Table Value Behavior if you're changing a table value. A Change Attribute Behavior cannot change a table value. Likewise, a Change Table Value Behavior cannot change a regular game attribute.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Tks but that is not my question. I am asking wether I should use tablecellvalue+change table value or change attribute in order to get everything work faster.
So I guess your real question is whether to use tables or not? Tables are more powerful and can be easier to use depending on the situation. It's also easier on processing, though you're not going to notice a difference between game attributes or tables unless you have a huge and complicated game.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
@stefdelec, there is no noticeable difference in speed between using ChangeTable/TableCellValue and ChangeAttribute. Both store values in memory and there is hardly any difference in accessing them.
Things to consider:
Attributes are more straight forward to use if you only need a few values to keep track of.
Your question implies to me that you need quite a few values to be stored and updated. In this case Tables give your code more structure and give you more flexibility and power through the table functions.
However, don't add or remove table rows too often, this does impact performance quite a bit as memory needs to be reallocated.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Tks both of u!