Forum rules - please read before posting.

Gameplay/camera problem in Linux builds only

Hi,

I'm getting an unusual issue in Linux builds of my game.

I was getting strange timing problems during cutscenes and after a bit of digging, it appears like the game acts as if "wait until finish" is ticked on all camera transitions and fades.

As an example, I have a cutscene where I want the camera to push in slightly throughout the whole scene, so at the start, I have a camera switch action, which does a linear move over 60 seconds. Wait until finish is unticked, so it starts moving the camera, then immediately goes to the next node, which plays some dialogue. On Windows builds, this works fine, but on Linux builds, the dialogue doesn't play until the 60 second camera switch has completed.

Worth noting that the game also runs correctly on Xbox and Switch, so it's really strange that I'm just seeing a problem on Linux.

I realise this is a bit vague, so I'm really just asking to see if anybody else has ever seen anything similar.

My next step is to install the Unity editor in a Linux VM and see what happens if I run in editor on Linux.

Using Unity 2020.3 and AC 1.73.7. I realise this is a bit old, but I'm fairly locked down at this point, as the game is just a few weeks away from release, and has already passed cert on consoles.

Thanks,

Charlotte

Comments

  • Welcome to the community, @CaveMonsters.

    It should be possible to update the "Camera: Switch" Action - without importing the rest of AC - to the latest version. Even if you end up reverting back, it'll be important to know if this issue persists by doing so.

    If you import the latest AC release into a fresh project, try copying over the Action file into your project - /AdventureCreator/Scripts/Action/ActionCamera.cs. Does that continue to show the issue?

  • Thanks for your help. That doesn't fix it, unfortunately.

    I've done some more testing, and the results are a bit weird. I installed an Ubuntu machine with Linux version of Unity to see if I could trap it happening in the editor, but it worked fine in the Linux version of the Unity Editor. So I made a build from there, and that worked fine on the Ubuntu machine. Copied this working build over to my other Linux machine (a Steam Deck) and still get the same issue.

    So, basically, the game breaks on Steam Deck's Linux, but runs fine in Ubuntu.

    I've also tried moving up to the next Unity LTS version, which broke a load of things, but also doesn't fix this particular issue.

    So I think my solution at this point is to tell Valve to serve the Windows build to Steam Decks (as that works fine under Proton), as every other Linux machine I've tried it on it works fine.

    It's a really strange bug though. If I get time, I'll try and remote debug a development build on Steam Deck, and see if I can figure it out.

  • edited July 2022

    Strange indeed, and it makes it difficult to pinpoint the source of the issue. Though you've only encountered it under certain platform conditions, I don't want to rule out this being an AC issue too quickly.

    As a further test, try opening your copy of ActionCamera.cs, and replace the line:

    if (showWaitOption)
    

    with:

    if (!showWaitOption) willWait = false; else
    

    Does that make any difference?

  • Thanks. Still not fixed it, unfortunately.

    Digging in more, it seems like a more general problem with actions keeping on running, rather than specifically just the camera. I've made a build with the AC Status box turned on, and I seem to get action lists being stuck running, whereas they aren't on other platforms. I'm struggling a bit to debug it, but it looks like at least some actions aren't setting isRunning false so the action lists they're in keep running them. I can't quite figure out why, though.

    For example, I have an action list that runs when I click a UI button, which just contains a variable set action, followed by an action list run action (with wait until finished unchecked). This action list stays in the "running actions" debug output on the Linux build, but not on other platforms.

    The ActionLists running debug output ends up with lots more in it on the Linux system than on other systems as old lists that should have finished are kept around. It's all a bit odd though.

    I'll keep looking into it.

  • Well, I've figured out why it's happening, and it's not Adventure Creator.

    Basically, running the Linux build on Steam Deck, Mathf.Approximately isn't working. So, this code will produce debug output, which it obviously shouldn't.

    float testFloat = 0f;
    if (!Mathf.Approximately(testFloat, 0f))
    {
        Debug.LogFormat(LogType.Error, LogOption.NoStacktrace, null, "0 is not approximately 0!");
    }
    

    So, in RunAction, this was causing the test for waitTime being 0 to fail, which meant the actions kept running. If I replace

    if (!Mathf.Approximately (waitTime, 0f))
    

    with

    if (!(Mathf.Abs(waitTime) < 0.0001f))
    

    The problems go away. Though, clearly, this isn't an ideal fix, as Approximately is used in quite a few places in AC.

    I think I need to get Unity support to look at this one.

  • I appreciate your efforts in getting to the bottom of this!

    This may well be a Unity issue, in that case. Approximately is essentially the same as your "Abs<" check, only comparing the value of Epsilom instead.

    The use of Approximately is recommended by Unity over direct float comparisons, but if you get some official advice from Unity support about a possible amendment, by all means share and I'll consider it.

  • So, just to update on the off-chance anybody else gets the same thing, I fixed this eventually. Turns out the problem was caused by the FMOD audio engine. I assume it's messing up some floating point mode when the library is initialised, but in a totally blank project built for Linux, Mathf.Approximately worked, then if I imported the FMOD package, it broke.

    Anyway, upgrading to a newer version of FMOD has fixed both the maths stuff and the hang on exit.

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.