Commit Graph

23391 Commits

Author SHA1 Message Date
Alayan
185772ca4a
Fix a strict-aliasing violation
See #5035, based on a commit by @miller-alex
2024-05-10 15:48:37 +02:00
CodingJellyfish
0542e6b279
Fix #3671 and fix #4254 2024-05-10 12:35:30 +02:00
Alayan
8e49634e77
Move the new quality switch logic to autoComputeLevel
Doing additional checks every frame was wasteful, and this change will also allow to easily adapt this logic to account for an object's size.

Also fix and improve comments
2024-05-08 19:01:55 +02:00
Alayan
e9a75f6c52
Fix #3678
Don't play drive-on sound from materials when the game state is paused.
2024-05-08 17:40:48 +02:00
Alayan
99868d5897
Fix #5026
The SFX manager and SFXOpenAL would check if SFXs are enabled before pausing (looping) sound effects, so disabling SFXs in the options would fail to stop looping SFxs.

Furthermore, 'OnSoundEnabledBack' would pause all looping SFXs. This commit checks for the pause status of the World (if applicable) to decide if the looping SFXs should be immediately resumed (networking) or not (real pause).

Also clean some comments and move some code around.

This patch doesn't address sound resuming when going from the pause menu to the options in networked mode, whereas it doesn't in a normal race. This is what caused the bug to trigger in the first place, but it's very minor by itself and the design of the SFX code could have triggered other future issues too.
2024-05-08 17:21:39 +02:00
Alayan
8dbf0a9922
Add geometry detail to the graphics presets 2024-05-07 18:27:15 +02:00
Alayan
e83fdc9324
Display a basic summary of benchmark results 2024-05-07 17:11:16 +02:00
Alayan
e505d9c686
Show a lower LoD level instead of having a detailled level pop up when very close
- It is visually more pleasant to have a low quality model than to have a sudden popping from the high quality one appearing when already close
- This also boosts performance
2024-05-06 23:24:43 +02:00
Alayan
553595fa63
Prevent geometry level from removing objects
The latest version was bugged as it removed all standard objects, but removing only objects marked by track-makers removed almost nothing of note, and bugs would sometimes remove normal objects. Fix #5052. Fix #5066. This makes #5063 moot.
2024-05-06 22:59:58 +02:00
Alayan
df803c18b8
Various adjustments to auto-LOD
- Increase the effect preventing LoD objects from popping at very short distances
- Add comments to all the steps and other clarifications
- Update the multiplier values to be approximately equally spaced geometrically
2024-05-06 22:51:25 +02:00
Nomagno
e47958f2d3
Fix #5053 (bool vector -> uint8_t vector) (#5073) 2024-05-05 23:21:31 +02:00
Alayan
dae5c49fcc
Add the label widget to common options includes
Should fix compilation on mobile
2024-05-05 18:13:28 +02:00
Alayan
785915770a
Remove code duplication in the help screens
Same approach as with the options screen: managing all the generic includes needed by all help screens in one place and adding a new standalone 'switchTab function
2024-05-05 18:00:45 +02:00
Alayan
fa421b43c7
Move the splitscreen split orientation in the display settings
It makes a lot of sense there too, and it makes the UI settings less crowded. This allows also to put the label as a section title, fixing an overflow that happened with some translations when using the very large font size.
2024-05-05 17:29:14 +02:00
Alayan
ad02608744
Remove code duplication in the options screens
Use a new standalone 'switchTab' function to centralize the activation of the screen matching the selected tab
2024-05-05 17:06:36 +02:00
Alayan
2fc05e94fc
Miscellaneous improvements to the options screens
* Use a new file for includes to reduce redundancy between option files
* Remove some unnecessary includes
* Reorder some includes
* Increase spacing in the graphics settings screen
* Increase spacing in the audio settings screen
2024-05-05 16:16:22 +02:00
Alayan
7ad4040b2d
Add a new 'Display' option tab
The video settings were getting crowded with the benchmark mode, and with large font size the benchmark buttons ended off-screen.
2024-05-05 14:24:56 +02:00
CodingJellyfish
aba99c22b6 Enable new screen resizing code 2024-05-05 13:45:23 +08:00
CodingJellyfish
6e2d528b91 Remove static variable in cutscenes 2024-05-05 13:18:59 +08:00
CodingJellyfish
7d02e57a19 Avoid resetting FOV which caused issue after resizing cutscene 2024-05-05 13:08:35 +08:00
Alayan
0969a173c7
Fix #5069 2024-05-04 20:26:24 +02:00
Alayan
8fd0a0a09d
Split the displaySoccerResults function
Use a 'drawTeamScorers' function to reduce code duplication and make it easier to understand what's going on. Some minor clean-up has also been done, but more could be done, especially regarding variables that had to be recreated in the new separate function.
2024-05-04 20:19:54 +02:00
Alayan
7a75f9e541
Clean up the Race Result GUI code
- Remove excessive indentations in race_result_gui.cpp
- Move the bulk of the displayPostRaceInfo function into new functions: displayHighscores, displayLapDifficulty and displayChallengeInfo
- Add comments for the closing braces of functions, for the closing braces of some large code blocks, and explaining some functions
2024-05-04 19:14:48 +02:00
CodingJellyfish
3a0a2eaf97 Add resizing code for kart selection 2024-05-04 16:54:09 +08:00
CodingJellyfish
0266b03809 Add minimum resizing code for race result screen 2024-05-04 15:38:18 +08:00
Deve
a14b9fd747 Update linux build script 2024-05-04 00:52:07 +02:00
CodingJellyfish
26aa328994 Add resizing code for credits 2024-05-03 20:20:03 +08:00
CodingJellyfish
e52b2fafdc Add resizing code for soccer setup screen 2024-05-03 18:02:46 +08:00
CodingJellyfish
31239615ef Add resizing code for add device dialog 2024-05-03 17:54:13 +08:00
CodingJellyfish
f73e56c204 Add resizing code for dialog and screen keyboard 2024-05-02 15:34:08 +08:00
CodingJellyfish
f8a43b86ea Fix server only build 2024-05-01 16:04:39 +08:00
CodingJellyfish
ff186339e1 Use proper method to shrink text in bubble widget to fix #3432 2024-05-01 13:00:54 +08:00
CodingJellyfish
c9d44736ed Add resizing code for bubble widget 2024-04-30 10:45:01 +08:00
Alayan
0716965df7
Improve Auto-LoD
- Increase the Auto-LoD distance on tracks with a low scene complexity (fix #5065)
- Increase the Auto-LoD distance when the old formula gives a too low base distance (small objects). This helps with some of the worst popping issues for comparatively little performance cost.
- Make the LoD distance auto-compute code clearer by moving the settings-related multiplier after the squaring step
- Also fix a couple of unrelated warnings about comparison between signed and unsigned integers
2024-04-29 21:47:17 +02:00
Alayan
ec4f4065f5
Enable a higher maximum shadow resolution in the video settings 2024-04-29 12:01:54 +02:00
Alayan
95c8f452de
Update the LoD distance factors
With the existing engine and tracks, when the framerate is rather GPU-limited, the performance cost of increasing LoD distance is minor. It becomes more significant at higher framerates when the CPU can be more of a limiting factor, but it also noticeably enhances the player experience by removing the distracting 'popping' when an object visibly changes shape or appears because of LoD.

- Lowest is changed from 0.75 to 0.8
- Low is reduced to 0.8, just like Lowest. The difference is now only the display of optional geometry objects, but it's a big difference.
- Medium is changed from 1.25 to 1.3
- High is changed from 1.3 to 1.8
- Very high is changed from 1.8 to 2.4
- Ultra is changed from 3.0 to 3.2
2024-04-29 11:12:25 +02:00
Alayan
32a53827a8
Fix #5063
- Ensure that optional geometry objects are properly removed. This provides a massive performance boost, at the cost of visuals. Benchmark on graphics 2 with lowest geometry level: bugged has 202 steady FPS, 230 mostly stable FPS, fixed has 427 steady FPS, 495 mostly stable FPS.
- Restrict the removal of objects based on geometry detail to the lowest geometry level. This ignore the different levels of geometry removal that track authors can set for objects, and which was mostly unused: all objects marked for removal at any level are either all removed or all kept.
2024-04-29 10:55:55 +02:00
CodingJellyfish
3f8b78dc41 Add resizing code for CGUIEditBox 2024-04-29 10:18:51 +08:00
CodingJellyfish
5ff449d6c9 Remove an unneeded method 2024-04-29 10:06:47 +08:00
Alayan
e64e2d8cd5
Fix #4931
The assert could be triggered when a new sign-in request was sent before the first one was resolved, usually when using the enter key to request the sign in. Since it can happen in normal operations to have the player profile status different from signing out or signed out, an assert is incorrect.

Also fix server-only compilation for the previous commit.
2024-04-28 21:43:42 +02:00
Alayan
01d62be5de
Fix crashing when turning the modern renderer on or off before benchmarking 2024-04-28 18:32:51 +02:00
CodingJellyfish
9206b923f7 Use xmlDecode for news 2024-04-28 15:57:42 +08:00
CodingJellyfish
18094c505a Add resizing code for networking lobby 2024-04-28 13:25:20 +08:00
CodingJellyfish
f6949972b3 Add resizing code for label widget 2024-04-28 11:15:41 +08:00
CodingJellyfish
97ca195e20 Fix dynamic ribbon widget being shown above a dialog after resized 2024-04-27 15:05:52 +08:00
CodingJellyfish
10b6c4b1e1 Fix focus bug when multiplayer handling is not needed 2024-04-26 23:24:51 +08:00
Alayan
543ee92e00
Confirm the performance report saving to the user
Also fix a compilation issue with compilers not recognizing uint
2024-04-26 16:50:50 +02:00
Alayan
792c1e0926
Compute new performance metrics and improve saving of profiler data
* Format the standard CPU and GPU profiler data as CSV, to simplify its analysis
* Include the internal identifier name of the track in the report name, or 'menu' if there is no active track. This uses the current track at the time of report saving. It is possible to keep the profiler on through multiple tracks and menus, but it's on people enabling the artist debug mode and the profiler to use it sensibly
* Stop the profiler when saving data, if it's not already stopped
* Compute, when profiling is stopped, for all integer FPS values up to 1000, three key metrics:
 - The number of frames too slow to reach this FPS value
 - The proportion of total time spent in frames slower than this FPS value
 - The proportion of total time spent in frames beyond the maximum duration associated with this FPS value
* Compute three key indicator values:
 - Steady FPS (highest FPS with no more than 1% time spent in slower frames and no more than 0.1% time spent beyond the maximum duration)
 - Mostly stable FPS (highest FPS with no more than 12% time spent in slower frames and no more than 2% time spent beyond the maximum duration)
 - Typical FPS (highest FPS with no more than 50% time spent in slower frames and no more than 10% time spent beyond the maximum duration)
* Save an additional 'perf-report' containing this new data

 Traditional performance measurements, such as average FPS and 1% lows (which are typically based on the 1% slowest frames, not on the 1% slowest gameplay time), are flawed because they unduly reward outputting more fast frames. Increasing the number of fast frames without speeding up the slow frames is useless when it comes to making the game feel smooth, which is especially critical in a racing game.

 Missing features:
 - Displaying a summary of the performance test instead of the normal end screen
 - Confirm to the user that the report has been successfully saved
 - And more advanced options.
2024-04-26 16:11:55 +02:00
Alayan
62d0281a18
Adapt the end screen in benchmark mode (part 1)
- Customize the race result screen to offer three options : leave to main menu, save test data, and return to video settings
- Ensure all three options do as they say
- Ensure that the benchmark mode and the profiler are always turned off when leaving through the end screen
2024-04-26 13:39:39 +02:00
CodingJellyfish
e68acaa02a Add resizing code for dynamic ribbon widget 2024-04-26 13:05:36 +08:00