From eb14240b0a2f850046368beaec41d13a463a20f6 Mon Sep 17 00:00:00 2001 From: Vaclav Elias Date: Sun, 5 May 2024 19:09:24 +0100 Subject: [PATCH 01/17] feat: Contet improvements --- en/manual/index.md | 12 ++++++++---- en/toc.yml | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/en/manual/index.md b/en/manual/index.md index 0703423f9..f757dbfb0 100644 --- a/en/manual/index.md +++ b/en/manual/index.md @@ -5,15 +5,15 @@ These pages contain information about how to use Stride, an open-source C# game engine. > [!Note] -> The Stride manual is under construction and updated regularly with new content. Follow [Stride on X](https://x.com/stridedotnet?s=20) for documentation updates. +> The Stride manual is under construction and is regularly updated with new content. Follow [Stride on X](https://x.com/stridedotnet?s=20) for documentation updates. ## Latest documentation ### Recent updates - Updated [Linux - Setup and requirements](platforms/linux/setup-and-requirements.md) - Fedora OS option added -- New [Scripts - Serialization](scripts/serialization.md) - Serialization explained +- New [Scripts - Serialization](scripts/serialization.md) - Explanation of serialization - Updated [Scripts - Public properties and fields](scripts/public-properties-and-fields.md) - Content improvements and additions -- New [Engine - Entity Component model - Usage](engine/entity-component-system/usage.md) - ECS usage explained +- New [Engine - Entity Component model - Usage](engine/entity-component-system/usage.md) - Explanation of ECS usage - Updated [Engine - Entity Component model](engine/entity-component-system/index.md) - Content improvements - Updated [Stride for Unity® developers](stride-for-unity-developers/index.md) - Content improvements @@ -32,4 +32,8 @@ These pages contain information about how to use Stride, an open-source C# game The Stride documentation is open source, so anyone can edit it. If you find a mistake, you can correct it or comment in [GitHub](https://github.com/stride3d/stride-docs). -To edit any page of this manual, at the bottom, click **Edit this page** link. Please make sure to follow the [writing guidelines](https://github.com/stride3d/stride-docs/wiki). +To edit any page of this manual, click the **Edit this page** link at the bottom. Please make sure to follow the [writing guidelines](../contributors/documentation/index.md) + +## Stride community toolkit + +Check out our [Stride community toolkit](https://stride3d.github.io/stride-community-toolkit/index.html) for additional helpers and extensions. \ No newline at end of file diff --git a/en/toc.yml b/en/toc.yml index c4c808ee8..6508c1dbc 100644 --- a/en/toc.yml +++ b/en/toc.yml @@ -23,6 +23,6 @@ # - name: 🔍 Diagnostics # href: diagnostics/ # homepage: diagnostics/index.md -- name: 🏋🏽 Community resources +- name: 🏋🏽 Community resources ⭐New href: community-resources/ homepage: community-resources/index.md \ No newline at end of file From 705807feefca58e08d1fe3f5789f704b5f34e16f Mon Sep 17 00:00:00 2001 From: Vaclav Elias Date: Sun, 5 May 2024 19:13:58 +0100 Subject: [PATCH 02/17] feat: Typo fixed --- en/manual/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/manual/index.md b/en/manual/index.md index f757dbfb0..5a0b0a4f0 100644 --- a/en/manual/index.md +++ b/en/manual/index.md @@ -32,7 +32,7 @@ These pages contain information about how to use Stride, an open-source C# game The Stride documentation is open source, so anyone can edit it. If you find a mistake, you can correct it or comment in [GitHub](https://github.com/stride3d/stride-docs). -To edit any page of this manual, click the **Edit this page** link at the bottom. Please make sure to follow the [writing guidelines](../contributors/documentation/index.md) +To edit any page of this manual, click the **Edit this page** link at the bottom. Please make sure to follow the [writing guidelines](../contributors/documentation/index.md). ## Stride community toolkit From 759472268973342870c7156eef1036a92c3b3c66 Mon Sep 17 00:00:00 2001 From: Vaclav Elias Date: Sun, 5 May 2024 19:39:30 +0100 Subject: [PATCH 03/17] feat: GitHub Actions improvement, including release notes generation --- .../workflows/stride-docs-release-azure.yml | 31 ++++++++++++++----- .../stride-docs-release-fast-track-azure.yml | 21 ++++++++++--- .../stride-docs-staging-fast-track-azure.yml | 21 ++++++++++--- 3 files changed, 56 insertions(+), 17 deletions(-) diff --git a/.github/workflows/stride-docs-release-azure.yml b/.github/workflows/stride-docs-release-azure.yml index cd4cd05ef..a9d1f7110 100644 --- a/.github/workflows/stride-docs-release-azure.yml +++ b/.github/workflows/stride-docs-release-azure.yml @@ -3,6 +3,11 @@ name: Build Stride Docs for Azure Web App Release 🚀 +env: + COMMON_SETTINGS_PATH: en/docfx.json + VERSION: "2.0.0.${{ github.run_number }}" + DOCS_PATH: stride-docs + on: push: branches: @@ -23,8 +28,7 @@ jobs: runs-on: windows-2022 steps: - # Setup .NET SDK - - name: Dotnet Setup + - name: .NET SDK Setup uses: actions/setup-dotnet@v4 with: dotnet-version: 8.x @@ -33,9 +37,16 @@ jobs: - name: Checkout Stride Docs uses: actions/checkout@v4 with: - path: stride-docs + path: ${{ env.DOCS_PATH }} lfs: true + - name: Set Version in docfx.json + run: | + $settingsContent = Get-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Raw + $updatedDocFxJsonContent = $settingsContent -replace '2.0.0.x', "${{ env.VERSION }}" + Set-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Value $updatedDocFxJsonContent + shell: pwsh + # Checkout the Stride repository from the default branch - name: Checkout Stride (note the LFS) uses: actions/checkout@v4 @@ -53,10 +64,10 @@ jobs: - name: Build documentation run: ./build-all.bat - working-directory: stride-docs + working-directory: ${{ env.DOCS_PATH }} - name: Compress artifact - run: 7z a -r DocFX-app.zip ./stride-docs/_site/* + run: 7z a -r DocFX-app.zip ./${{ env.DOCS_PATH }}/_site/* - name: Upload artifact for deployment job uses: actions/upload-artifact@v4 @@ -64,6 +75,12 @@ jobs: name: DocFX-app path: DocFX-app.zip + - name: Create GitHub Release + run: | + gh release create ${{ env.VERSION }} --title "v${{ env.VERSION }}" --notes "Release notes for ${{ env.VERSION }}" --draft + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + deploy: if: github.repository == 'stride3d/stride-docs' runs-on: windows-2022 @@ -83,7 +100,7 @@ jobs: # run: ls - name: Decompress artifact - run: 7z x DocFX-app.zip "-o./stride-docs/_site" + run: 7z x DocFX-app.zip "-o./${{ env.DOCS_PATH }}/_site" - name: Deploy to Azure Web App id: deploy-to-webapp @@ -92,4 +109,4 @@ jobs: app-name: 'stride-doc' slot-name: 'Production' publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_4803638D673FA67D0C8650F34C4FA9D1 }} - package: ./stride-docs/_site \ No newline at end of file + package: ./${{ env.DOCS_PATH }}/_site \ No newline at end of file diff --git a/.github/workflows/stride-docs-release-fast-track-azure.yml b/.github/workflows/stride-docs-release-fast-track-azure.yml index ede06a0de..7d98c0b12 100644 --- a/.github/workflows/stride-docs-release-fast-track-azure.yml +++ b/.github/workflows/stride-docs-release-fast-track-azure.yml @@ -4,6 +4,11 @@ # The Fast Track skips creating artifacts and compressing them name: Build Stride Docs (Fast Track) for Azure Web App Release 🚀 +env: + COMMON_SETTINGS_PATH: en/docfx.json + VERSION: "2.0.0.${{ github.run_number }}" + DOCS_PATH: stride-docs + on: workflow_dispatch: @@ -17,8 +22,7 @@ jobs: name: 'Production' steps: - # Setup .NET SDK - - name: Dotnet Setup + - name: .NET SDK Setup uses: actions/setup-dotnet@v4 with: dotnet-version: 8.x @@ -27,9 +31,16 @@ jobs: - name: Checkout Stride Docs uses: actions/checkout@v4 with: - path: stride-docs + path: ${{ env.DOCS_PATH }} lfs: true + - name: Set Version in docfx.json + run: | + $settingsContent = Get-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Raw + $updatedDocFxJsonContent = $settingsContent -replace '2.0.0.x', "${{ env.VERSION }}" + Set-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Value $updatedDocFxJsonContent + shell: pwsh + # Checkout the Stride repository from the default branch - name: Checkout Stride (note the LFS) uses: actions/checkout@v4 @@ -47,7 +58,7 @@ jobs: - name: Build documentation run: ./build-all.bat - working-directory: stride-docs + working-directory: ${{ env.DOCS_PATH }} - name: Deploy to Azure Web App id: deploy-to-webapp @@ -56,4 +67,4 @@ jobs: app-name: 'stride-doc' slot-name: 'Production' publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_4803638D673FA67D0C8650F34C4FA9D1 }} - package: ./stride-docs/_site \ No newline at end of file + package: ./${{ env.DOCS_PATH }}/_site \ No newline at end of file diff --git a/.github/workflows/stride-docs-staging-fast-track-azure.yml b/.github/workflows/stride-docs-staging-fast-track-azure.yml index 426ff355b..573c28b80 100644 --- a/.github/workflows/stride-docs-staging-fast-track-azure.yml +++ b/.github/workflows/stride-docs-staging-fast-track-azure.yml @@ -4,6 +4,11 @@ # The Fast Track skips creating artifacts and compressing them name: Build Stride Docs (Fast Track) for Azure Web App Staging +env: + COMMON_SETTINGS_PATH: en/docfx.json + VERSION: "2.0.0.${{ github.run_number }}" + DOCS_PATH: stride-docs + on: workflow_dispatch: @@ -17,8 +22,7 @@ jobs: name: 'Production' steps: - # Setup .NET SDK - - name: Dotnet Setup + - name: .NET SDK Setup uses: actions/setup-dotnet@v4 with: dotnet-version: 8.x @@ -27,9 +31,16 @@ jobs: - name: Checkout Stride Docs uses: actions/checkout@v4 with: - path: stride-docs + path: ${{ env.DOCS_PATH }} lfs: true + - name: Set Version in docfx.json + run: | + $settingsContent = Get-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Raw + $updatedDocFxJsonContent = $settingsContent -replace '2.0.0.x', "${{ env.VERSION }}" + Set-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Value $updatedDocFxJsonContent + shell: pwsh + # Checkout the Stride repository from the default branch - name: Checkout Stride (note the LFS) uses: actions/checkout@v4 @@ -47,7 +58,7 @@ jobs: - name: Build documentation run: ./build-all.bat - working-directory: stride-docs + working-directory: ${{ env.DOCS_PATH }} - name: Deploy to Azure Web App id: deploy-to-webapp @@ -56,4 +67,4 @@ jobs: app-name: 'stride-doc' slot-name: 'staging' publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_32FCD402B970463A9143B24C9B225749 }} - package: ./stride-docs/_site \ No newline at end of file + package: ./${{ env.DOCS_PATH }}/_site \ No newline at end of file From f49ea6181de12caea2f5e2847b46ada8a1459031 Mon Sep 17 00:00:00 2001 From: Vaclav Elias Date: Sun, 5 May 2024 19:54:47 +0100 Subject: [PATCH 04/17] feat: GitHub action for GitHub Pages updated --- .github/workflows/stride-docs-github.yml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/stride-docs-github.yml b/.github/workflows/stride-docs-github.yml index 937301cb0..106bf1cd2 100644 --- a/.github/workflows/stride-docs-github.yml +++ b/.github/workflows/stride-docs-github.yml @@ -2,6 +2,11 @@ name: Build Stride Docs for GitHub Staging +env: + COMMON_SETTINGS_PATH: en/docfx.json + VERSION: "2.0.0.${{ github.run_number }}" + DOCS_PATH: stride-docs + on: workflow_dispatch: @@ -10,8 +15,7 @@ jobs: runs-on: windows-2022 steps: - # Setup .NET SDK - - name: Dotnet Setup + - name: .NET SDK Setup uses: actions/setup-dotnet@v4 with: dotnet-version: 8.x @@ -20,9 +24,16 @@ jobs: - name: Checkout Stride Docs uses: actions/checkout@v4 with: - path: stride-docs + path: ${{ env.DOCS_PATH }} lfs: true + - name: Set Version in docfx.json + run: | + $settingsContent = Get-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Raw + $updatedDocFxJsonContent = $settingsContent -replace '2.0.0.x', "${{ env.VERSION }}" + Set-Content -Path "${{ env.DOCS_PATH }}/${{ env.COMMON_SETTINGS_PATH }}" -Value $updatedDocFxJsonContent + shell: pwsh + # Checkout the Stride repository from the default branch - name: Checkout Stride (note the LFS) uses: actions/checkout@v4 @@ -40,11 +51,11 @@ jobs: - name: Build documentation run: ./build-all.bat - working-directory: stride-docs + working-directory: ${{ env.DOCS_PATH }} - name: Deploy uses: peaceiris/actions-gh-pages@v3.9.2 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: stride-docs/_site + publish_dir: ${{ env.DOCS_PATH }}/_site publish_branch: gh-pages \ No newline at end of file From e6b3139b95d490f3c712465f2e21b646e35fbb7e Mon Sep 17 00:00:00 2001 From: Vaclav Elias Date: Sun, 5 May 2024 20:37:43 +0100 Subject: [PATCH 05/17] Update stride-docs-release-azure.yml --- .github/workflows/stride-docs-release-azure.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/stride-docs-release-azure.yml b/.github/workflows/stride-docs-release-azure.yml index a9d1f7110..7db216955 100644 --- a/.github/workflows/stride-docs-release-azure.yml +++ b/.github/workflows/stride-docs-release-azure.yml @@ -80,6 +80,7 @@ jobs: gh release create ${{ env.VERSION }} --title "v${{ env.VERSION }}" --notes "Release notes for ${{ env.VERSION }}" --draft env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + working-directory: ${{ env.DOCS_PATH }} deploy: if: github.repository == 'stride3d/stride-docs' @@ -109,4 +110,4 @@ jobs: app-name: 'stride-doc' slot-name: 'Production' publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_4803638D673FA67D0C8650F34C4FA9D1 }} - package: ./${{ env.DOCS_PATH }}/_site \ No newline at end of file + package: ./${{ env.DOCS_PATH }}/_site From 321bf55d2848e529882930c2f1143a27696243ed Mon Sep 17 00:00:00 2001 From: Vaclav Elias Date: Sun, 5 May 2024 20:57:27 +0100 Subject: [PATCH 06/17] Update release.yml --- .github/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/release.yml b/.github/release.yml index 4e1c52fb5..cf1ade31a 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -2,6 +2,7 @@ changelog: exclude: labels: - ignore-for-release + - deployment authors: - dependabot categories: From 0c802f157d5a1b8b27d4b632a8d6516af113eff3 Mon Sep 17 00:00:00 2001 From: Vaclav Elias Date: Sun, 5 May 2024 23:17:04 +0100 Subject: [PATCH 07/17] docs: Comments updated --- BuildDocs.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BuildDocs.ps1 b/BuildDocs.ps1 index fad4b8151..8fe4346f3 100644 --- a/BuildDocs.ps1 +++ b/BuildDocs.ps1 @@ -219,12 +219,12 @@ function Build-NonEnglishDoc { # Copy all files from en folder to the selected language folder, this way we can keep en files that are not translated Copy-Item en/* -Recurse $langFolder -Force - # Get all translated files from the selected language folder + # Get all previously copied en files from the selected language folder $files = Get-ChildItem "$langFolder/$($Settings.ManualFolderName)/*.md" -Recurse -Force Write-Host "Start write files:" - # Mark files as not translated if they are not in the toc.md file + # Mark files as not translated if they are not a toc.md file foreach ($file in $files) { if($file.ToString().Contains("toc.md")) { From 6b761b6e2f365c66d2180eb9dc326147d5f2df4a Mon Sep 17 00:00:00 2001 From: Doprez <73259914+Doprez@users.noreply.github.com> Date: Sun, 5 May 2024 17:19:49 -0600 Subject: [PATCH 08/17] Remove empty project --- en/community-resources/physics.md | 1 - 1 file changed, 1 deletion(-) diff --git a/en/community-resources/physics.md b/en/community-resources/physics.md index eb3fc16b4..535a0427c 100644 --- a/en/community-resources/physics.md +++ b/en/community-resources/physics.md @@ -3,4 +3,3 @@ * [Bepu physics integration](https://github.com/Nicogo1705/BepuPhysicIntegrationTest/tree/master) * [Trigger Example](https://github.com/profan/XenkoByteSized#xenkobytesizedtriggerscene---doorscript) * [Vehicle Script](https://github.com/profan/XenkoByteSized#xenkobytesizedvehiclescene---vehiclescript) -* [XenkoRotatingSun](https://github.com/SuavePirate/Xenko.RotatingSun) - Rotating Sun From de744a3471a087703003e7f59417c1851f810042 Mon Sep 17 00:00:00 2001 From: Vaclav Elias Date: Sun, 12 May 2024 23:28:54 +0100 Subject: [PATCH 09/17] feat: Example external overwrite docs added --- en/examples/Stride.Utilities-examples.md | 54 +++--------------------- en/examples/Stride.Utilities-remarks.md | 14 +++--- 2 files changed, 12 insertions(+), 56 deletions(-) diff --git a/en/examples/Stride.Utilities-examples.md b/en/examples/Stride.Utilities-examples.md index 7bb5884c2..e60b97fcf 100644 --- a/en/examples/Stride.Utilities-examples.md +++ b/en/examples/Stride.Utilities-examples.md @@ -1,57 +1,15 @@ --- -uid: Stride.Utilities.Test +uid: Stride.Utilities example: [*content] --- ```csharp -using System; -using System.IO; -using System.Text; +// This example demonstrates how to add C# code snippets to API documentation from external files, though it's unrelated to the subject matter. -class Test -{ - - public static void Main() - { - string path = @"c:\temp\MyTest.txt"; - - // Delete the file if it exists. - if (File.Exists(path)) - { - File.Delete(path); - } - - //Create the file. - using (FileStream fs = File.Create(path)) - { - AddText(fs, "This is some text"); - AddText(fs, "This is some more text,"); - AddText(fs, "\r\nand this is on a new line"); - AddText(fs, "\r\n\r\nThe following is a subset of characters:\r\n"); +var trigger = Entity.Get(); - for (int i=1;i < 120;i++) - { - AddText(fs, Convert.ToChar(i).ToString()); - } - } - - //Open the stream and read it back. - using (FileStream fs = File.OpenRead(path)) - { - byte[] b = new byte[1024]; - UTF8Encoding temp = new UTF8Encoding(true); - int readLen; - while ((readLen = fs.Read(b,0,b.Length)) > 0) - { - Console.WriteLine(temp.GetString(b,0,readLen)); - } - } - } - - private static void AddText(FileStream fs, string value) - { - byte[] info = new UTF8Encoding(true).GetBytes(value); - fs.Write(info, 0, info.Length); - } +foreach (var collision in trigger.Collisions) +{ + //do something with the collision } ``` \ No newline at end of file diff --git a/en/examples/Stride.Utilities-remarks.md b/en/examples/Stride.Utilities-remarks.md index 0736de539..0dc67c409 100644 --- a/en/examples/Stride.Utilities-remarks.md +++ b/en/examples/Stride.Utilities-remarks.md @@ -1,16 +1,14 @@ --- -uid: Stride.Utilities.Test +uid: Stride.Utilities remarks: *content --- -Use the FileStream class to read from, write to, open, and close files on a file system, and to manipulate other file-related operating system handles, including pipes, standard input, and standard output. You can use the Read, Write, CopyTo, and Flush methods to perform synchronous operations, or the ReadAsync, WriteAsync, CopyToAsync, and FlushAsync methods to perform asynchronous operations. Use the asynchronous methods to perform resource-intensive file operations without blocking the main thread. This performance consideration is particularly important in a Windows 8.x Store app or desktop app where a time-consuming stream operation can block the UI thread and make your app appear as if it is not working. FileStream buffers input and output for better performance. +This remark serves as a demonstration of how to use overwrite files in API documentation. Overwrite files allow us to add a remarks section to the API docs seamlessly. > [!NOTE] -> This type implements the IDisposable interface. When you have finished using the type, you should dispose of it either directly or indirectly. To dispose of the type directly, call its Dispose method in a `try/catch block`. To dispose of it indirectly, use a language construct such as `using` (in C#) or Using (in Visual Basic). For more information, see the "Using an Object that Implements IDisposable" section in the IDisposable interface topic. - -The IsAsync property detects whether the file handle was opened asynchronously. You specify this value when you create an instance of the FileStream class using a constructor that has an isAsync, useAsync, or options parameter. When the property is true, the stream utilizes overlapped I/O to perform file operations asynchronously. However, the IsAsync property does not have to be true to call the ReadAsync, WriteAsync, or CopyToAsync method. When the IsAsync property is false and you call the asynchronous read and write operations, the UI thread is still not blocked, but the actual I/O operation is performed synchronously. - -The Seek method supports random access to files. Seek allows the read/write position to be moved to any position within the file. This is done with byte offset reference point parameters. The byte offset is relative to the seek reference point, which can be the beginning, the current position, or the end of the underlying file, as represented by the three members of the SeekOrigin enumeration. +> This text is an example of how to incorporate notes within the documentation. Notes are useful for providing additional information about the subject. You can also use ticks ` for code snippets. > [!CAUTION] -> Disk files always support random access. At the time of construction, the CanSeek property value is set to true or false depending on the underlying file type. If the underlying file type is FILE_TYPE_DISK, as defined in winbase.h, the CanSeek property value is true. Otherwise, the CanSeek property value is false. \ No newline at end of file +> This text is an example of how to incorporate caution notes within the documentation to highlight important information or warnings. + +

