So, you want to help with Bevy Website? Then this is the right place for you! Bevy is created by volunteers; if you want to help us build the next great game engine, please reach out. We need all the help we can get.
If you want to help with Bevy Engine itself, then see the engine's CONTRIBUTING.md.
We want Bevy to be a vibrant developer community. That's actually why we chose the name; a Bevy is a group of birds, just like we are a group of game developers. Join the Bevy!
The Bevy website is built using the Zola static site engine. In our experience, it is fast, flexible, and straightforward to use.
To check out any local changes you've made:
- Download Zola v0.18.0.
- Clone the Bevy Website git repo and enter that directory:
git clone https://github.com/bevyengine/bevy-website.git
cd bevy-website
- Start the Zola server with
zola serve
.
A local server should start and you should be able to access a local version of the website from there.
The code in the book is compiled and tested to make sure that the examples work for readers.
To check your local changes, move into the code-validation
folder of this project using cd code-validation
, and then run cargo test
. If you write a new section of the book, you have to add it in code-validation/src/lib.rs
to enable code validation for it.
As you probably noticed, our introductory learning material is split into two main sections:
- Bevy Quick Start: "Get started making your first game now!"
- Bevy Book: "Understand how Bevy works, and how you can use it"
This is intended to cater to two different types of learners, without compromising the experience for either:
- Example-first: These users want to dive right in, see everything in action and get a working game as quickly as possible. These users often have an idea in their mind that they want to start prototyping as quickly as possible.
- Definition-first: These users want to carefully build up a mental model of Bevy, thoroughly understanding each new concept before moving on. These users tend to be driven by curiosity, or are aiming to carefully develop a new skill.
Crucially, these paths are independent of the experience levels of the learner! Bevy intentionally aims to be inclusive of both complete beginners who have never programmed before, and professionals coming from other engines.
Beginner | Professional | |
---|---|---|
Example-first | Enthusiastic, wants to create a new version of the game they love. | Exploratory, wants to dive in and see how Bevy holds up in practice. |
Definition-first | Curious, wants to understand how making games works. | Critical, wants to understand Bevy's unique design choices. |
Each of these requires their own complementary learning paths that branch as soon as they get to the Learn page to ensure that the first experience that they have with Bevy matches what they need.
Once users have completed the introductory learning materials in their path of choice, they can begin creating their own games or move on to our advanced examples to see how everything comes together in a realistic way.
Users following the example-first path will tend to take the following route:
- Encounter the Bevy homepage due to social media or word of mouth.
- Navigate to the Learn page.
- Choose one of the most relevant quick start games.
- Complete that tutorial.
- Dive into making the game they have in mind, accessing the following resources as needed when they encounter road-blocks:
- Official Examples.
- The Bevy book.
- Community tutorials and template games.
- Various community support forums.
- Streams, YouTube channels and blogs.
- Advanced examples.
Each quick start game should:
- Assume zero existing knowledge of Bevy.
- Begin with a initial high-level explanation of what we're trying to build.
- Introduce commented code first, then explain what each of the critical terms means as they come up.
- Be broken into compilable, playable sections: one per page of the guide.
- Gradually refactor the code to add more functionality.
- End with a list of suggestions (with appropriate links) on how you could extend the game in interesting ways.
This path should prioritize:
- Rapid time-to-fun.
- Functional, good-enough explanations that are tied to the code in front of them.
- Relevance of quick-start game to the genre of game they want to make.
- High asset quality.
- Ease of extending the quick-start game with their own tweaks.
- Explaining how to get unstuck, through documentation, community help and filing issues.
Users following the definition-first path will tend to take the following route:
- Encounter the Bevy homepage due to social media or word of mouth.
- Navigate to the Learn page.
- Select the Bevy book.
- Read through the book, largely in order.
- Once they feel they have a good enough understanding of the engine, they will begin to make their own games, typically by jumping over onto the example-first path.
- As they explore, they will also browse:
- The source code.
- docs.rs
- CONTRIBUTING.md, GitHub issues and pull requests.
- Release notes.
- The engine development channels on Discord.
- Advanced examples to see how everything comes together.
Each chapter of the Bevy Book should:
- Have a clear topic, and give a high-level overview of the subtopics it is going to cover and how they fit together.
- Be broken down into several sections / pages to focus on detailed topics.
- These should have simple, minimal examples explaining how that functionality works.
- Link to appropriate sections of quick start guides that demonstrate the ideas being taught in a more coherent way.
This path should prioritize:
- Clear, thorough explanations.
- Carefully introducing one concept at a time in an organized fashion.
- Connecting concepts to each other in context.
- Explaining the technical details of how things work, but only in clearly marked asides.
- Communicating all of the supporting development practices that make Bevy productive:
- How to set up your dev environment.
- Code organization.
- Design patterns and best practices.
- Testing, benchmarking and debugging.
- Contributing to Bevy itself.
- Linking to further reading: official examples,
docs.rs
and (very sparingly) source code links.
When writing and reviewing learning material for the Bevy Book and Quick Start Games, please try to follow these guidelines:
- Use clear, simple language.
- Prefer short sentences. Remove extra words.
- Bold new vocabulary words where they are defined.
- Define them as soon as is reasonable after they are introduced.
- Make sure your grammar and spelling are correct.
- Avoid idioms and slang.
- Speak directly to the reader in an approachable tone. Use "we" and "you" pronouns.
- It can be useful to create specific, named characters to demonstrate a point.
- If you do, pick a pronoun set for them and stick to it.
- Otherwise, use "they/them" third-person pronouns to refer to the reader or others.
- Keep humor light.
- Avoid off-color or offensive humor.
- Be mindful not to overuse in-jokes or cultural references.
- Don't drag your jokes out: that's not what the audience is here to read.
- Carefully organize your work into separate pages, headings, paragraphs and code blocks.
- Clearly signal when you are explaining a concept in technical depth so it can be skipped.
- Use lists, numbered lists and sub-lists to present information in bite-sized ways.
- Refer back to these items by number!
- Provide plenty of links, but be sure that what you are linking to is obvious by context.
- Link to other sections of the book / example / web page when you mention them.
- Always link to the most specific location you can, whether that's a section on a page or a method on a struct.
- Use the
latest
tag when linking to Bevy docs and source code so it won't go stale every time the version is updated. - When linking to detailed explanations or discussions, summarize the most important points in addition to providing a link.
- All examples must be able to be compiled and run.
- Prefer game-relevant, descriptive examples and variable names over generic ones like
MyEvent
. Avoid meaningless names likefoo
at all times. - It's good practice to break your code into blocks with comments or explanatory text, but you need to link to a cohesive, copy-able whole at the end.
- Examples must pass Bevy's standard
clippy
lints. - The polish level of your examples should correspond to the point you're trying to make.
- If you're demonstrating a new feature, show only the most basic syntax as locally as possible.
- When trying to explain how a game can be made, organize and polish your code to showcase best practices.
- Lack of polish should serve an end: don't show bad or sloppy practices without a good reason.
- Showing how (and why!) to refactor your code is a very powerful teaching tool.
- Stick to a consistent style (e.g. for loops vs map) within each example.
- If you need to give advice that will only matter to some of your audience (e.g. how to handle an edge case, or support a specific platform), do so in a clearly marked aside or list.
- Examples should not use or rely on third-party plugins.
These may be appropriate to link in "next steps" however at the end of the examples.
- Third-party crates should be limited to the most essential, such as
rand
.
- Third-party crates should be limited to the most essential, such as
- If additional code block attributes like
no_run
orhide-lines=x-y
need to be specified, you should always order these so that the language is the last attribute. If we would specifyrust,no_run
the syntax highlighting wouldn't work, but changing it tono_run,rust
makes it work. - To validate if local code changes are compiling you can
cd
into thecode-validation
folder and test your code usingcargo test
. - To make sure your web-based files (html, markdown) are formatted correctly run the commands:
in the root directory of your local Bevy website repository. This will format markdown files and tell you the issues in HTML files. In order to run the command you should install
markdownlint -f -c .github/linters/.markdown-lint.yml . djlint typos
markdownlint-cli
,djlint
, andtypos-cli
. See: https://github.com/igorshubovych/markdownlint-cli, https://www.djlint.com/docs/getting-started/, and https://github.com/crate-ci/typos?tab=readme-ov-file#install. Note that the CI also includeseditorconfigchecker
but there isn't an easy way to run this manually, so you should instead rely on CI to validate files with this tool. - To hide lines of code in Zola Rust code blocks of the book you should: a. Mark each line you wish to hide with a
#
with an empty space afterwards like# //...line_of_code_here...
although you were hiding lines in rustdoc. b. Run the utility tool in<ROOT_OF_WEBSITE>/write_rustdoc-hide-lines/
namedwrite_rustdoc_hide_lines.sh
. - To reference Rust API docs you can use markdown's reference-style links like so:
HashMap
[`HashMap`]
[`HashMap`]: https://doc.rust-lang.org/std/collections/struct.HashMap.html