Giter Site home page Giter Site logo

niklasei / bevy_game_template Goto Github PK

View Code? Open in Web Editor NEW
768.0 8.0 87.0 55.99 MB

Template for a Bevy game including CI/CD for web, Windows, Linux, macOS, iOS and Android

Home Page: https://niklasei.github.io/bevy_game_template/

License: Creative Commons Zero v1.0 Universal

Rust 68.28% Shell 13.70% HTML 3.00% JavaScript 7.84% CSS 3.08% Makefile 3.79% C 0.07% Objective-C 0.24%
bevy game-development template-project hacktoberfest bevy-engine mobile-game rust web-game

bevy_game_template's Introduction

Hi there πŸ‘‹

bevy_game_template's People

Contributors

adamekka avatar altf02 avatar byteatatime avatar caspark avatar chickenchicken9 avatar cleancut avatar cupnfish avatar divark avatar extrawurst avatar fidius-jko avatar gitghillie avatar imgbotapp avatar janhohenheim avatar jrasanen avatar kaydensigh avatar maaku avatar niklasei avatar ramon-bernardo avatar striezel avatar therawmeatball avatar will-hart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bevy_game_template's Issues

Fix web builds for itch

The .zip files currently created by trunk are not compatible with itch.io, because they load resources from non-relative paths.

WARNING: No tag push needed to trigger workflows

Hi,

I was expecting to need to push a tag before github would start charging me for runners on a private repository. Please modify the documentation to realy spell out that one needs to disable them from the gitub webpage.
You might need to make it obnoxiously loud to get the point across.

workflow for GitHub actions creating releases for Windows, Linux, macOS, and Web (Wasm) ready for distribution
* the same workflow creates development builds for the mobile platforms (two separate workflows can push to the stores after some setup)
* push a tag in the form of v[0-9]+.[0-9]+.[0-9]+* (e.g. v1.1.42) to trigger the flow

thanks for the great template!

cheers,

Alia

panic on macOS w/ Apple M2

Steps to reproduce: checkout the template, cd into directory and type cargo run. Panics with:

    Finished dev [optimized + debuginfo] target(s) in 1m 03s
     Running `target/debug/bevy_game`
2023-11-18T20:26:11.043100Z  INFO bevy_render::renderer: AdapterInfo { name: "Apple M2 Ultra", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
thread 'main' panicked at src/main.rs:40:54:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
2023-11-18T20:26:11.134921Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "MacOS 14.1.1 ", kernel: "23.1.0", cpu: "Apple M2 Ultra", core_count: "24", memory: "64.0 GiB" }
Encountered a panic in system `bevy_game::set_window_icon`!
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!

Full backtrace:

    Finished dev [optimized + debuginfo] target(s) in 0.12s
     Running `target/debug/bevy_game`