Html support is also available in the remarks section.

From a268ada11a48ef96e0208562cb1b46b768b12856 Mon Sep 17 00:00:00 2001 From: Vaclav Elias Date: Sun, 12 May 2024 23:46:24 +0100 Subject: [PATCH 10/17] docs: Physics jitter page styling corrected --- en/manual/physics/fix-physics-jitter.md | 33 ++++++++++++++----------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/en/manual/physics/fix-physics-jitter.md b/en/manual/physics/fix-physics-jitter.md index 72a931613..be4371321 100644 --- a/en/manual/physics/fix-physics-jitter.md +++ b/en/manual/physics/fix-physics-jitter.md @@ -8,7 +8,7 @@ In Stride, there is no default smoothing applied to entities that are attached t In this tutorial, we will explore how to add smoothing to an entity using a SyncScript. > [!Note] -> You can also decrease the `Fixed Time Step` in the physics settings configuration to achieve more accurate physics simulations. For example, changing it from `0.016667` to `0.008` will increase accuracy but at the cost of higher CPU usage. +> You can also decrease the `FixedTimeStep` in the physics settings configuration to achieve more accurate physics simulations. For example, changing it from `0.016667` to `0.008` will increase accuracy but at the cost of higher CPU usage. ## Code to handle smoothing between two entities The following code is all that's needed to smoothly attach two entities. Ensure that you unparent the entity you are trying to smooth, otherwise the transform processor will override this script. @@ -42,7 +42,7 @@ public class SmoothFollowAndRotate : SyncScript ## Example Usage -This example demonstrates modifications to the **First Person Shooter** Template to integrate smooth camera movement. +This example demonstrates modifications to the **First Person Shooter** template to integrate smooth camera movement. 1. Detach the camera from the physics entity. 2. Remove the FPS camera script from the camera. @@ -84,29 +84,32 @@ var inverseView = Matrix.Invert(camera.ViewMatrix); ``` to -`var inverseView = camera.Transform.WorldMatrix;` + +```cs +var inverseView = camera.Transform.WorldMatrix; +``` ### FpsCamera.cs Remove ```cs - /// - /// Gets the camera component used to visualized the scene. - /// - private Entity Component; +/// +/// Gets the camera component used to visualized the scene. +/// +private Entity Component; ``` and change ```cs - private void UpdateViewMatrix() - { - var camera = Component; - if (camera == null) return; - var rotation = Quaternion.RotationYawPitchRoll(Yaw, Pitch, 0); - - Entity.Transform.Rotation = rotation; - } +private void UpdateViewMatrix() +{ + var camera = Component; + if (camera == null) return; + var rotation = Quaternion.RotationYawPitchRoll(Yaw, Pitch0); + + Entity.Transform.Rotation = rotation; +} ``` to From 46c2012b1fa50ff069c43bbebcc822af2dc31fe2 Mon Sep 17 00:00:00 2001 From: IXLLEGACYIXL Date: Mon, 27 May 2024 01:44:18 +0200 Subject: [PATCH 11/17] feat: add STRDIAG010 --- en/diagnostics/STRDIAG010.md | 53 ++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 en/diagnostics/STRDIAG010.md diff --git a/en/diagnostics/STRDIAG010.md b/en/diagnostics/STRDIAG010.md new file mode 100644 index 000000000..fe7ae96a7 --- /dev/null +++ b/en/diagnostics/STRDIAG010.md @@ -0,0 +1,53 @@ +# Diagnostics Warning STRDIAG010 + +> The Type '{0}' doesn't have a public parameterless constructor, which is needed for Serialization + +## Explanation + +By default, Stride serializers only support types that have a parameterless constructor. +If no constructor is defined then the default constructor counts as parameterless constructor. +Primary Constructors with parameters count as non parameterless constructor. +Structs have per default a parameterless constructor so this warning will never appear on a struct. + +## Example + +The following example generates STRDIAG010: + +```csharp +using Stride.Core; + +[DataContract] +public class InvalidSTRDIAG010 +{ + // no parameterless constructor available so it will throw STRDIAG010 + public InvalidSTRDIAG010(int x, int y) + { + + } +} +``` + +The following example doesn't generate STRDIAG010: + +```csharp +public class ValidSTRDIAG010 +{ + // will be ignored by the serializers + public ValidSTRDIAG010(int x, int y) + { + } + // this parameterless constructor will be used by the serializers + public ValidSTRDIAG010() + { + + } +} +``` + +## Solution + +To resolve the warning, add a parameterless constructor that can be used by the serializers. Or remove the @Stride.Core.DataContractAttribute so the class gets entirely ignored by the serialization system. + +## References + +- [Serialisation](../manual/scripts/serialization.md) \ No newline at end of file From bacc83e3ad3c4e90dc652b38556cf0d68f7151ce Mon Sep 17 00:00:00 2001 From: IXLLEGACYIXL Date: Thu, 30 May 2024 23:48:04 +0200 Subject: [PATCH 12/17] fix: apply review --- en/diagnostics/STRDIAG010.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/en/diagnostics/STRDIAG010.md b/en/diagnostics/STRDIAG010.md index fe7ae96a7..68d09fe0c 100644 --- a/en/diagnostics/STRDIAG010.md +++ b/en/diagnostics/STRDIAG010.md @@ -1,13 +1,10 @@ # Diagnostics Warning STRDIAG010 -> The Type '{0}' doesn't have a public parameterless constructor, which is needed for Serialization +> The Type '{0}' doesn't have a public parameterless constructor, which is needed for Serialization. ## Explanation -By default, Stride serializers only support types that have a parameterless constructor. -If no constructor is defined then the default constructor counts as parameterless constructor. -Primary Constructors with parameters count as non parameterless constructor. -Structs have per default a parameterless constructor so this warning will never appear on a struct. +By default, Stride serializers only support types that have a parameterless constructor. If no constructor is defined then the default constructor counts as parameterless constructor. Primary Constructors with parameters count as non parameterless constructor. Structs have per default a parameterless constructor so this warning will never appear on a struct. ## Example From af6585458ce30a67446401a68e3bd85870874bf3 Mon Sep 17 00:00:00 2001 From: jklawreszuk Date: Wed, 5 Jun 2024 13:40:11 +0200 Subject: [PATCH 13/17] Enable to skip pdf generating step --- BuildDocs.ps1 | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/BuildDocs.ps1 b/BuildDocs.ps1 index 8fe4346f3..053492f4d 100644 --- a/BuildDocs.ps1 +++ b/BuildDocs.ps1 @@ -15,12 +15,16 @@ Switch parameter. If provided, the script will build documentation in all available languages and include API documentation. .PARAMETER Version The Version to build the Docs, the default is the latest version +.PARAMETER SkipPdfBuilding + Switch parameter. If provided, It skips Pdf generation step. .EXAMPLE .\BuildDocs.ps1 -BuildAll In this example, the script will build the documentation in all available languages and include API documentation. Use this in GitHub Actions. .EXAMPLE .\BuildDocs.ps1 In this example, the script will prompt the user to select an operation and an optional language. If the user chooses to build the documentation, the script will also ask if they want to include API documentation. +.EXAMPLE + .\BuildDocs.ps1 -SkipPdfBuilding #> param ( @@ -30,6 +34,7 @@ param ( param([string] $CommandName,[string] $ParameterName,[string] $WordToComplete,[System.Management.Automation.Language.CommandAst] $CommandAst,[System.Collections.IDictionary] $FakeBoundParameters) return (Get-Content $PSScriptRoot\versions.json -Encoding UTF8 | ConvertFrom-Json).versions })] + [switch]$SkipPdfBuilding, $Version = $((Get-Content $PSScriptRoot\versions.json -Encoding UTF8 | ConvertFrom-Json).versions | Sort-Object -Descending | Select-Object -First 1) ) @@ -189,12 +194,23 @@ function Build-EnglishDoc { # Output to both build.log and console docfx build en/docfx.json -o $outputDirectory | Write-Host - # Build pdf files - docfx pdf en/docfx.json -o $outputDirectory | Write-Host + Build-EnglishPdf -SkipBuilding $SkipPdfBuilding return $LastExitCode } +function Build-EnglishPdf +{ + param ( + $SkipBuilding + ) + if(!$SkipBuilding) + { + # Build pdf files + docfx pdf en/docfx.json -o $outputDirectory | Write-Host + } +} + function Build-NonEnglishDoc { param ( $SelectedLanguage From 6812bba2301f5cb99d0acf0afbe4ed793af93a30 Mon Sep 17 00:00:00 2001 From: jklawreszuk Date: Wed, 5 Jun 2024 13:41:54 +0200 Subject: [PATCH 14/17] update requirements --- en/manual/files-and-folders/distribute-a-game.md | 2 +- en/manual/platforms/index.md | 6 +++--- en/manual/requirements/index.md | 8 +++++--- en/manual/troubleshooting/stride-doesnt-run.md | 5 +---- jp/manual/files-and-folders/distribute-a-game.md | 2 +- jp/manual/requirements/index.md | 2 +- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/en/manual/files-and-folders/distribute-a-game.md b/en/manual/files-and-folders/distribute-a-game.md index 9195c9a23..2a3525f9d 100644 --- a/en/manual/files-and-folders/distribute-a-game.md +++ b/en/manual/files-and-folders/distribute-a-game.md @@ -65,7 +65,7 @@ After you create a release build, how you distribute it is up to you. To run games made with Stride on Windows, users need: -* .NET 4.6.1 +* .NET 8 SDK * DirectX11 (included with Windows 10 and later), OpenGL, or Vulkan diff --git a/en/manual/platforms/index.md b/en/manual/platforms/index.md index 7c939e0c7..b950dbf5a 100644 --- a/en/manual/platforms/index.md +++ b/en/manual/platforms/index.md @@ -6,9 +6,9 @@ Stride is cross-platform game engine. This means you can create your game once, ## Supported platforms -* Windows Desktop 7, 8, 10 -* Windows Universal (UWP) -* [Linux (Ubuntu)](linux/index.md) +* Windows 7, 8, 10 +* Windows Universal Platform (UWP) +* [Linux](linux/index.md) * Android 2.3 and later * [iOS 8.0 and later](ios.md) diff --git a/en/manual/requirements/index.md b/en/manual/requirements/index.md index af5f336ba..6212d6cd8 100644 --- a/en/manual/requirements/index.md +++ b/en/manual/requirements/index.md @@ -11,12 +11,14 @@ To develop projects with Stride, you need: | CPU | x64 | GPU | Direct3D 10+ compatible GPU | RAM | 4GB (minimum), 8GB (recommended) [see (2)] +| .NET SDK | 8+ [see (3)] | (1) Earlier versions of Windows _may_ work but are untested. (2) RAM requirements vary depending on your project: * Developing simple 2D applications doesn't require much RAM. * Developing 3D games with lots of assets requires larger amounts of RAM. +(3) .NET SDK is being downloaded with the Stride installer ## Mobile development requirements @@ -25,10 +27,10 @@ To develop for mobile platforms, you also need: | Platform | Requirements |----------|------- -| Android | Xamarin [see (3)] -| iOS | Mac computer, Xamarin [see (3)] +| Android | Xamarin [see (4)] +| iOS | Mac computer, Xamarin [see (4)] -(3) Xamarin is included with Visual Studio installations. For instructions about how to install Xamarin with Visual Studio, see [this MSDN page](https://docs.microsoft.com/en-us/visualstudio/cross-platform/setup-and-install). +(4) Xamarin is included with Visual Studio installations. For instructions about how to install Xamarin with Visual Studio, see [this MSDN page](https://docs.microsoft.com/en-us/visualstudio/cross-platform/setup-and-install). ## Running Stride Games diff --git a/en/manual/troubleshooting/stride-doesnt-run.md b/en/manual/troubleshooting/stride-doesnt-run.md index dfb20a46b..0ffea6886 100644 --- a/en/manual/troubleshooting/stride-doesnt-run.md +++ b/en/manual/troubleshooting/stride-doesnt-run.md @@ -34,16 +34,13 @@ To check if this is installed, follow the instructions on [this page](https://le If it's not installed, you can download it from the [Microsoft Download Center](https://dotnet.microsoft.com/en-us/download/dotnet-framework). -> [!Note] -> If you have .NET 4.8 installed, you don't need to install .NET 4.7.2. Each 4.x version is cumulative. - ### Visual Studio 2022 (optional) If you have Visual Studio 2022 (or later) installed, you need to have the following workloads and/or components installed: * **.NET desktop development** with **Development tools for .NET** optional component enabled. > [!Note] -> Earlier versions might work with older version of Stride. However, for Stride 4.2 and later you need to have .NET 8 support. +> Earlier versions might work with older version of Stride. However, for Stride 4.2 and later you only need to have .NET 8 SDK installed. ### Build Tools for Visual Studio 2022 (optional) diff --git a/jp/manual/files-and-folders/distribute-a-game.md b/jp/manual/files-and-folders/distribute-a-game.md index 738550fc7..5a55dae4a 100644 --- a/jp/manual/files-and-folders/distribute-a-game.md +++ b/jp/manual/files-and-folders/distribute-a-game.md @@ -57,7 +57,7 @@ Stride で作成されたゲームを Windows で実行するには、次のものが必要です。 -* .NET 4.6.1 +* .NET 8 SDK * DirectX11 (Windows 10 以降に含まれます)、OpenGL、または Vulkan diff --git a/jp/manual/requirements/index.md b/jp/manual/requirements/index.md index 518718450..58a41063c 100644 --- a/jp/manual/requirements/index.md +++ b/jp/manual/requirements/index.md @@ -36,6 +36,6 @@ Stride がサポートするプラットフォームについては、「[プラ Stride で作成したゲームを実行するには、次のものが必要です。 -- .NET 4.6.1 +- .NET 8 SDK - DirectX11 (Windows 10 以降に含まれます)、OpenGL、または Vulkan - Visual C++ 2015 ランタイム (Visual Studio でのプロジェクトのプロパティの設定に応じて、x86 および x64 のどちらか一方または両方) From 11973045fcc546bc77333beddf5e2cc097bf5dae Mon Sep 17 00:00:00 2001 From: jklawreszuk Date: Wed, 5 Jun 2024 13:43:24 +0200 Subject: [PATCH 15/17] Update outdated/misleading text --- en/manual/engine/file-system.md | 16 ++++++++-------- en/manual/get-started/launch-stride.md | 2 +- en/manual/get-started/visual-studio-extension.md | 2 +- en/manual/nuget/create-packages.md | 3 --- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/en/manual/engine/file-system.md b/en/manual/engine/file-system.md index b268bf28d..4fc0d4743 100644 --- a/en/manual/engine/file-system.md +++ b/en/manual/engine/file-system.md @@ -19,11 +19,11 @@ var gamesave2 = VirtualFileSystem.ApplicationRoaming.OpenStream("gamesave001.dat ## Default mount points -| Mount point | Description | Writable | Cloud | Notes | PC | Android | iOS | Windows Phone 8.1 -| ----------- | -------------| -------- | ----- | -------| ---- | -------- | ------- | -- -| data | Application data, deployed by package | ✗ | ✗ | | Output directory/data | APK itself | Deployed package directory | InstalledLocation.Path -| binary | Application binaries, deployed by package | ✗ | ✗ | Usually the same as *app_data* (except on Android) | Assembly directory | Assembly directory | Assembly directory | Assembly directory -| roaming | User specific data (roaming) | ✓ | ✓ | Backup | Output directory/roaming, *%APPDATA%* | *$(Context.getFilesDir)/roaming* | Library/roaming | Roaming -| local | User application data | ✓ | ✓ | Backup | Output directory/local | $(Context.getFilesDir)local | Library/local | Local -| cache | Application cache | ✓ | ✗ | DLC, etc. Might be deleted manually by user (restore, clear data, etc...) | Output directory/cache, with do-not-back-up flags | *$(Context.getFilesDir)/cache* | Library/caches | LocalCache -| tmp | Application temporary data | ✓ | ✗ | Might be deleted without notice by OS | Output directory/temp, *%TEMP%/%APPNAME%* | *$(Context.getCacheDir)* | tmp | Temporary \ No newline at end of file +| Mount point | Description | Writable | Cloud | Notes | PC | Android | iOS | +|-------------|-------------------------------------------|----------|-------|---------------------------------------------------------------------------|---------------------------------------------------|----------------------------------|----------------------------| +| data | Application data, deployed by package | ✗ | ✗ | | Output directory/data | APK itself | Deployed package directory | +| binary | Application binaries, deployed by package | ✗ | ✗ | Usually the same as *app_data* (except on Android) | Assembly directory | Assembly directory | Assembly directory | +| roaming | User specific data (roaming) | ✓ | ✓ | Backup | Output directory/roaming, *%APPDATA%* | *$(Context.getFilesDir)/roaming* | Library/roaming | +| local | User application data | ✓ | ✓ | Backup | Output directory/local | $(Context.getFilesDir)local | Library/local | +| cache | Application cache | ✓ | ✗ | DLC, etc. Might be deleted manually by user (restore, clear data, etc...) | Output directory/cache, with do-not-back-up flags | *$(Context.getFilesDir)/cache* | Library/caches | +| tmp | Application temporary data | ✓ | ✗ | Might be deleted without notice by OS | Output directory/temp, *%TEMP%/%APPNAME%* | *$(Context.getCacheDir)* | tmp | \ No newline at end of file diff --git a/en/manual/get-started/launch-stride.md b/en/manual/get-started/launch-stride.md index 26377b758..62875e59a 100644 --- a/en/manual/get-started/launch-stride.md +++ b/en/manual/get-started/launch-stride.md @@ -16,7 +16,7 @@ If you choose to install the latest version, the Stride Launcher asks if you wan ![Install Visual Studio integration](media/install-VS-plug-in-prompt.webp) -The Stride Visual Studio extension adds syntax highlighting, live code validation, error checking, and navigation. It also lets you you [edit shaders directly from Visual Studio](../graphics/effects-and-shaders/custom-shaders.md). You don't need to install the extension to use Stride, but we recommend it, especially for programmers. +The Stride Visual Studio extension lets you you [edit shaders directly from Visual Studio](../graphics/effects-and-shaders/custom-shaders.md). You don't need to install the extension to use Stride, but we recommend it, especially for programmers. ## Manage different versions of Stride diff --git a/en/manual/get-started/visual-studio-extension.md b/en/manual/get-started/visual-studio-extension.md index 04e6eba85..a8c559ba7 100644 --- a/en/manual/get-started/visual-studio-extension.md +++ b/en/manual/get-started/visual-studio-extension.md @@ -2,7 +2,7 @@ Beginner -The **Stride Visual Studio extension** adds syntax highlighting, live code validation, error checking, and navigation. It also lets you you [edit shaders directly from Visual Studio](../graphics/effects-and-shaders/custom-shaders.md). +The **Stride Visual Studio extension** lets you [edit shaders directly from Visual Studio](../graphics/effects-and-shaders/custom-shaders.md). You don't need to install the extension to use Stride, but we recommend it, especially for programmers. diff --git a/en/manual/nuget/create-packages.md b/en/manual/nuget/create-packages.md index 4ac2f3ff6..4e6ec4a69 100644 --- a/en/manual/nuget/create-packages.md +++ b/en/manual/nuget/create-packages.md @@ -5,9 +5,6 @@ ## Open your project in Visual Studio -> [!Note] -> Game Studio will later support creating NuGet packages directly. - First of all, after saving all your changes, open your project with Visual Studio. You can easily do this by clicking the appropriate button on the toolbar: ![Open project in Visual Studio](../game-studio/media/open-project-in-visual-studio.png) From 52ff6c1173b941a7cde5a60042ff5e6b93e5db98 Mon Sep 17 00:00:00 2001 From: jklawreszuk Date: Wed, 5 Jun 2024 13:43:40 +0200 Subject: [PATCH 16/17] Add freeimage as requirement --- .../platforms/linux/setup-and-requirements.md | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/en/manual/platforms/linux/setup-and-requirements.md b/en/manual/platforms/linux/setup-and-requirements.md index e08738b75..29c74b56f 100644 --- a/en/manual/platforms/linux/setup-and-requirements.md +++ b/en/manual/platforms/linux/setup-and-requirements.md @@ -85,18 +85,30 @@ sudo dnf install SDL2-devel sudo pacman -S sdl2 ``` ---- +## FreeImage + +FreeImage is battle-tested library for loading and saving popular image file formats like BMP, PNG, JPEG etc. The minimum required version is 3.18 and can be installed via: + -## .NET +### [Debian / Ubuntu](#tab/freeimage-ubuntu) -For information about how to install .NET, see the [.NET instructions for Linux](https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites). +```bash +sudo apt install libfreeimage-dev +``` -We recommend to install .NET 8. To check which version you have installed, type: +### [Fedora](#tab/freeimage-fedora) +```bash +sudo dnf install freeimage-devel ``` -dotnet --info + +### [Arch](#tab/freeimage-arch) + +```bash +sudo pacman -S freeimage ``` + ## See also * [Create a Linux game](create-a-linux-game.md) From e0fad2cd181dbf98996ec185e17dd5c64fea3b05 Mon Sep 17 00:00:00 2001 From: jklawreszuk Date: Wed, 5 Jun 2024 14:23:46 +0200 Subject: [PATCH 17/17] Bring back Net FW note --- en/manual/troubleshooting/stride-doesnt-run.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/en/manual/troubleshooting/stride-doesnt-run.md b/en/manual/troubleshooting/stride-doesnt-run.md index 0ffea6886..3e2d6eafc 100644 --- a/en/manual/troubleshooting/stride-doesnt-run.md +++ b/en/manual/troubleshooting/stride-doesnt-run.md @@ -34,6 +34,9 @@ To check if this is installed, follow the instructions on [this page](https://le If it's not installed, you can download it from the [Microsoft Download Center](https://dotnet.microsoft.com/en-us/download/dotnet-framework). +> [!Note] +> If you have .NET 4.8 installed, you don't need to install .NET 4.7.2. Each 4.x version is cumulative. + ### Visual Studio 2022 (optional) If you have Visual Studio 2022 (or later) installed, you need to have the following workloads and/or components installed: