amethyst / space-menace Goto Github PK
View Code? Open in Web Editor NEWAn action 2D platformer made with Amethyst game engine
License: MIT License
An action 2D platformer made with Amethyst game engine
License: MIT License
Currently, there is a very basic implementation of dying logic. To improve upon the current implementation, the first step is to add the logic to delete the marine entity once it dies and falls out of the screen.
It feels like there is between 200ms-500ms delay between pressing a key and seeing a response. Do others see the same thing?
Level map is incomplete. The complete map needs to be designed.
The assets are available here. Feel free to add / modify assets if required.
For those who are new to Tiled, here is an excellent tutorial.
[deemon@Zen space-menace]$ cargo run
warning: spurious network error (2 tries remaining): [28] Timeout was reached (download of `im v12.3.4` failed to transfer more than 10 bytes in 30s)
warning: spurious network error (2 tries remaining): [28] Timeout was reached (failed to download any data for `httpdate v0.3.2` within 30s)
Downloading 71 crates, remaining bytes: 33.0 KB
and pretty much for everything.
I have managed to compile on NixOS, but the resulting executable can't find its runtime dependencies (specifically libXrandr.so.2
but I suspect the issue will happen again with other dependencies).
Command:
nix-shell -p rustup pkg-config openssl alsaLib xorg.libX11 xorg.libXrandr cmake python3 freetype expat --run 'cargo run'
Output:
Finished dev [unoptimized + debuginfo] target(s) in 6.16s
Running `target/debug/space-menace`
thread 'main' panicked at 'Failed to initialize any backend! Wayland status: NoCompositorListening X11 status: LibraryOpenError(OpenError { kind: Library, detail: "opening library failed (libXrandr.so.2.2.0: cannot open shared object file: No such file or directory); opening library failed (libXrandr.so.2: cannot open shared object file: No such file or directory); opening library failed (libXrandr.so: cannot open shared object file: No such file or directory)" })', /home/naughtylus/.cargo/registry/src/github.com-1ecc6299db9ec823/winit-0.19.2/src/platform/linux/mod.rs:459:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
(This is a dev build, but the same happens with a release build)
This is the first Rust project I try to compile on NixOS, I'll ask on the Nix Matrix room for insights.
OS: Manjaro Linux x86_64
Kernel: 5.10.42-1-MANJARO
CPU: Intel Celeron J1800 (2) @ 2.415GHz
GPU: Intel Atom Processor Z36xxx/Z37xxx Series Graphics & Display
RAM: 4G
Got the following error:
error[E0308]: mismatched types --> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/bigcomp.rs:243:55 | 243 | let nlz = den.leading_zeros().wrapping_sub(wlz) & (u32::BITS - 1); | ^^^^^^^^^^^^^^^ expected
usize, found
u32`
error[E0277]: no implementation for usize & u32
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/bigcomp.rs:243:53
|
243 | let nlz = den.leading_zeros().wrapping_sub(wlz) & (u32::BITS - 1);
| ^ no implementation for usize & u32
|
= help: the trait BitAnd<u32>
is not implemented for usize
error[E0308]: mismatched types
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/bigcomp.rs:261:40
|
261 | let (q, r) = shift.ceil_divmod(Limb::BITS);
| ^^^^^^^^^^ expected usize
, found u32
|
help: you can convert a u32
to a usize
and panic if the converted value doesn't fit
|
261 | let (q, r) = shift.ceil_divmod(Limb::BITS.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/bigint.rs:85:24
|
85 | let bytes = bits / Limb::BITS;
| ^^^^^^^^^^ expected usize
, found u32
error[E0277]: cannot divide usize
by u32
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/bigint.rs:85:22
|
85 | let bytes = bits / Limb::BITS;
| ^ no implementation for usize / u32
|
= help: the trait Div<u32>
is not implemented for usize
error[E0308]: mismatched types
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1045:42
|
1045 | let mut count = index.saturating_mul(Limb::BITS);
| ^^^^^^^^^^ expected usize
, found u32
|
help: you can convert a u32
to a usize
and panic if the converted value doesn't fit
|
1045 | let mut count = index.saturating_mul(Limb::BITS.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1060:28
|
1060 | Limb::BITS.checked_mul(x.len())
| ^^^^^^^ expected u32
, found usize
|
help: you can convert a usize
to a u32
and panic if the converted value doesn't fit
|
1060 | Limb::BITS.checked_mul(x.len().try_into().unwrap())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1061:22
|
1061 | .map(|v| v - nlz)
| ^^^ expected u32
, found usize
error[E0277]: cannot subtract usize
from u32
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1061:20
|
1061 | .map(|v| v - nlz)
| ^ no implementation for u32 - usize
|
= help: the trait Sub<usize>
is not implemented for u32
error[E0308]: mismatched types
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1062:20
|
1062 | .unwrap_or(usize::max_value())
| ^^^^^^^^^^^^^^^^^^ expected u32
, found usize
|
help: you can convert a usize
to a u32
and panic if the converted value doesn't fit
|
1062 | .unwrap_or(usize::max_value().try_into().unwrap())
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1060:5
|
1056 | pub fn bit_length(x: &[Limb]) -> usize {
| ----- expected usize
because of return type
...
1060 | / Limb::BITS.checked_mul(x.len())
1061 | | .map(|v| v - nlz)
1062 | | .unwrap_or(usize::max_value())
| |______________________________________^ expected usize
, found u32
|
help: you can convert a u32
to a usize
and panic if the converted value doesn't fit
|
1060 | Limb::BITS.checked_mul(x.len())
1061 | .map(|v| v - nlz)
1062 | .unwrap_or(usize::max_value()).try_into().unwrap()
|
error[E0308]: mismatched types
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1087:23
|
1087 | debug_assert!(n < bits && n != 0);
| ^^^^ expected usize
, found u32
|
help: you can convert a u32
to a usize
and panic if the converted value doesn't fit
|
1087 | debug_assert!(n < bits.try_into().unwrap() && n != 0);
| ^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1094:25
|
1094 | let lshift = bits - n;
| ^ expected u32
, found usize
error[E0277]: cannot subtract usize
from u32
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1094:23
|
1094 | let lshift = bits - n;
| ^ no implementation for u32 - usize
|
= help: the trait Sub<usize>
is not implemented for u32
error[E0308]: mismatched types
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1135:19
|
1135 | let rem = n % bits;
| ^^^^ expected usize
, found u32
error[E0277]: cannot mod usize
by u32
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1135:17
|
1135 | let rem = n % bits;
| ^ no implementation for usize % u32
|
= help: the trait Rem<u32>
is not implemented for usize
error[E0308]: mismatched types
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1136:19
|
1136 | let div = n / bits;
| ^^^^ expected usize
, found u32
error[E0277]: cannot divide usize
by u32
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1136:17
|
1136 | let div = n / bits;
| ^ no implementation for usize / u32
|
= help: the trait Div<u32>
is not implemented for usize
error[E0308]: mismatched types
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1192:23
|
1192 | debug_assert!(n < bits);
| ^^^^ expected usize
, found u32
|
help: you can convert a u32
to a usize
and panic if the converted value doesn't fit
|
1192 | debug_assert!(n < bits.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^
error[E0308]: mismatched types
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1202:25
|
1202 | let rshift = bits - n;
| ^ expected u32
, found usize
error[E0277]: cannot subtract usize
from u32
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1202:23
|
1202 | let rshift = bits - n;
| ^ no implementation for u32 - usize
|
= help: the trait Sub<usize>
is not implemented for u32
error[E0308]: mismatched types
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1254:19
|
1254 | let rem = n % bits;
| ^^^^ expected usize
, found u32
error[E0277]: cannot mod usize
by u32
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1254:17
|
1254 | let rem = n % bits;
| ^ no implementation for usize % u32
|
= help: the trait Rem<u32>
is not implemented for usize
error[E0308]: mismatched types
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1255:19
|
1255 | let div = n / bits;
| ^^^^ expected usize
, found u32
error[E0277]: cannot divide usize
by u32
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:1255:17
|
1255 | let div = n / bits;
| ^ no implementation for usize / u32
|
= help: the trait Div<u32>
is not implemented for usize
error[E0308]: mismatched types
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:2066:27
|
2066 | let rs = Limb::BITS - s;
| ^ expected u32
, found usize
error[E0277]: cannot subtract usize
from u32
--> /home/julio/.asdf/installs/rust/stable/registry/src/github.com-1ecc6299db9ec823/lexical-core-0.4.6/src/atof/algorithm/math.rs:2066:25
|
2066 | let rs = Limb::BITS - s;
| ^ no implementation for u32 - usize
|
= help: the trait Sub<usize>
is not implemented for u32
error: aborting due to 27 previous errors
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try rustc --explain E0277
.
error: could not compile lexical-core
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed`
Keeping track of similar projects here, I.e. 2D platformer games made in Rust/Amethyst. Up to date list should be kept in the readme.
When trying to run the thing via cargo run --release
the game draws the window but immediately segfaults:
$ cargo run --release
Finished release [optimized] target(s) in 0.59s
Running `target\release\space-menace.exe`
[INFO][winit::platform::platform::window] Guessed window DPI factor: 1.25
[INFO][amethyst::app] Initializing Amethyst...
[INFO][amethyst::app] Version: 0.12.0
[INFO][amethyst::app] Platform: x86_64-pc-windows-gnu
[INFO][amethyst::app] Amethyst git commit: c72063f13f90bae4ae96b6c96e04a2206493bbf3
[INFO][amethyst::app] Rustc version: 1.39.0-nightly Nightly
[INFO][amethyst::app] Rustc git commit: 9af17757be1cc3f672928ecf06c40a662c5ec26d
error: process didn't exit successfully: `target\release\space-menace.exe` (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)
Segmentation fault
running in debug mode gives the same output
When trying to run on Windows (using Vulkan) I got the following error:
Error: Error { inner: Inner { source: None, backtrace: None, error: ConfigError(File(Os { code: 123, kind: Other, message: "The filename, directory name, or volume label syntax is incorrect." })) } }
I posted in the Amethyst discord -- I wanted to reach you directly as mentioned in the Readme, but no Discord username/number is mentioned. If you need more info, you can reach out to me there. Chish#2578
Hey team! I am super interested in trying space-menace but I can't get the dang thing to run! It compiles just fine for me, but won't run. ๐ Let me know if I'm doing something wrong or if I found a real bug we can fix.
$ cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.19s
Running `target/debug/space-menace`
[INFO][amethyst::app] Initializing Amethyst...
[INFO][amethyst::app] Version: 0.12.0
[INFO][amethyst::app] Platform: x86_64-unknown-linux-gnu
[INFO][amethyst::app] Amethyst git commit: c72063f13f90bae4ae96b6c96e04a2206493bbf3
[INFO][amethyst::app] Rustc version: 1.39.0-nightly Nightly
[INFO][amethyst::app] Rustc git commit: 72b2abfd65ba024e12d7fe51852a309419f494d8
[WARN][gfx_backend_vulkan] Unable to find layer: VK_LAYER_LUNARG_standard_validation
[WARN][rendy_factory::factory] Slow safety checks are enabled! Disable them in production by enabling the 'no-slow-safety-checks' feature!
[INFO][rendy_util::wrap] Slow safety checks are enabled! You can disable them in production by enabling the 'no-slow-safety-checks' feature!
[INFO][gfx_backend_vulkan]
GENERAL [Loader Message (0)] : Device Extension: VK_KHR_8bit_storage (/usr/lib64/libvulkan_intel.so) version 0.0.1
object info: (type: INSTANCE, hndl: 94501314526768)
[INFO][gfx_backend_vulkan]
GENERAL [Loader Message (0)] : Device Extension: VK_KHR_16bit_storage (/usr/lib64/libvulkan_intel.so) version 0.0.1
object info: (type: INSTANCE, hndl: 94501314526768)
[ ... snip ... ]
[INFO][gfx_backend_vulkan]
GENERAL [Loader Message (0)] : Device Extension: VK_GOOGLE_hlsl_functionality1 (/usr/lib64/libvulkan_intel.so) version 0.0.1
object info: (type: INSTANCE, hndl: 94501314526768)
[INFO][gfx_backend_vulkan]
GENERAL [Loader Message (0)] : Device Extension: VK_NV_compute_shader_derivatives (/usr/lib64/libvulkan_intel.so) version 0.0.1
object info: (type: INSTANCE, hndl: 94501314526768)
WARN][rendy_wsi] Image count not supported. Supported: 4..4294967295, requested: 3
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ErrorMessage { msg: "Image count not supported." }', src/libcore/result.rs:1084:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[ERROR][rendy_resource::escape] Terminal must be dropped after all `Escape`s
[ERROR][rendy_resource::escape] Terminal must be dropped after all `Escape`s
[ERROR][rendy_resource::escape] Terminal must be dropped after all `Escape`s
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(139264) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(12288) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(65536) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(524288) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(4194304) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(155648) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(1048576) is still used
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
[ERROR][rendy_resource::escape] `Escape` was dropped after a `Terminal`?
Segmentation fault (core dumped)
$ rustc --version
rustc 1.39.0-nightly (72b2abfd6 2019-08-29)
$ cargo --version
cargo 1.39.0-nightly (22f7dd049 2019-08-27)
$ uname -s -r -v -m -p -i -o
Linux 5.2.9-200.fc30.x86_64 #1 SMP Fri Aug 16 21:37:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
I am running Wayland on Fedora 30.
Pincer but a little smarter, i.e. when hit by a bullet it should start moving in the direction of the player. It should be of different color than its basic version (Reddish may be).
The implementation should be almost identical to that of basic Pincer. Some of the files related to basic Pincer to get started:
https://github.com/amethyst/space-menace/blob/master/src/components/pincer.rs
https://github.com/amethyst/space-menace/blob/master/src/entities/pincer.rs
More information here: https://community.amethyst.rs/t/space-menace-networked-vs-mode/994?u=erlend_sh
Feel free to ask questions here or on the forum if you're interested in moving this along.
$SUBJ
Hello,
As a side project I'd like to learn Rust and thought a 2D game would be a fun first project.
When running Space Menace on Manjaro 20.0.1 I'm having issues with the size of the window (resizing doesn't help).
I updated Cargo.toml
features default value to vulkan
as described in the README
[features]
default = ["vulkan"]
metal = ["amethyst/metal"]
vulkan = ["amethyst/vulkan"]
It seems that somehow everything is scaled up, I noticed load_flier: scale = 2
in the terminal output though that seems unrelated (I set it to 1.0 with no change in the output).
I also noticed Guessed window DPI factor: 1
in the terminal output, though that seems to be standard from other issues I found on the Amethyst repo.
Any ideas of how I can get it to display correctly?
Terminal output below:
cargo run --release
Compiling xcb v0.8.2
Compiling x11-clipboard v0.3.3
Compiling clipboard v0.5.0
Compiling amethyst_ui v0.10.0
Compiling amethyst_animation v0.10.0
Compiling amethyst v0.15.0
Compiling space-menace v0.1.0 (/home/rafael/Github/space-menace)
warning: unused import: `GenericBox`
--> src/entities/flier.rs:15:28
|
15 | Directions, Flier, GenericBox, Motion,
| ^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: 1 warning emitted
Finished release [optimized] target(s) in 36.83s
Running `target/release/space-menace`
[INFO][amethyst::app] Initializing Amethyst...
[INFO][amethyst::app] Version: 0.15.0
[INFO][amethyst::app] Platform: x86_64-unknown-linux-gnu
[INFO][amethyst::app] Amethyst git commit: UNKNOWN
[INFO][amethyst::app] Rustc version: 1.45.0-nightly Nightly
[INFO][amethyst::app] Rustc git commit: 9912925c254589f58338cb2993163e618475ff75
[INFO][winit::platform::platform::x11::window] Guessed window DPI factor: 1
Xlib: extension "NV-GLX" missing on display ":1".
[WARN][rendy_factory::factory] Slow safety checks are enabled! Disable them in production by enabling the 'no-slow-safety-checks' feature!
[INFO][rendy_util::wrap] Slow safety checks are enabled! You can disable them in production by enabling the 'no-slow-safety-checks' feature!
load_flier: scale = 2
Thanks!
Just FYI, compiling on Windows 10 with Rust 1.36, target x86_64-pc-windows-msvc, both stable and nightly, gives the following error:
error: failed to run custom build command for `gfx-backend-metal v0.2.1`
Caused by:
process didn't exit successfully: `C:\Work\GitRepos\code-name-dune\target\debug\build\gfx-backend-metal-206d35fc40fc6342\build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'unsupported target x86_64-pc-windows-msvc', C:\Users\YourMum\.cargo\registry\src\github.com-1ecc6299db9ec823\gfx-backend-metal-0.2.1\build.rs:17:9
stack backtrace:
0: backtrace::backtrace::trace_unsynchronized
at C:\Program Files\Rust\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.29\src\backtrace\mod.rs:66
1: std::sys_common::backtrace::_print
at /rustc/0b680cfce544ff9a59d720020e397c4bf3346650\/src\libstd\sys_common\backtrace.rs:47
2: std::sys_common::backtrace::print
at /rustc/0b680cfce544ff9a59d720020e397c4bf3346650\/src\libstd\sys_common\backtrace.rs:36
3: std::panicking::default_hook::{{closure}}
at /rustc/0b680cfce544ff9a59d720020e397c4bf3346650\/src\libstd\panicking.rs:200
4: std::panicking::default_hook
at /rustc/0b680cfce544ff9a59d720020e397c4bf3346650\/src\libstd\panicking.rs:214
5: std::panicking::rust_panic_with_hook
at /rustc/0b680cfce544ff9a59d720020e397c4bf3346650\/src\libstd\panicking.rs:477
6: std::panicking::continue_panic_fmt
at /rustc/0b680cfce544ff9a59d720020e397c4bf3346650\/src\libstd\panicking.rs:384
7: std::panicking::begin_panic_fmt
at /rustc/0b680cfce544ff9a59d720020e397c4bf3346650\/src\libstd\panicking.rs:339
8: build_script_build::main
at .\build.rs:17
9: std::rt::lang_start::{{closure}}<()>
at /rustc/0b680cfce544ff9a59d720020e397c4bf3346650\src\libstd\rt.rs:64
10: std::rt::lang_start_internal::{{closure}}
at /rustc/0b680cfce544ff9a59d720020e397c4bf3346650\/src\libstd\rt.rs:49
11: std::panicking::try::do_call<closure,i32>
at /rustc/0b680cfce544ff9a59d720020e397c4bf3346650\/src\libstd\panicking.rs:296
12: panic_unwind::__rust_maybe_catch_panic
at /rustc/0b680cfce544ff9a59d720020e397c4bf3346650\/src\libpanic_unwind\lib.rs:82
13: std::panicking::try
at /rustc/0b680cfce544ff9a59d720020e397c4bf3346650\/src\libstd\panicking.rs:275
14: std::panic::catch_unwind
at /rustc/0b680cfce544ff9a59d720020e397c4bf3346650\/src\libstd\panic.rs:394
15: std::rt::lang_start_internal
at /rustc/0b680cfce544ff9a59d720020e397c4bf3346650\/src\libstd\rt.rs:48
16: std::rt::lang_start<()>
at /rustc/0b680cfce544ff9a59d720020e397c4bf3346650\src\libstd\rt.rs:64
17: main
18: invoke_main
at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
19: __scrt_common_main_seh
at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
20: BaseThreadInitThunk
21: RtlUserThreadStart
warning: build failed, waiting for other jobs to finish...
error: build failed
Hi,
I would like to report the same bug as for my previous issue #9, in spite of setting the features flag correctly in the Cargo.toml
:
#...
[dependencies]
amethyst = { git = "https://github.com/amethyst/amethyst", features = ["nightly","vulkan", "json"] }
#...
Here's the backtrace - the only difference with that of #9 is that gfx-backend-metal
is v0.2.3 instead of v0.2.1
error: failed to run custom build command for `gfx-backend-metal v0.2.3`
Caused by:
process didn't exit successfully: `C:\Work\GitRepos\space-menace\target\debug\build\gfx-backend-metal-d9da2542148691d8\build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'unsupported target x86_64-pc-windows-msvc', C:\Users\YourMum\.cargo\registry\src\github.com-1ecc6299db9ec823\gfx-backend-metal-0.2.3\build.rs:17:9
stack backtrace:
0: backtrace::backtrace::trace_unsynchronized
at C:\Users\VssAdministrator\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.29\src\backtrace\mod.rs:66
1: std::sys_common::backtrace::_print
at /rustc/c798dffac9dc8c82374db48f5b474690cc6e9686\/src\libstd\sys_common\backtrace.rs:47
2: std::sys_common::backtrace::print
at /rustc/c798dffac9dc8c82374db48f5b474690cc6e9686\/src\libstd\sys_common\backtrace.rs:36
3: std::panicking::default_hook::{{closure}}
at /rustc/c798dffac9dc8c82374db48f5b474690cc6e9686\/src\libstd\panicking.rs:200
4: std::panicking::default_hook
at /rustc/c798dffac9dc8c82374db48f5b474690cc6e9686\/src\libstd\panicking.rs:214
5: std::panicking::rust_panic_with_hook
at /rustc/c798dffac9dc8c82374db48f5b474690cc6e9686\/src\libstd\panicking.rs:477
6: std::panicking::continue_panic_fmt
at /rustc/c798dffac9dc8c82374db48f5b474690cc6e9686\/src\libstd\panicking.rs:384rs:384
7: std::panicking::begin_panic_fmt rs:339
at /rustc/c798dffac9dc8c82374db48f5b474690cc6e9686\/src\libstd\panicking.rs:339
8: build_script_build::main
at .\build.rs:17
9: std::rt::lang_start::{{closure}}<()>
at /rustc/c798dffac9dc8c82374db48f5b474690cc6e9686\src\libstd\rt.rs:64
10: std::rt::lang_start_internal::{{closure}}
at /rustc/c798dffac9dc8c82374db48f5b474690cc6e9686\/src\libstd\rt.rs:49 rs:296
11: std::panicking::try::do_call<closure,i32>
at /rustc/c798dffac9dc8c82374db48f5b474690cc6e9686\/src\libstd\panicking.ib.rs:82rs:296
12: panic_unwind::__rust_maybe_catch_panic rs:275
at /rustc/c798dffac9dc8c82374db48f5b474690cc6e9686\/src\libpanic_unwind\lib.rs:82 94
13: std::panicking::try
at /rustc/c798dffac9dc8c82374db48f5b474690cc6e9686\/src\libstd\panicking.rs:275
14: std::panic::catch_unwind
at /rustc/c798dffac9dc8c82374db48f5b474690cc6e9686\/src\libstd\panic.rs:394
15: std::rt::lang_start_internal l:78
at /rustc/c798dffac9dc8c82374db48f5b474690cc6e9686\/src\libstd\rt.rs:48
16: std::rt::lang_start<()>
at /rustc/c798dffac9dc8c82374db48f5b474690cc6e9686\src\libstd\rt.rs:64
17: main
18: invoke_main
at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78 19: __scrt_common_main_seh
at d:\agent\_work\2\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
20: BaseThreadInitThunk 21: RtlUserThreadStart
warning: build failed, waiting for other jobs to finish...
error: build failed
I also tried on stable and without release
, but no cigar. This must be due to recent changes, because I managed to compile and run it when issue #9 was closed.
On my machine space marines uses about 50% of a processor. This seems high to me, although maybe it isn't an issue. Amethyst supports frame limiting as a way to reduce unnecessary cpu usage.
Just checked out this project, currently at 9c697897875545461749ca8a1080d419e1f4427e
.
Straight cargo build
did not work, had to run off nightly; then I hit:
cargo +nightly run
Finished dev [unoptimized + debuginfo] target(s) in 0.48s
Running `target/debug/space-menace`
[INFO][amethyst::app] Initializing Amethyst...
[INFO][amethyst::app] Version: 0.12.0
[INFO][amethyst::app] Platform: x86_64-apple-darwin
[INFO][amethyst::app] Amethyst git commit: c72063f13f90bae4ae96b6c96e04a2206493bbf3
[INFO][amethyst::app] Rustc version: 1.44.0-nightly Nightly
[INFO][amethyst::app] Rustc git commit: b2e36e6c2d229126b59e892c9147fbb68115d292
thread 'main' panicked at 'attempted to leave type `std::mem::ManuallyDrop<error::BoxedErr>` uninitialized, which is invalid', /rustc/b2e36e6c2d229126b59e892c9147fbb68115d292/src/libcore/mem/mod.rs:661:5
stack backtrace:
0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
1: core::fmt::write
2: std::io::Write::write_fmt
3: std::panicking::default_hook::{{closure}}
4: std::panicking::default_hook
5: std::panicking::rust_panic_with_hook
6: rust_begin_unwind
7: core::panicking::panic_fmt
8: core::panicking::panic
9: crossbeam::ms_queue::MsQueue<T>::new
10: specs::common::Errors::new
11: <specs::common::Errors as core::default::Default>::default
12: amethyst::app::ApplicationBuilder<S,T,E,X>::new
13: amethyst::app::CoreApplication<T,E,R>::build
14: space_menace::main
15: std::rt::lang_start::{{closure}}
16: std::rt::lang_start_internal
17: std::rt::lang_start
18: main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /Users/sam/.cargo/registry/src/github.com-1ecc6299db9ec823/crossbeam-0.4.1/src/ms_queue.rs:204:20
stack backtrace:
0: 0x10add87ff - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9b566daa2a455421
1: 0x10adfcfce - core::fmt::write::ha1b9f49163694e4d
2: 0x10add59f7 - std::io::Write::write_fmt::h5bf7ecb3d7765923
3: 0x10adda8aa - std::panicking::default_hook::{{closure}}::h694d41cd08e58408
4: 0x10adda5ec - std::panicking::default_hook::ha6f28bd33ba2e689
5: 0x10addae78 - std::panicking::rust_panic_with_hook::hb00d3c1dea212869
6: 0x10addaa42 - rust_begin_unwind
7: 0x10ae2cf4f - core::panicking::panic_fmt::h1194552d43282424
8: 0x10ae2cea7 - core::panicking::panic::h38c465954407f791
9: 0x10ac9f035 - core::option::Option<T>::unwrap::haf563af5f22a5d9f
10: 0x10acad0ce - crossbeam::ms_queue::MsQueue<T>::try_pop::h32dc8cb0851adbf2
11: 0x10acaca5c - <crossbeam::ms_queue::MsQueue<T> as core::ops::drop::Drop>::drop::h7ab4bb3006e0ca51
12: 0x10ac9b341 - core::ptr::drop_in_place::h69559e69411bed69
13: 0x10acacf95 - crossbeam::ms_queue::MsQueue<T>::new::hd551644edc62a7bc
14: 0x10acb1fd9 - specs::common::Errors::new::ha7b86883e631b1f1
15: 0x10acb1fa4 - <specs::common::Errors as core::default::Default>::default::h63fbd81d1d7bedbe
16: 0x109b2a1bf - amethyst::app::ApplicationBuilder<S,T,E,X>::new::h78d366a477c9cbd2
17: 0x109b28d66 - amethyst::app::CoreApplication<T,E,R>::build::h00b2e48851f3d52b
18: 0x1098219ce - space_menace::main::h00e17a6c79a477f3
19: 0x10981f2ee - std::rt::lang_start::{{closure}}::hd7718dacc6536e7a
20: 0x10addb2a9 - std::rt::lang_start_internal::hf66bdb55704675cb
21: 0x10981f2d1 - std::rt::lang_start::h2dd39c1ac96bcb8f
22: 0x109822152 - main
thread panicked while panicking. aborting.
[1] 40190 illegal hardware instruction cargo +nightly run
cargo +nightly -V
cargo 1.44.0-nightly (8751eb301 2020-04-21)
It would be good to create a widget for viewing info about the scene (fps, number of sprites etc.) in debug mode. A translucent background and a text box should do the trick.
cargo run --release
cargo.toml
[dependencies.amethyst]
version = "0.15.0"
default-features = false
features = ["json", "animation"]
[features]
default = ["metal"]
metal = ["amethyst/metal"]
vulkan = ["amethyst/vulkan"]
[dependencies.amethyst]
version = "0.15.0"
default-features = false
features = ["json", "animation", "no-slow-safety-checks"]
[features]
default = ["vulkan"]
empty = ["amethyst/empty"]
metal = ["amethyst/metal"]
vulkan = ["amethyst/vulkan"]
warning: unused import: GenericBox
src\entities\flier.rs:15:28
|
15 | Directions, Flier, GenericBox, Motion,
| ^^^^^^^^^^
|
= note:#[warn(unused_imports)]
on by default
warning: 1 warning emitted
Finished release [optimized] target(s) in 4m 03s
Running `target\release\space-menace.exe`
[INFO][amethyst::app] Initializing Amethyst...
[INFO][amethyst::app] Version: 0.15.0
[INFO][amethyst::app] Platform: x86_64-pc-windows-msvc
[INFO][amethyst::app] Amethyst git commit: UNKNOWN
[INFO][amethyst::app] Rustc version: 1.51.0-nightly Nightly
[INFO][amethyst::app] Rustc git commit: a2f8f6281817d430e20726128b739d3c6708561c
[INFO][winit::platform::platform::window] Guessed window DPI factor: 1
thread '' panicked at 'attempted to leave type linked_hash_map::Node<u32, rusttype::gpu_cache::Row>
uninitialized, which is invalid', C:\Users\andre.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib/rustlib/src/rust\library\core\src\mem\mod.rs:671:9
note: run with RUST_BACKTRACE=1
environment variable to display a backtrace
[ERROR][rendy_resource::escape] Terminal must be dropped after all Escape
s
[ERROR][rendy_resource::escape] Terminal must be dropped after all Escape
s
[ERROR][rendy_resource::escape] Terminal must be dropped after all Escape
s
[ERROR][rendy_resource::escape] Terminal must be dropped after all Escape
s
[ERROR][rendy_resource::escape] Terminal must be dropped after all Escape
s
[ERROR][rendy_resource::escape] Terminal must be dropped after all Escape
s
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(196608) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(1024) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(524288) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(131072) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(32768) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(4194304) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(110592) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(262144) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(933888) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(1048576) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(229376) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(8192) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(65536) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(425984) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(4096) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(2097152) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(180224) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(131072) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(2048) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(1048576) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(256) is still used
[ERROR][rendy_memory::allocator::dynamic] Memory leak: SizeEntry(16384) is still used
[ERROR][rendy_descriptor::allocator] Not all descriptor sets were deallocated
[ERROR][rendy_descriptor::allocator] Descriptor pool is still in use during allocator disposal. DescriptorPool { size: 64, free: 62, freed: 0 }
[ERROR][rendy_descriptor::allocator] Not all descriptor sets were deallocated
[ERROR][rendy_descriptor::allocator] Descriptor pool is still in use during allocator disposal. DescriptorPool { size: 64, free: 63, freed: 0 }
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
[ERROR][rendy_resource::escape] Escape
was dropped after a Terminal
?
error: process didn't exit successfully: target\release\space-menace.exe
(exit code: 101)
It opens the game window, but then it closes, and I tested it without the flag --release
the error persisted
Windows 10 20H2 19042.804
On running the game, player should land on the home screen which should have the following information:
Just like Pincer, add a new enemy, Stinger (alien flying enemy).
The implementation should be almost identical to that of Pincer. The assets are available here.
Some of the files related to Pincer to get started:
https://github.com/amethyst/space-menace/blob/master/src/components/pincer.rs
https://github.com/amethyst/space-menace/blob/master/src/entities/pincer.rs
At the moment, whenever there is a drop in frames the characters noticeably slow down. When running in debug mode, it is common (at least on my laptop) for framerates to occasionally drop down to 30-40 fps. This causes a very noticeable and irritating jank in the characters' movements.
It would be desirable if the movements and animations advanced as a function of time passed, rather than number of frames passed.
I'd like to give this a go, if nobody is working on this yet. Any input is welcome. :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.