2023-11-18T20:28:15.565254Z  INFO bevy_render::renderer: AdapterInfo { name: "Apple M2 Ultra", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }
thread 'main' panicked at src/main.rs:40:54:
called `Option::unwrap()` on a `None` value
stack backtrace:
2023-11-18T20:28:15.649828Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "MacOS 14.1.1 ", kernel: "23.1.0", cpu: "Apple M2 Ultra", core_count: "24", memory: "64.0 GiB" }
   0: rust_begin_unwind
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:597:5
   1: core::panicking::panic_fmt
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panicking.rs:72:14
   2: core::panicking::panic
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panicking.rs:127:5
   3: core::option::Option<T>::unwrap
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/option.rs:935:21
   4: bevy_game::set_window_icon
             at ./src/main.rs:40:19
   5: core::ops::function::FnMut::call_mut
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/ops/function.rs:166:5
   6: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/ops/function.rs:294:13
   7: <Func as bevy_ecs::system::function_system::SystemParamFunction<fn(F0,F1) .> Out>>::run::call_inner
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.12.0/src/system/function_system.rs:642:21
   8: <Func as bevy_ecs::system::function_system::SystemParamFunction<fn(F0,F1) .> Out>>::run
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.12.0/src/system/function_system.rs:645:17
   9: <bevy_ecs::system::function_system::FunctionSystem<Marker,F> as bevy_ecs::system::system::System>::run_unsafe
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.12.0/src/system/function_system.rs:485:19
  10: bevy_ecs::schedule::executor::multi_threaded::MultiThreadedExecutor::spawn_system_task::{{closure}}::{{closure}}
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.12.0/src/schedule/executor/multi_threaded.rs:505:26
  11: core::ops::function::FnOnce::call_once
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/ops/function.rs:250:5
  12: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panic/unwind_safe.rs:271:9
  13: std::panicking::try::do_call
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:504:40
  14: std::panicking::try
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:468:19
  15: std::panic::catch_unwind
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panic.rs:142:14
  16: bevy_ecs::schedule::executor::multi_threaded::MultiThreadedExecutor::spawn_system_task::{{closure}}
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.12.0/src/schedule/executor/multi_threaded.rs:500:23
  17: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::future::future::Future>::poll
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panic/unwind_safe.rs:296:9
  18: <futures_lite::future::CatchUnwind<F> as core::future::future::Future>::poll::{{closure}}
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-lite-1.13.0/src/future.rs:626:42
  19: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panic/unwind_safe.rs:271:9
  20: std::panicking::try::do_call
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:504:40
  21: std::panicking::try
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:468:19
  22: std::panic::catch_unwind
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panic.rs:142:14
  23: <futures_lite::future::CatchUnwind<F> as core::future::future::Future>::poll
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-lite-1.13.0/src/future.rs:626:9
  24: async_executor::Executor::spawn::{{closure}}
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-executor-1.6.0/src/lib.rs:151:20
  25: async_task::raw::RawTask<F,T,S,M>::run
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-task-4.5.0/src/raw.rs:568:17
  26: async_task::runnable::Runnable<M>::run
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-task-4.5.0/src/runnable.rs:784:18
  27: async_executor::Executor::tick::{{closure}}
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-executor-1.6.0/src/lib.rs:216:9
  28: bevy_tasks::thread_executor::ThreadExecutorTicker::tick::{{closure}}
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_tasks-0.12.0/src/thread_executor.rs:105:39
  29: bevy_tasks::task_pool::TaskPool::execute_scope::{{closure}}::{{closure}}::{{closure}}
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_tasks-0.12.0/src/task_pool.rs:512:45
  30: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::future::future::Future>::poll
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panic/unwind_safe.rs:296:9
  31: <futures_lite::future::CatchUnwind<F> as core::future::future::Future>::poll::{{closure}}
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-lite-1.13.0/src/future.rs:626:42
  32: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panic/unwind_safe.rs:271:9
  33: std::panicking::try::do_call
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:504:40
  34: std::panicking::try
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:468:19
  35: std::panic::catch_unwind
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panic.rs:142:14
  36: <futures_lite::future::CatchUnwind<F> as core::future::future::Future>::poll
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-lite-1.13.0/src/future.rs:626:9
  37: bevy_tasks::task_pool::TaskPool::execute_scope::{{closure}}::{{closure}}
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_tasks-0.12.0/src/task_pool.rs:515:77
  38: <futures_lite::future::Or<F1,F2> as core::future::future::Future>::poll
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-lite-1.13.0/src/future.rs:526:33
  39: bevy_tasks::task_pool::TaskPool::execute_scope::{{closure}}
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_tasks-0.12.0/src/task_pool.rs:518:41
  40: bevy_tasks::task_pool::TaskPool::scope_with_executor_inner::{{closure}}
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_tasks-0.12.0/src/task_pool.rs:429:85
  41: futures_lite::future::block_on::{{closure}}
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-lite-1.13.0/src/future.rs:89:27
  42: std::thread::local::LocalKey<T>::try_with
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/thread/local.rs:270:16
  43: std::thread::local::LocalKey<T>::with
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/thread/local.rs:246:9
  44: futures_lite::future::block_on
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-lite-1.13.0/src/future.rs:79:11
  45: bevy_tasks::task_pool::TaskPool::scope_with_executor_inner
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_tasks-0.12.0/src/task_pool.rs:383:13
  46: bevy_tasks::task_pool::TaskPool::scope_with_executor::{{closure}}
  47: std::thread::local::LocalKey<T>::try_with
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/thread/local.rs:270:16
  48: std::thread::local::LocalKey<T>::with
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/thread/local.rs:246:9
  49: bevy_tasks::task_pool::TaskPool::scope_with_executor
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_tasks-0.12.0/src/task_pool.rs:316:31
  50: <bevy_ecs::schedule::executor::multi_threaded::MultiThreadedExecutor as bevy_ecs::schedule::executor::SystemExecutor>::run
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.12.0/src/schedule/executor/multi_threaded.rs:198:9
  51: bevy_ecs::world::World::try_run_schedule::{{closure}}
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.12.0/src/world/mod.rs:2074:55
  52: bevy_ecs::world::World::try_schedule_scope
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.12.0/src/world/mod.rs:2007:21
  53: bevy_ecs::world::World::try_run_schedule
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.12.0/src/world/mod.rs:2074:9
  54: bevy_app::main_schedule::Main::run_main
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_app-0.12.0/src/main_schedule.rs:145:27
  55: core::ops::function::FnMut::call_mut
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/ops/function.rs:166:5
  56: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/ops/function.rs:294:13
  57: <Func as bevy_ecs::system::exclusive_function_system::ExclusiveSystemParamFunction<fn(F0) .> Out>>::run::call_inner
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.12.0/src/system/exclusive_function_system.rs:207:21
  58: <Func as bevy_ecs::system::exclusive_function_system::ExclusiveSystemParamFunction<fn(F0) .> Out>>::run
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.12.0/src/system/exclusive_function_system.rs:210:17
  59: <bevy_ecs::system::exclusive_function_system::ExclusiveFunctionSystem<Marker,F> as bevy_ecs::system::system::System>::run
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.12.0/src/system/exclusive_function_system.rs:107:19
  60: <bevy_ecs::schedule::executor::single_threaded::SingleThreadedExecutor as bevy_ecs::schedule::executor::SystemExecutor>::run::{{closure}}
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.12.0/src/schedule/executor/single_threaded.rs:92:21
  61: core::ops::function::FnOnce::call_once
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/ops/function.rs:250:5
  62: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panic/unwind_safe.rs:271:9
  63: std::panicking::try::do_call
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:504:40
  64: std::panicking::try
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:468:19
  65: std::panic::catch_unwind
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panic.rs:142:14
  66: <bevy_ecs::schedule::executor::single_threaded::SingleThreadedExecutor as bevy_ecs::schedule::executor::SystemExecutor>::run
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.12.0/src/schedule/executor/single_threaded.rs:91:27
  67: bevy_ecs::world::World::run_schedule::{{closure}}
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.12.0/src/world/mod.rs:2088:51
  68: bevy_ecs::world::World::try_schedule_scope
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.12.0/src/world/mod.rs:2007:21
  69: bevy_ecs::world::World::schedule_scope
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.12.0/src/world/mod.rs:2059:9
  70: bevy_ecs::world::World::run_schedule
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.12.0/src/world/mod.rs:2088:9
  71: bevy_app::app::App::update
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_app-0.12.0/src/app.rs:265:24
  72: bevy_app::app::App::run
             at /Users/mark/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_app-0.12.0/src/app.rs:317:13
  73: bevy_game::main
             at ./src/main.rs:13:5
  74: core::ops::function::FnOnce::call_once
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Encountered a panic in system `bevy_game::set_window_icon`!
Encountered a panic in system `bevy_app::main_schedule::Main::run_main`!

