Forum rules - please read before posting.

Quick question about NIntendo Switch controls port



    edited March 2021


  • Well, I spent 7 hours today after work trying to get this to work. Even tried the hotspot workaround, but sadly there was no way to engage the button animation with hotspots... So... I reverted and then tried recreate Unity Ui in Scene Menu linking to the button in the scene, but NOPE still unresponsive, despite it being set up exactly like other buttons that respond just fine. Still, only the system mouse get them to highlight and click, while the keyboard/controller cursor does nothing :(

  • Ugh. Well I need to go to bed for work again. Damn it. This hurdle is just such a demotivator.

    Once I resolve this, I need to ask about a weird sticking issue I'm seeing with the UI, where in game if I select a verb like LOOK with the controller and then scan around the button will highlight like it's doing direct control (it is not setup for direct control) to Take, Use etc, though this does not change the cursor from LOOK and LOOK is still applied to the area clicked. In an ideal world the button clicked would remain highlighted until used or deselected (canceled). That's how it works on PC with the Mouse. I do not understand why Keybaord/Controler is behaving differently.

    But that's after I can resolve this main menu issue that's resulting in me quickly going bald.

  • I'd zip this and stick it on my google drive with a private password-protected link to ChrisIceBox if he wanted to take a look at what the heck is going on here... Because I'm at a loss at this point :/ This isn't the most recent version of AC, but considering the things that broke last time I updated I'm scared to try, plus the version of Unity I'm on is approved for the Switch...

    Unity 2019.3.8f1 and AC 1.70.4

    If that is at all helpful.

  • Sticking with just the menu for the moment: what is the exact behaviour you have right now? In very basic terms - i.e. are you able to move the AC simulated cursor, does it highlight elements when over, etc?

    Unity UI does add another layer of complexity, so let's revert back to a regular AC menu and get that working first. Switch the Source back to Adventure Creator - what is the behaviour here? Let's see screens of how it appears in-game, it's properties in the Menu Manager, as well as the global settings at the top of the Menu Manager.

    I'd also appreciate some insight into what it is about input on Switch that has you relying on Rewired - is there an issue when manually defining AC's Inputs mapped to the Switch controller in Unity's Input Manager?

  • 1) AC simulated cursor, does it highlight elements when over, etc?

    Yes, the cursor moves, however only SOME things highlight. On the main menu screen the quit button highlights, it's an AC menu button.

    The New Game, Load, and Options do not highlight. These buttons are Unity UI buttons that trigger action scripts. In other scenes, I have my Verbs done with unity UI Buttons linked inside the Menu system and they also highlight.

    So, I thought by doing the same with these perhaps that would resolve the issue, it has not.

    2) Switch the Source back to Adventure Creator - what is the behavior here? Let's see screens of how it appears in-game, it's properties in the Menu Manager, as well as the global settings at the top of the Menu Manager.

    This will have to wait until I get off of work, it will take me a while. I'm just confused as to why the Unity UI stuff works everywhere else, but not the main menu, but yeah 1 one button that's AC does work. huh... Well, I'll get back to you on this one I get off in 4 hours.

    3) I'd also appreciate some insight into what it is about input on Switch that has you relying on Rewired - is there an issue when manually defining AC's Inputs mapped to the Switch controller in Unity's Input Manager?

    Honestly, I bought Rewired, because that is what Nintendo recommended when porting to their console, it's also what the other AC people on the forums and elsewhere claimed to use when they ported. Honestly, I was just trying to find the easiest way to do it, ReWired does make it easy to trigger force feedback, etc, and now that I understand my earlier mistakes I have the buttons responding and the cursor moving around just fine (seriously I should write a step by step guide to get to that point) and it's supposedly now "native" to the Switch, and now if I wanted to say put it on the Xbox it would be as easy as clicking the Xbox controller toggle in ReWired and copy and pasting a few values over (from my understanding). But the Switch is what everyone was asking for in 2019, hate to deliver it so late, but I'm not a strong programmer and am a PM at my day job. The reason I like AC so much was that it's extremely easy to use once you get your desired interface hooked up. I'm hoping I can get this nailed down so I can repeat the steps with the sequel project and the follow-up on both PC and Switch simultaneously. Since the Switch seriously was what EVERYONE was asking for. Especially those who don't play PC games and were new to adventure games.

  • I assume your MainMenu menu is set to only appear in a specific scene. What is the effect of opening it in a fresh AC scene?

    In this new scene, try also unchecking Enabled on start?, and instead create a new OnStart cutscene that uses an Engine: Wait Action to wait for a brief time, followed by a Menu: Change state Action to manually tun on MainMenu.

    The use of Unity UI should be a bigger factor than whether you rely on prefabs or in-scene canvases. When you can, it is important to check that the problematic menus work when set to AC - even if they'll rely on Unity UI in the end.

    It's also important to check if the Pause game when enabled? option has any effect. Does unchecking this in e.g. your Pause menu give any difference?

    As I said earlier, a crucial aspect of getting the simulated cursor to work with Unity UI is to rely on AC's own EventSystem, which carries AC's Optional Mouse Input Module component. This will not spawn if your scene already has an EventSystem - might this be the case?

    If not, select the EventSystem at runtime, and expand the bottom of its Inspector to get details of what UI element is currently selected. Does this reveal any key detail, e.g. elements being correctly/incorrectly selected?

  • So I rebuilt the main menu in AC, and it responds fine.

    Now the main menu scene can load and new game just fine. However, hitting options the Options menu it shows up, but the simulated cursor can't change anything, but the system cursor can. However, in the game itself, the same menu is called up through the pause menu and it works perfectly fine... In the main menu I can call up the pause menu and then call up options that way, but it has the same result as selecting options from the main menu.

    Sorry it's 1 am and I have to be at work tomorrow at 7 am, I've been working on this every day since the moment I get off of work. I really don't know why it's broken in this one scene. I need the game to not be paused while in options btw, because the audio levels are adjustable and it's how you can tell how loud the music is playing.

    Sorry, I'll try to answer more succinctly tomorrow, I'm just too exhausted and am no longer thinking clearly.

  • hitting options the Options menu it shows up, but the simulated cursor can't change anything, but the system cursor can.

    It does sound like an EventSystem issue, in that case. Testing in a fresh scene in the way I describe above would be the necessary next step.

  • Update. Man I worked 20 hours yesterday for my job, so it took me a while to get enough free time to work on this. But here I am, I rebuilt the Main Menu from a copied game scene, and it worked. I mean it took hours to get all the pieces added the action scripts, etc. But hey everything is working. So yaaaa! Now the main menu works and the game.

    Not the sticky button and saving are the issues that remain to be resolved. But the game now builds and deploys and is entirely playable all the way through on the Switch so that's a huge plus.

    What I call a "Sticky button issue" -
    This happens in the Verb menu and in the options menu (sorta).

    In the verb menu, I can click "look" and then proceed to move the cursor through the scene. Now the cursor remains the proper icon and when I click the verb the icon is on does execute properly, however moving left shifts the selected button to the left, moving right does the same, along with up and down. This does not affect the execution of the verb, but it does look very confusing on screen as I can easily have USE highlighted while I'm actually LOOKING. Very odd.

    The Option's menu of this is if I grab and drag the Music volume bar it works fine, but if I move the cursor away from that and do not click a 2nd time any movement left or right continues to move the bar and raise/lower the volume until I click a 2nd time or close the options menu. IE releasing the handle does not release my control of the volume, I'm guessing this might be some setting I've screwed up and will now dig into this further...

  • Well... The easiest solution seems to be to just check auto-select valid UI raycasts. It means that the buttons are no longer highlighted after clicking, which sucks, but at least the highlight isn't shifting around with the cursor movement and the cursor should remind the player what is currently selected. Wish this wasn't required, but I can't seem to figure out how to keep that button highlighted until used without it moving the highlight around in controller mode...

  • Woah... Not sure what happened, but now the game crashes as soon as I attempt to launch it on the Console. Um... Wow... This isn't good. :/

  • Ok restoring the previous version of that scene, the game works again. But of course, now Options has broken again (because this was the version where Start/Load worked, but Options didn't... I wonder what is causing the failure here with the rebuilt menu... It works fine on PC.

    I should note, Save and Load seems to be working just fine on the switch... That surprised me, I thought I'd have to do something to get it working... But I'm not going to complain :)

  • Oh great I brought back in the version with the working menu, just to compare the two and well now the working version behaves exactly like the broken version... So back to square one... Goodbye 3 hours of work building out the menu from scratch again... WHY DOES THIS KEEP BREAKING?! Ugh.

  • Ok restarting Unity has the old menu working again. However... Now I have to figure out why this version works on PC but not the Switch and why the old version works on both... There is nothing obvious that should break anything... I mean I could just keep both in the project and have MainMenu2 be the Main Menu, but that means going through every death sequence, etc and changing the scene load name... Ugh.

  • Oh jeeze... Ok so if I have that new scene in my project, the one I built from scratch that has all the menus working just fine on the PC. It will crash on the switch every time... Damn. I have no idea what to do now. So I can't make a new Menu scene apparently, as this has shown me it will cause some weird crashing issue. And I can't fix the old menu screen for some reason due to some bug that appears to be beyond my control... I think I'm screwed.

  • In the event of a crash, the first step should always be to check Unity's log files. If you can hook up the Profiler while running a build, that may also reveal potential causes.

    Are you still involving Rewired? Please see my questions and suggestions in my earlier posts, which are intended to help reveal the possible cause. If things appear to start/stop working based on restarting Unity, it may not even be an issue with AC - but the above will help to at least eliminate possibilities.

    Assuming you're making use of version control, see if you can compare the state of your project when things work vs when they don't.

    edited March 2021

    Ok... Well, I got it to work, using the most ridiculous method ever. Basically, put the Event system in a splash screen and not the main menu, and then everything works. It seems that having the Event Manager in the main menu scene was what was making it so the options menu wasn't responding to the emulated mouse... Glad this is over with.

    Now all that's left is to get the Nintendo version of Achievements working and it'll be ready to submit :)

    It's now 1:11am and I'm going to pass out (have to be at work today at 8am). Hope everyone had a great weekend.


    Now have played through the game multiple times, resolved few minor bugs. Everything seems to be working gameplay-wise.

    Game save is the one thing left to resolve. I assumed it was working earlier because I hit save, it made an entry I could go and do things, go to load from within the game or inside the main menu and it would take me to the saved spot and everything behaved as it should. However, if I close the app and relaunch, all the saved game data is gone. Like it's storing it in some kind of temp folder that deletes when the game exits. Going to have to read into this a bit.

    Had a hard work week (for instance yesterday I worked 11 hours in of the office, I wish I got paid overtime or at least was an FTE so not getting paid for my over 40 hours a week would come with health insurance or some kind of benefit :/ ), but anyway it's the weekend so I finally have a bit of time to look into this. Will keep you guys posted with what I find...

    If there is some kind of basic documentation on how to save works with AC and their system it would be a tremendous benefit to AC users in getting their games onto the switch platform since Adventure games seem rather popular there. If I find it violates the mind-numbingly stupid NDA (M$ nor $ony have this level of legal nonsense, they want people to actually tell each other how to get things working because they want actual content. And I'd know, I use to be part of the Xbox ID team and managed their launch calendar many years ago.) I'll post it up on Nintendo's private forums and link to it here, so those with a Nintendo Switch dev account can at least know where to find the post and share what little I can.

  • The details on how the Switch's save system works are indeed protected behind NDAs, but having a Nintendo developer account should give you access to documentation and examples related to it.

    Details on how AC's save system works can be found in the Manual's "Save system" chapters. In particular, see the "Custom save formats and handling" chapter, which covers how it's possible to customise the save system for unsupported platform.

    This aspect of customisation essentially covers two aspects:

    1) The format used to serialize data
    2) The method by which serialized data is recorded to disk

    It sounds like the default behaviour of 1) is working fine, since you're able to save/load files succesfully within the same launch. It sounds like you'll only need to focus on 2), which is a case of writing a new iSaveFileHandler implementation class.

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.