Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bevy game templates #5371

Open
alice-i-cecile opened this issue Jul 18, 2022 · 9 comments
Open

Bevy game templates #5371

alice-i-cecile opened this issue Jul 18, 2022 · 9 comments
Labels
C-Examples An addition or correction to our examples X-Controversial There is active debate or serious implications around merging this PR

Comments

@alice-i-cecile
Copy link
Member

alice-i-cecile commented Jul 18, 2022

What problem does this solve or what need does it fill?

Bevy games are becoming increasingly sophisticated. It's important to see realistic examples for both users and developers: teaching best practices, reducing ramp-up and spotting holes in the engine.

For example, 2D platformers are a very popular starting project, and it can be surprisingly hard to figure out how to make one in Bevy.

Game templates, especially official ones, will help educate users, and ensure that the engine ships with the basic tools to make this easy.

What solution would you like?

  1. Create a templates category on Bevy Assets (or its successor).
  2. Create a standardized process by which to make game templates (a meta-template?), likely using cargo generate.
  3. Create an initial official game template or two. These should likely live within the Bevy org, but in their own repo and should be updated before each official release to spot critical problems.

What alternative(s) have you considered?

Create more official example games. This is worse because:

  • bloats the size of this repo, worsening contributor experience
  • cannot be easily used to start new projects
  • cannot reasonably rely on 3rd party plugins, even when using them is best practice
  • harder to discover
  • increases friction with each PR
  • harder to delegate authority for
@alice-i-cecile alice-i-cecile added D-Trivial Nice and easy! A great choice to get started with Bevy C-Examples An addition or correction to our examples and removed D-Trivial Nice and easy! A great choice to get started with Bevy labels Jul 18, 2022
@cart
Copy link
Member

cart commented Jul 18, 2022

As a thought: i think we might want to focus on "game templates" first, then build more complex games like VVVVVV clones on top (and adapt the template as our idea of "best practices" changes).

Ex: a "platformer template" that provides the baseline platforming mechanics, animated sprites / state changes, collisions, and a simple scene, but no real "gameplay loop".

That way people wanting to build a platformer can clone bevy_template_2d_platformer and immediately start fleshing it out, rather than needing to strip out a bunch of specific gameplay things.

(I also agree with removing the good-first-issue label ... example games and templates should be developed by our most informed / experienced developers as they illustrate and effectively define best practices)

@alice-i-cecile
Copy link
Member Author

Yep, I think that's very reasonable. And yeah, I love the idea of game templates, and want to do all we can to develop (and promote) strong ones.

Unsure where those should be kept: probably in their own repos? And then obviously promoted heavily on Bevy Assets.

@cart
Copy link
Member

cart commented Jul 18, 2022

Yup my vote is new repos within the bevyengine org with a standardized naming convention (ex: bevy_template_X) and with Bevy Assets entries (and maybe boosted prominence)

@tigregalis
Copy link
Contributor

tigregalis commented Jul 19, 2022

A good starting point: https://github.com/NiklasEi/bevy_game_template

It does make some opinionated decisions (e.g. using bevy_kira_audio) - is this acceptable?

If so, it could be worth looking at options for each concept; for example, it rolls its own input-mapping solution, but perhaps leafwing-input-manager might be a better choice. And until Stageless lands, using iyes_loopless

That one's a GitHub template, but I'd suggest using cargo-generate - and it can handle all of the "ToDos" renaming.

You could also add conditionals when generating so that you can make other project-specific decisions, e.g. 2D vs 3D? Do you want to include LDTK level editor support? Physics? Then pull in the crate(s) and the basic logic for these. In theory you could have one big branching template.

Edit: This is in relation to the template, not the 2D platformer.

@alice-i-cecile
Copy link
Member Author

I think for template games it's reasonable to use stable ecosystem plugins. We want to showcase genuine best practices, and in a lot of cases, that means "use the cool stuff the community has made".

We may be able to migrate to bevy_audio for simple games though; it's improved a lot since that template was made.

@mockersf
Copy link
Member

I don't think an official template from Bevy should use community plugins if it's to replace a part of Bevy, or if there is more than one plugin for something. And if one was used, it should be under high scrutiny, and removed as soon as another plugin would be created for the same thing.

For templates, we could use one of the recognised universal tool like https://github.com/cookiecutter/cookiecutter or https://yeoman.io, or the rust https://github.com/cargo-generate/cargo-generate.

@alice-i-cecile : should this issue still be about a 2d game, or should it be changed to be about a template?

@tigregalis
Copy link
Contributor

tigregalis commented Jul 21, 2022

@alice-i-cecile : should this issue still be about a 2d game, or should it be changed to be about a template?

Agree with this, or a separate issue with cross-references (the template being a prerequisite for the 2d platformer).

For templates, we could use one of the recognised universal tool like https://github.com/cookiecutter/cookiecutter or https://yeoman.io, or the rust https://github.com/cargo-generate/cargo-generate.

My vote is on cargo-generate, because it's Rust, and Bevy users have already bought into the Rust ecosystem, i.e. users already have cargo and it's a cargo install cargo-generate to get started.

On the other hand: yeoman relies on node and npm, and cookiecutter relies on python.

I don't think an official template from Bevy should use community plugins if it's to replace a part of Bevy,

While I think this is generally a reasonable stance, if the Bevy first-party plugins aren't (yet) to the same standard, then either you do use third-party plugins, or templates are blocked on Bevy catching up in this area. And the fact is, Bevy users do tend to be using these third-party plugins like bevy_kira_audio and iyes_loopless to make real games.

or if there is more than one plugin for something. And if one was used, it should be under high scrutiny, and removed as soon as another plugin would be created for the same thing.

I don't think I agree with this. While it does mean the bevy org is "picking winners", some plugins are objectively further along / more stable / more maintained than others, and how would you build the template / game without these plugins, other than rolling your own plugin (in which case, all you're doing is picking a winner for something less tried and tested than a third-party plugin)?

It might be worth considering what the goals, non-goals and anti-goals of Bevy Templates should be. Some things to consider:

  • Showcasing the bevy ecosystem
  • Demonstrating best practices
  • Making it easy to start a game, e.g. for a game jam

@alice-i-cecile alice-i-cecile changed the title Add a simple 2D platformer example game Bevy game templates Jul 22, 2022
@alice-i-cecile alice-i-cecile added the X-Controversial There is active debate or serious implications around merging this PR label Jul 22, 2022
@alice-i-cecile
Copy link
Member Author

Updated the issue description!

I don't think an official template from Bevy should use community plugins if it's to replace a part of Bevy,

Strongly agreed here. Things like camera, physics, tilemap or input management plugins feel much more reasonable than things like audio plugins or loopless. If we can't make template games due to limitations with the current tools (not just their absence), we need to prioritize upstream fixes.

@janhohenheim
Copy link
Member

Worth noting that there is a strong link between this issue and #1885

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Examples An addition or correction to our examples X-Controversial There is active debate or serious implications around merging this PR
Projects
None yet
Development

No branches or pull requests

5 participants