It seems the set_window_icon system is getting an empty option value when fetching the primary window handle.

Keep the file permissions of the linux build

Currently, the execute permission is set on the linux executable during the workflow job. But the way the build is later zipped does not keep the permission. This means the user always needs to use chmod to set the execute permission on the build...

It seems not possible to keep file permissions with the currently used zip action.

Plugins memo for newcomers

Hey, Rust newbie here, and I just discovered this great game template, and I think it definitely helped me a lot in understanding how Bevy works!

However, since there's a lot of code in here in the src directory, I made myself a small "memo" to list all the plugins and what they're used for.

It's there: https://github.com/Pierstoval/TestBevy/blob/main/memo.md

Do you think this could somehow be added to this project's documentation somehow, with rewrites and adaptations of course?

I think some plugins could refer to very specific documentation pages on Bevy docs, like transformations, audio, or assets.

WDYT?

Add ToDo to main.rs for `use bevy_game::GamePlugin` (error[E0432]: unresolved import `bevy_game`)

I just hit this in https://github.com/chickenchicken9/help_game/actions/runs/4583696654/jobs/8094705941#step:6:499.

I have a fix in https://github.com/chickenchicken9/bevy_game_template_fix_package (or feel free to just write your own - I'm still slowly learning GitHub.)

Full error:

