Forum rules - please read before posting.

"Pause game when enabled" does not pause game

Hi,

I've run into another issue (in 1.60 / 2017.2.3f1) where opening a menu does not change the game state to "paused", like it should. The main problem here is that it causes hotspot-icons, which are permanently displayed, to be displayed in front of other interface elements - which is a problem when you're trying to read journal entry.

This happened most of the time, but not all of the time. It's not a problem that happens in specific scenes or with specific menus. It actually only happened when starting the game from the main menu. I figured this out accidentaly because the issue wouldn't show up in the editor when I started a scene directly.

What I'm doing now is creating an autosave at the beginning of each scene and immediately loading it, before the game continues. It doubles all our loading times, but since we don't really know what's causing this problem and this appears to prevent this from happening, we have to stick with it for now.

Comments

  • edited August 2018
    Your symptoms don't match up with the title - is the game actually not pausing (i.e. character animations continue to play, the timescale is non-zero, etc), or is it just that hotspot icons are still showing?  Are they set to display in Screen or World Space?

    The current state of your game can be displayed in the Game window by enabling the AC Status box at the bottom of the Settings Manager (previously this was labelled "List active ActionLists".
  • "The current state of your game can be displayed in the Game window by enabling the AC Status box at the bottom of the Settings Manager (previously this was labelled "List active ActionLists"."

    That's exactly what I did because I couldn't think of anything else that was causing this problem and it turned out my guess was right. Whenever I opened a menu, the game state would not change to "paused". it's either that or something would cause it to change back to "normal" instantly (but only when the first scene of the game was the main menu). the hotspot icons still showing is just the symptom that made us notice (we have a seperate gui layer that catches clicks raycast outside of interface elements when menus are opened).

    Hotspot Icons are set to display in Screen Space, because in World Space they'd have different sizes depending on how close they are to the camera.
  • In that case, we'll first need to determine if this is an existing issue.  In a duplicate/backup project, upgrade to the current release and see if it persists.

    I'll also need to know more about this Menu.
  • I will, when I have time. We want to upgrade parts of this project to the current release anways, to see what still works for future projects, but it will be sometime next month.
  • The issue persists in the latest release.
  • edited September 2018
    Then again: please provide more detail about the Menu, including its properties and details about how/when exactly you're turning it on.

    The more information you can give to help me reproduce the issue, the more likely I can address it.
  • In addition: To determine what's going on with the game state, attach this to your PersistentEngine prefab:

    That will show a Console line whenever the GameState changes, as well as a stacktrace to reveal the cause.  What occurs at the time of the menu showing?
  • Thanks! I will give you an update in the next few days.
  • The script you've given me works, but whenever I turn on a menu nothing shows up in the console - even though I can see in the 'AC Status' box that the GameState pops to "Paused" for a splitsecond and right back to "Normal"...

    Funny enough, I solved it by playing around for a bit: all my ActionLists that open a menu had "Unfreeze 'pause' Menus?" checked. Unchecking this now pauses the game correctly.

    This doesn't really explain why this would only cause problems when loading a scene from the main menu, but not when loading the scene directly, tho.

    I made a short video (<4min) showcasing the issue (and fix?). This was done in AC 1.64.5 (that's why the layers are a bit messed up, nevermind that) and Unity 2018.2.9f1. https://drive.google.com/open?id=1JDG0iUEFGhYIKwjiX_xN1avTKIg8ptgB

    First part loads the first chapter regularly and you see the difference when "Unfreeze 'pause' Menus?" is checked and when it isn't.
    In the second run it shows how this checkbox is irrelevant when the scene is loaded a second time (via create+load autosave).
    The third time I start the scene directly from editor without loading it twice, which also doesn't cause the issue, regardless of the state the checkbox is in.

    The exact works of the main menu scenes aren't that complicated, it just resets a bunch of menus and creates profiles, eventuall switches to the first scene of chapter 1.

  • edited September 2018
    To be clear: unchecking the Unfreeze option resolves the issue completely?  Please post a screenshot showing the entire contents of the ActionList.
  • edited September 2018
    Yes, unchecking the Unfreeze option appears to resolve the issue completely. I will double-check if this is valid for the entire game, not just the first scene.

    Edit: There are other menus in the game that need to have the Unfreeze option checked in order to function properly (because they open other menus), some of them get stuck in GameState "Cutscene", but I can get around that by combining the necessary menus into one.

    No other ActionList is run when this one opens the Tasks menu.

  • The Menus that open/close as a result of it - Lessons, Map, Puzzle - what are their properties?  Do they pause the game / run ActionLists of their own?
  • edited September 2018
    These are other menus that will be added to the top bar later in the game, but they are still locked at this stage. Including Tasks they are all setup like this:
    "Pause game when enabled" is checked
    "Clickable in cutscenes?" is unchecked
    "Appear type:" is set to Manual.
    I'm also only using Unity-UI prefabs for all of them.

    Once these menus are unlocked, some of them do have a WhenTurnOn/Off ActionList (for resetting them to their default view; or triggering specific events, depending on variables that aren't set accordingly at this stage).

    I changed the ActionList to skip the "Run parallel" node and go directly to "Turn On/Off" the Tasks menu, but it has no effect on the issue.


  • So those Menu: Change state Actions have no effect?

    The only instance in which I can recreate this kind of issue is if you open a Menu in the scene's "OnStart" cutscene.  A fix is available in the beta test, if you'd like to try it.

    Otherwise, I'm going to need a project / unitypackage file (stripped of all but essential assets) that allows me to experience the issue for myself.
  • edited September 2018
    The menu is not opened from the OnStart cutscene.

    I've setup the bug for you in this package

    Replace the 3 managers I've included and add the 3 scenes to your build manager. Start from the 00_menu and click on the button that says 'Begin', it will take you to 01_scene where you click on 'TASKS' at the top of the screen to bring up the menu. GameState shouldn't pause and you should see the Hotspot icons in front of the menu.

    Sidenote: I'm using a cutscene named 'Awake' for both OnLoad & OnStart. At the end of this cutscene I call another cutscene named 'Start'.
    The reason I have to do this is because using a loading screen scene messes with OnStart and OnLoad in a way that confuses me and this is the solution I've found that allows me to control, without fail, what happens when.
  • Received, I'll let you know if I need more.
  • Recreated - this'll be fixed in v1.65.
  • Awesome! I wonder what the actual issue was :)
Sign In or Register to comment.

Howdy, Stranger!

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

Welcome to the official forum for Adventure Creator.