GlowPuff / ImperialCommander2

A companion app for the Imperial Assault board game.
MIT License
88 stars 12 forks source link

4:3 not possible native or remote, Splashtop or steamlink tested #42

Closed vida2001 closed 1 year ago

vida2001 commented 1 year ago

Hello there,

first, thanks for this great app!

Is there a way to force 4:3 resolution for iPads/tablets? e.g. 1980x1440 would work fine. Whatever I do, setting the resolution in windows, or trying to force it with steam, it is always 16:9, both one the same computer running the app, and on the iPad remotely.

I am using currently Splashtop, but have tried different other options, including directly on the windows desktop "server" running the app.

GlowPuff commented 1 year ago

I've been looking into this and finding a lot of developers asking about it over the years, and no clear cut solution. The oddball solutions that might work... I'd rather not implement. It's a shame, because I actually designed the app to work natively at 4:3 if need be. Since we don't have a native iPad build, that 4:3 support will only kick in on Android tablets with that aspect ratio.

On top of that, Unity has no way of easily forcing an aspect ratio. They removed the Display Resolution chooser a few years ago that would have made this easy. 🤷🏻‍♂️ I'll keep an eye out for sensible solutions.

GlowPuff commented 1 year ago

Just found this, is it relevant? This person is using Moonlight to stream games to iPad. https://www.reddit.com/r/cloudygamer/comments/y4bjj9/reminder_for_anyone_playing_on_an_ipad_try_using/

By default, Imperial Commander will pick up the native resolution and ratio of the host system. This person puts their PC into a 4:3 resolution and sets up a custom resolution to use in Moonlight.

GlowPuff commented 1 year ago

One more thing I just found - Unity takes command line arguments to override the screen size:

Imperial Commander2.exe -screen-height 1440 -screen-width 1980

And maybe add "-window-mode exclusive" to force it full screen.

Put your PC into that resolution first, then try running it with those arguments, otherwise it'll just pop into windowed mode in 4:3, but then revert to 16:9. I haven't actually tried this, but it's worth a shot.

vida2001 commented 1 year ago

"Imperial Commander2.exe" -screen-height 1440 -screen-width 1980 -window-mode exclusive Did not work. Looks like it should but does not ;-) Windows is set to this res.

Does it work on Android 100% ? Are there any disadvantages of the Android app, any known bugs? I might buy a cheap/very old Android Tablet just for this, but I must be sure it works 100%. Would also get rid of having to power on the server etc. I will certainly not buy a "surface"....

vida2001 commented 1 year ago

Moonlight does not work either...it is like the app/unity just cannot run 4:3, at least this is how it feels. Anything I set, which works for a ton of other apps/games, does not work here...

If anyone found a solution using any streaming tool, please let me know. I am running Windows 10 latest on the server, and IpadOS, latest.

vida2001 commented 1 year ago

strangely, ultra wide, 3440x1440 works on MacOS. I have to try 4:3, but theoretically could work. Maybe it is something I am missing on Windows, and the issues is before the screen ;-) ? Any step-by-step instructions you could share? I have zero Windows skills besides installing steam & Nvidia drivers ;-) , always used Linux/MacOS for 20> years...

vida2001 commented 1 year ago

on MacOS, the app works in any resolution. However, my Air has not enough CPU/GPU computing power to run Unity/app smooth AND stream...so again no workaround ;-) But if it is possible to have the app run in any res on Mac, it should be possible on Windows? Anyone had more success on this?

GlowPuff commented 1 year ago

Yes, it really should run in any resolution while full screen in Windows, or anywhere for that matter. In windowed mode it's locked to 16:9, even when resizing the window. This is by design because of requests from other people who require that feature. But this ratio lock while windowed only does this when it's run on Windows, and only while running in a window (not full screen).

On the command line I mentioned, did you get a message saying "...is not recognized as an internal or external command, operable program or batch file." ? Be sure to run that command in the folder where the app is, otherwise the OS will not find it. So navigate to the folder where the EXE is, open a command prompt at this location, then paste the command line.

My only Android tablet is 16:9, and my phone is a weird ultra-wide 18:9 or something, so I'm not 100% sure the app will run 4:3 on Android. But it ran at the weird 18:9 perfectly sized to it. So, it SHOULD run at 4:3 on Android, also. Unity picks up the native resolution of the host device it's run on, as you've seen while running it on a Mac. So the problem here is getting it to do that under Windows, it seems.

But as for running "well" on Android 100%, the answer is yes, with no caveats or downsides. I've run it on my very, very old 16:9 Android tablet and on my 3 or 4 year old Note 9 phone with the weird 18:9 screen ratio. The phone ran it flawlessly, but I think the ancient tablet stuttered just a bit, I don't remember now for sure. But it is ancient, after all. 😁

If I come across anything else, I'll let you know.

vida2001 commented 1 year ago

in windows, I actually put it in the desktop link, but on terminal, I get the "...is not recognized as an internal or external command, operable program or batch file." whatever I do. Google says:

https://stackoverflow.com/questions/48321639/error-is-not-recognized-as-an-internal-or-external-command-operable-program-o

Do I really have to do this? At the path to sys env variables? Sounds wierd, but again I have zero clue on how Windows works.

GlowPuff commented 1 year ago

No need for environment variables, that's only for when you want to call the EXE from any location other than where the EXE actually is. Just make sure the terminal path is pointing to where the EXE is located. The fastest way to do this is to open the terminal right from within the destination folder.

  1. Open the actual folder where the EXE is
  2. Click in the folder path area and type "cmd": image
  3. Hit Enter to open a terminal that automatically gets its path set to this folder
  4. Now paste the command line: "Imperial Commander2.exe" -screen-height 1440 -screen-width 1980 -window-mode exclusive
  5. The quotes around the EXE name are necessary because there is a space in the name
  6. Since the terminal path is now pointing to the required folder, the EXE will be found
vida2001 commented 1 year ago

no error this time, but as always 16:9 :-(

We can live with it, but a shame to loose so much screen space on the tablet...and it just does not looks as cool ;-)

You said: "In windowed mode it's locked to 16:9, even when resizing the window." Why would someone want to have that? Could you compile a version without that "lock", maybe it is the issue?

On MacOS the app adjusts perfectly to any resolution...

GlowPuff commented 1 year ago

It was a requested feature - lots of people playing on laptops. I even know a few who run it from a laptop connected to a big TV.

vida2001 commented 1 year ago

yes, it think it is the "lock", try e.g. window-mode borderless, or 800x600, no effect. but it gets blurry/pixelated. according to https://docs.unity3d.com/Manual/PlayerCommandLineArguments.html it should work, but it does not...

vida2001 commented 1 year ago

It was a requested feature - lots of people playing on laptops. I even know a few who run it from a laptop connected to a big TV.

ok, but how does it impact those people using TV or Laptop if the app automagically adjusts to ANY resolution? It would work fine with any res, any format.,

GlowPuff commented 1 year ago

It was so long ago, I don't even remember why it was requested. I had to add a hook into the Windows API to grab the resize event, do some math, and manually change the window size accordingly.

I haven't needed to look at the code for this feature since I wrote it, but I just took a look. The 16:9 ratio is indeed enforced by my code in Full screen mode, as well as windowed mode, so this probably is the reason. What I'm going to do is make this an option or remove it entirely if it's no longer needed by players. 👍🏻

vida2001 commented 1 year ago

Cool, so another great feature for this app :-D

GlowPuff commented 1 year ago

Aspect ratio lock is now removed on Windows.