error[E0432]: unresolved import bevy_game
--> src/main.rs:8:5
|
8 | use bevy_game::GamePlugin;
| ^^^^^^^^^ use of undeclared crate or module bevy_game

I assume this happens because I updated the crate name, which had a ToDo (chickenchicken9/help_game@261e698).

trunk serve is broken

The trunk configuration from #90 is a proper solution to issues with absolute URLs in web builds but broke trunk serve, which doesn't like paths starting with a dot. Overwriting the URL in the serve section of Trunk.toml doesn't work since Trunk will add a leading "/" to the path. This should get fixed with trunk-rs/trunk#674

Find a setup that doesn't require ugly sed commands like before #90 but works out of the box with trunk build and trunk serve.

deploy-github-page fails if you use local paths in cargo.toml

As the title says, the deploy-github-page action fails if your cargo.toml has a local path dependency. Maybe this should have been obvious to me but it caught me off guard a bit as when you publish to crates.io it strips the local dependencies out and falls back to the published crate.

If this isn't really a bug it might at least be worth noting in the readme that you should remove local paths before publishing as the cause wasn't immediately obvious.

Failed output from the "Build release" step
Run trunk build --release --public-url "${GITHUB_REPOSITORY#*/}"
2022-08-31T08:00:[4](https://github.com/sarkahn/bevy_ascii_tetris/runs/8108815613?check_suite_focus=true#step:8:5)4.290680Z  INFO πŸ“¦ starting build
2022-08-31T08:00:44.2912[5](https://github.com/sarkahn/bevy_ascii_tetris/runs/8108815613?check_suite_focus=true#step:8:6)1Z  INFO spawning asset pipelines
2022-08-31T08:00:45.[6](https://github.com/sarkahn/bevy_ascii_tetris/runs/8108815613?check_suite_focus=true#step:8:7)56057Z ERROR ❌ error
error from HTML pipeline

Caused by:
    0: error getting cargo metadata
Error: error from HTML pipeline
    1: `cargo metadata` exited with an error: error: failed to get `bevy` as a dependency of package `bevy_ascii_tetris v0.1.0 (/home/runner/work/bevy_ascii_tetris/bevy_ascii_tetris)`
       
       Caused by:

Caused by:
    0: error getting cargo metadata
    1: `cargo metadata` exited with an error: error: failed to get `bevy` as a dependency of package `bevy_ascii_tetris v0.1.0 (/home/runner/work/bevy_ascii_tetris/bevy_ascii_tetris)`
       
       Caused by:
         failed to load source for dependency `bevy`
       
       Caused by:
         Unable to update /home/runner/work/bevy_ascii_tetris/bevy
       
       Caused by:
         failed to read `/home/runner/work/bevy_ascii_tetris/bevy/Cargo.toml`
       
       Caused by:
         No such file or directory (os error 2)
         failed to load source for dependency `bevy`
       
       Caused by:
         Unable to update /home/runner/work/bevy_ascii_tetris/bevy
       
       Caused by:
         failed to read `/home/runner/work/bevy_ascii_tetris/bevy/Cargo.toml`
       
       Caused by:
         No such file or directory (os error 2)

Mac OS release CI workflow fails: "can't find crate for `core`"

I'm trying to run the release CI workflow and only Mac OS fails with this error:

error[E0463]: can't find crate for `core`
  |
  = note: the `aarch64-apple-darwin` target may not be installed
  = help: consider downloading the target with `rustup target add aarch64-apple-darwin`

error[E0463]: can't find crate for `compiler_builtins`

For more information about this error, try `rustc --explain E0463`.
error: could not compile `cfg-if` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
Error: Process completed with exit code 101.

I'm puzzled because the workflow seems to be installing the aarch64-apple-darwin target here:

     - name: Install rust toolchain for Apple Silicon
        uses: dtolnay/rust-toolchain@master
        with:
          toolchain: stable
          targets: aarch64-apple-darwin

Canvas not used with trunk?

Thank you for this awesome template! I migrated my toy bevy game project to it and it is just great to have all the deployment targets set up!

I notice that trunk adds a canvas element to index.html and does not use <canvas id="bevy">.

$ trunk --version
trunk 0.17.5
$ wasm-bindgen --version
wasm-bindgen 0.2.87
$ cargo --version
cargo 1.72.0 (103a7ff2e 2023-08-15)

I worked myself around it by removing this canvas element as well as the surrounding div container.

CI does not fail on clippy warnings

CI does not fail on clippy warnings while it does fail on fmt issues. Is this intentional? Can't think of any reason otherwise to have clippy in the CI.

A fix would be run: cargo clippy --workspace --all-targets --all-features -- -Dwarnings

LTO options in release and dist profiles are swapped

These are the profiles as they currently exist.

[profile.release]
lto = true
codegen-units = 1

# The profile that 'cargo dist' will build with
[profile.dist]
inherits = "release"
lto = "thin"

The parts below produce potentially better optimizations at the cost of speed. (vs thin and default codegen units)

lto = true
codegen-units = 1

I believe they should be in the dist profile, not release.

IMO, LTO shouldn't be used at all in release, but I am impatient.

Readme should mention Mac+Windows CI can get expensive on private repos.

After only 5 pushes I've used 3/4 of my free private repo CI build minutes for the month, mainly due to Mac build minutes being charged at 10x their real minutes. Windows minutes are also charged at 2x their real minutes.

It'd be nice if the readme included a warning for people using private repos that they might want to either upgrade their plan, setup their own runners, or disable mac+windows CI.

GitHub pages support

Are you interested in supporting GitHub pages for WASM builds?
I wanted to make my game's releases very easy to play.
For the moment I just added

      - name: Deploy to GitHub Pages
        uses: JamesIves/[email protected]
        with:
          branch: gh-pages
          folder: wasm
          clean-exclude: index.html

as an additional step of the release-wasm job.

In the future extending this feature to support multiple (all available) release and not just the most recent on could be very interesting.

Building for iOS causes errors

When attempting to use this template I get all these errors when building in Xcode.

cargo_ios
could not compile `cfg-if` (lib) due to 2 previous errors

could not compile `pin-project-lite` (lib) due to 9 previous errors

could not compile `bitflags` (lib) due to 3 previous errors

cannot find macro `panic` in this scope

could not compile `rustc-hash` (lib) due to 4 previous errors

cannot find attribute `derive` in this scope

could not compile `parking` (lib) due to 27 previous errors

could not compile `thiserror` (lib) due to 15 previous errors

cannot determine resolution for the macro `vec`

cannot find macro `assert_eq` in this scope

cannot find macro `write` in this scope

cannot find macro `assert` in this scope

could not compile `log` (lib) due to 92 previous errors

cannot find macro `assert_ne` in this scope

cannot find macro `debug_assert` in this scope

cannot determine resolution for the macro `ptr::addr_of`

cannot determine resolution for the macro `ptr::addr_of_mut`

cannot find macro `unreachable` in this scope

could not compile `futures-core` (lib) due to 75 previous errors

cannot find macro `debug_assert_ne` in this scope

cannot find macro `debug_assert_eq` in this scope

could not compile `libc` (lib) due to 3 previous errors

cannot find macro `matches` in this scope

could not compile `mint` (lib) due to 287 previous errors

could not compile `zerocopy` (lib) due to 341 previous errors

cannot find macro `concat` in this scope

could not compile `once_cell` (lib) due to 241 previous errors

could not compile `bytemuck` (lib) due to 459 previous errors

could not compile `ppv-lite86` (lib) due to 747 previous errors

cannot find macro `unimplemented` in this scope

cannot find attribute `test` in this scope

cannot find macro `format_args` in this scope

cannot find macro `stringify` in this scope

could not compile `memchr` (lib) due to 663 previous errors

could not compile `serde` (lib) due to 5115 previous errors

No clue what I've done wrong, I'm very new to Bevy and Rust in general.

Need to create two crates when registering on crates.io

Hey,

I like the layout of the template! Omakase..

One things is that when comes time to publish to crates.io, I needed to create two crates (this may have caused a technical issue, or I just didnt want to publish 2 crates).

Is there a way to roll the game_plugin crate into the game crate?

I moved the code myself from the game_plugin crate, but I would prefer a better solution if I keep using the template, as it was a little tricky.

Thanks.

Rust Analyser + Symlink to Apps on MacOs = 🀯

Hello, thank you for awesome template.

I encountered issues using it with rust-analyser, it seems that it tried to analyse everything (ok) and even went through symlinks (not ok). Project could not be compiled and everything I got was:

Blocking waiting for file lock on build directory

I was able to solve the issue by deleting the symlink to Applications.
Is this symlink necessary?

macOS deployments only work on the latest macOS version

The issue is MACOSX_DEPLOYMENT_TARGET here: https://github.com/NiklasEi/bevy_game_template/blob/main/.github/workflows/release.yaml#L48
The current config will set this to the newest macOS version, which disables the app on all older machines.
I'm no expert at what a sensible default would be, but I'd wager a good candidate could be 11.0 Big Sur from November 19, 2020, since it is the first version to support universal binaries.

(credit for this discovery and suggested fix goes to @bash who's sitting next to me πŸ˜„)

Logging

I don't see any examples of using println! or console.log. I think it would be good to include a macro to handle this in a way that works for both wasm and native platforms. Frankly, I don't know how to do it and am trying to figure it out.

The windows installer cannot be created for versions wit pre-release or build numbers

E.g.

C:\Program Files\dotnet\sdk\7.0.202\NuGet.targets(132,5): error : 'v0.1.0-manual' is not a valid version string. (Parameter 'value') [D:\a\bevy_game_template\bevy_game_template\build\windows\installer\Installer.wixproj]

Build FAILED.

C:\Program Files\dotnet\sdk\7.0.202\NuGet.targets(132,5): error : 'v0.1.0-manual' is not a valid version string. (Parameter 'value') [D:\a\bevy_game_template\bevy_game_template\build\windows\installer\Installer.wixproj]
    0 Warning(s)
    1 Error(s)

Edit: for some reason, this currently also happens with "normal" version strings like v0.1.0. As a workaround, please apply 6fd0f16 to disable the windows installer.

Stuck at trunk serve

It's been 10min and it keep saying

test_bevy_template]$ trunk serve
2023-11-28T12:35:31.683422Z  INFO πŸ“¦ starting build
2023-11-28T12:35:31.683729Z  INFO spawning asset pipelines

Requested resource does not exist on linux native

Hello, I tried to clone your repo but something must have gone wrong.
Everything works fine with cargo make serve but when I try to run a simple cargo run the game crashes right after start with this error: thread 'mainthread '' panicked at 'Requested resource does not exist: alloc::boxed::Box<dyn bevy_render::renderer::render_resource_context::RenderResourceContext>...

Here's the full error with RUST_BACKTRACE=1 https://pastebin.com/Cs10g1Qc
rustc --version = rustc 1.56.1 (59eed8a2a 2021-11-01)
uname -a = Linux snowy-pc 5.10.70-1-MANJARO #1 SMP PREEMPT Thu Sep 30 15:29:01 UTC 2021 x86_64 GNU/Linux

Fullscreen CSS tweak

Thanks so much for maintaining this template, I really appreciate it especially the out-of-the-box CI/CD.

I notice that in order to get Itch.io full-screen working correctly (i.e. actually full-screen and not letterboxed) I'm needing to add the following CSS:

canvas#bevy {
    flex-grow: 1;
    z-index: 2;
    height: 100% !important;
    width: 100% !important;
}

Perhaps a trifle hacky, but it does work. I think it may be something to do with the various styles Itch itself injects. Would you accept a PR like this, or is it something you'd prefer folks add after the fact?

Edit: I also needed to add

    height: 100%;
    width: 100%;

to .game-container.

Thanks

Self-closing issue to say thanks so much for what must have been a considerable amount of work putting this together. I really appreciate the time and attention to detail.

Update bevy_main branch

Currently, Bevy commit 4f341430469acef478a709aff00bde375743f946 does not work with bevy_webgl2 due to dependency version mismatches.

Error when compiling apk

When I run the build command cargo apk run -p mobile I get the following error.

info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: latest update on 2023-12-10, rust version 1.76.0-nightly (06e02d5b2 2023-12-09)
info: component 'clippy' for target 'x86_64-pc-windows-msvc' is up to date
info: component 'rust-std' for target 'aarch64-linux-android' is up to date
info: component 'rust-std' for target 'armv7-linux-androideabi' is up to date
info: component 'rustfmt' for target 'x86_64-pc-windows-msvc' is up to date
warning: Force-skipping unavailable component 'cargo-apk-x86_64-pc-windows-msvc'
Using package `mobile` in `C:\Users\Administrator\Documents\projects\hero-showdown\mobile\Cargo.toml`
Warning: Environment variable ANDROID_SDK_ROOT is deprecated (https://developer.android.com/studio/command-line/variables#envar). It will be used until it is unset and replaced by ANDROID_HOME.
Warning: Environment variable ANDROID_SDK_HOME is deprecated (https://developer.android.com/studio/command-line/variables#envar). It will be used until it is unset and replaced by ANDROID_USER_HOME.
   Compiling bevy_utils v0.12.0
   Compiling tokio-util v0.7.10
   Compiling wgpu-hal v0.17.2
   Compiling naga_oil v0.10.0
   Compiling gltf-json v1.3.0
   Compiling egui v0.23.0
   Compiling quinn-proto v0.10.6
   Compiling trust-dns-proto v0.21.2
   Compiling bson v2.7.0
   Compiling arboard v3.3.0
   Compiling tokio-rustls v0.24.1
   Compiling bevy-inspector-egui-derive v0.21.0
   Compiling typed-builder v0.10.0
   Compiling derivative v2.2.0
   Compiling redis-macros-derive v0.1.1
   Compiling bevy_asset_loader_derive v0.18.0
error[E0433]: failed to resolve: could not find `Clipboard` in `platform`                                                                                                                                                                                                                                          
  --> C:\Users\Administrator\.cargo\registry\src\rsproxy.cn-0dccff568467c15b\arboard-3.3.0\src\lib.rs:68:38
   |
68 |         Ok(Clipboard { platform: platform::Clipboard::new()? })
   |                                            ^^^^^^^^^ could not find `Clipboard` in `platform`

error[E0433]: failed to resolve: could not find `Clear` in `platform`                                                                                                                                                                                                                                              
   --> C:\Users\Administrator\.cargo\registry\src\rsproxy.cn-0dccff568467c15b\arboard-3.3.0\src\lib.rs:122:31
    |
122 |         Clear { platform: platform::Clear::new(&mut self.platform) }
    |                                     ^^^^^ could not find `Clear` in `platform`

error[E0433]: failed to resolve: could not find `Get` in `platform`                                                                                                                                                                                                                                                
   --> C:\Users\Administrator\.cargo\registry\src\rsproxy.cn-0dccff568467c15b\arboard-3.3.0\src\lib.rs:127:29
    |
127 |         Get { platform: platform::Get::new(&mut self.platform) }
    |                                   ^^^ could not find `Get` in `platform`

error[E0433]: failed to resolve: could not find `Set` in `platform`                                                                                                                                                                                                                                                
   --> C:\Users\Administrator\.cargo\registry\src\rsproxy.cn-0dccff568467c15b\arboard-3.3.0\src\lib.rs:132:29
    |
132 |         Set { platform: platform::Set::new(&mut self.platform) }
    |                                   ^^^ could not find `Set` in `platform`

error[E0412]: cannot find type `Clipboard` in module `platform`                                                                                                                                                                                                                                                    
  --> C:\Users\Administrator\.cargo\registry\src\rsproxy.cn-0dccff568467c15b\arboard-3.3.0\src\lib.rs:62:33
   |
62 |     pub(crate) platform: platform::Clipboard,
   |                                    ^^^^^^^^^ not found in `platform`

error[E0412]: cannot find type `Get` in module `platform`
   --> C:\Users\Administrator\.cargo\registry\src\rsproxy.cn-0dccff568467c15b\arboard-3.3.0\src\lib.rs:139:33
    |
139 |     pub(crate) platform: platform::Get<'clipboard>,
    |                                    ^^^ not found in `platform`

error[E0412]: cannot find type `Set` in module `platform`
   --> C:\Users\Administrator\.cargo\registry\src\rsproxy.cn-0dccff568467c15b\arboard-3.3.0\src\lib.rs:163:33
    |
163 |     pub(crate) platform: platform::Set<'clipboard>,
    |                                    ^^^ not found in `platform`

error[E0412]: cannot find type `Clear` in module `platform`
   --> C:\Users\Administrator\.cargo\registry\src\rsproxy.cn-0dccff568467c15b\arboard-3.3.0\src\lib.rs:204:33
    |
204 |     pub(crate) platform: platform::Clear<'clipboard>,
    |                                    ^^^^^ not found in `platform`

Some errors have detailed explanations: E0412, E0433.                                                                                                                                                                                                                                                              
For more information about an error, try `rustc --explain E0412`.
error: could not compile `arboard` (lib) due to 8 previous errors                                                                                                                                                                                                                                                  
warning: build failed, waiting for other jobs to finish...
Error: Command `cargo build --target aarch64-linux-android --package mobile` had a non-zero exit code. 

My compilation on windows,I ran the example of this repository arboard directly and there was no problem
image

Wasm builds fail

Thanks for making this template, but when I try to follow the steps to build for web on a fresh clone of this repo, it fails with the following output:

Finished dev [optimized + debuginfo] target(s) in 2m 01s
Running wasm-server-runner target/wasm32-unknown-unknown/debug/bevy_game.wasm
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', /home/pixelartist/.cargo/registry/src/github.com-1ecc6299db9ec823/wasm-bindgen-cli-support-0.2.79/src/descriptor.rs:208:15

I get the same error when I try to use Github Actions to build this template from tags. It seems like an issue with the wasm-bindgen step?

However, I am able to build the standard Bevy examples to web just fine.

Is anyone else running into this issue? I'm running the latest version of Pop OS (Linux) and am able to build the template for Linux just fine, just not for web.

Extend menu

Add links to Bevy and the github repository. Is there an easy way to include a credits list generated from the credits directory?

Error on step `Deploy to GitHub Pages`

I have triggered the deploy-github-page as you instructed in your README.md in header, β€œDeploy web build to GitHub pages”.
Got error message on step Deploy to GitHub Pages.

Error: The deploy step encountered an error: The process '/usr/bin/git' failed with exit code 128 ❌
Notice: Deployment failed! ❌

Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
```
My fork is https://github.com/Siiir/ArbiGame .

Running `cargo make serve` on Windows fails

I've forked your template and trying to run on web 'as-is'. It finishes compilation and then unfortunately fails with this:

   ...
   Replacing C:\Users\username\.cargo\bin\wasm2es6js.exe
    Replaced package `wasm-bindgen-cli v0.2.69` with `wasm-bindgen-cli v0.2.69` (executables `wasm-bindgen-test-runner.exe`, `wasm-bindgen.exe`, 
`wasm2es6js.exe`)
[cargo-make] INFO - Execute Command: "wasm-bindgen" "--out-dir" "target/wasm32-unknown-unknown/release/" "--out-name" "wasm" "--target" "web" "--no-typescript" "target/wasm32-unknown-unknown/release/bevy_game.wasm"
[cargo-make] INFO - Execute Command: "mkdir" "-p" "build/web/target"
[cargo-make] ERROR - Error while executing command, error: Os {
    code: 2,
    kind: NotFound,
    message: "The system cannot find the file specified.",
}

I think it's something trivial, but I can't figure it out.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.