1. Welcome to the Wargroove support forums. Please check the support FAQs before posting: http://wargroove.com/support

Bug/Issue Memory Error - Location and Teleport Issue

Discussion in 'Support' started by RollingResonant, Jun 28, 2020.

  1. RollingResonant

    RollingResonant Aquatic Astronaut

    I will try to reveal what I'm doing without spoiling the map. If you need more specifics or a video clip of what happens, please private message me a way to contact whoever more directly (I can use Discord). I don't like giving spoilers. :)

    ---
    Memory Error
    Platform: Nintendo Switch
    ---
    I can only suspect a memory error is occuring due to either some unforeseen event or its a memory error caused by not being able to move ALL units from one location to another. For example:

    At the START OF MATCH there are units spawned under NEUTRAL player (around 50 or so units).

    Later, I TELEPORT some units from one LOCATION to another LOCATION.

    When this happens, I move some units from the LOCATION that had units at START OF MATCH to specific LOCATIONs, but not all the units will fit into the other location.

    When I do this during a single turn, everything seems to work okay. However, if I go through 5 turns (Players 1, 2, 3, 4, 1) and end up on Player 2's turn, it gets stuck in a cycle of spawning units at the "START OF MATCH" LOCATION, after I TELEPORTed a unit from a different LOCATION upon the death of a unit (doesn't matter the unit type).

    Thoughts of what might not be working properly...

    Maybe start of match isn't only getting triggered then, or if there is a memory error, maybe it's defaulting to a 0 start memory location of some sort and thus executes on an infinite loop of spawning units at the initial location.
    - If this is the case, it is ignoring the CONDITION boolean I set to ensure it would execute only once.


    P.S. An other odd note. I noticed if you add a counter to have an incriment of 1 at END OF TURN, it will treat that trigger as a loop. That is odd behavior, when everything else gets executed once. The get past this, I added a boolean so it would break out of the loop.

    Ex:
    If(counter < 5)
    Counter++

    Obviously that is a pseudo-ish representation of the trigger. It would loop that at END OF TURN, but if executed in the main method of the map turn (even on REPEAT), it would execute the trigger once and move to the next one.

    Also, I'm curious what language you are coding Wargroove in. Maybe I could help. Even if I'm not 100% familiar with the language, I am good at analyzing and could reference APIs. I like puzzles.


    Also, is there any chance you will double the Trigger and Location limits?


    Edit: I wonder if another possible fix could be if I could specify how many units from a location I coukd teleport, instead of ALL units. Maybe because it is unable to fit ALL units, it is causing a memory leak.
     
    • RollingResonant

      RollingResonant Aquatic Astronaut

      I think I figured out what is happening, kind if...

      Imagine using the TELEPORT Action with a Trigger at END OF TURN. Due to the glitch or logic error of having it constantly loop the Trigger, and even though it is set to Repeat and with a boolean to break it out of the loop, it is still running the Trigger. I think I confirmed this with my QA testing.

      As part of the Action, it is looping to TELEPORT over 40 units around, if applicable. It breaks out of loop, (I don't know if this next part matters, but I keep doing it in case it does) I go through 5 player turns, get to Player 2's turn. Have Player 2 kill a unit (of Player 1).

      It is now going to call on the TELEPORT Action, since the Action is still in loop, it gets stuck and tries to TELEPORT units where units already exist (from the memory leaked loop of the END OF TURN trigger).

      Hope that makes sense.

      Edit: I confirmed this by disabling the Trigger that is at END OF TURN. When disabled, the bug doesn't seem to happen, but there still might be a memory leak (see post below). I know it isn't an error in my logic. I put a dialog box in the Trigger to alert me when it is activated (how I debug javascript). It isn't officially called a second time.
       
        Last edited: Jun 28, 2020
      • RollingResonant

        RollingResonant Aquatic Astronaut

        I still think there could also be a memory leak, since it isn't possible to limit the number of units to TELEPORT. It tries to TELEPORT all units.

        Also, it would be nice if I could specify where in a LOCATION a unit could TELEPORT (or SPAWN) or if it could randomly pick a location, or if there was a counter to incriment the next tile it will use to TELEPORT the unit to. :)
         
        • RollingResonant

          RollingResonant Aquatic Astronaut

          UPDATE [on possibly a related issue - which is why I didn't create a new Ticket]:

          Bug Report
          Looping is occurring for Triggers with Properties setting REPEAT enabled. I have confirmed this and the bug is repeatable. For example, in this Trigger I have the Action to SUBTRACT from a COUNTER by 1.

          NOTE: it is possible to "break" the loop of a Trigger by using a FLAG so that the Conditions are not met, therefore preventing the Actions from being executed. I speculate that even by doing this, there is a bug that the Trigger is still being executed in the background [ex: the loop is still occurring, even if the Actions cannot execute due to the Conditions not being met]. Over time, this could cause unforeseen glitches, memory leaks, etc. I am concerned that this Trigger is getting layered every time it is executed - or, if that is not the case, I am also concerned that the loop is a constant for the Actions of the Trigger.

          The definition of the Actions panel in the Trigger Properties states that the "...following actions will be executed...in the sequence provided." It does not suggest a loop of the Trigger or Actions in the Trigger [whichever is happening].

          Image Reference
          - both with and without the FLAG

          [​IMG]

          [​IMG]
          • I have QA tested this and can get it to noticeably repeat. If further explanation is required to expedite fixing this bug, let me know.

          P.S. Also, I am noticing that Current Player does not work as stated in the Trigger Properties. I have to sometimes make 4 different Triggers if I want Triggers to apply to each of the players, since Current Player glitches and doesn't remember what Player is currently active. If you want help identifying this bug or others [in the code], I would be happy to assist. Please take notice I am doing efforts to provide feedback that can help, and not simply report a bug. If I'm unable to provide a solution [since I cannot see the source code], I will do my best to document it. Thank you, and I hope the week treats you well. :)
           

          Share This Page