How to change 90 actors colour without delay?
Hello all,
Came across a problem a couple of days ago and still can't find a work around.
I have 90 actors (a grid of 9x9)) plus a few others.
After different score values, (10,20,30,40), they change colour at the same time.
However it takes around 0.1 to 0.2 to do it, and therefore affects the character who is constraining its positions to another actor (Actor .
The problem shows when the 90 actors change colour, the main actor and Actor B, then have a gap between them for a split second.
At first I thought it was just a GS viewer thing and would work fine on devices. But after testing the adhoc, it does the same. And I need to try and fix this.
How am I changing the colours?
-- The colours are changed using three (3) interpolates behaviours changing actors self.green (Blue and red) values.
-- At first I was getting these values from a table, using each actors unique ID to reference the row. But after manually entering the values instead of referencing them form the table, I notice it improved, but it still is noticeable.
I even replaced the interpolates with the simple change attributes, but that didn't change anything.
I have also changed the layers, really cleaned the code of all actors. But I think the problem is that it can not change around 270 attributes in a short time.
Is there any possible way this can be achieved, or any other optimisations I should be doing, or even tricks with layers.
Also running latest build.
Many Thanks,
Comments
is the color change code at the top of the stack?
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@The_Gamesalad_Guru
Yes. The change colour code is at the top of the code stack in each actor. Would it have something to do with the movement of the main and extra actor? I have tried re-arranging the code to make it run in different ways but nothing works yet.
Do you have the constrains for the actor at the top of the stack?
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@The_Gamesalad_Guru They are at the top too. They are also at the top of the layer, whether that plays a part or not. Would it just be a matter that GS doesn't run through all the triggers fast enough and therefore something is going to be a fraction of a second delayed?
GameSalad will not run 90 colour changes simultaneously, so you're probably going to struggle greatly to make this happen with so many actors.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
@Armelline I got it to work, sort of. There is an actor that is adding a table row every 0 seconds. If I take out this behaviour, everything runs perfect. Add it back in, and when they have to change colour, it glitches for a fraction of second. However I need that table row to be added every 0 seconds. Back to the drawing board to find out why adding rows is causing the problem.
if you're constantly adding table rows you might try a loop behavior instead of a 0 timer
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
A 0 second timer will definitely interrupt things. Can you get away with a 0.05s timer?
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
@The_Gamesalad_Guru Loops just made everything so much smoother. There is still a delay, but it is slightly less then what it was before. Thanks for the suggestion.
Is there a way to have a table start off with more then 999 rows. I have it now that they have to add extra rows up to 10 000. But if I could start off with 10 000 I wouldn't need to be adding the extra and would not need the delay.
Otherwise I will try find a work around so it stays under 999. Many Thanks @Armelline
Make a 10,000 row spreadsheet in numbers or Excel, export a CSV and import that into your table.
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Very Insightful. Seems to work perfectly. Many Thanks.
(I was just going to loop adding 10 rows, and have a quick one time loading time, and then save the table... Silly me)
The number of rows in a table is one of those weird, seemingly arbitrary limits GameSalad has!
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support