Triforce v0.7.0 "Sage Of Courage"

The 0.6 crashes after warps and area changes fixed (no write-back into memory the capture leaves out), invisible objects fixed (occlusion gate), DLSS frame generation flicker fixed, achievements, the renderer built with a play profile, faster translated game code, helper threads judged on settled scenes, memory, shader preparation, audio effects, launcher, controls and Linux fixes.
This commit is contained in:
ruckus7382sfgsgdf
2026-11-22 11:59:06 -06:00
parent 70c210cee1
commit e6f2f248f2
529 changed files with 55958 additions and 1898 deletions

View File

@@ -176,7 +176,7 @@ public sealed partial class Backend
/// <summary>The menu's own words for the values the benchmark touches (Triforce.Logic.GameOptionsSchema).</summary>
static string BenchLabel(string key, int v, IReadOnlyList<SettingChange> all, bool after = false)
{
if (GameOptionsSchema.ByKey(key) is not { } row) return v.ToString();
if (GameOptionsSchema.ByKey(key) is not { } row) return GameOptionsSchema.Part(key)?.Label(v) ?? v.ToString(); // ((Triforce, options_version 8) a merged row's part: Steady frame rate, Frame generation)
if (key == Benchmark.KResolution)
{
// (its label follows the Upscaler: "Quality (67%)" with DLSS / FSR, "67%" without)

View File

@@ -328,15 +328,21 @@ public sealed partial class Backend
r.Line += l => { lock (logOut) logOut.AppendLine(l); };
var last = DateTime.MinValue;
var eb = req.IsUpdate ? (release != null && workKind == "update" ? "Updating to " + release.Tag : "Building your game again") : "Building your game";
// (the lines come on two threads, the tick on a third: one at a time)
var pushGate = new object();
var ticking = true;
void Push(bool force = false)
{
if (!force && (DateTime.UtcNow - last).TotalMilliseconds < 250) return;
last = DateTime.UtcNow;
var e = r.Estimate ?? est;
var left = BuildClock.Remaining(e, r.Tracker);
WorkScreen(eb, BuildClock.LeftText(left), 0.08 + 0.92 * Fraction(e, r.Tracker), Steps(null, (e, r.Tracker)),
"Keep this window open; you can minimize it. You get a notice when the game is ready.", true,
req.IsUpdate ? null : new[] { ("Your game", "done"), ("Build", "now"), ("Play", "") });
lock (pushGate)
{
if (!force && (DateTime.UtcNow - last).TotalMilliseconds < 250) return;
last = DateTime.UtcNow;
var e = r.Estimate ?? est;
var left = BuildClock.Remaining(e, r.Tracker);
WorkScreen(eb, BuildClock.LeftText(left), 0.08 + 0.92 * Fraction(e, r.Tracker), Steps(null, (e, r.Tracker)),
"Keep this window open; you can minimize it. You get a notice when the game is ready.", true,
req.IsUpdate ? null : new[] { ("Your game", "done"), ("Build", "now"), ("Play", "") });
}
}
r.Event += _ => Push();
r.StageChanged += (_, _) => Push(true);
@@ -344,7 +350,15 @@ public sealed partial class Backend
Go("work");
using var reg = token.Register(() => r.Stop());
lastFailure = null;
var res = lastResult = await r.RunAsync(req, token);
// (a step can take minutes with no line: the time left counts down, or holds, every second all the same)
var tick = new Timer(_ => { lock (pushGate) if (ticking) Push(); }, null, 1000, 1000);
BuildResult res;
try { res = lastResult = await r.RunAsync(req, token); }
finally
{
lock (pushGate) ticking = false;
tick.Dispose();
}
Push(true);
FlushLog();
logTimer?.Dispose(); logTimer = null;

View File

@@ -23,16 +23,21 @@ public sealed partial class Backend
if (!CanChangeGame(out var f) || GameOptionsSchema.ByKey(key) is not { } row) return;
var now = f!.Get(key);
var text = H(row.Help ?? "") + (row.Restart ? "<br><span style=\"color:var(--text3)\">Takes effect the next time the game starts.</span>" : "");
if (key == Benchmark.KPreset)
text += "<br>" + string.Join("<br>", GameOptionsSchema.PresetSummaries.Select((s, i) => i == 0 ? "" : "<b>" + H(f.ChoicesOf(key).ElementAtOrDefault(i)?.Label) + "</b> " + H(s)).Where(x => x.Length > 0));
var choices = f.ChoicesOf(key).AsEnumerable();
if (key == Benchmark.KUpscaler)
{
// (as the game's menu offers them: DLSS and DLAA with an NVIDIA card and DLSS in the build; FSR 4 on AMD cards)
// (as the game's menu offers them: DLSS (and DLAA, its Native) with an NVIDIA card and DLSS in the build; FSR 4 on AMD cards)
var dlss = Gpus.HasNvidia() && new Game(ctx).HasDlss(GameDir!);
var amd = Gpus.List().Any(x => x.Vendor == GpuVendor.Amd);
choices = choices.Where(c => c.Value == now || (c.Value is not (1 or 2) || dlss) && (c.Value is not (4 or 5) || amd));
}
if (key == GameOptionsSchema.FrameGenKey)
{
// ((Triforce, options_version 8) NVIDIA DLSS 2x to 4x, merged into the row, where DLSS frame generation can run:
// an NVIDIA card and DLSS in the build, as the game's menu offers them (vk_menu.cpp dlssg_offered))
var dlssg = Gpus.HasNvidia() && new Game(ctx).HasDlss(GameDir!);
choices = choices.Where(c => c.Value == now || c.Value < 10 || dlssg);
}
Choice(row.Name, text, "gopt.set", choices.Select(c => (c.Value.ToString(), c.Label, (string?)null, c.Value == now)), "Choose", key);
});
On("gopt.set", m =>
@@ -74,7 +79,7 @@ public sealed partial class Backend
{
var g = GameDir;
if (g == null) return null;
if (!gpusHooked) { GameOptionsSchema.UseGameGpus(() => GameDir); gpusHooked = true; } // ((Triforce) 11-19: the game's own order)
if (!gpusHooked) { GameOptionsSchema.UseGameGpus(() => GameDir); GameOptionsSchema.UseSystemLatency(); gpusHooked = true; } // ((Triforce) 11-19: the game's own order; options_version 8: Low latency by the card's maker)
GameOptionsFile f;
try { f = GameOptionsFile.Load(g, MainScreen()); }
catch (Exception e) { Log.Write("game options: " + e.Message); return null; }

View File

@@ -305,11 +305,11 @@ public sealed class WinHost : IHost
[DllImport("user32", CharSet = CharSet.Unicode)] static extern ushort RegisterClassEx(ref WNDCLASSEX c);
[DllImport("user32", CharSet = CharSet.Unicode)] static extern IntPtr CreateWindowEx(uint ex, string cls, string name, uint style, int x, int y, int w, int h, IntPtr parent, IntPtr menu, IntPtr inst, IntPtr p);
[DllImport("user32")] static extern IntPtr DefWindowProc(IntPtr h, uint m, IntPtr w, IntPtr l);
[DllImport("user32")] static extern int GetMessage(out MSG m, IntPtr h, uint a, uint b);
[DllImport("user32", CharSet = CharSet.Unicode)] static extern IntPtr DefWindowProc(IntPtr h, uint m, IntPtr w, IntPtr l);
[DllImport("user32", CharSet = CharSet.Unicode)] static extern int GetMessage(out MSG m, IntPtr h, uint a, uint b);
[DllImport("user32")] static extern bool TranslateMessage(ref MSG m);
[DllImport("user32")] static extern IntPtr DispatchMessage(ref MSG m);
[DllImport("user32")] static extern bool PostMessage(IntPtr h, uint m, IntPtr w, IntPtr l);
[DllImport("user32", CharSet = CharSet.Unicode)] static extern IntPtr DispatchMessage(ref MSG m);
[DllImport("user32", CharSet = CharSet.Unicode)] static extern bool PostMessage(IntPtr h, uint m, IntPtr w, IntPtr l);
[DllImport("user32")] static extern void PostQuitMessage(int c);
[DllImport("user32")] static extern bool ShowWindow(IntPtr h, int c);
[DllImport("user32")] static extern bool UpdateWindow(IntPtr h);
@@ -318,8 +318,8 @@ public sealed class WinHost : IHost
[DllImport("user32")] static extern bool SetForegroundWindow(IntPtr h);
[DllImport("user32")] static extern bool GetClientRect(IntPtr h, out RECT r);
[DllImport("user32")] static extern bool SetWindowPos(IntPtr h, IntPtr after, int x, int y, int w, int hh, uint f);
[DllImport("user32")] static extern IntPtr LoadCursor(IntPtr i, int id);
[DllImport("user32")] static extern IntPtr LoadIcon(IntPtr i, IntPtr id);
[DllImport("user32", CharSet = CharSet.Unicode)] static extern IntPtr LoadCursor(IntPtr i, int id);
[DllImport("user32", CharSet = CharSet.Unicode)] static extern IntPtr LoadIcon(IntPtr i, IntPtr id);
[DllImport("user32")] static extern uint GetDpiForSystem();
[DllImport("user32")] static extern bool SetProcessDpiAwarenessContext(IntPtr v);
[DllImport("user32")] static extern bool SystemParametersInfo(uint a, uint b, ref RECT r, uint c);

View File

@@ -12,6 +12,9 @@
<Nullable>enable</Nullable>
<InvariantGlobalization>true</InvariantGlobalization>
<Version>1.0.0</Version>
<!-- ((Triforce) 11-20) the name Windows shows for the exe (pinned taskbar button, Task Manager), not its file name -->
<AssemblyTitle>Triforce</AssemblyTitle>
<Product>Triforce</Product>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net10.0-windows'">