Skip to content

Commit e4183b4

Browse files
authored
0.6.0.103 - [Enhance] TJA Command and some Fixes (#913)
- [Feat] New TJA header `.FORCEGAUGE:`, which forces the gauge type for the player-side - [Feat] New TJA header `.BOOMRULE:`, which specifies the gauge penalty of the BOOM judgement for the player-side - [Feat] Multi-value `SCENEPRESET:` (separated by comma (`,`)) for TJA and box.def to randomly use one of specified scenes - [Feat] Add new branch condition rules and ranges (based on (#807)) - [Feat] Rotate barlines according to scroll direction like in TaikoJiro2 - [Feat] Support reading `inf` and `infinity` (case-insensitive) in TJA as `Infinity` - [Enhance] TJA `#BRANCHSTART:` Allow omitting comma (,) between multi-letter condition type and value, and reject unknown type or range - [Enhance] Make the following header per-player-side: `GAME:`, `HIDDENBRANCH:`, `SIDE:`, `LIFE:`, `TOWERTYPE:`, `DANTICK:`, `DANTICKCOLOR:` (specifying them before the first `COURSE:` sets the default value of all difficulties) - [Enhance] Make TJA NOTESDESIGNER headers per-player-side and respect difficulty number if defined before the first `COURSE:` in TJA - [Enhance] Adjust gameplay stack order to be debug texts > fading-in/out > lyrics > training UI > OBJ > notes > background and training bar (from top layer to bottom layer) - [Enhance] Make log more complete (Allow logging to file before reading Config.ini, log exception in some empty catches, set up inner exceptions in nested throws) - [Fix] Big note branch score was not tracked - [Fix] Game crashed when the played OBJ command contains non-registered obj name - [Fix] Eased value for OBJ command was truncated to int - [Fix] Not all OBJ/CAM command states were reset properly on retry - [Fix] CAM commands failed to apply to the main screen - [Fix] `#BORDERCOLOR` command had no effects - [Fix] Lyrics and OBJs could not hide when retry or rewind - [Fix] OBJ & CAM commands did not respect play speed - [Fix] `#SUDDEN` move offset had no effects - [Fix] `#ENABLEDORON` & `#DISABLEDORON` were not per-player and did not reset after retrying gameplay - [Fix] `#SUDDEN` could not hide SENote and `#ENABLE`/`DISABLEDORON`, `#SUDDEN`, note hidden upon hit, & balloon appear during popping interfered with each other - [Fix] TJA `#SCROLL` could not parse number containing Infinity successfully - [Fix] TJA `#SUDDEN` could not handle Infinity values - [Fix] `#DELAY Infinity` crashed the game - [Fix] Could not select difficulties with `LEVEL:Infinity` or negative value (needs hard reloading song list) - [Fix] `LEVEL:10.45` displayed as 10+, `LEVEL:12.95` as 12(-) (for examples) due to unintended rounding - [Fix] COURSE-scope headers ignored the default scope before the first `COURSE:`, broken some charts made for TaikoJiro - [Fix] Invalid commands starting with `#BRANCHSTART` made the difficulty treated as branched chart - [Fix] Pre-COURSE LEVEL: broke difficulty available test (#625) (needs hard reloading) - [Fix] Per-player-side headers beyond selected player-side chart not ignored, broke per-player-side BALLOON and other headers - [Fix] Displayed puchi/character coin multiplier did not include rarity multiplier in Heya - [Optimize] Stop processing finished or truncated OBJ/CAM commands - [Chore] Decompose `EBranchConditionType` into `Exam.Type`, `EBranchCondBig`, & `Exam.Range` - [Chore] Simplify CAM command handling during gameplay - [Chore] Fix `CLang.GetExamName()` matched exam type by raw int and would break if Exam.Type changes
1 parent a31a295 commit e4183b4

32 files changed

+1181
-1351
lines changed

FDK/src/01.Framework/Core/Game.cs

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2020
* THE SOFTWARE.
2121
*/
22+
using System.Diagnostics;
2223
using System.Reflection;
2324
using System.Runtime.InteropServices;
2425
using FDK;
@@ -246,6 +247,16 @@ public unsafe void GetScreenShotAsync(Action<SKBitmap> action) {
246247

247248
public static Matrix4X4<float> Camera;
248249

250+
private static Color4 _borderColor = new Color4(0f, 0f, 0f, 1f);
251+
public static Color4 BorderColor {
252+
get => _borderColor;
253+
set {
254+
if (value != _borderColor)
255+
Gl.ClearColor(BorderColor.Red, BorderColor.Green, BorderColor.Blue, BorderColor.Alpha);
256+
_borderColor = value;
257+
}
258+
}
259+
249260
public static float ScreenAspect {
250261
get {
251262
return (float)GameWindowSize.Width / GameWindowSize.Height;
@@ -274,6 +285,13 @@ private RawImage GetIconData(string fileName) {
274285
/// Initializes a new instance of the <see cref="Game"/> class.
275286
/// </summary>
276287
protected Game(string iconFileName, params string[] args) {
288+
try {
289+
this.InitializeLog();
290+
} catch (Exception ex) {
291+
Console.WriteLine(ex.ToString());
292+
Console.WriteLine("Error initializing log.");
293+
}
294+
277295
strIconFileName = iconFileName;
278296
parameters = args;
279297

@@ -304,17 +322,18 @@ protected Game(string iconFileName, params string[] args) {
304322
if ((OperatingSystem.IsLinux() && Environment.GetEnvironmentVariable("XDG_SESSION_TYPE") == "wayland" && windowing_override != "glfw")
305323
|| windowing_override == "sdl") {
306324
Silk.NET.Windowing.Sdl.SdlWindowing.Use();
307-
Console.WriteLine("SDL selected for Windowing");
325+
Trace.TraceInformation("SDL selected for Windowing");
308326
} else {
309327
Silk.NET.Windowing.Glfw.GlfwWindowing.Use();
310-
Console.WriteLine("GLFW selected for Windowing");
328+
Trace.TraceInformation("GLFW selected for Windowing");
311329
}
312330

313331
try {
314332
Window_ = Window.Create(options);
315333
}
316-
catch {
317-
Console.WriteLine("The window failed to be created.\nYou can attempt to fix this by overriding the default windowing.\nTry launching OpenTaiko with args, using '-w glfw' to force GLFW or '-w sdl' to force SDL.");
334+
catch (Exception ex) {
335+
Trace.TraceError(ex.ToString());
336+
Trace.TraceError("The window failed to be created.\nYou can attempt to fix this by overriding the default windowing.\nTry launching OpenTaiko with args, using '-w glfw' to force GLFW or '-w sdl' to force SDL.");
318337
throw;
319338
}
320339

@@ -393,6 +412,10 @@ protected virtual void Configuration() {
393412

394413
}
395414

415+
protected virtual void InitializeLog() {
416+
417+
}
418+
396419
protected virtual void Initialize() {
397420

398421
}
@@ -492,6 +515,7 @@ public void Window_Update(double deltaTime) {
492515

493516
public void Window_Render(double deltaTime) {
494517
Camera = Matrix4X4<float>.Identity;
518+
Gl.ClearColor(BorderColor.Red, BorderColor.Green, BorderColor.Blue, BorderColor.Alpha);
495519

496520
if (AsyncActions.Count > 0) {
497521
AsyncActions[0]?.Invoke();

FDK/src/02.Input/CInputManager.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ public void Initialize(IWindow window, bool useBufferedInput, bool bUseMidiIn, f
3939
try {
4040
cinputkeyboard = new CInputKeyboard(Context.Keyboards[0]);
4141
cinputmouse = new CInputMouse(Context.Mice[0]);
42-
} catch {
42+
} catch (Exception ex) {
43+
Trace.TraceWarning(ex.ToString());
44+
Trace.TraceWarning("Error adding keyboard and mouse.");
4345
}
4446
if (cinputkeyboard != null) {
4547
this.InputDevices.Add(cinputkeyboard);
@@ -63,14 +65,18 @@ public void Initialize(IWindow window, bool useBufferedInput, bool bUseMidiIn, f
6365
this.InputDevices.Add(new CInputMIDI(midiIn, i));
6466
}
6567
} catch (Exception e) {
66-
Trace.TraceError(e.ToString());
68+
Trace.TraceWarning(e.ToString());
69+
Trace.TraceWarning("Error adding MIDI input devices.");
6770
}
6871
#endregion
6972
Trace.TraceInformation("Found {0} Input Device{1}", InputDevices.Count, InputDevices.Count != 1 ? "s:" : ":");
7073
for (int i = 0; i < InputDevices.Count; i++) {
7174
try {
7275
Trace.TraceInformation("Input Device #" + i + " (" + InputDevices[i].CurrentType.ToString() + " - " + InputDevices[i].Name + ")");
73-
} catch { }
76+
} catch (Exception ex) {
77+
Trace.TraceWarning(ex.ToString());
78+
Trace.TraceWarning("Error logging input devices.");
79+
}
7480
}
7581

7682
Game.InitImGuiController(window, Context);
@@ -157,6 +163,8 @@ public void Polling() {
157163
device.Polling();
158164
} catch (Exception e) // #24016 2011.1.6 yyagi: catch exception for unplugging USB joystick, and remove the device object from the polling items.
159165
{
166+
Trace.TraceWarning($"Error polling input device {i}.");
167+
Trace.TraceWarning(e.ToString());
160168
//this.InputDevices.Remove(device);
161169
//device.Dispose();
162170
//Trace.TraceError("tポーリング時に対象deviceが抜かれており例外発生。同deviceをポーリング対象からRemoveしました。");

FDK/src/04.Graphics/CTexture.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,9 +386,9 @@ public CTexture(int n幅, int n高さ)
386386
this.sz画像サイズ = new Size(n幅, n高さ);
387387
this.szTextureSize = this.t指定されたサイズを超えない最適なテクスチャサイズを返す(this.sz画像サイズ);
388388
this.rc全画像 = new Rectangle(0, 0, this.sz画像サイズ.Width, this.sz画像サイズ.Height);
389-
} catch {
389+
} catch (Exception ex) {
390390
this.Dispose();
391-
throw new CTextureCreateFailedException(string.Format("テクスチャの生成に失敗しました。\n({0}x{1}, {2})", n幅, n高さ));
391+
throw new CTextureCreateFailedException(string.Format("テクスチャの生成に失敗しました。\n({0}x{1}, {2})", n幅, n高さ), innerException: ex);
392392
}
393393
}
394394

@@ -485,10 +485,10 @@ public void MakeTexture(SKBitmap bitmap, bool b黒を透過する) {
485485
this.sz画像サイズ = new Size(bitmap.Width, bitmap.Height);
486486
this.rc全画像 = new Rectangle(0, 0, this.sz画像サイズ.Width, this.sz画像サイズ.Height);
487487
this.szTextureSize = this.t指定されたサイズを超えない最適なテクスチャサイズを返す(this.sz画像サイズ);
488-
} catch {
488+
} catch (Exception ex) {
489489
this.Dispose();
490490
// throw new CTextureCreateFailedException( string.Format( "テクスチャの生成に失敗しました。\n{0}", strファイル名 ) );
491-
throw new CTextureCreateFailedException(string.Format("テクスチャの生成に失敗しました。\n"));
491+
throw new CTextureCreateFailedException(string.Format("テクスチャの生成に失敗しました。\n"), innerException: ex);
492492
}
493493
}
494494

OpenTaiko/src/Common/CConfigIni.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public CTimingZones(int gz, int oz, int bz) {
217217

218218
public bool bTight;
219219
public bool bIncludeSubfoldersOnRandomSelect;
220-
public bool bOutputLogs;
220+
public bool bOutputLogs; // For ensuring complete log messages, output is enabled before reading Config.ini
221221
public bool bDisplayDebugInfo;
222222
public bool bEnableVSync;
223223
public bool bFullScreen;

OpenTaiko/src/Common/CSystemError.cs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public enum Errno {
2020
ENO_SONGLISTINITFAILED = 5
2121
};
2222

23-
public void LoadError(Errno errno) {
23+
public void LoadError(Errno errno, Exception? exception = null, string? message = null) {
2424
GameCrashed = true;
2525

2626
// Head with the error code
@@ -30,36 +30,48 @@ public void LoadError(Errno errno) {
3030
switch (errno) {
3131
default:
3232
case Errno.ENO_UNKNOWN: {
33+
if (!string.IsNullOrEmpty(message))
34+
ErrorMessage += message;
3335
ErrorMessage += "Please try restarting OpenTaiko.";
3436
break;
3537
}
3638
case Errno.ENO_NOAUDIODEVICE: {
3739
ErrorMessage += "No audio device was found.\n";
40+
if (!string.IsNullOrEmpty(message))
41+
ErrorMessage += "Additional message: " + message;
3842
ErrorMessage += "Please ensure that you have an active audio output display on your machine.\n";
3943
ErrorMessage += "Additionally, check if your speakers or headset are not turned off.\n";
4044
ErrorMessage += "If this does not resolve the issue, please try the troubleshooting feature on your OS.";
4145
break;
4246
}
4347
case Errno.ENO_SKINNOTFOUND: {
4448
ErrorMessage += "No compatible skin was found.\n";
49+
if (!string.IsNullOrEmpty(message))
50+
ErrorMessage += "Additional message: " + message;
4551
ErrorMessage += "Please ensure that you have a compatible skin within your System folder.\n";
4652
ErrorMessage += "If you have not installed a skin, please do so through the OpenTaiko Hub (Skins tab).\n";
4753
ErrorMessage += "If this does not resolve the issue, please try updating your skins through the OpenTaiko Hub.\n";
4854
break;
4955
}
5056
case Errno.ENO_PADINITFAILED: {
5157
ErrorMessage += "The pad initialisation failed.\n";
58+
if (!string.IsNullOrEmpty(message))
59+
ErrorMessage += "Additional message: " + message;
5260
ErrorMessage += "Please try the troubleshooting feature on your OS.";
5361
break;
5462
}
5563
case Errno.ENO_INPUTINITFAILED: {
5664
ErrorMessage += "The input device initialisation failed.\n";
65+
if (!string.IsNullOrEmpty(message))
66+
ErrorMessage += "Additional message: " + message;
5767
ErrorMessage += "Please ensure that you are not using a faulty input device when launching the game.\n";
5868
ErrorMessage += "If the device seems to work on other tasks, please try the troubleshooting feature on your OS.";
5969
break;
6070
}
6171
case Errno.ENO_SONGLISTINITFAILED: {
6272
ErrorMessage += "The song list initialisation failed.\n";
73+
if (!string.IsNullOrEmpty(message))
74+
ErrorMessage += "Additional message: " + message;
6375
ErrorMessage += "Please try removing the songlist.db file within your OpenTaiko folder.";
6476
break;
6577
}
@@ -68,6 +80,9 @@ public void LoadError(Errno errno) {
6880

6981
// Append a call to contact if necessary
7082
ErrorMessage += "\nIf the error persists, please contact us through the links provided on the OpenTaiko Hub.";
83+
84+
if (exception != null)
85+
ErrorMessage += "\n\nException: " + exception.ToString();
7186
}
7287

7388
// Constructor

OpenTaiko/src/Common/Easing.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
namespace OpenTaiko;
44

55
static class Easing {
6-
public static int EaseIn(CCounter counter, float startPoint, float endPoint, CalcType type) {
6+
public static float EaseIn(CCounter counter, float startPoint, float endPoint, CalcType type) {
77
double CounterValue = counter.CurrentValue / (double)(int)counter.EndValue;
88
return EaseIn(CounterValue, startPoint, endPoint, type);
99
}
1010

11-
public static int EaseIn(double CounterValue, float startPoint, float endPoint, CalcType type) {
11+
public static float EaseIn(double CounterValue, float startPoint, float endPoint, CalcType type) {
1212
float Sa = endPoint - startPoint;
1313
double Value = 0;
1414

@@ -42,15 +42,15 @@ public static int EaseIn(double CounterValue, float startPoint, float endPoint,
4242
break;
4343
}
4444

45-
return (int)Value;
46-
}
47-
48-
public static int EaseOut(CCounter counter, float startPoint, float endPoint, CalcType type) {
45+
return (float)Value;
46+
}
47+
48+
public static float EaseOut(CCounter counter, float startPoint, float endPoint, CalcType type) {
4949
double CounterValue = counter.CurrentValue / (double)(int)counter.EndValue;
5050
return EaseOut(CounterValue, startPoint, endPoint, type);
5151
}
5252

53-
public static int EaseOut(double CounterValue, float startPoint, float endPoint, CalcType type) {
53+
public static float EaseOut(double CounterValue, float startPoint, float endPoint, CalcType type) {
5454
float Sa = endPoint - startPoint;
5555
double Value = 0;
5656

@@ -89,7 +89,7 @@ public static int EaseOut(double CounterValue, float startPoint, float endPoint,
8989
break;
9090
}
9191

92-
return (int)Value;
92+
return (float)Value;
9393
}
9494

9595
public static float EaseInOut(CCounter counter, float startPoint, float endPoint, CalcType type) {

0 commit comments

Comments
 (0)