Jump to content

Guide:Naninovel Visual Novels on Steam

From VNDev Wiki


This guide is based off of the guide on uploading Ren'py games to Steam. Naninovel is made in Unity, so it requires slightly different prepwork than Ren'Py.

The differences between Ren'Py and Steam uploading are the following:

  1. Discrete Windows, Linux, and Mac builds and depots
  2. Steam Cloud Saves
  3. Achivements in Naninovel

Depot Builds & App Launcher Setup

Here's how to set up the depot builds and the app launcher settings. We'll be using Possessed By Fate as an example. It was built on Naninovel 1.21 and Unity 6.3 LTS. We are releasing on Windows, Mac, and Linux.

Modern Unity versions only support 64-bit OSes, so we chose "Windows, 64 bit only", and "Linux + SteamOS" and then "MacOS" as our platforms.


Under "installation" is where you set your launch options. Here are how ours are configured.


Our game and our executable is named "Possessed By Fate". The executable path for Windows is set to Possessed By Fate.exe and the launch type is set to Launch (Default). The OS is set to Windows, and the CPU is set to 64-bit only.

It's the same for Linux + SteamOS, but the executable is named PossessedByFate.x86_64.

For MacOS, you want to tick the boxes that say 64 Bit (Intel) Binaries are included as well as the one that says Apple Silicon Binaries are included. The app bundles are not notarized, and this is OK! Mac users will still be able to enjoy your game as long as they launch from Steam.

You do not need to choose any common redistributables, generally, unless you are using an older version of Unity. Unity 6+ should include everything. This is under Installation > Redistrubutables. Click "Check this box if no redistributables are needed".

TIP: When you export the game in Unity for Linux, you must name it the same as what you set it in your launcher here! If I named my game in the Unity export as "Possessed-By-Fate.exe", it would not run! Be mindful of your build names!


You can see when I export it, I get the option to choose the executable name, but this only happens on Linux export. It's important to choose the same name every time you build the project!


I deleted the default depot and created two named ones: A "WindowsDepot" and a "LinuxDepot", just so I know which is which. I set both to 64-bit architecture, and I set both to be referenced in the main depot as well as the developer depot. This is needed if you delete the main depot, but I believe it's just good to know where everything is. This is located on the main app admin page and then you click on your game name (for me, it's Possessed By Fate - 1858159).


Additionally, you will have to make sure these depots are referenced in the developer depot, which is at All Associated Packages, DLC, Demos And Tools. on the app page.




Each of these "CD key packages" all need to reference your each of your Linux + Windows depots, or else you won't be able to test properly! They are called "CD Key" because Steam is old and weird and Steam.


Steam Cloud Saves

Steam Cloud saves are not required, but it is reccomended for the best experience. Here's the exact settings you need to use to configure Cloud Saves with Naninovel/Unity:


I set my Steam Cloud quota to 512000000 (512 megabytes max), and 10,000 files max.

Also—be sure to untick this box for Beta Testing, or else Steam review may reject your game!


Here is how I configured Steam Cloud itself.


The game is made by the studio "Sapphicore" (set in Unity player settings), so the game itself stores saves files at C:\Users\Jordan\AppData\locallow\Sapphicore\Possessed By Fate\Saves. The path it's using is C:\Users\WindowsUsernameHere\AppData\locallow\DefaultCompany\GameName\Saves or %USERPROFILE%/AppData/LocalLow/Sapphicore/Possessed By Fate/Saves. I set "*.nson" as the pattern and the OS restriction to "Cross-Platform".

Then, I set the root overrides for MacOS and Linux + SteamOS. I also ticked "Replace Path". Be mindful of the "original root" field, that should be set to "WinAppDataLocalLow".

macOS path: unity.Sapphicore.Possessed By Fate

Linux path: /config/unity3d/Sapphicore/Possessed By Fate/Saves

Be sure to test Cloud Sync and enable it under Store Admin > Supported features! Show off your Steam Cloud support!


Setting up Achievements

Achivements may sound intimidating to set up in Unity, but they're pretty straightforward with Naninovel.

You call the associated Steamworks API. To expose this to NaniScripts, use a custom command: https://naninovel.com/guide/custom-commands#adding-custom-command, but we're going to override the @unlock command.

The Unity Github link is here. You need to add this package to your project in the same way that the Naninovel Github extension is added. If you encounter an error adding a Unity package from Github, install Git and reboot your system.


I set a "Dummy" file in my Unity start scene has the SteamManager script attached to it. There is, additionally, a "SteamUnlock.cs" file with the following code that creates an @unlock command.


Here is the code to create the "unlock" command:

using System;
using Naninovel;
using Steamworks;
using UnityEngine;

[Serializable, Alias("unlock")]
public class SteamUnlock : Naninovel.Commands.Unlock
{
    public override async Awaitable Execute (ExecutionContext ctx)
    {
        await base.Execute(ctx);

        if (SteamManager.Initialized && SteamUserStats.SetAchievement(Id))
            SteamUserStats.StoreStats();
    }
}

[Serializable, Alias("lock")]
public class SteamLock : Naninovel.Commands.Lock
{
    public override async Awaitable Execute (ExecutionContext ctx)
    {
        await base.Execute(ctx);

        if (SteamManager.Initialized && SteamUserStats.ClearAchievement(Id))
            SteamUserStats.StoreStats();
    }
}


Here are Possessed By Fate's achievements.



The code to trigger the achievements looks like this:

Aurora: Ah! A ghost!
@unlock ACH2_NICOLE_LOOMS

I call @unlock and then the name of the achievement, and that's it. Just be sure to be running the game through Steam and Steamworks when testing it or else it will not unlock.

I do not know how to clear achievements for testing.