From 98197ec34899204385d72c57f890e0bffdb2239c Mon Sep 17 00:00:00 2001 From: Alice Cecile Date: Fri, 11 Feb 2022 13:14:22 -0500 Subject: [PATCH 01/35] Add markdownlint to CI --- .github/workflows/ci.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87cd7f0d62..e4f53c6796 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,3 +30,21 @@ jobs: BUILD_DIR: . BUILD_ONLY: true TOKEN: fake-secret + + markdownlint: + runs-on: ubuntu-latest + needs: check-missing-examples-in-docs + if: always() + steps: + - uses: actions/checkout@v2 + with: + # Full git history is needed to get a proper list of changed files within `super-linter` + fetch-depth: 0 + - name: Run Markdown Lint + uses: docker://ghcr.io/github/super-linter:slim-v4 + env: + VALIDATE_ALL_CODEBASE: false + VALIDATE_MARKDOWN: true + DEFAULT_BRANCH: main + # Not needed here as only one Linter is used. + #GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 8737cfeae0d5dbe3ba26a41e5f53045a10235812 Mon Sep 17 00:00:00 2001 From: Alice Cecile Date: Fri, 11 Feb 2022 13:14:54 -0500 Subject: [PATCH 02/35] Add dead-link checking to CI --- .github/workflows/ci.yml | 49 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4f53c6796..b9a7df54e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,3 +48,52 @@ jobs: DEFAULT_BRANCH: main # Not needed here as only one Linter is used. #GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + check-markdown-links: + runs-on: ubuntu-latest + needs: markdownlint + if: always() + steps: + - uses: actions/checkout@v2 + - name: check dead links + continue-on-error: true + id: run1 + uses: gaurav-nelson/github-action-markdown-link-check@9710f0fec812ce0a3b98bef4c9d842fc1f39d976 + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' + config-file: '.github/linters/markdown-link-check.json' + - name: Sleep for 30 seconds + if: steps.run1.outcome=='failure' + run: sleep 30s + shell: bash + - name: check dead links (retry) + continue-on-error: true + id: run2 + if: steps.run1.outcome=='failure' + uses: gaurav-nelson/github-action-markdown-link-check@9710f0fec812ce0a3b98bef4c9d842fc1f39d976 + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' + config-file: '.github/linters/markdown-link-check.json' + - name: Sleep for 30 seconds + if: steps.run2.outcome=='failure' + run: sleep 30s + shell: bash + - name: check dead links (retry 2) + continue-on-error: true + id: run3 + if: steps.run2.outcome=='failure' + uses: gaurav-nelson/github-action-markdown-link-check@9710f0fec812ce0a3b98bef4c9d842fc1f39d976 + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' + config-file: '.github/linters/markdown-link-check.json' + - name: set the status + if: always() + run: | + if ${{ steps.run1.outcome=='success' || steps.run2.outcome=='success' || steps.run3.outcome=='success' }}; then + echo success + else + exit 1 + fi From 2aa6680ff5588b5791843d9db215ed108b6a0ea6 Mon Sep 17 00:00:00 2001 From: Alice Cecile Date: Fri, 11 Feb 2022 13:16:18 -0500 Subject: [PATCH 03/35] Clean up CI logic to adapt from bevyengine/bevy context --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9a7df54e8..b605b27c37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,8 +33,6 @@ jobs: markdownlint: runs-on: ubuntu-latest - needs: check-missing-examples-in-docs - if: always() steps: - uses: actions/checkout@v2 with: @@ -51,8 +49,6 @@ jobs: check-markdown-links: runs-on: ubuntu-latest - needs: markdownlint - if: always() steps: - uses: actions/checkout@v2 - name: check dead links From 55dd01c5054be39d305fa403cbe3e21cf5652d76 Mon Sep 17 00:00:00 2001 From: Alice Cecile Date: Fri, 11 Feb 2022 13:19:28 -0500 Subject: [PATCH 04/35] Ignore some mdlint rules --- .github/workflows/linters/.markdown-lint.yml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .github/workflows/linters/.markdown-lint.yml diff --git a/.github/workflows/linters/.markdown-lint.yml b/.github/workflows/linters/.markdown-lint.yml new file mode 100644 index 0000000000..6b7d62c3dd --- /dev/null +++ b/.github/workflows/linters/.markdown-lint.yml @@ -0,0 +1,5 @@ + +{ + "line-length": false, + "no-inline-html": false, +} \ No newline at end of file From d973184d30d0165c438f4e2752ba9185a0513a74 Mon Sep 17 00:00:00 2001 From: Alice Cecile Date: Fri, 11 Feb 2022 17:17:31 -0500 Subject: [PATCH 05/35] Ignore mdlint 40 due to presence of untyped error code blocks --- .github/workflows/linters/.markdown-lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linters/.markdown-lint.yml b/.github/workflows/linters/.markdown-lint.yml index 6b7d62c3dd..fbff9ecd1f 100644 --- a/.github/workflows/linters/.markdown-lint.yml +++ b/.github/workflows/linters/.markdown-lint.yml @@ -2,4 +2,5 @@ { "line-length": false, "no-inline-html": false, + "fenced-code-language": false, } \ No newline at end of file From f78bc515fd92dafc1709c4c1cbcd9520aa078bfa Mon Sep 17 00:00:00 2001 From: Alice Cecile Date: Fri, 11 Feb 2022 17:26:29 -0500 Subject: [PATCH 06/35] Update CI to target master rather than main --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b605b27c37..d7bc69f84b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,7 +43,7 @@ jobs: env: VALIDATE_ALL_CODEBASE: false VALIDATE_MARKDOWN: true - DEFAULT_BRANCH: main + DEFAULT_BRANCH: master # Not needed here as only one Linter is used. #GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From d8eafdd80def516ce1dd0b6849cc11ef223e5df1 Mon Sep 17 00:00:00 2001 From: Alice Cecile Date: Fri, 11 Feb 2022 17:43:30 -0500 Subject: [PATCH 07/35] Allow trailing punctuation in headers to support Cart's enthusiasm --- .github/workflows/linters/.markdown-lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/linters/.markdown-lint.yml b/.github/workflows/linters/.markdown-lint.yml index fbff9ecd1f..00699c1fdf 100644 --- a/.github/workflows/linters/.markdown-lint.yml +++ b/.github/workflows/linters/.markdown-lint.yml @@ -3,4 +3,5 @@ "line-length": false, "no-inline-html": false, "fenced-code-language": false, + "no-trailing-punctuation": false, } \ No newline at end of file From cacf645618298ee39454bc391207f2fbf14e405d Mon Sep 17 00:00:00 2001 From: Alice Cecile Date: Sun, 13 Feb 2022 21:47:21 -0500 Subject: [PATCH 08/35] Lint news posts --- .../news/2020-08-10-introducing-bevy/index.md | 62 ++-- content/news/2020-08-19-scaling-bevy/index.md | 15 +- content/news/2020-09-19-bevy-0.2/index.md | 131 ++++--- content/news/2020-11-03-bevy-0.3/index.md | 175 +++++----- content/news/2020-12-19-bevy-0.4/index.md | 212 ++++++------ content/news/2021-04-06-bevy-0.5/index.md | 326 +++++++++--------- 6 files changed, 463 insertions(+), 458 deletions(-) diff --git a/content/news/2020-08-10-introducing-bevy/index.md b/content/news/2020-08-10-introducing-bevy/index.md index fc0dfb2aaf..a71ca5319e 100644 --- a/content/news/2020-08-10-introducing-bevy/index.md +++ b/content/news/2020-08-10-introducing-bevy/index.md @@ -20,7 +20,7 @@ It has the following design goals: * Capable: Offer a complete 2D and 3D feature set * Simple: Easy for newbies to pick up, but infinitely flexible for power users -* Data Focused: Data-oriented architecture using the Entity Component System paradigm +* Data Focused: Data-oriented architecture using the Entity Component System paradigm * Modular: Use only what you need. Replace what you don't like * Fast: App logic should run quickly, and when possible, in parallel * Productive: Changes should compile quickly ... waiting isn't fun @@ -33,6 +33,7 @@ Bevy has a number of features that I think set it apart from other engines: * Productive Compile Times: Expect changes to compile in ~0.8-3.0 seconds with the "fast compiles" config It also has many features most people expect from a modern, general purpose engine: + * Cross Platform: Windows, MacOS, and Linux (with planned support for mobile and web) * 3D: Lights, meshes, textures, MSAA, and GLTF loading * Sprites: Render individual images as sprites, render from sprite sheets, and dynamically generate new sprite sheets @@ -45,17 +46,15 @@ It also has many features most people expect from a modern, general purpose engi * Hot Asset Reloading: Automatically reload changes to assets at runtime without recompiles or restarts * Events: Efficiently consume and produce Events from within ECS systems * Properties: Dynamically get and set component fields using a string version of their names -* Hierarchical Transforms: Create parent-child relationships between entities that propagate Transforms down the hierarchy +* Hierarchical Transforms: Create parent-child relationships between entities that propagate Transforms down the hierarchy That being said, Bevy is still in the very early stages. I consider it to be in the "prototyping" phase: features are missing, APIs will change, and documentation is sparse. I don't yet recommend using Bevy in serious projects unless you are willing to deal with gaps and instability. - Hopefully at this point you are either (1) jazzed about Bevy or (2) not reading anymore. If you want to dive in right now, [The Bevy Book](https://bevyengine.org/learn/book/introduction/) is the best place to get started. You can also keep reading to find out what the current state of Bevy is and where we'd like to take it. **Quick note to the reader**: in this article you will find text formatted like this: {{rust_type(type="struct" crate="bevy_render" version="0.1.0" mod="texture" name="Texture" no_mod=true)}} This formatting indicates that the text is a Rust type that links to API documentation. I encourage you to click on anything that seems interesting to you! - ## Bevy Apps @@ -105,6 +104,7 @@ All Bevy engine and game logic is built on top of a custom [Entity Component Sys The ECS pattern encourages clean, decoupled designs by forcing you to break up your app data and logic into its core components. Unlike other Rust ECS implementations, which require complex lifetimes, traits, builder patterns, or macros, Bevy ECS uses normal Rust datatypes for all of these concepts: + * Components: normal Rust structs * Systems: normal Rust functions * Entities: a type containing a unique integer @@ -148,6 +148,7 @@ That is a complete self-contained Bevy app with automatic parallel system schedu ### Performance One of the reasons the ECS paradigm is so popular is that it has the potential to make game logic _super_ fast, primarily for these two reasons: + 1. Iteration Speed: Components are packed tightly together to optimize for cache-locality, which makes iterating over them blazing fast 2. Parallelism: Systems declare read/write dependencies, which enables automatic and efficient lock-free parallel scheduling @@ -161,7 +162,7 @@ Bevy ECS does both of these things about as well as it can. According to the pop ![ecs iter performance graph](ecs_build.svg) -Note that `ecs_bench` is a single threaded benchmark, so it doesn't illustrate the multi-threading capabilities of these framework. And as always, please be aware that `ecs_bench` is a micro benchmark and it doesn't illustrate the performance of a complex game. There is a lot of nuance in the ECS performance space and each of the ECS implementations above will perform differently under different workloads. +Note that `ecs_bench` is a single threaded benchmark, so it doesn't illustrate the multi-threading capabilities of these framework. And as always, please be aware that `ecs_bench` is a micro benchmark and it doesn't illustrate the performance of a complex game. There is a lot of nuance in the ECS performance space and each of the ECS implementations above will perform differently under different workloads. I have pushed my version of `ecs_bench` [here](https://github.com/cart/ecs_bench) if anyone wants to double-check my methodology. For some reasonable amount of time I will post updates here if anyone reports a problem or my results are not (on average) reproducible. @@ -192,6 +193,7 @@ fn system(mut query: Query<(&Position, &mut Velocity)>) { ``` #### Change Detection + ```rs // Added queries only run when the given component has been added fn system(mut query: Query>) { @@ -223,6 +225,7 @@ fn system(mut query: Query<&Position>>) { ``` #### Multiple Queries + ```rs fn system(mut wall_query: Query<&Wall>, mut player_query: Query<&Player>) { for player in &mut player_query.iter() { @@ -236,6 +239,7 @@ fn system(mut wall_query: Query<&Wall>, mut player_query: Query<&Player>) { ``` #### Entity Queries and Direct Component Access + ```rs fn system(mut entity_query: Query, mut player_query: Query<&Player>) { for entity in &mut entity_query.iter() { @@ -247,6 +251,7 @@ fn system(mut entity_query: Query, mut player_query: Query<&Player>) { ``` #### Resources + ```rs // Res and ResMut access global resources fn system(time: Res