Turning your iPhone or Android into a gaming console.
Requirements:
- An iOS or Android device.
- A Windows 7 or later PC.
- Nvidia GTX 600-series GPU or later (AMD GPUs won’t work).
- Moonlight app for iOS/Android and PC.
- Playnite video game library manager for PC.
Why game on your phone?
With the pandemic and staying at home going on now, our hobbies are limited. As someone who loves video games, I enjoy gaming during my free time. It’s great how the Nintendo Switch exists as a great portable gaming device. The ability to pick up instantly and game when taking breaks at your desk is very convenient, and it is easier to time manage compared to going over to your video game console lying in your living room.
However, there is an issue with my current setup for portable gaming. The Nintendo Switch’s game library is fairly limited compared to the library of PC games. It’s possible to just run a game on your desktop, but that defeats the whole purpose of the fast, grab and go type of gaming during breaks. You get immersed too much when gaming on your desktop and could be easy to lose track of time. This is where Moonlight comes into play.
What is Moonlight?
Moonlight is a client that implements Nvidia’s GameStream to stream your games and apps on your PC to other devices. In this case, it’s possible to stream PC games to your phone for the ultimate portability experience.
Setup
1. Download Moonlight from the App Store or Google Play Store.
2. Download the latest version of Moonlight for your PC here.
3. Make sure your PC has Nvidia’s GeForce Experience software installed and update to the latest drivers.
4. In GeForce Experience, go to Settings -> Shield, and turn on GameStream.
5. Have your phone be on the same network as your PC and within the Moonlight app, connect to your PC by selecting it. (If you don’t find it in the list of “Select Host” you may have to add it manually by typing the IP Address of your PC)
6. Enter the PIN shown on your phone on the GeForce Experience pairing prompt on your PC.
7. Done! Your phone is now correctly connected to your PC and can play any games added to your Nvidia GameStream library.
Further Issues
I’ve had few issues when playing games on my phone this way. The games don’t run on the same resolution as your phone, so there will be black borders on the side which can be distracting. The mouse cursor is always centered, so before starting a game, you’ll need to manually move it to the side. Also, if you want to switch games, you’ll have to end the stream connection to your PC on your phone’s Moonlight app and then choose a new game, prompting a reconnection.
Solution
Since Nvidia GameStream can only add individual programs to run, why not run a program that acts as a video game library? This way when you quit a game on your phone, you’ll be taken back to the video game library instead of ending the stream connection to your PC.
I found a program that does exactly that called Playnite, and it has a full screen UI with controller support that can act as a hub for your games. You can easily set up Playnite to sync all games from your Steam, Epic Games, Battle.net, etc. game libraries as well as adding them manually.
However, adding Playnite to Nvidia GameStream doesn’t solve all our issues. A solution to run it on a custom resolution for running fullscreen on your phone is required. Since GameStream can stream and run batch scripts, we’ll need to write a batch and VBScript for this.
Scripting
NOTE: Multiple batch scripts and VBScripts will be needed. Currently this is the best way that I’ve come up with that can keep the Playnite and game window in focus instead of the command prompt when streaming on my phone.
To get this working, we’ll need to write two VBScripts and one batch. The VBScript will launch Playnite and hide the mouse cursor, while the batch changes the resolution and runs the VBScripts. Open your favorite text editor and start writing.
- VBScript for hiding the mouse cursor (I called mine HideCursor.vbs)
set WshShell = WScript.CreateObject("WScript.Shell")WshShell.Run"RunDll32.exe user32.dll,SetCursorPos 999,999"
2. VBScript for launching Playnite (I called mine Launch.vbs)
set Playnite = createobject("WScript.Shell")
Playnite.run("""C:\Users\<USERNAME>\AppData\Local\Playnite\Playnite.FullscreenApp.exe"""), 1, true
3. Batch for GameStream
@ECHO OFFstart /min QRes.exe /x:2532 /y:1170 /r:144
REM This is the resolution for iPhone 12, the 'r' parameter is the refresh ratestart /min cmd /c "HideCursor.vbs"start /min cmd /c "Launch.vbs"start /wait QRes.exe /x:2560 /y:1440 /r:144
REM Set resolution back to your display's default resolution when quitting Playnite
Finally, simply add the batch file to GameStream and run it on your phone via Moonlight!
Of course, you could always enhance the experience with an iOS or Android compatible controller that physically connects to your phone.