Nintendo Switch support?


#1

Hi,

Does the pathfinding package support nintendo switch? It seems not to work for our project, but it could be another factor as well - there appears to be a similar question from earlier. Is there a new version that would work better w/ the switch?

Thanks!


#2

Update - disabled the RVO stuff and can confirm that it was preventing the game from working. We’re using an earlier beta that had 2D RVO functionality.


#3

Hi

Ok. Do you happen to have any error messages from that build that could help me debug why it is not working?


#4

Unfortunately, I don’t.


#5

I can verify that it’s hanging on the Switch as well. I’m still trying to figure out how to debug on this hardware so I can’t share any more details yet. I had been running a pretty old version of a*, and just upgraded to the latest with the same issue.


#6

Ok @Noogy.
I don’t have a switch myself so it is hard for me to debug it. Any details you can share will be helpful.
Try to disable multithreading. That is the most common thing that fails on new platforms.


#7

Disable multithreading… as in under the Astar Path ‘Settings’ tab? I currently have the Thread Count set to ‘None’, “Using a single coroutine (no threads)”

So I don’t think that’s it. I’ll try to narrow it down, but it’s a bit tedious as I’m not receiving any debug feedback from the device. It literally just hangs somewhere, but everything else (such as audio) continues to run fine.


#8

Which graph type are you using?

but everything else (such as audio) continues to run fine.

Audio in particular is usually run by another thread or possibly even another process, so it often continues to run even when the main application is completely frozen.


#9

I’m using grid graphs exclusively. Tonight I’ll try to step through things and be more specific as to where it’s hanging. I know I’ve never had issues before on PC and iOS, so it’s definitely Switch specific.


#10

It’s a long shot, but maybe it is related to this bug?


Simple check is to change the Grid Graph Settings -> Collision Testing -> Mode -> Sphere instead of Capsule.


#11

Ok so far…

I am actually already using Spheres for collision testing.
I wish I could step through the code but right now my best bet is just process of elimination.

I’m adding AstarPath and creating the graphs completely via script. I’ve found that it halts when i first add an AstarPath component. This is BEFORE I actually add, scan, or access any graphs.

        gameObject.AddComponent<AstarPath>();

I suspect it must be somewhere in your Awake? I’ll try to work through it, it’s just slow since it takes several minutes to redeploy each time.


#12

A bit more testing:

Everything up to the following works fine in the AstarPath.Awake(), at which point it’ll crash:

    if (scanOnStartup && (!data.cacheStartup || data.file_cachedStartup == null)) {
		Scan();

I’m currently commenting out the entire AstarPath.Update() method as that’s causing issues.

Edit: this is the only offending method in Update(), going to delve deeper:

    pathReturnQueue.ReturnPaths(true);

Double Edit: crashing in the following method in ReturnPaths:

	Path p = pathReturnStack.PopAll();

Ah, ok, got one step closer. At least it’s not crashing now… simply added ’ || UNITY_SWITCH’ in a few #if spots in the LockFreeStack.cs. New issues arose but I’m looking into it.


#13

Nice work debugging this so far.
Any news about those later issues?


#14

Update, so yeah I think all is solved. Some of the other issues were just me adding a ton of debug code trying to figure out the issue, which really was just as simple as adding the || UNITY_SWITCH in the right places. I wish I had saved quite a few hours checking the usings in the first place! Anyway, I can confirm your asset is running fine on Switch :slight_smile:


#15

Nice!
I included the fix you mentioned earlier in beta 4.1.5.


#16

Thanks all! Will this fix also apply to the 2D RVO code, and is that functionality in the new beta? When is this new beta out, as well?


#17

I cannot say if RVO works on Nintendo Switch since I haven’t had the means to debug it. 2D RVO is included in that beta however. 2D RVO has been included in all releases since 4.0.
You can download the beta here: https://www.arongranberg.com/astar/download


#19

Hi @aron_granberg it’s been 12 months since this thread was created, just wondering if Switch is officially supported now?

Thanks


#20

Hi @arvz

I do unfortunately not have a Switch of my own to test it with, so it is very hard for me to say. I will try to fix any bugs that are reported but I cannot guarantee that it will work out of the box. I haven’t had any users report that something on the Switch is not working in a very long time though, so I think it should be fine.