mrdimas / rusty-shooter Goto Github PK
View Code? Open in Web Editor NEW[suspended] 3d shooter written in Rust using rg3d
License: MIT License
[suspended] 3d shooter written in Rust using rg3d
License: MIT License
cargo run --release
Compiling rusty-shooter v0.13.0 (/home/pavel/rusty-shooter)
error[E0599]: no method named visit
found for struct HashMap
in the current scope
--> src/leader_board.rs:145:29
|
145 | self.personal_score.visit("PersonalScore", visitor)?;
| ^^^^^ method not found in HashMap<std::string::String, PersonalScore>
error[E0599]: no method named visit
found for struct HashMap
in the current scope
--> src/leader_board.rs:146:25
|
146 | self.team_score.visit("TeamScore", visitor)?;
| ^^^^^ method not found in HashMap<Team, u32>
For more information about this error, try rustc --explain E0599
.
error: could not compile rusty-shooter
due to 2 previous errors
I'm on Linux, with i3 on X11 or sway on wayland and i have a problem.
The mouse cursor is shown and the game does not grab it. So i'm not able to turn the player head because the mouse quit the window.
Is rg3d allowing that ? Grabbing the mouse, hide the cursor, and move it to keep it at center of the window ?
The game averages at around 35-40 FPS. My computer should be able to handle a game like this at 60 FPS at least (it can do Xonotic and CS:GO at 200 FPS).
Specs:
I don't know anything about game development, but it would be interesting to see what kinds of optimizations can improve performance.
после сборки я попытался запустить игру но получаю эту ошибку
https://pastebin.com/DHvgGRPW
среда
stable-x86_64-unknown-linux-gnu
rustc 1.41.0
Followed steps in the README and got this with cargo run --release
warning: field is never read: `cb_fullscreen`
--> src/options_menu.rs:38:5
|
38 | cb_fullscreen: UINodeHandle,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: field is never read: `crouch_speed`
--> src/player.rs:79:5
|
79 | crouch_speed: f32,
| ^^^^^^^^^^^^^^^^^
warning: field is never read: `stand_up_speed`
--> src/player.rs:80:5
|
80 | stand_up_speed: f32,
| ^^^^^^^^^^^^^^^^^^^
warning: field is never read: `last_tick_time`
--> src/main.rs:85:5
|
85 | last_tick_time: time::Instant,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: field is never read: `text`
--> src/main.rs:100:5
|
100 | text: Handle<UiNode>,
| ^^^^^^^^^^^^^^^^^^^^
error: unused `Result` that must be used
--> src/main.rs:418:25
|
418 | game.engine.renderer.set_frame_size(new_size.into());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> src/main.rs:2:9
|
2 | #![deny(unused_must_use)]
| ^^^^^^^^^^^^^^^
= note: this `Result` may be an `Err` variant, which should be handled
error: aborting due to previous error; 23 warnings emitted
error: could not compile `rusty-shooter`
Caused by:
process didn't exit successfully: `rustc --crate-name rusty_shooter --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=b5473231cb3e43b3 -C extra-filename=-b5473231cb3e43b3 --out-dir /var/dev/rusty/rusty-shooter/target/release/deps -L dependency=/var/dev/rusty/rusty-shooter/target/release/deps --extern crossbeam=/var/dev/rusty/rusty-shooter/target/release/deps/libcrossbeam-dafd4633c755c6ac.rlib --extern rg3d=/var/dev/rusty/rusty-shooter/target/release/deps/librg3d-f37a356bbe594a6d.rlib -L native=/usr/lib` (exit status: 1)
I'm on Manjaro 21, cargo 1.54.0 (5ae8d74b3 2021-06-22), rustc 1.54.0 (a178d0322 2021-07-26)
First of all thank you for all your hard work and making it easy to start with the commands from the README.md file.
i just tested this repository by cloning and running the release version and had a couple of bugs.
Side note: I'm using a decked out PC with Windows 10 Pro, latest i9, 64GB ram and 2 TB SSDs and GTX 2070 Super with 240Hz screen.
[Minor] When you die and press the save in menu button, then press load you are alive on the location you died, instead of re-spawning at a new location.
[Minor] The music in the menu is default set to 0.0, while you can hear the music playing. Changing the slider does work properly, e.g music is increased / decreased according to the sliders scale, but the value is back to 0.0 when you open the menu.
[Minor] Monsters spawn in walls and can be shot through walls when seen sticking half through the wall.
[Mayor] Full screen checkbox only works the first time the game is started. The next time the full screen option is ignored and always remains full screen when resolution is changed to values smaller than the actual display.
[Improvement] The log in the terminal is being spammed, I suggest moving these messages to verbose or debug:
GL texture 23 was created!
GL geometry buffer was created - VBO: 471, EBO: 472, VAO: 236!
GL texture 40 was destroyed!
GL geometry buffer was destroyed - VBO: 33, EBO: 34, VAO: 17!
[Minor] The in-game score (TAB key) shows 'Player' and does not seem use the nickname specified at the start, e.g 'Unnamed Player'.
[Minor] On screen damage info messages, like 'Mutant dealt 15 damage to Parasite' are updated very slowly. E.g they only change every 5-10 seconds. I suggest removing or disabling these.
The game runs around 45-56 fps even with all the settings turnt off.
Specs:
Windows 10 64-bit
Intel i7-8750H 2.20GHz
Nvidia GeForce 1060M
Bots must have precise hit boxes, currently there is only one "hit box" - capsule.
When i shoot a weapon, the sound is played with a small delay.
It looks like the loader is using absolute paths and windows style path separator breaks on a linux machine.
This is the error when clicking on the New Game
Shader compiled!
font cache loaded! 7
FBX: Trying to load "data/models/dm6.fbx"
FBX: Parsing - 31 ms
FBX: DOM Prepare - 2 ms
Unable to load texture data/textures/..\textures\metal5.tga! Reason No such file or directory (os error 2)
Unable to load texture data/textures/..\..\..\..\..\Users\mrDIMAS\Desktop\xcsv_bq3hi-res\textures\gothic_block\blocks9.tga! Reason No such file or directory (os error 2)
Unable to load texture data/textures/..\textures\largeblockfloor3.tga! Reason No such file or directory (os error 2)
Looking at the hdex dump of data/models/dm6.fbx
I can see that absolute paths is used to reference the other assets.
000c8c70: 0001 0000 003c 0000 0008 4669 6c65 4e61 .....<....FileNa
000c8c80: 6d65 5337 0000 0043 3a5c 446d 6974 7279 meS7...C:\Dmitry
000c8c90: 7345 6e67 696e 655c 5368 6f6f 7465 725c sEngine\Shooter\
000c8ca0: 6269 6e5c 6461 7461 5c74 6578 7475 7265 bin\data\texture
000c8cb0: 735c 6d65 7461 6c31 5f31 2e74 6761 f88c s\metal1_1.tga..
000c8cc0: 0c00 0100 0000 1d00 0000 1052 656c 6174 ...........Relat
000c8cd0: 6976 6546 696c 656e 616d 6553 1800 0000 iveFilenameS....
000c8ce0: 2e2e 5c74 6578 7475 7265 735c 6d65 7461 ..\textures\meta
000c8cf0: 6c31 5f31 2e74 6761 298d 0c00 0200 0000 l1_1.tga).......
000c8d00: 1200 0000 124d 6f64 656c 5556 5472 616e .....ModelUVTran
000c8d10: 736c 6174 696f 6e44 0000 0000 0000 0000 slationD........
000c8d20: 4400 0000 0000 0000 0056 8d0c 0002 0000 D........V......
error[E0432]: unresolved import fyrox::scene::sound::effect
--> src/level.rs:39:13
|
39 | effect::{BaseEffectBuilder, Effect, EffectInput, ReverbEffectBuilder},
| ^^^^^^ could not find effect
in sound
error[E0283]: type annotations needed: cannot satisfy SoundManager: fyrox::fyrox_core::visitor::Visit
--> src/level.rs:124:10
|
124 | #[derive(Visit)]
| ^^^^^
|
note: multiple impl
s or where
clauses satisfying SoundManager: fyrox::fyrox_core::visitor::Visit
found
--> src/level.rs:54:19
|
54 | #[derive(Default, Visit)]
| ^^^^^
...
124 | #[derive(Visit)]
| ^^^^^
= note: this error originates in the derive macro Visit
(in Nightly builds, run with -Z macro-backtrace for more info)
Some errors have detailed explanations: E0283, E0432.
For more information about an error, try rustc --explain E0283
.
error: could not compile rusty-shooter
due to 2 previous errors
Here are the build errors that I get:
error[E0433]: failed to resolve: could not find `physics` in `rg3d`
--> src/actor.rs:12:5
|
12 | physics::geometry::ContactEvent,
| ^^^^^^^ could not find `physics` in `rg3d`
error[E0433]: failed to resolve: could not find `physics` in `rg3d`
--> src/bot.rs:25:5
|
25 | physics::{
| ^^^^^^^ could not find `physics` in `rg3d`
error[E0432]: unresolved import `rg3d::scene::physics::RayCastOptions`
--> src/bot.rs:37:28
|
37 | physics::{Physics, RayCastOptions},
| ^^^^^^^^^^^^^^ no `RayCastOptions` in `scene::physics`
error[E0432]: unresolved import `rg3d::engine::RigidBodyHandle`
--> src/character.rs:8:5
|
8 | engine::RigidBodyHandle,
| ^^^^^^^^^^^^^^^^^^^^^^^ no `RigidBodyHandle` in `engine`
error[E0433]: failed to resolve: could not find `physics` in `rg3d`
--> src/level.rs:33:5
|
33 | physics::{
| ^^^^^^^ could not find `physics` in `rg3d`
error[E0432]: unresolved import `rg3d::engine::RigidBodyHandle`
--> src/jump_pad.rs:7:5
|
7 | engine::RigidBodyHandle,
| ^^^^^^^^^^^^^^^^^^^^^^^ no `RigidBodyHandle` in `engine`
error[E0433]: failed to resolve: could not find `physics` in `rg3d`
--> src/player.rs:17:5
|
17 | physics::{
| ^^^^^^^ could not find `physics` in `rg3d`
error[E0432]: unresolved import `rg3d::scene::physics::RayCastOptions`
--> src/level.rs:39:69
|
39 | self, base::BaseBuilder, camera::CameraBuilder, node::Node, physics::RayCastOptions, Scene,
| ^^^^^^^^^^^^^^^^^^^^^^^ no `RayCastOptions` in `scene::physics`
error[E0433]: failed to resolve: could not find `physics` in `rg3d`
--> src/projectile.rs:20:5
|
20 | physics::{
| ^^^^^^^ could not find `physics` in `rg3d`
error[E0433]: failed to resolve: could not find `physics` in `rg3d`
--> src/weapon.rs:15:5
|
15 | physics::geometry::InteractionGroups,
| ^^^^^^^ could not find `physics` in `rg3d`
error[E0432]: unresolved imports `rg3d::engine::RigidBodyHandle`, `rg3d::scene::physics::RayCastOptions`
--> src/projectile.rs:19:5
|
19 | engine::RigidBodyHandle,
| ^^^^^^^^^^^^^^^^^^^^^^^ no `RigidBodyHandle` in `engine`
...
31 | physics::RayCastOptions,
| ^^^^^^^^^^^^^^^^^^^^^^^ no `RayCastOptions` in `scene::physics`
error[E0432]: unresolved import `rg3d::scene::physics::RayCastOptions`
--> src/weapon.rs:21:28
|
21 | physics::{Physics, RayCastOptions},
| ^^^^^^^^^^^^^^ no `RayCastOptions` in `scene::physics`
error[E0433]: failed to resolve: use of undeclared type `ContactEvent`
--> src/actor.rs:207:17
|
207 | if let &ContactEvent::Started(a, b) = contact_event {
| ^^^^^^^^^^^^ use of undeclared type `ContactEvent`
error[E0433]: failed to resolve: use of undeclared type `RigidBodyBuilder`
--> src/bot.rs:875:13
|
875 | RigidBodyBuilder::new(BodyStatus::Dynamic)
| ^^^^^^^^^^^^^^^^ use of undeclared type `RigidBodyBuilder`
error[E0433]: failed to resolve: use of undeclared type `BodyStatus`
--> src/bot.rs:875:35
|
875 | RigidBodyBuilder::new(BodyStatus::Dynamic)
| ^^^^^^^^^^ use of undeclared type `BodyStatus`
error[E0433]: failed to resolve: use of undeclared type `ColliderBuilder`
--> src/bot.rs:880:13
|
880 | ColliderBuilder::capsule_y(body_height * 0.5, 0.28)
| ^^^^^^^^^^^^^^^ use of undeclared type `ColliderBuilder`
error[E0433]: failed to resolve: use of undeclared type `InteractionGroups`
--> src/bot.rs:964:33
|
964 | groups: InteractionGroups::all(),
| ^^^^^^^^^^^^^^^^^ use of undeclared type `InteractionGroups`
error[E0433]: failed to resolve: use of undeclared type `ChannelEventCollector`
--> src/level.rs:622:48
|
622 | scene.physics.event_handler = Box::new(ChannelEventCollector::new(
| ^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `ChannelEventCollector`
error[E0433]: failed to resolve: use of undeclared type `InteractionGroups`
--> src/level.rs:793:21
|
793 | groups: InteractionGroups::all(),
| ^^^^^^^^^^^^^^^^^ use of undeclared type `InteractionGroups`
error[E0433]: failed to resolve: use of undeclared type `InteractionGroups`
--> src/level.rs:1266:33
|
1266 | groups: InteractionGroups::all(),
| ^^^^^^^^^^^^^^^^^ use of undeclared type `InteractionGroups`
error[E0433]: failed to resolve: use of undeclared type `ChannelEventCollector`
--> src/level.rs:1402:68
|
1402 | engine.scenes[self.scene].physics.event_handler = Box::new(ChannelEventCollector::new(
| ^^^^^^^^^^^^^^^^^^^^^ use of undeclared type `ChannelEventCollector`
error[E0433]: failed to resolve: use of undeclared type `RigidBodyBuilder`
--> src/player.rs:160:13
|
160 | RigidBodyBuilder::new(BodyStatus::Dynamic)
| ^^^^^^^^^^^^^^^^ use of undeclared type `RigidBodyBuilder`
error[E0433]: failed to resolve: use of undeclared type `BodyStatus`
--> src/player.rs:160:35
|
160 | RigidBodyBuilder::new(BodyStatus::Dynamic)
| ^^^^^^^^^^ use of undeclared type `BodyStatus`
error[E0433]: failed to resolve: use of undeclared type `ColliderBuilder`
--> src/player.rs:165:13
|
165 | ColliderBuilder::capsule_y(height * 0.5, 0.35)
| ^^^^^^^^^^^^^^^ use of undeclared type `ColliderBuilder`
error[E0433]: failed to resolve: use of undeclared type `ColliderBuilder`
--> src/projectile.rs:186:36
|
186 | let collider = ColliderBuilder::ball(size).sensor(true).build();
| ^^^^^^^^^^^^^^^ use of undeclared type `ColliderBuilder`
error[E0433]: failed to resolve: use of undeclared type `RigidBodyBuilder`
--> src/projectile.rs:187:32
|
187 | let body = RigidBodyBuilder::new(BodyStatus::KinematicPositionBased)
| ^^^^^^^^^^^^^^^^ use of undeclared type `RigidBodyBuilder`
error[E0433]: failed to resolve: use of undeclared type `BodyStatus`
--> src/projectile.rs:187:54
|
187 | let body = RigidBodyBuilder::new(BodyStatus::KinematicPositionBased)
| ^^^^^^^^^^ use of undeclared type `BodyStatus`
error[E0433]: failed to resolve: use of undeclared type `InteractionGroups`
--> src/projectile.rs:293:25
|
293 | groups: InteractionGroups::all(),
| ^^^^^^^^^^^^^^^^^ use of undeclared type `InteractionGroups`
error[E0433]: failed to resolve: use of undeclared type `InteractionGroups`
--> src/weapon.rs:275:25
|
275 | groups: InteractionGroups::all(),
| ^^^^^^^^^^^^^^^^^ use of undeclared type `InteractionGroups`
error[E0412]: cannot find type `ContactEvent` in this scope
--> src/actor.rs:206:52
|
206 | pub fn handle_event(&mut self, contact_event: &ContactEvent, context: &mut UpdateContext) {
| ^^^^^^^^^^^^ not found in this scope
error[E0412]: cannot find type `IntersectionEvent` in this scope
--> src/level.rs:154:68
|
133 | pub struct Level {
| - help: you might be missing a type parameter: `<IntersectionEvent>`
...
154 | proximity_events_receiver: Option<crossbeam::channel::Receiver<IntersectionEvent>>,
| ^^^^^^^^^^^^^^^^^ not found in this scope
error[E0412]: cannot find type `ContactEvent` in this scope
--> src/level.rs:155:66
|
133 | pub struct Level {
| - help: you might be missing a type parameter: `<ContactEvent>`
...
155 | contact_events_receiver: Option<crossbeam::channel::Receiver<ContactEvent>>,
| ^^^^^^^^^^^^ not found in this scope
error[E0422]: cannot find struct, variant or union type `Isometry3` in this scope
--> src/projectile.rs:342:32
|
342 | let position = Isometry3 {
| ^^^^^^^^^ not found in this scope
error[E0422]: cannot find struct, variant or union type `Translation3` in this scope
--> src/projectile.rs:344:34
|
344 | translation: Translation3 {
| ^^^^^^^^^^^^ not found in this scope
error[E0412]: cannot find type `IntersectionEvent` in this scope
--> src/projectile.rs:412:27
|
412 | proximity_event: &IntersectionEvent,
| ^^^^^^^^^^^^^^^^^ not found in this scope
warning: unused import: `std::path::Path`
--> src/effects.rs:21:5
|
21 | use std::path::Path;
| ^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `rg3d::engine::resource_manager::TextureImportOptions`
--> src/main.rs:30:5
|
30 | use rg3d::engine::resource_manager::TextureImportOptions;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `rg3d::resource::texture::CompressionOptions`
--> src/main.rs:33:5
|
33 | use rg3d::resource::texture::CompressionOptions;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0283]: type annotations needed
--> src/character.rs:64:19
|
64 | body: Default::default(),
| ^^^^^^^^^^^^^^^^ cannot infer type
|
= note: cannot satisfy `_: std::default::Default`
note: required by `std::default::Default::default`
--> /home/Barugon/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/default.rs:116:5
|
116 | fn default() -> Self;
| ^^^^^^^^^^^^^^^^^^^^^
error[E0283]: type annotations needed
--> src/jump_pad.rs:33:19
|
33 | body: Default::default(),
| ^^^^^^^^^^^^^^^^ cannot infer type
|
= note: cannot satisfy `_: std::default::Default`
note: required by `std::default::Default::default`
--> /home/Barugon/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/default.rs:116:5
|
116 | fn default() -> Self;
| ^^^^^^^^^^^^^^^^^^^^^
error[E0282]: type annotations needed
--> src/level.rs:181:40
|
181 | proximity_events_receiver: None,
| ^^^^ cannot infer type for type parameter `T` declared on the enum `Option`
error[E0283]: type annotations needed
--> src/projectile.rs:93:19
|
93 | body: Default::default(),
| ^^^^^^^^^^^^^^^^ cannot infer type
|
= note: cannot satisfy `_: std::default::Default`
note: required by `std::default::Default::default`
--> /home/Barugon/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/default.rs:116:5
|
116 | fn default() -> Self;
| ^^^^^^^^^^^^^^^^^^^^^
Some errors have detailed explanations: E0282, E0283, E0412, E0422, E0432, E0433.
For more information about an error, try `rustc --explain E0282`.
warning: `rusty-shooter` (bin "rusty-shooter") generated 3 warnings
error: could not compile `rusty-shooter` due to 39 previous errors; 3 warnings emitted
Is there a way to fix this ?
I just built rusty-shooter on my machine. I think the setup could be simpler if the Cargo.toml
file referenced a git
repository (in addition to the version
from crates.io) for dependencies instead of a path
.
If all rg3d crates did this, we could just:
git clone https://github.com/mrDIMAS/rusty-shooter
cd rusty-shooter
cargo run --release
See cargo docs about multiple locations for a crate.
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.