Forum rules - please read before posting.

Strange behaviour on screen ratios other than 16:9

Hi, I recently realised that I'm getting strange behaviour on screen ratios like 5:4, 4:3 or 3:2.

It seems that the taller the screen, the less responsive hotspots and navmeshes are, but it all works fine if the game resolution is wider than original.

Hotspots:
They appear to be "squished". The taller the screen, the less area I get to hover over the hotspot, eventually becoming not responsive at all at 5:4 ratio. While in play mode, all hotspots look just fine (Scene view), but when actually playing the game (Game view), the area gets smaller and it gets worse as you make the screen taller.

Navmesh:
Same behaviour. Clicking on the ground doesn't get picked up and as I try taller ratios, the less interactive the ground gets.

Cursor:
I also realised that the cursor graphic gets super stretched when trying more ultrawide resolutions and it can also get very tiny when trying some taller ratios. Maybe it's connected to other issues?

The game is designed with 16:9 ratio in mind, and the original resolution for everything is 640x360. In Unity settings I have only 16:9 checked as a supported ratio (but also tested with all other ratios checked, but no improvements).

I'm currently implementing some further support for other ratios (planning to simply add letter-boxing for other screen resolutions, but the game itself is meant to stick to 16:9), but this is something I can't figure out. Any ideas why this could be happening?

Unity version: 2018.2.18f1
AC version: 1.68.4

Comments

  • edited March 2020

    Aside the cursor's size, is it correctly positioned? What platform are you building to, and what is your "Input method" set to?

    I'll need some some screenshots to explain the issue. Please use a red rectangle to show where the invisible boundary of interactivity / non-interactivity lies.

    Are you enforcing an aspect ratio in the Settings Manager? Auto-letterboxing should occur for non-16:9 ratios if this is set to 1.778.

    AC's aspect ratio code was re-written in v1.70. Even if it's only in a test/duplicate project, try the latest release to see if this is a current issue.

  • I'm building to PC and input method is set to "Mouse and Keyboard". The cursors is correctly positioned, the graphic just changes size.

    Here's what happens with the hotspots and walkable area:
    https://imgur.com/a/5GGFyIa

    I've only highlighted some of the hotspots, to demonstrate what happens (but this is true for all other hotspots in the scene and all characters, other scenes behave the same).

    Green is the interactive area, and red represents the parts that aren't working. While doing this, I realised that there's this clear line that just keeps covering everything, that spans across all hotspots. When in Play mode, I dragged one of the characters above that line, and back in Game view he works fine. I thought maybe it's one of my GUI's not scaling properly, and blocking the interactions, but after turning off all GUI's in Hierarchy, while in playmode, this still persists.

    Are you enforcing an aspect ratio in the Settings Manager? Auto-letterboxing should occur for non-16:9 ratios if this is set to 1.778.

    I wasn't aware of this feature and tried using some external plug ins. Now that I'm aware, I removed the plug in, and used the AC enforced ratio and set it to 1.778 but I get the same behaviour.

    Lastly, I have tried updating AC on a copy of my project, but it just results in a lot of errors with my code. I would really try and avoid updating AC as we launched the game two weeks ago and it's going to be problematic to test it all again and make sure it's all working! I also tried importing only the SettingsManger.cs, as I can see that's where the forced ratio code is placed, but that also throws me a lot of errors.

    However, I tried setting up a new quick project, with similar set up to mine (small camera size set up for pixel art setting, forced ratio etc.) and it seems like it's all working like it should with the latest AC.

    I understand that ideally I would just update AC, but I really hope there's some kind of workaround I could do to get it fixed D:

  • edited March 2020

    I can't suggest too much until we learn exactly what the issue is. The aspect-ratio feature isn't new to the latest release - it'll still be in v1.68.4.

    If you want to share the errors you do get upon updating, I can try to work through them with you.

    Going by the screenshots, it does indeed look like some kind of UI issue - whereby raycasting to the scene is being blocked by a UI element. Are you using Unity UI for your AC menus, and/or UI Canvases that aren't linked to AC?

    If you view the EventSystem's Inspector at runtime, it should report the currently-active UI element - see if this is empty (as it should be) when hovering the mouse over a problematic area.

    If it's not a UI issue, I'd still guess that it is at least a raycasting one. Instead of dragging a character above the line, what is the effect of dragging the active GameCamera?

  • I am sorry, once again, this is just something on my end! D:

    Basically what happened: one of my GUI's has a RectTransorm Boundary. I realised that it is set to be scaling with screen size, so as the screen got taller, the boundary scaled up and covered the hotspots in the scene!

    I thought earlier that one of the GUI might be covering the screen, but while in play mode, I turned all the GUI's off through the inspector. All my GUI's are connected to AC, and when turning them off, I guess it didn't really turn them off? Basically, all the graphics for the GUI would disappear, so I assumed they're off, but the RectTRansform Boundary must still have been active from the AC. When I deleted the GUI altogether in the Hierarchy when in play mode, then it finally worked - and that's how realised what was the issue.

    (Note: when clicking on assets in Scene view, Unity always selects the top active gameobject first, but somehow it never picked up the boundary, so I couldn't determine the problem straight away).

    Anyway, it's all fixed now! Thanks to your hints and suggestions I was able to further investigate and was able to find the problem, so thank you very much for your help and time!
    (And I also learned about the forced aspect ratio in AC, which is fantastic!)

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.