Actor Completely Stops Working. Please help.
I have an actor called Table Analyser which looks at a table in my game and determines whether player 1 wins or player 2 wins. Unfortunately this is a very complicated process and the actor has 144 base rules. These rules are all quite basic (3 conditions resulting in one change attribute in each case). What I'm finding is that once any one of the 144 rules activates, the actor no longer activates any of its rules. To try and fix this i put in a debugging rule in, which worked until one of the rules activates, then the debugging rule stops sending anything to the debugger. I couldn't find anything wrong with the debugging rule, but I put in in a timer instead just in case, every 5 seconds log debugging statement, with no rules with the debugger that time. That also stopped sending as soon as any one of the 144 rules activated. I'm really stumped. Is it possible that the actor just shuts down?
Answers
It is hard to imagine 144 rules in one actor. It would be a nightmare if a condition in each rule needed to be changed.
It is also hard to answer your question without seeing the project. Are you resetting the conditions that triggered the rule after your routine has completed? If they are not reset they won't fire again.
If this doesn't help upload a test project so we can see what is going on.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
One thing to consider is that rules only trigger when their condition changes. So for example, if you have a rule that says When game.someNumber > 3, that rule will trigger when game.someNumber changes from 0 to 4, but it will NOT trigger again when game.someNumber changes from 4 to 5. For it to trigger again, the condition of the rule would have to change from true back to false (e.g. game.someNumber changing back to 0) and then to true (e.g. game.someNumber changing from 0 to 4.
It may be that you have rules that are evaluated once and then never again because their condition hasn't changed.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
The thing is the rules are very simple. In each rule, there are three conditions which look at table values, and then if each of the three conditions are met, then it changes a public attribute from 0 to 1 (if player one wins) or to 2 (if player two wins). There are 9 of these public attributes (each of the 9 can be won by either player, and until they are won they all have value 0). There is so many rules because there are 8 ways to win each of the 9 public attributes. And there are 2 players. So 8x9x2 makes up 144 rules. I am confused because once one of the 9 is won, the Table Analyser no longer recognises if any of the other 8 are won.
The table which is 9x9, with all values starting at 0 and changing to 1 or 2. Imagine the table is divided into 9 groups of 9, like a sudoku game (my game is definitely not sudoku). Each of those 9 groups are responsible for each of the 9 public attributes, and so each of the 9 public attributes are completely independent from each other as they rely on different sections of the table.
Without seeing the rules or the project itself, it's going to be nearly impossible for us to help you. You can post screenshots or a link to download your file (.zip it first). Just make sure it's something you don't mind sharing with the whole community. You could also send it via private message to @colander and/or myself.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks for your help everyone. I managed to fix the problem by splitting the Table analyser actor into two, so that each has 72 rules not 144. For some reason this fixed things. It seems as if the actor could not handle that many rules, that the actor itself just crashed. Because it wasn't even logging debugging statements on a timer after one rule activated. Anyways, thanks tatiang and colander